wushilong 3 سال پیش
والد
کامیت
5e6a94ab7b

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/label/PatientLabelEndpoint.java

@ -45,8 +45,8 @@ public class PatientLabelEndpoint extends EnvelopRestEndpoint {
    public PageEnvelop<List<Map<String,Object>>> findSignPatientLabelListByTeamCode (
            @ApiParam(name = "teamCode", value = "团队code", required = true)
            @RequestParam(value = "teamCode",required = true) String teamCode,
            @ApiParam(name = "labelCode", value = "标签", required = true)
            @RequestParam(value = "labelCode",required = true) String labelCode,
            @ApiParam(name = "labelCode", value = "标签", required = false)
            @RequestParam(value = "labelCode",required = false) String labelCode,
            @ApiParam(name = "name", value = "姓名或身份证", required = false)
            @RequestParam(value = "name",required = false) String name,
            @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典", required = false)//有绑定相关专题设备

+ 14 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/label/PatientLableService.java

@ -66,11 +66,20 @@ public class PatientLableService extends BaseJpaService<WlyyPatientLabelDO, Wlyy
        String sql = "SELECT DISTINCT p.id,p.name,p.photo,p.idcard,p.mobile,p.openid,p.sex,p.pad_imei padImei " ;
        sql +=",(select COUNT(*) from wlyy_patient_device a where a.`user` = p.id and a.del=0) deviceFlag ";
        String countSql = "SELECT count(DISTINCT p.id) ";
        String filters = "from base_service_package_sign_record sr,base_service_package_record r,  " +
                "                base_patient p,wlyy_patient_label l " +
                "                WHERE sr.id = r.sign_id and sr.status=1  " +
                "                and r.team_code =  '"+teamCode+"' " +
                "                and sr.patient = p.id and p.id = l.patient and l.label_type = 1 and l.label_code =  '"+labelCode+"' ";
        String filters ="";
        if(StringUtils.isNotBlank(labelCode)){
             filters = "from base_service_package_sign_record sr,base_service_package_record r,  " +
                    "                base_patient p,wlyy_patient_label l " +
                    "                WHERE sr.id = r.sign_id and sr.status=1  " +
                    "                and r.team_code =  '"+teamCode+"' " +
                    "                and sr.patient = p.id and p.id = l.patient and l.label_type = 1 and l.label_code =  '"+labelCode+"' ";
        }else {
            filters = "from base_service_package_sign_record sr,base_service_package_record r,  " +
                    "                base_patient p,wlyy_patient_label l " +
                    "                WHERE sr.id = r.sign_id and sr.status=1  " +
                    "                and r.team_code =  '"+teamCode+"' " +
                    "                and sr.patient = p.id and p.id = l.patient and l.label_type = 1  ";
        }
        if(StringUtils.isNotBlank(name)){
            filters += " and (p.name like '%"+name+"%' or p.idcard like '%"+name+"%') ";
        }