LAPTOP-KB9HII50\70708 3 gadi atpakaļ
vecāks
revīzija
143ce4f6f0

+ 11 - 9
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ArchiveService.java

@ -273,18 +273,20 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
        }
        String countSql = " select count(distinct p.id)  ";
        String  sql = " SELECT a.create_time,p.openid,p.pad_imei padImei,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo,CAST(a.sign_status AS char) sign_status  " ;
        String filter = "from wlyy_archive a,base_patient p WHERE  a.patient = p.id and a.sign_status = 1 and p.del=1 and EXISTS( " +
                    "SELECT DISTINCT sr.patient from base_service_package_sign_record sr,base_service_package_record r, " +
                    "base_service_package_item i,base_team_member m " +
                    "WHERE  sr.id = r.sign_id and sr.patient = a.patient and sr.status=1 and r.service_package_id = i.service_package_id " +
                    "and i.del = 1 and m.team_code = r.team_code " ;
        if (StringUtils.isNotBlank(hospital)){
            filter += " and m.org_code='"+hospital+"'   ";
        }
//        String filter = "from wlyy_archive a,base_patient p WHERE  a.patient = p.id and a.sign_status = 1 and p.del=1 and EXISTS( " +
//                    "SELECT DISTINCT sr.patient from base_service_package_sign_record sr,base_service_package_record r, " +
//                    "base_service_package_item i,base_team_member m " +
//                    "WHERE  sr.id = r.sign_id and sr.patient = a.patient and sr.status=1 and r.service_package_id = i.service_package_id " +
//                    "and i.del = 1 and m.team_code = r.team_code " ;
        //排除签约社区关系
        String filter = "from wlyy_archive a,base_patient p WHERE  a.patient = p.id and a.sign_status = 1 and p.del=1 " ;
//        if (StringUtils.isNotBlank(hospital)){
//            filter += " and m.org_code='"+hospital+"'   ";
//        }
        if(StringUtils.isNotBlank(name)){
            filter += " and p.name like '%"+name+"%'";
        }
        filter+= " and m.del = '1' and sr.`status`=1 ) ";
//        filter+= " and m.del = '1' and sr.`status`=1 ) ";
        if (StringUtils.isNotBlank(filterMyPatient)){//
            filter += " and p.id not in (select patient from base_patient_helper where doctor='"+doctorId+"' and del=1) ";
        }