|  | @ -1579,8 +1579,8 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
 | 
	
		
			
				|  |  |         result.put("emeAssistance", false);
 | 
	
		
			
				|  |  |         result.put("monitorInfo", null);
 | 
	
		
			
				|  |  |         String sql = " select dict.code,count(ord.id) total from base_system_dict_entry dict LEFT JOIN base_security_monitoring_order ord " +
 | 
	
		
			
				|  |  |                 " on dict.code = ord.topic_item COLLATE utf8_unicode_ci and ord.status=" + SecurityMonitoringOrderDO.Status.apply.getType() + " where dict.dict_code='service_item' " +
 | 
	
		
			
				|  |  |                 "and dict.remark='security' and ord.patient='" + patient + "' GROUP BY dict.code ";
 | 
	
		
			
				|  |  |                 " on dict.code = ord.topic_item COLLATE utf8_unicode_ci and ord.status=" + SecurityMonitoringOrderDO.Status.apply.getType() + " and ord.patient='" + patient + "' where dict.dict_code='service_item' " +
 | 
	
		
			
				|  |  |                 "and dict.remark='security' GROUP BY dict.code ";
 | 
	
		
			
				|  |  |         List<Map<String, Object>> sqlResult = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         for (Map<String, Object> tmp : sqlResult) {
 | 
	
		
			
				|  |  |             switch (tmp.get("code").toString()) {
 | 
	
	
		
			
				|  | @ -1650,6 +1650,99 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取各专题预警情况
 | 
	
		
			
				|  |  |      * @param patient
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public List<Map<String,Object>> getPatientTopicWarnInfo(String patient) {
 | 
	
		
			
				|  |  |         String sql = " select dict.code,count(ord.id) total,ord.patient,ord.id,'22' as OrderType,ord.serve_desc as serveDesc from base_system_dict_entry dict LEFT JOIN base_security_monitoring_order ord " +
 | 
	
		
			
				|  |  |                 " on dict.code = ord.topic_item COLLATE utf8_unicode_ci and ord.status=" + SecurityMonitoringOrderDO.Status.apply.getType() + " and ord.patient='" + patient + "' " +
 | 
	
		
			
				|  |  |                 " where dict.dict_code='service_item' " +
 | 
	
		
			
				|  |  |                 "and dict.remark='security'  GROUP BY dict.code ";
 | 
	
		
			
				|  |  |         List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         for (Map<String, Object> tmp : list) {
 | 
	
		
			
				|  |  |             switch (tmp.get("code").toString()) {
 | 
	
		
			
				|  |  |                 case "preventGasLeakage":
 | 
	
		
			
				|  |  |                     List<Map<String,Object>> devices = patientDeviceService.patientDeviceListByTopic(patient,"preventGasLeakage");
 | 
	
		
			
				|  |  |                     if (devices.size()>0) {
 | 
	
		
			
				|  |  |                         tmp.put("band", true);
 | 
	
		
			
				|  |  |                         tmp.put("devices", devices);
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                         tmp.put("band", false);
 | 
	
		
			
				|  |  |                         tmp.put("devices", null);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     break;
 | 
	
		
			
				|  |  |                 case "preventFire":
 | 
	
		
			
				|  |  |                     devices = patientDeviceService.patientDeviceListByTopic(patient,"preventFire");
 | 
	
		
			
				|  |  |                     if (devices.size()>0){
 | 
	
		
			
				|  |  |                         tmp.put("band", true);
 | 
	
		
			
				|  |  |                         tmp.put("devices", devices);
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                         tmp.put("band", false);
 | 
	
		
			
				|  |  |                         tmp.put("devices", null);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     break;
 | 
	
		
			
				|  |  |                 case "preventFall":
 | 
	
		
			
				|  |  |                     devices = patientDeviceService.patientDeviceListByTopic(patient,"preventFall");
 | 
	
		
			
				|  |  |                     if (devices.size()>0){
 | 
	
		
			
				|  |  |                         tmp.put("band", true);
 | 
	
		
			
				|  |  |                         tmp.put("devices", devices);
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                         tmp.put("band", false);
 | 
	
		
			
				|  |  |                         tmp.put("devices", null);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     break;
 | 
	
		
			
				|  |  |                 case "preventOutOfBed":
 | 
	
		
			
				|  |  |                     devices = patientDeviceService.patientDeviceListByTopic(patient,"preventOutOfBed");
 | 
	
		
			
				|  |  |                     if (devices.size()>0){
 | 
	
		
			
				|  |  |                         tmp.put("band", true);
 | 
	
		
			
				|  |  |                         tmp.put("devices", devices);
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                         tmp.put("band", false);
 | 
	
		
			
				|  |  |                         tmp.put("devices", null);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     break;
 | 
	
		
			
				|  |  |                 case "preventLost":
 | 
	
		
			
				|  |  |                     devices = patientDeviceService.patientDeviceListByTopic(patient,"preventLost");
 | 
	
		
			
				|  |  |                     if (devices.size()>0){
 | 
	
		
			
				|  |  |                         tmp.put("band", true);
 | 
	
		
			
				|  |  |                         tmp.put("devices", devices);
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                         tmp.put("band", false);
 | 
	
		
			
				|  |  |                         tmp.put("devices", null);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     break;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         sql = " select 'emeAssistance' as code,ord.id,ord.patient,'20' as OrderType,'紧急呼叫' as serveDesc " +
 | 
	
		
			
				|  |  |                 " from base_emergency_assistance_order ord where ord.`status`='"+EmergencyAssistanceDO.Status.apply.getType()+"' " +
 | 
	
		
			
				|  |  |                 " and ord.patient='"+patient+"' limit 1 ";
 | 
	
		
			
				|  |  |         List<Map<String,Object>> emeAssistances = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         sql = " select dd.photo,pd.device_sn,dd.brands,dd.category_code,dd.model,pd.device_name,date_format(pd.czrq,'%Y-%m-%d %H:%i:%S' ) deviceTime \n" +
 | 
	
		
			
				|  |  |                 "from dm_device dd INNER JOIN wlyy_patient_device pd on dd.category_code = pd.category_code INNER JOIN wlyy_devices wd on dd.model = wd.device_model and pd.device_sn = wd.device_code \n" +
 | 
	
		
			
				|  |  |                 "where 1=1 and  pd.del=0 and dd.category_code in (4,7,16) and user='"+patient+"' ";
 | 
	
		
			
				|  |  |         List<Map<String,Object>> devices = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         if (emeAssistances.size()>0){
 | 
	
		
			
				|  |  |           Map<String,Object> tmp =  emeAssistances.get(0);
 | 
	
		
			
				|  |  |             tmp.put("band",devices.size()>0?true:false);
 | 
	
		
			
				|  |  |             tmp.put("devices",devices);
 | 
	
		
			
				|  |  |             list.add(tmp);
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  |             Map<String,Object> tmp = new HashMap<>();
 | 
	
		
			
				|  |  |             tmp.put("code","emeAssistance");
 | 
	
		
			
				|  |  |             tmp.put("id",null);
 | 
	
		
			
				|  |  |             tmp.put("patient",null);
 | 
	
		
			
				|  |  |             tmp.put("OrderType",null);
 | 
	
		
			
				|  |  |             tmp.put("serveDesc",null);
 | 
	
		
			
				|  |  |             tmp.put("band",devices.size()>0?true:false);
 | 
	
		
			
				|  |  |             tmp.put("devices",devices);
 | 
	
		
			
				|  |  |             list.add(tmp);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return list;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 老人家属首页实时监护信息
 | 
	
		
			
				|  |  |      * 居家状态取手表 无手表缺省
 |