|
@ -853,8 +853,8 @@ public class StatisticsService {
|
|
|
}
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
String sql = " select dict.dict_code,dict_value,count(DISTINCT lab.patient) total from wlyy_hospital_sys_dict dict \n" +
|
|
|
"LEFT JOIN wlyy_patient_label lab on dict.dict_code = lab.label_code AND lab.label_type='1' " +
|
|
|
"where dict.dict_name='service_type' and lab.patient "+filter+" and dict.dict_code is not null and dict_code<>5 \n" +
|
|
|
"LEFT JOIN wlyy_patient_label lab on dict.dict_code = lab.label_code AND lab.label_type='1' and lab.patient "+filter+" " +
|
|
|
"where dict.dict_name='service_type' and dict.dict_code is not null and dict_code<>5 \n" +
|
|
|
" GROUP BY dict.dict_code; ";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
@ -1142,8 +1142,17 @@ public class StatisticsService {
|
|
|
}
|
|
|
|
|
|
public JSONObject deviceUsingInfo(String area){
|
|
|
String filter = "";
|
|
|
String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' ";
|
|
|
List<Map<String,Object>> listtmp = jdbcTemplate.queryForList(sqltmp);
|
|
|
if(listtmp.size()>0){
|
|
|
String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
|
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
|
filter = " not in ('"+orgCodes+"')";
|
|
|
}
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
String sql = "SELECT COUNT(DISTINCT device_sn) FROM wlyy_patient_device WHERE del = 0";
|
|
|
String sql = "SELECT COUNT(DISTINCT device_sn) FROM wlyy_patient_device WHERE del = 0 and user "+filter;
|
|
|
Integer use = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
sql = "SELECT COUNT(DISTINCT device_code) FROM wlyy_devices ";
|
|
|
Integer total = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
@ -1152,7 +1161,7 @@ public class StatisticsService {
|
|
|
result.put("stock",total-use);//库存
|
|
|
|
|
|
sql = "SELECT DISTINCT count(wd.device_code) FROM wlyy_devices wd INNER JOIN wlyy_patient_device pd on " +
|
|
|
"wd.device_code =pd.device_sn WHERE contact_status = 0";//contact_status = 0 失联
|
|
|
"wd.device_code =pd.device_sn WHERE contact_status = 0 and pd.user "+filter;//contact_status = 0 失联
|
|
|
Integer lost = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
//物联率 失联率
|
|
|
result.put("deviceAll",total);//物联率分母总数 设备总数(包括库存)
|
|
@ -1165,6 +1174,15 @@ public class StatisticsService {
|
|
|
}
|
|
|
|
|
|
public PageEnvelop getSecurityOrderList(String area,String status, String svrDesc,String topicItem, Integer page, Integer pageSize){
|
|
|
String testPatients = "";
|
|
|
String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' ";
|
|
|
List<Map<String,Object>> listtmp = jdbcTemplate.queryForList(sqltmp);
|
|
|
if(listtmp.size()>0){
|
|
|
String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
|
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
|
testPatients = " not in ('"+orgCodes+"') ";
|
|
|
}
|
|
|
|
|
|
page = page>1?page-1:0;
|
|
|
JSONArray result = new JSONArray();
|
|
|
|
|
@ -1183,6 +1201,7 @@ public class StatisticsService {
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(topicItem)){
|
|
|
fliter+=" and ord.topic_item='"+topicItem+"' ";
|
|
|
}
|
|
|
fliter +=" and ord.patient "+testPatients;
|
|
|
Long count = jdbcTemplate.queryForObject(sqlCount+fliter,Long.class);
|
|
|
fliter+=" order by ord.create_time desc limit " + (page*pageSize) + "," + pageSize;
|
|
|
List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql+fliter);
|
|
@ -1241,6 +1260,15 @@ public class StatisticsService {
|
|
|
|
|
|
public JSONObject getSecurityTab(String area,String status,String svrDesc,String topicItem){
|
|
|
|
|
|
String testPatients = "";
|
|
|
String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' ";
|
|
|
List<Map<String,Object>> listtmp = jdbcTemplate.queryForList(sqltmp);
|
|
|
if(listtmp.size()>0){
|
|
|
String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
|
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
|
testPatients = " not in ('"+orgCodes+"') ";
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(area)){
|
|
|
|
|
|
}
|
|
@ -1274,6 +1302,8 @@ public class StatisticsService {
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(topicItem)){
|
|
|
fliter+=" and ord.topic_item='"+topicItem+"' ";
|
|
|
}
|
|
|
fliter +=" and ord.patient "+testPatients;
|
|
|
|
|
|
fliter+=" group by ord.status,ord.serve_desc ";
|
|
|
List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql+fliter);
|
|
|
String pyCode = "";
|