|
@ -36,7 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@ -192,7 +191,11 @@ public class PatientInfoPlatFormService {
|
|
|
//能力状况
|
|
|
BaseCapacityLabelDO capacityLabelDO = capacityLabelDao.findByPatient(patient);
|
|
|
result.put("capacityLabelDO",capacityLabelDO);
|
|
|
result.put("capacityLabelDOStr",capacityLabelDO.getCapacityLabels());
|
|
|
if (capacityLabelDO.getCapacityLabels().size() > 0) {
|
|
|
result.put("capacityLabelDOStr", capacityLabelDO.getCapacityLabels());
|
|
|
}else {
|
|
|
result.put("capacityLabelDOStr", null);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
return null;
|
|
@ -300,6 +303,8 @@ public class PatientInfoPlatFormService {
|
|
|
list = jdbcTemplate.queryForList(sql);
|
|
|
if (list.size()>0){
|
|
|
healthIndex.put("lastXTHealthIndex",list.get(0));
|
|
|
}else{
|
|
|
healthIndex.put("lastXTHealthIndex",null);
|
|
|
}
|
|
|
sql = " select *,CAST(DATE_FORMAT(record_date,'%Y-%m-%d %H:%i:%S') as char) record_date, " +
|
|
|
" CAST(DATE_FORMAT(sort_date,'%Y-%m-%d %H:%i:%S') as char) sort_date, " +
|
|
@ -307,6 +312,8 @@ public class PatientInfoPlatFormService {
|
|
|
list = jdbcTemplate.queryForList(sql);
|
|
|
if (list.size()>0){
|
|
|
healthIndex.put("lastXYHealthIndex",list.get(0));
|
|
|
}else{
|
|
|
healthIndex.put("lastXYHealthIndex",null);
|
|
|
}
|
|
|
result.put("healthIndex",healthIndex);
|
|
|
return result;
|
|
@ -731,13 +738,13 @@ public class PatientInfoPlatFormService {
|
|
|
}
|
|
|
break;
|
|
|
case "4"://手表 电量、佩戴状态、是否预警、在线状态
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'20' orderType,'1' type,o.serve_address,'紧急呼叫' serve_desc, " +
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'20' OrderType,'1' type,o.serve_address,'紧急呼叫' serve_desc, " +
|
|
|
" o.status,DATE_FORMAT(o.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_emergency_assistance_order o " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 " +
|
|
|
" UNION " +
|
|
|
" select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' orderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
" select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' OrderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
" o.status,DATE_FORMAT(o.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_security_monitoring_order o " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 " +
|
|
|
"ORDER BY create_time desc limit 1 ";
|
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
|
if (sqlResult.size()>0){
|
|
@ -764,9 +771,9 @@ public class PatientInfoPlatFormService {
|
|
|
}
|
|
|
break;
|
|
|
case "7"://报警器 电量 是否报警、在线状态
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'20' orderType,'1' type,o.serve_address,'紧急呼叫' serve_desc, " +
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'20' OrderType,'1' type,o.serve_address,'紧急呼叫' serve_desc, " +
|
|
|
" o.status,DATE_FORMAT(o.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_emergency_assistance_order o " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' ORDER BY create_time desc limit 1 ";
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 ORDER BY create_time desc limit 1 ";
|
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
|
if (sqlResult.size()>0){
|
|
|
detailInfo.put("warnStatus",true);
|
|
@ -787,9 +794,9 @@ public class PatientInfoPlatFormService {
|
|
|
}
|
|
|
break;
|
|
|
case "12"://监控
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' orderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' OrderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
" o.status,DATE_FORMAT(o.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_security_monitoring_order o " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 " +
|
|
|
"ORDER BY create_time desc limit 1 ";
|
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
|
if (sqlResult.size()>0){
|
|
@ -800,9 +807,9 @@ public class PatientInfoPlatFormService {
|
|
|
}
|
|
|
break;
|
|
|
case "13"://床带 是否压床、 心率和呼吸频率、在线状态
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' orderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' OrderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
" o.status,DATE_FORMAT(o.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_security_monitoring_order o " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 " +
|
|
|
"ORDER BY create_time desc limit 1 ";
|
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
|
if (sqlResult.size()>0){
|
|
@ -834,9 +841,9 @@ public class PatientInfoPlatFormService {
|
|
|
}
|
|
|
break;
|
|
|
case "14"://燃气
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' orderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' OrderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
" o.status,DATE_FORMAT(o.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_security_monitoring_order o " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 " +
|
|
|
"ORDER BY create_time desc limit 1 ";
|
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
|
if (sqlResult.size()>0){
|
|
@ -846,12 +853,19 @@ public class PatientInfoPlatFormService {
|
|
|
detailInfo.put("warnStatus",false);
|
|
|
}
|
|
|
//获取最新一次燃气浓度
|
|
|
sql = "";
|
|
|
sql = " select value,record_time from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
|
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
|
if (sqlResult.size()>0){
|
|
|
detailInfo.putAll(sqlResult.get(0));
|
|
|
}else {
|
|
|
detailInfo.put("value",null);
|
|
|
detailInfo.put("record_time",null);
|
|
|
}
|
|
|
break;
|
|
|
case "15"://烟感
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' orderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' OrderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
" o.status,DATE_FORMAT(o.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_security_monitoring_order o " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 " +
|
|
|
"ORDER BY create_time desc limit 1 ";
|
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
|
if (sqlResult.size()>0){
|
|
@ -860,24 +874,25 @@ public class PatientInfoPlatFormService {
|
|
|
}else {
|
|
|
detailInfo.put("warnStatus",false);
|
|
|
}
|
|
|
//获取最新一次燃气浓度
|
|
|
sql = " select value,record_time from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
|
|
|
//获取最新一次烟雾浓度
|
|
|
sql = " select value,record_time from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
|
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
|
if (sqlResult.size()>0){
|
|
|
detailInfo.putAll(sqlResult.get(0));
|
|
|
}else {
|
|
|
}
|
|
|
else {
|
|
|
detailInfo.put("value",null);
|
|
|
detailInfo.put("record_time",null);
|
|
|
}
|
|
|
break;
|
|
|
case "16"://拐杖 是否预警
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'20' orderType,'1' type,o.serve_address,'紧急呼叫' serve_desc, " +
|
|
|
sql = " select o.id,p.id patient,p.name,p.idcard,p.residential_area,'20' OrderType,'1' type,o.serve_address,'紧急呼叫' serve_desc, " +
|
|
|
" o.status,DATE_FORMAT(o.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_emergency_assistance_order o " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 " +
|
|
|
" UNION " +
|
|
|
" select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' orderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
" select o.id,p.id patient,p.name,p.idcard,p.residential_area,'22' OrderType,'1' type,o.serve_address,o.serve_desc, " +
|
|
|
" o.status,DATE_FORMAT(o.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_security_monitoring_order o " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' " +
|
|
|
" INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 " +
|
|
|
"ORDER BY create_time desc limit 1 ";
|
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
|
if (sqlResult.size()>0){
|