|
@ -6,6 +6,7 @@ import com.yihu.jw.care.dao.security.BaseEmergencyWarnLogDao;
|
|
|
import com.yihu.jw.entity.care.securitymonitoring.BaseEmergencyWarnLogDO;
|
|
|
import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
@ -557,23 +558,28 @@ public class WlyygcStatisticsService {
|
|
|
return PageEnvelop.getSuccessListWithPage("查询成功",maps,page,size,Long.parseLong(maps.size()+""));
|
|
|
}
|
|
|
//1血糖仪,2.血压计,3药盒,4智能手表,7 = 居家报警器,12 监控器 13 睡眠带 14气感报警器 15烟感报警器 16拐杖 17随身wifi
|
|
|
public List<Map<String, Object>> deviceCollectInfo(String deviceSN,String code){
|
|
|
public List<Map<String, Object>> deviceCollectInfo(String deviceSN,String code,String startDate,String endDate){
|
|
|
String sql = "";
|
|
|
switch (code){
|
|
|
case "14":
|
|
|
//烟感气感实时数据
|
|
|
sql = "SELECT device_sn,device_type,value,unit,create_time,temperature_value,power_value FROM base_device_health_index WHERE device_sn = '"+deviceSN+"' ORDER BY create_time DESC LIMIT 1";
|
|
|
sql = "SELECT device_sn,device_type,value,unit,DATE_FORMAT(create_time,'%Y-%m-%d') as create_time,temperature_value,power_value FROM base_device_health_index WHERE device_sn = '"+deviceSN+"'";
|
|
|
break;
|
|
|
case "16": //拐杖
|
|
|
sql = "SELECT lat,lon,create_time FROM base_yxdevice_index WHERE sn = '"+deviceSN+"' ORDER BY create_time DESC LIMIT 1";
|
|
|
sql = "SELECT lat,lon,DATE_FORMAT(create_time,'%Y-%m-%d') as create_time FROM base_yxdevice_index WHERE sn = '"+deviceSN+"'";
|
|
|
break;
|
|
|
case "13": //睡眠带
|
|
|
sql = "SELECT * FROM base_sleep_device WHERE device_sn = '"+deviceSN+"' ORDER BY create_time DESC LIMIT 1";
|
|
|
sql = "SELECT * FROM base_sleep_device WHERE device_sn = '"+deviceSN+"'";
|
|
|
break;
|
|
|
case "4": //智能手表
|
|
|
sql = "SELECT sleep_time,deep_sleep,light_sleep,awake_time,interval_time,total,del FROM base_sleep_x1device WHERE device_sn = '"+deviceSN+"' ORDER BY create_time DESC LIMIT 1;";
|
|
|
sql = "SELECT sleep_time,deep_sleep,light_sleep,awake_time,interval_time,total,del,DATE_FORMAT(create_time,'%Y-%m-%d') as create_time FROM base_sleep_x1device WHERE device_sn = '"+deviceSN+"' ";
|
|
|
break;
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startDate)&&StringUtils.isNotBlank(endDate)){
|
|
|
sql += " AND create_time >= '"+startDate+"' AND create_time <='"+endDate+"' ";
|
|
|
}
|
|
|
|
|
|
sql += " ORDER BY create_time";
|
|
|
return jdbcTemplate.queryForList(sql);
|
|
|
}
|
|
|
|