|
@ -250,20 +250,23 @@ public class PatientDeviceService {
|
|
List<String> onContact = new ArrayList<>();
|
|
List<String> onContact = new ArrayList<>();
|
|
/*******************未失联**/
|
|
/*******************未失联**/
|
|
//血糖仪,血压计。30天内有数据上传,则改为未失联
|
|
//血糖仪,血压计。30天内有数据上传,则改为未失联
|
|
String sql = " SELECT pd.device_sn FROM base.wlyy_patient_device pd where pd.del=0 and pd.category_code in (1,2) and EXISTS ( " +
|
|
|
|
"select dp.device_sn from device_data_push_log dp where dp.device_sn = pd.device_sn and dp.create_time " +
|
|
|
|
" BETWEEN '"+startTimeDevice1+"' AND '"+endTime+"') ";
|
|
|
|
List<String> devices = jdbcTemplate.queryForList(sql,String.class) ;
|
|
|
|
if (devices.size() > 0) {
|
|
|
|
onContact.addAll(devices);
|
|
|
|
}
|
|
|
|
|
|
// String sql = " SELECT pd.device_sn FROM base.wlyy_patient_device pd where pd.del=0 and pd.category_code in (1,2) and EXISTS ( " +
|
|
|
|
// "select dp.device_sn from device_data_push_log dp where dp.device_sn = pd.device_sn and dp.create_time " +
|
|
|
|
// " BETWEEN '"+startTimeDevice1+"' AND '"+endTime+"') ";
|
|
|
|
// List<String> devices = jdbcTemplate.queryForList(sql,String.class) ;
|
|
|
|
// if (devices.size() > 0) {
|
|
|
|
// onContact.addAll(devices);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// //智能拐杖。手表2天内有数据上传,则改为未失联**
|
|
|
|
// sql = " SELECT pd.device_sn FROM base.wlyy_patient_device pd where pd.del=0 and pd.category_code in (4,16) and EXISTS ( " +
|
|
|
|
// "select dp.device_sn from device_data_push_log dp where dp.device_sn = pd.device_sn and dp.create_time " +
|
|
|
|
// " BETWEEN '"+startTimeDevice2+"' AND '"+endTime+"') ";
|
|
|
|
|
|
//智能拐杖。手表2天内有数据上传,则改为未失联**
|
|
|
|
sql = " SELECT pd.device_sn FROM base.wlyy_patient_device pd where pd.del=0 and pd.category_code in (4,16) and EXISTS ( " +
|
|
|
|
"select dp.device_sn from device_data_push_log dp where dp.device_sn = pd.device_sn and dp.create_time " +
|
|
|
|
|
|
//清除消息
|
|
|
|
String sql = " select distinct dp.device_sn from device_data_push_log dp where dp.create_time " +
|
|
" BETWEEN '"+startTimeDevice2+"' AND '"+endTime+"') ";
|
|
" BETWEEN '"+startTimeDevice2+"' AND '"+endTime+"') ";
|
|
|
|
|
|
devices = jdbcTemplate.queryForList(sql,String.class) ;
|
|
|
|
|
|
List<String> devices = jdbcTemplate.queryForList(sql,String.class) ;
|
|
if (devices.size() > 0) {
|
|
if (devices.size() > 0) {
|
|
onContact.addAll(devices);
|
|
onContact.addAll(devices);
|
|
}
|
|
}
|