|
@ -433,11 +433,29 @@ public class StatisticsService {
|
|
res.put("emergencyCallNum", emergencyCallNum); //紧急呼叫的次数
|
|
res.put("emergencyCallNum", emergencyCallNum); //紧急呼叫的次数
|
|
res.put("securityMonitoringNum", securityMonitoringNum); //安防监护触发工单的次数
|
|
res.put("securityMonitoringNum", securityMonitoringNum); //安防监护触发工单的次数
|
|
//离线的设备数 超过6小时未受理的预警数 超6小时未响应服务(审核照料发起6小时未接单)
|
|
//离线的设备数 超过6小时未受理的预警数 超6小时未响应服务(审核照料发起6小时未接单)
|
|
sqltmp = " select count(distinct pd.device_sn) from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
|
|
|
|
|
|
sqltmp = " select count(distinct pd.device_sn) total ,pd.device_type from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
|
|
" INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " +
|
|
" INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " +
|
|
"where (dev.contact_status=0 or dev.contact_status is null ) and pd.user "+userfilter;
|
|
"where (dev.contact_status=0 or dev.contact_status is null ) and pd.user "+userfilter;
|
|
Long count = jdbcTemplate.queryForObject(sqltmp,Long.class);//离线设备
|
|
|
|
|
|
sqltmp += " group by pd.device_type ";
|
|
|
|
List<Map<String,Object>> offlineDevices = jdbcTemplate.queryForList(sqltmp);//离线设备
|
|
|
|
Long count = 0l;
|
|
|
|
Long offlineDevice0 = 0l;
|
|
|
|
Long offlineDevice1 = 0l;
|
|
|
|
for (Map<String,Object> tmp:offlineDevices){
|
|
|
|
String deviceType = tmp.get("device_type").toString();
|
|
|
|
if ("0".equals(deviceType)){
|
|
|
|
offlineDevice0 = Long.valueOf(tmp.get("total").toString());
|
|
|
|
}
|
|
|
|
if ("1".equals(deviceType)){
|
|
|
|
offlineDevice1 = Long.valueOf(tmp.get("total").toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
count = offlineDevice0+offlineDevice1;
|
|
res.put("offlineDevice", count);
|
|
res.put("offlineDevice", count);
|
|
|
|
res.put("offlineDevice0", offlineDevice0);//健康设备离线数
|
|
|
|
res.put("offlineDevice1", offlineDevice1);//安防设备离线数
|
|
|
|
|
|
|
|
|
|
sqltmp = " select sum(total) from ( " +
|
|
sqltmp = " select sum(total) from ( " +
|
|
"select count(o.id) total from " +
|
|
"select count(o.id) total from " +
|
|
"base_emergency_assistance_order o INNER JOIN base_patient p on o.patient = p.id where status=1 and o.patient " +userfilter+
|
|
"base_emergency_assistance_order o INNER JOIN base_patient p on o.patient = p.id where status=1 and o.patient " +userfilter+
|