liubing 3 سال پیش
والد
کامیت
3f30452e80

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java

@ -164,8 +164,8 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
//            return result;
//        }
        //签约防走失服务包
        String sql ="SELECT i.code,r.team_code,i.org_code,i.org_name from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i  \n" +
                "where  sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id   and i.del = 1 and sr.`status`=1 \n" +
        String sql ="SELECT i.code,r.team_code,pack.org_code,pack.org_name from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack  \n" +
                "where  sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id and i.del = 1 and sr.`status`=1 \n" +
                "and  sr.patient  = '"+assistanceDO.getPatient()+"' and i.code='emergencyAssistance' ";
        List<Map<String,Object>> items = jdbcTemplate.queryForList(sql);
        if (items.size()==0){

+ 8 - 8
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/birthday/BirthdayWishesService.java

@ -177,9 +177,9 @@ public class BirthdayWishesService {
                "p.idcard, p.photo," +
                " CASE LENGTH(p.idcard) WHEN  18 then SUBSTR(p.idcard,11,4) when 15 then SUBSTR(p.idcard, 9,4) END date " +
                "from wlyy_archive a,base_patient p WHERE  a.patient = p.id and a.sign_status = 1 and EXISTS( " +
                "SELECT DISTINCT sr.patient from base_service_package_sign_record sr,base_service_package_record r, " +
                "SELECT DISTINCT sr.patient from base_service_package_sign_record sr,base_service_package_record r,base_service_package pack, " +
                "base_service_package_item i,base_team_member m " +
                "WHERE  sr.id = r.sign_id and sr.patient = a.patient  and r.service_package_id = i.service_package_id " +
                "WHERE  sr.id = r.sign_id and sr.patient = a.patient  and r.service_package_id = i.service_package_id and r.service_package_id = pack.id  " +
                "and i.del = 1 and m.team_code = r.team_code and m.doctor_code = '"+doctor+"' ) "+
                " and (p.archive_status<>2 or p.archive_status is null) " +
                "AND CASE LENGTH(p.idcard) WHEN  18 then SUBSTR(p.idcard,11,4) when 15 then SUBSTR(p.idcard, 9,4) END =  '" + dateString + "' " ;
@ -258,9 +258,9 @@ public class BirthdayWishesService {
        String sqlCount = "SELECT count(distinct p.idcard) ";
        String whereSql = "from wlyy_archive a,base_patient p WHERE  a.patient = p.id and a.sign_status = 1 and EXISTS( " +
                "SELECT DISTINCT sr.patient from base_service_package_sign_record sr,base_service_package_record r, " +
                "SELECT DISTINCT sr.patient from base_service_package_sign_record sr,base_service_package_record r,base_service_package pack , " +
                "base_service_package_item i,base_team_member m " +
                "WHERE  sr.id = r.sign_id and sr.patient = a.patient  and r.service_package_id = i.service_package_id " +
                "WHERE  sr.id = r.sign_id and sr.patient = a.patient  and r.service_package_id = i.service_package_id and and r.service_package_id = pack.id " +
                "and i.del = 1 and m.team_code = r.team_code ";
        //根据权限获取生日居民列表
@ -269,19 +269,19 @@ public class BirthdayWishesService {
        } else {//管理员
            switch (currentUserRoleLevel) {
                case "1": {//省
                    whereSql += " and i.org_code in ( select org.code from base_org org where org.province_code = '"+currentUserRole+"' and org.del=1 )  ";
                    whereSql += " and pack.org_code in ( select org.code from base_org org where org.province_code = '"+currentUserRole+"' and org.del=1 )  ";
                    break;
                }
                case "2": {//市
                    whereSql += " and i.org_code in ( select org.code from base_org org where org.city_code = '"+currentUserRole+"' and org.del=1 )  ";
                    whereSql += " and pack.org_code in ( select org.code from base_org org where org.city_code = '"+currentUserRole+"' and org.del=1 )  ";
                    break;
                }
                case "3": {//区
                    whereSql += " and i.org_code in ( select org.code from base_org org where org.town_code = '"+currentUserRole+"' and org.del=1 )  ";
                    whereSql += " and pack.org_code in ( select org.code from base_org org where org.town_code = '"+currentUserRole+"' and org.del=1 )  ";
                    break;
                }
                case "4": {//社区机构
                    whereSql += " and i.org_code = '" + currentUserRole + "' ";
                    whereSql += " and pack.org_code = '" + currentUserRole + "' ";
                    break;
                }
            }

+ 3 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/contacts/ContactsService.java

@ -203,9 +203,9 @@ public class ContactsService {
        String sql =  "select * from base_org org  " ;
        if (StringUtils.isNotBlank(patient)){
            sql +=" LEFT JOIN ( " +
                    "SELECT  DISTINCT i.org_code,'1' as signFlag FROM  base_service_package_sign_record sr,  base_service_package_record r, " +
                    " base_service_package_item i WHERE  sr.id = r.sign_id and sr.status=1 and sr.patient = '"+patient+"'" +
                    " AND r.service_package_id = i.service_package_id " +
                    "SELECT  DISTINCT pack.org_code,'1' as signFlag FROM  base_service_package_sign_record sr,  base_service_package_record r, " +
                    " base_service_package_item i,base_service_package pack  WHERE  sr.id = r.sign_id and sr.status=1 and sr.patient = '"+patient+"'" +
                    "  and r.service_package_id = pack.id AND r.service_package_id = i.service_package_id " +
                    " AND i.del = 1  AND sr.`status` = 1)A on org.code = A.org_code ";
        }
        sql +=  " where org.del=1 and org.type=3 " ;

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/CareDoctorService.java

@ -593,8 +593,8 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        //人文关怀
        try {
            Integer counts = birthdayWishesService.getPatientByDoctorCount(doctor);
            if (count>0){
                result.put("patientCare",count);
            if (counts>0){
                result.put("patientCare",counts);
            }
        }catch (Exception e){
            e.printStackTrace();

+ 4 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -165,8 +165,8 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        }
        //签约防走失服务包
        String sql ="SELECT i.code,r.team_code,i.org_code,i.org_name from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i  \n" +
                "where  sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id   and i.del = 1 and sr.`status`=1 \n" +
        String sql ="SELECT i.code,r.team_code,pack.org_code,pack.org_name from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack    \n" +
                "where  sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id  and i.del = 1 and sr.`status`=1 \n" +
                "and  sr.patient  = '"+orderDO.getPatient()+"' and i.code='preventLost' ";
        List<Map<String,Object>> items = jdbcTemplate.queryForList(sql);
        if (items.size()==0) {
@ -377,8 +377,8 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            noticePersons.add(noticeObj);
        }
        //医生信息
        String sql ="SELECT i.code,r.team_code,i.org_code,i.org_name from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i  \n" +
                "where  sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id   and i.del = 1 and sr.`status`=1 \n" +
        String sql ="SELECT i.code,r.team_code,pack.org_code,pack.org_name from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack  \n" +
                "where  sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id  and i.del = 1 and sr.`status`=1 \n" +
                "and  sr.patient  = '"+orderDO.getPatient()+"' and i.code='preventLost' ";
        List<Map<String,Object>> items = jdbcTemplate.queryForList(sql);
        if (items.size()>0){

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/patient/PatientNoLoginService.java

@ -29,10 +29,10 @@ public class PatientNoLoginService {
                " DISTINCT o.* " +
                "FROM " +
                " base_service_package_record r, " +
                " base_service_package_item i, " +
                " base_service_package_item i, base_service_package pack  " +
                " base_org o " +
                "WHERE " +
                " r.service_package_id = i.service_package_id " +
                " r.service_package_id = i.service_package_id and r.service_package_id = pack.id " +
                "AND i.del = 1 " +
                "and i.org_code = o.code " ;
        if("1".equals(type)){