wsl 2 tahun lalu
induk
melakukan
1a301e7bfa

+ 5 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -540,7 +540,7 @@ public class StatisticsService {
        //离线的设备数 超过6小时未受理的预警数  超6小时未响应服务(审核照料发起6小时未接单)
        sqltmp = " select count(distinct pd.device_sn) total ,pd.device_type from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
                " INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " +
                "where (dev.contact_status=0 or dev.contact_status is null ) and pd.user "+userfilter;
                "where dev.contact_status=0  and pd.user "+userfilter;
        sqltmp += " group by pd.device_type ";
        List<Map<String,Object>> offlineDevices = jdbcTemplate.queryForList(sqltmp);//离线设备
        Long count = 0l;
@ -3233,7 +3233,8 @@ public class StatisticsService {
                        " AND sr.STATUS = 1  " +
                        " AND r.service_package_id = i.service_package_id  " +
                        " AND r.service_package_id = pack.id  " +
                        " AND i.del = 1  " +
                        " AND i.del = 1 " +
                        " AND p.del = 1  " +
                        " AND sr.`status` = 1  " +
                        " AND CONVERT ( sr.patient USING utf8 ) = p.id  " +
                        " AND r.team_code = t.id  " +
@ -3277,7 +3278,7 @@ public class StatisticsService {
        page = (page - 1) * size;
        String testUserSql = "AND p.id NOT IN (SELECT DISTINCT dict_code FROM wlyy_hospital_sys_dict" +
                " WHERE( dict_name = 'jkzl_child' OR dict_name = 'jkzl_older' OR dict_name = 'jkzl_user') AND dict_code IS NOT NULL ) ";
        sql += "  ORDER BY id limit " + page + "," + size + "";
        sql += "  ORDER BY id DESC limit " + page + "," + size + "";
        sql = sql.replace("<testUserSql>",testUserSql);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
@ -3832,7 +3833,7 @@ public class StatisticsService {
        //离线设备数量
        String offLineDeviceSql="select count(distinct pd.device_sn) total from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
                "                 INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " +
                "                where (dev.contact_status=0 or dev.contact_status is null ) and pd.device_type = "+type+"  AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type";
                "                where dev.contact_status=0  and pd.device_type = "+type+"  AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type";
        //设备总数
        String deviceTotalSql = "SELECT count(DISTINCT device_code) FROM wlyy_devices WHERE (device_code IS NOT NULL OR device_code <> '') AND device_type = "+type+"";