|
@ -1585,41 +1585,58 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
|
|
|
for (Map<String, Object> tmp : sqlResult) {
|
|
|
switch (tmp.get("code").toString()) {
|
|
|
case "preventGasLeakage":
|
|
|
Integer count = Integer.parseInt(tmp.get("total").toString());
|
|
|
if (count > 0) {
|
|
|
result.put("gasLeakage", true);
|
|
|
} else {
|
|
|
result.put("gasLeakage", false);
|
|
|
if (patientDeviceService.patientDeviceListByTopic(patient,"preventGasLeakage").size()==0){
|
|
|
result.put("gasLeakage", null);
|
|
|
}else {
|
|
|
Integer count = Integer.parseInt(tmp.get("total").toString());
|
|
|
if (count > 0) {
|
|
|
result.put("gasLeakage", true);
|
|
|
} else {
|
|
|
result.put("gasLeakage", false);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case "preventFire":
|
|
|
count = Integer.parseInt(tmp.get("total").toString());
|
|
|
if (count > 0) {
|
|
|
result.put("fire", true);
|
|
|
} else {
|
|
|
result.put("fire", false);
|
|
|
if (patientDeviceService.patientDeviceListByTopic(patient,"preventFire").size()==0){
|
|
|
result.put("fire", null);
|
|
|
}else {
|
|
|
Integer count = Integer.parseInt(tmp.get("total").toString());
|
|
|
if (count > 0) {
|
|
|
result.put("fire", true);
|
|
|
} else {
|
|
|
result.put("fire", false);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case "preventFall":
|
|
|
count = Integer.parseInt(tmp.get("total").toString());
|
|
|
if (count > 0) {
|
|
|
result.put("fall", true);
|
|
|
} else {
|
|
|
result.put("fall", false);
|
|
|
if (patientDeviceService.patientDeviceListByTopic(patient,"preventFall").size()==0){
|
|
|
result.put("fall", null);
|
|
|
}else {
|
|
|
Integer count = Integer.parseInt(tmp.get("total").toString());
|
|
|
if (count > 0) {
|
|
|
result.put("fall", true);
|
|
|
} else {
|
|
|
result.put("fall", false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
case "preventOutOfBed":
|
|
|
count = Integer.parseInt(tmp.get("total").toString());
|
|
|
if (count > 0) {
|
|
|
result.put("sleep", true);
|
|
|
sql = " select serve_desc from base_security_monitoring_order where topic_item='preventOutOfBed' " +
|
|
|
"and patient='" + patient + "' and `status`=1 order by create_time desc limit 1 ";
|
|
|
List<String> serveDesces = jdbcTemplate.queryForList(sql, String.class);
|
|
|
if (serveDesces.size() > 0) {
|
|
|
result.put("sleepOrderInfo", serveDesces.get(0));
|
|
|
if (patientDeviceService.patientDeviceListByTopic(patient,"preventOutOfBed").size()==0){
|
|
|
result.put("sleep", null);
|
|
|
}else {
|
|
|
Integer count = Integer.parseInt(tmp.get("total").toString());
|
|
|
if (count > 0) {
|
|
|
result.put("sleep", true);
|
|
|
sql = " select serve_desc from base_security_monitoring_order where topic_item='preventOutOfBed' " +
|
|
|
"and patient='" + patient + "' and `status`=1 order by create_time desc limit 1 ";
|
|
|
List<String> serveDesces = jdbcTemplate.queryForList(sql, String.class);
|
|
|
if (serveDesces.size() > 0) {
|
|
|
result.put("sleepOrderInfo", serveDesces.get(0));
|
|
|
}
|
|
|
} else {
|
|
|
result.put("sleep", false);
|
|
|
}
|
|
|
} else {
|
|
|
result.put("sleep", false);
|
|
|
}
|
|
|
break;
|
|
|
}
|