|
@ -1013,7 +1013,11 @@ public class PatientInfoPlatFormService {
|
|
detailInfo.put("warnStatus",false);
|
|
detailInfo.put("warnStatus",false);
|
|
}
|
|
}
|
|
//获取最新一次燃气浓度
|
|
//获取最新一次燃气浓度
|
|
sql = " select value, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
|
|
|
|
|
|
if(bl){
|
|
|
|
sql = " select value, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time from base_device_health_index where device_sn='"+deviceSn+"' and record_time >= '"+beforeTime+"' and record_time <= '"+afterTime+"' ORDER BY record_time desc limit 1 ";
|
|
|
|
}else {
|
|
|
|
sql = " select value, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
|
|
|
|
}
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
if (sqlResult.size()>0){
|
|
if (sqlResult.size()>0){
|
|
detailInfo.putAll(sqlResult.get(0));
|
|
detailInfo.putAll(sqlResult.get(0));
|
|
@ -1035,7 +1039,11 @@ public class PatientInfoPlatFormService {
|
|
detailInfo.put("warnStatus",false);
|
|
detailInfo.put("warnStatus",false);
|
|
}
|
|
}
|
|
//获取最新一次烟雾浓度
|
|
//获取最新一次烟雾浓度
|
|
sql = " select value,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
|
|
|
|
|
|
if(bl){
|
|
|
|
sql = " select value,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time from base_device_health_index where device_sn='"+deviceSn+"' and record_time >='"+beforeTime+"' and record_time <= '"+afterTime+"' ORDER BY record_time desc limit 1 ";
|
|
|
|
}else {
|
|
|
|
sql = " select value,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
|
|
|
|
}
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
if (sqlResult.size()>0){
|
|
if (sqlResult.size()>0){
|
|
detailInfo.putAll(sqlResult.get(0));
|
|
detailInfo.putAll(sqlResult.get(0));
|
|
@ -1044,7 +1052,11 @@ public class PatientInfoPlatFormService {
|
|
detailInfo.put("value",null);
|
|
detailInfo.put("value",null);
|
|
detailInfo.put("record_time",null);
|
|
detailInfo.put("record_time",null);
|
|
}
|
|
}
|
|
sql = " select temperature_value ,record_time as temperature_value_record_time from base_device_health_index where device_sn='"+deviceSn+"' and temperature_value is not null ORDER BY record_time desc limit 1 ";
|
|
|
|
|
|
if(bl){
|
|
|
|
sql = " select temperature_value ,record_time as temperature_value_record_time from base_device_health_index where device_sn='"+deviceSn+"' and temperature_value is not null and record_time >= '"+beforeTime+"' and record_time<= '"+afterTime+"' ORDER BY record_time desc limit 1 ";
|
|
|
|
}else {
|
|
|
|
sql = " select temperature_value ,record_time as temperature_value_record_time from base_device_health_index where device_sn='"+deviceSn+"' and temperature_value is not null ORDER BY record_time desc limit 1 ";
|
|
|
|
}
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
sqlResult = jdbcTemplate.queryForList(sql);
|
|
if (sqlResult.size()>0){
|
|
if (sqlResult.size()>0){
|
|
detailInfo.putAll(sqlResult.get(0));
|
|
detailInfo.putAll(sqlResult.get(0));
|