|
@ -145,6 +145,21 @@ public class DoctorMessageService {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public PageEnvelop getHealthMonitoringListTwo(Integer page, Integer pageSize, String hospital){
|
|
|
|
page = page>0?page-1:0;
|
|
|
|
String sql = "SELECT pd.id,pd.device_sn deviceSn,pd.`user`,p.`name`,d.contact_status_time contactStatusTime,CASE pd.category_code WHEN '1' THEN '血糖仪离线' WHEN '2' THEN '血压计离线' WHEN '13' THEN '睡眠带离线'\n" +
|
|
|
|
"WHEN '17' THEN '随身WiFi离线' WHEN '7' THEN '居家安全报警器离线' WHEN '12' THEN '监控器离线' WHEN '14' THEN '气感报警器离线' WHEN '15' THEN '烟感报警器离线' WHEN '16' THEN '智能拐杖离线' WHEN '4' THEN '智能手表离线'\n" +
|
|
|
|
"ELSE '未知' END categoryCode,pd.category_code categoryNum,pd.device_name devName \n" +
|
|
|
|
"FROM wlyy_devices d,wlyy_patient_device pd,base_patient p,base_service_package_sign_record spsr,base_service_package_record spr,base_service_package sp\n" +
|
|
|
|
"WHERE d.contact_status = 0 AND pd.del = 0 AND pd.device_sn = d.device_code AND pd.`user` = p.id \n" +
|
|
|
|
"AND spsr.patient = pd.`user` AND spsr.id = spr.sign_id AND spr.service_package_id = sp.id AND sp.org_code = '"+hospital+"'\n" +
|
|
|
|
"GROUP BY pd.device_sn ORDER BY d.contact_status_time DESC";
|
|
|
|
String countSql = "select count(id) from ("+sql+")A ";
|
|
|
|
long count = jdbcTemplate.queryForObject(countSql,long.class);
|
|
|
|
sql +=" limit "+page*pageSize+","+pageSize;
|
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
|
|
|
|
}
|
|
|
|
|
|
public JSONObject getPreventLost(String doctor,String id,String type){
|
|
public JSONObject getPreventLost(String doctor,String id,String type){
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|