|
@ -1703,42 +1703,42 @@ public class MonitorPlatformService {
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getHealthScoreByPatient(String patient,String date,String endDate){
|
|
|
String sql = "SELECT chhs.* FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_health_score chhs,wlyy.hm_token t\n" +
|
|
|
String sql = "SELECT chhs.device_sn deviceSn,chhs.export_key exportKey,chhs.export_time exportTime,chhs.name name,chhs.score score,chhs.total total,chhs.date date FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_health_score chhs,wlyy.hm_token t\n" +
|
|
|
"WHERE t.patient = '"+patient+"' AND t.patient = chd.patient AND chd.device_sn = chhs.device_sn and chhs.date > '"+endDate+"' and chhs.date < '"+date+"' ORDER BY export_time DESC ";
|
|
|
List<Map<String, Object>> scoreDO = jdbcTemplate.queryForList(sql);
|
|
|
return scoreDO;
|
|
|
}
|
|
|
|
|
|
public List<Map<String,Object>> getRealtimeDateByPatient(String patient,String date){
|
|
|
String sql = "SELECT chrd.* FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_realtime_date chrd,wlyy.hm_token t\n" +
|
|
|
String sql = "SELECT chrd.device_sn deviceSn,chrd.hr hr,chrd.st st,chrd.cal cal,chrd.date date FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_realtime_date chrd,wlyy.hm_token t\n" +
|
|
|
"WHERE t.patient = '"+patient+"' AND t.patient = chd.patient AND chd.device_sn = chrd.device_sn and chrd.date = '"+date+"' ORDER BY chrd.`date` DESC";
|
|
|
List<Map<String, Object>> realtimeDateDo = jdbcTemplate.queryForList(sql);
|
|
|
return realtimeDateDo;
|
|
|
}
|
|
|
|
|
|
public List<Map<String,Object>> getRundatePatient(String patient,String date){
|
|
|
String sql = "SELECT chr.* FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_rundate chr,wlyy.hm_token t\n" +
|
|
|
String sql = "SELECT chr.device_sn deviceSn,chr.date date,chr.last_sync_time lastSyncTime,chr.steps steps,chr.distance distance,chr.run_distance runDistance,chr.run_time runTime,chr.walk_time walkTime,chr.calories calories,chr.run_calories runCalories,chr.hour hour FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_rundate chr,wlyy.hm_token t\n" +
|
|
|
"WHERE t.patient = '"+patient+"' AND t.patient = chd.patient AND chd.device_sn = chr.device_sn and chr.date = '"+date+"' ORDER BY chr.`date` DESC";
|
|
|
List<Map<String, Object>> rundataDo = jdbcTemplate.queryForList(sql);
|
|
|
return rundataDo;
|
|
|
}
|
|
|
|
|
|
public List<Map<String,Object>> getPaiPatient(String patient,String date){
|
|
|
String sql = "SELECT chp.* FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_pai chp,wlyy.hm_token t\n" +
|
|
|
String sql = "SELECT chp.device_sn deviceSn,chp.calendar_day calendarDay,chp.timestamp timestamp,chp.total_pai totalPai,chp.daily_pai dailyPai,chp.date date FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_pai chp,wlyy.hm_token t\n" +
|
|
|
"WHERE t.patient = '"+patient+"' AND t.patient = chd.patient AND chd.device_sn = chp.device_sn and chp.date = '"+date+"' ORDER BY chp.`timestamp` DESC";
|
|
|
List<Map<String, Object>> paiDo = jdbcTemplate.queryForList(sql);
|
|
|
return paiDo;
|
|
|
}
|
|
|
|
|
|
public List<Map<String,Object>> getSleepByPatient(String patient,String date){
|
|
|
String sql = "SELECT chs.* FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_sleep chs,wlyy.hm_token t\n" +
|
|
|
String sql = "SELECT chs.device_sn deviceSn,chs.date date,chs.last_sync_time lastSyncTime,chs.deep_sleep_time deepSleepTime,chs.shallow_sleep_time shallowSleepTime,chs.wake_time wakeTime,chs.sleep_score sleepScore,chs.start start,chs.stop stop,chs.mode mode FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_sleep chs,wlyy.hm_token t\n" +
|
|
|
"WHERE t.patient = '"+patient+"' AND t.patient = chd.patient AND chd.device_sn = chs.device_sn and chs.date = '"+date+"' ORDER BY chs.`last_sync_time` DESC";
|
|
|
List<Map<String, Object>> paiDo = jdbcTemplate.queryForList(sql);
|
|
|
return paiDo;
|
|
|
}
|
|
|
|
|
|
public List<Map<String , Object>> getHeartByPatient(String patient,String date,String endDate){
|
|
|
String sql = "SELECT chh.* FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_heart chh,wlyy.hm_token t\n" +
|
|
|
String sql = "SELECT chh.device_sn deviceSn,chh.date date,chh.minute minute,chh.last_sync_time lastSyncTime,chh.timestamp timestamp,chh.heart_rate_data heartRateData,chh.measure_type measureType FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_heart chh,wlyy.hm_token t\n" +
|
|
|
"WHERE t.patient = '"+patient+"' AND t.patient = chd.patient AND chd.device_sn = chh.device_sn and chh.`date` > '"+endDate+"' and chh.`date` < '"+date+"' ORDER BY chh.`date` DESC";
|
|
|
List<Map<String, Object>> heartDo = jdbcTemplate.queryForList(sql);
|
|
|
return heartDo;
|