|
@ -1131,7 +1131,7 @@ public class MonitorPlatformService {
|
|
|
String sql = "select count(DISTINCT A.device_name) as total,A.device_name,A.manufacturer from (\n" +
|
|
|
"select pd.device_name,wd.manufacturer from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
|
|
|
"where pd.device_sn = wd.device_code and pd.del=0 \n" +
|
|
|
"and wd.manufacturer_code is not null and wd.manufacturer_code <>''\n" +
|
|
|
"and wd.manufacturer_code is not null and wd.manufacturer_code <>'' and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机' \n" +
|
|
|
"GROUP BY wd.manufacturer_code,pd.device_name\n" +
|
|
|
"UNION\n" +
|
|
|
"select '健康小屋' device_name,manufacturer from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name\n" +
|
|
@ -1145,7 +1145,7 @@ public class MonitorPlatformService {
|
|
|
sql = "select count(DISTINCT A.device_name)from (\n" +
|
|
|
"select pd.device_name from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
|
|
|
"where pd.device_sn = wd.device_code and pd.del=0 \n" +
|
|
|
"and wd.manufacturer_code is not null and wd.manufacturer_code <>''\n" +
|
|
|
"and wd.manufacturer_code is not null and wd.manufacturer_code <>'' and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机' \n" +
|
|
|
"GROUP BY wd.manufacturer_code,pd.device_name\n" +
|
|
|
"UNION\n" +
|
|
|
"select '健康小屋' device_name from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name\n" +
|
|
@ -1443,7 +1443,8 @@ public class MonitorPlatformService {
|
|
|
StringBuffer sql = new StringBuffer("select DISTINCT A.device_name from (\n" +
|
|
|
"select pd.device_name from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
|
|
|
"where pd.device_sn = wd.device_code and pd.del=0 \n" +
|
|
|
"and wd.manufacturer_code is not null and wd.manufacturer_code <>'' ");
|
|
|
"and wd.manufacturer_code is not null and wd.manufacturer_code <>'' " +
|
|
|
"and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机' ");
|
|
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceType)){
|
|
|
sql.append("and pd.category_code in ('").append(deviceType.replace(",","','")).append("') ");
|
|
|
}
|
|
@ -1453,8 +1454,20 @@ public class MonitorPlatformService {
|
|
|
}
|
|
|
sql.append(")A");
|
|
|
List<String> list = jdbcTemplate.queryForList(sql.toString(),String.class);
|
|
|
List<String> reList = new ArrayList<>();
|
|
|
int i=0;
|
|
|
for(String tmp:list){
|
|
|
if ("三诺血糖仪".equals(tmp)||"血糖仪-三诺亲智".equals(tmp)||"三诺亲智".equals(tmp)||"健康之路亲智血糖仪".equals(tmp)||"血糖仪".equals(tmp)||"血糖仪-健康之路亲智血糖仪".equals(tmp)){
|
|
|
i=1;
|
|
|
continue;
|
|
|
}
|
|
|
reList.add(tmp);
|
|
|
}
|
|
|
if (i==1){//上面去除的元素统一返回为三诺血糖仪
|
|
|
reList.add("三诺血糖仪");
|
|
|
}
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("brands",list);
|
|
|
result.put("brands",reList);
|
|
|
return result;
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@ -1486,13 +1499,17 @@ public class MonitorPlatformService {
|
|
|
Integer ee = jdbcTemplate.queryForObject(cabinCount,Integer.class);
|
|
|
object.put("medicalInstitutionIquipment",ee);
|
|
|
//小屋体征数据
|
|
|
String cabinSignData = "SELECT count(1) from wlyy.wlyy_sign_family s,wlyy.wlyy_patient_device d, device.wlyy_patient_health_index p WHERE s.`status`>0 \n" +
|
|
|
"and d.`user` = s.patient and p.`user`=d.`user` and p.del=1 and p.type>2";
|
|
|
String cabinSignData = "SELECT count(1) FROM xmiot.wlyy_iot_m ";
|
|
|
Integer ff = jdbcTemplate.queryForObject(cabinSignData,Integer.class);
|
|
|
object.put("medicalPhysicalSignData",ff);
|
|
|
//小屋异常体征数据
|
|
|
String abnormalSignDataOfCabin = "SELECT count(1) from wlyy.wlyy_sign_family s,wlyy.wlyy_patient_device d,device.wlyy_patient_health_index p WHERE s.`status`>0 \n" +
|
|
|
"and d.`user` = s.patient and p.`user`=d.`user` and p.`status`=1 and p.del=1 and p.type>2";
|
|
|
String abnormalSignDataOfCabin = "select count(1)\n" +
|
|
|
"from xmiot.wlyy_iot_d d \n" +
|
|
|
"where d.type='BloodPressure'\n" +
|
|
|
"and (\n" +
|
|
|
"(d.`code`='HighPressure' and (d.`value` not BETWEEN 90.0 and 140))\n" +
|
|
|
"or (d.`code`='LowPressure' and (d.`value` not BETWEEN 60.0 and 90))\n" +
|
|
|
");";
|
|
|
Integer gg = jdbcTemplate.queryForObject(abnormalSignDataOfCabin,Integer.class);
|
|
|
object.put("medicalAbnormalSignData",gg);
|
|
|
return object;
|
|
@ -1583,4 +1600,16 @@ public class MonitorPlatformService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* deviceName处理
|
|
|
* @param deviceName
|
|
|
* @return
|
|
|
*/
|
|
|
public String getDeviceNameByRequestParam(String deviceName){
|
|
|
if (deviceName.contains("三诺血糖仪")){
|
|
|
return deviceName.replace("三诺血糖仪","三诺血糖仪,血糖仪-三诺亲智,三诺亲智,健康之路亲智血糖仪,血糖仪,血糖仪-健康之路亲智血糖仪");
|
|
|
}
|
|
|
return deviceName;
|
|
|
}
|
|
|
|
|
|
}
|