| 
															
																@ -662,7 +662,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public PageEnvelop getSecurityOrderList(String doctor, String serverDoctor, String patientName, String patient, String status, 
															 | 
															
															 | 
															
																    public PageEnvelop getSecurityOrderList(String doctor, String serverDoctor, String patientName, String patient, String status, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                            String svrDesc,String topicItem, Integer page, Integer pageSize){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                            String svrDesc,String topicItem, Integer page, Integer pageSize,Integer dailyMonitor){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONArray result = new JSONArray(); 
															 | 
															
															 | 
															
																        JSONArray result = new JSONArray(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        //服务权限 
															 | 
															
															 | 
															
																        //服务权限 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if(doctorServicePermissionsService.isPermission(doctor,10)==0){ 
															 | 
															
															 | 
															
																        if(doctorServicePermissionsService.isPermission(doctor,10)==0){ 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -675,12 +675,53 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String sql = " select p.id patientCode,p.name,p.sex,p.photo,p.idcard,ord.id orderId,ord.number,ord.serve_desc,ord.create_time,ord.`status`,ord.doctor," + 
															 | 
															
															 | 
															
																        String sql = " select p.id patientCode,p.name,p.sex,p.photo,p.idcard,ord.id orderId,ord.number,ord.serve_desc,ord.create_time,ord.`status`,ord.doctor," + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                "ord.doctor_name,ord.update_user,ord.update_user_name,ord.patient_phone,ord.conclusion_status from base_security_monitoring_order ord INNER JOIN base_patient p on p.id = ord.patient " + 
															 | 
															
															 | 
															
																                "ord.doctor_name,ord.update_user,ord.update_user_name,ord.patient_phone,ord.conclusion_status from base_security_monitoring_order ord INNER JOIN base_patient p on p.id = ord.patient " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                "where 1=1 "; 
															 | 
															
															 | 
															
																                "where 1=1 "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (StringUtils.isNotBlank(doctor)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            fliter+=" and  EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," + 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    "base_team_member m " + 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    "where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and " + 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    " r.service_package_id = i.service_package_id and  m.team_code = r.team_code  and i.del = 1 and sr.`status`=1  and i.code='preventLost' and m.doctor_code = '"+doctor+"' and m.del = '1') "; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (1==dailyMonitor){//医生日常监护居民安防工单列表查询 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (StringUtils.isBlank(topicItem)||StringUtils.isBlank(doctor)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                return new PageEnvelop(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String categoryCode =""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            switch (topicItem){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventLost": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'4'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventFall": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'12'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventFire": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'15'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventGasLeakage": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'14'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventOutOfBed": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'13'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (StringUtils.isNotBlank(doctor)){//日常监护医生必传 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                fliter += " and EXISTS( SELECT DISTINCT p.id,p.name,p.residential_area residentialArea,p.photo,p.idcard,p.mobile, " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " p.openid,p.sex,p.pad_imei padImei " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " from base_patient p , base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " WHERE p.id = sr.patient and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " and m.doctor_code = '"+doctor+"' and m.del = '1' ) "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                fliter +=" and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " where  pd.user = p.id and pd.del=0 and pd.category_code in ("+categoryCode+") and FIND_IN_SET('"+topicItem+"',dd.service_topic)) "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                if ("preventLost".equals(topicItem)){//有绑定围栏的居民 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    fliter += " and EXISTS (select 1 from wlyy_patient_safe_area sf where sf.patient = p.id and sf.del=1 and sf.manage_status=1) "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        }else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (StringUtils.isNotBlank(doctor)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                fliter+=" and  EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        "base_team_member m " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        "where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " r.service_package_id = i.service_package_id and  m.team_code = r.team_code  and i.del = 1 and sr.`status`=1  and m.doctor_code = '"+doctor+"' and m.del = '1') "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (StringUtils.isNotBlank(serverDoctor)){ 
															 | 
															
															 | 
															
																        if (StringUtils.isNotBlank(serverDoctor)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            fliter +=" and ord.doctor = '"+serverDoctor+"' "; 
															 | 
															
															 | 
															
																            fliter +=" and ord.doctor = '"+serverDoctor+"' "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -755,7 +796,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return PageEnvelop.getSuccessListWithPage("success",result,page,pageSize,count); 
															 | 
															
															 | 
															
																        return PageEnvelop.getSuccessListWithPage("success",result,page,pageSize,count); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public JSONObject getSecurityTab(String patient,String doctor,String status,String svrDesc,String topicItem){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public JSONObject getSecurityTab(String patient,String doctor,String status,String svrDesc,String topicItem,Integer dailyMonitor){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject result = new JSONObject(); 
															 | 
															
															 | 
															
																        JSONObject result = new JSONObject(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        result.put("status_-2",0);//误报警 
															 | 
															
															 | 
															
																        result.put("status_-2",0);//误报警 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -776,11 +817,49 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        sql = "select ord.status,ord.serve_desc,count(ord.id) count from base_security_monitoring_order ord INNER JOIN base_patient p on p.id = ord.patient " + 
															 | 
															
															 | 
															
																        sql = "select ord.status,ord.serve_desc,count(ord.id) count from base_security_monitoring_order ord INNER JOIN base_patient p on p.id = ord.patient " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                "where 1=1 "; 
															 | 
															
															 | 
															
																                "where 1=1 "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String fliter = "  "; 
															 | 
															
															 | 
															
																        String fliter = "  "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (StringUtils.isNotBlank(doctor)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            fliter+=" and  EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," + 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    "base_team_member m " + 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    "where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and " + 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    " r.service_package_id = i.service_package_id and  m.team_code = r.team_code  and i.del = 1 and sr.`status`=1  and i.code='preventLost' and m.doctor_code = '"+doctor+"' and m.del = '1') "; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (1==dailyMonitor){//医生日常监护居民安防工单列表查询 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (StringUtils.isBlank(topicItem)||StringUtils.isBlank(doctor)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                return result; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String categoryCode =""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            switch (topicItem){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventLost": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'4'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventFall": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'12'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventFire": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'15'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventGasLeakage": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'14'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                case "preventOutOfBed": 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    categoryCode="'13'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (StringUtils.isNotBlank(doctor)) {//日常监护医生必传 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                fliter += " and EXISTS( SELECT DISTINCT p.id,p.name,p.residential_area residentialArea,p.photo,p.idcard,p.mobile, " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " p.openid,p.sex,p.pad_imei padImei " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " from base_patient p , base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " WHERE p.id = sr.patient and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " and m.doctor_code = '" + doctor + "' and m.del = '1' ) "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                fliter += " and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " where  pd.user = p.id and pd.del=0 and pd.category_code in (" + categoryCode + ") and FIND_IN_SET('" + topicItem + "',dd.service_topic)) "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                if ("preventLost".equals(topicItem)) {//有绑定围栏的居民 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    fliter += " and EXISTS (select 1 from wlyy_patient_safe_area sf where sf.patient = p.id and sf.del=1 and sf.manage_status=1) "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        }else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (StringUtils.isNotBlank(doctor)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                fliter+=" and  EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        "base_team_member m " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        "where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        " r.service_package_id = i.service_package_id and  m.team_code = r.team_code  and i.del = 1 and sr.`status`=1  and m.doctor_code = '"+doctor+"' and m.del = '1') "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (StringUtils.isNotBlank(patient)){ 
															 | 
															
															 | 
															
																        if (StringUtils.isNotBlank(patient)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            fliter+=" and ord.patient='"+patient+"' "; 
															 | 
															
															 | 
															
																            fliter+=" and ord.patient='"+patient+"' "; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -2071,7 +2150,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                " from base_patient p , base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " + 
															 | 
															
															 | 
															
																                " from base_patient p , base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                " WHERE p.id = sr.patient and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " + 
															 | 
															
															 | 
															
																                " WHERE p.id = sr.patient and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                " and m.doctor_code = '"+doctor+"' and m.del = '1' "; 
															 | 
															
															 | 
															
																                " and m.doctor_code = '"+doctor+"' and m.del = '1' "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String filter = ""; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        String fliter = ""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String categoryCode =""; 
															 | 
															
															 | 
															
																        String categoryCode =""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String topicItemTmp = topicItem; 
															 | 
															
															 | 
															
																        String topicItemTmp = topicItem; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        switch (topicItem){ 
															 | 
															
															 | 
															
																        switch (topicItem){ 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -2096,13 +2175,13 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                break; 
															 | 
															
															 | 
															
																                break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        filter =" and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " + 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        fliter =" and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    " where  pd.user = sr.patient and pd.del=0 and pd.category_code in ("+categoryCode+") and FIND_IN_SET('"+topicItemTmp+"',dd.service_topic)) "; 
															 | 
															
															 | 
															
																                    " where  pd.user = sr.patient and pd.del=0 and pd.category_code in ("+categoryCode+") and FIND_IN_SET('"+topicItemTmp+"',dd.service_topic)) "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if ("preventLost".equals(topicItem)){//有绑定围栏的居民 
															 | 
															
															 | 
															
																        if ("preventLost".equals(topicItem)){//有绑定围栏的居民 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            filter += " and EXISTS (select 1 from wlyy_patient_safe_area sf where sf.patient = p.id and sf.del=1 and sf.manage_status=1) "; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            fliter += " and EXISTS (select 1 from wlyy_patient_safe_area sf where sf.patient = p.id and sf.del=1 and sf.manage_status=1) "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        List<Map<String,Object>> list =  jdbcTemplate.queryForList(sql+filter); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        List<Map<String,Object>> list =  jdbcTemplate.queryForList(sql+fliter); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        result.put("total",list.size()); 
															 | 
															
															 | 
															
																        result.put("total",list.size()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (1 == detail){//获取详情 
															 | 
															
															 | 
															
																        if (1 == detail){//获取详情 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            JSONArray monitorInfos = new JSONArray(); 
															 | 
															
															 | 
															
																            JSONArray monitorInfos = new JSONArray(); 
															 |