Przeglądaj źródła

统计合并机构

trick9191 7 lat temu
rodzic
commit
6cbc6397a8

+ 17 - 8
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -975,12 +975,16 @@ public class CurrentDayAllQuotaJob implements Job {
        List<Map<String,Object>> m1 = getCityTowms();
        JSONObject json1 = new JSONObject();
        json1.put("data",m1);
        redisTemplate.opsForValue().set("quota:28:4:"+Constant.city+":3:"+RedisStorage.timeKey,json1.toString());
        String key = "quota:28:4:"+Constant.city+":3:"+RedisStorage.timeKey;
        redisTemplate.opsForValue().set(key,json1.toString());
        RedisStorage.keys.add(key);
        //获取市,机构统计结果
        List<Map<String,Object>> m2 = getCityHoss();
        JSONObject json2 = new JSONObject();
        json2.put("data",m2);
        redisTemplate.opsForValue().set("quota:28:4:"+Constant.city+":2:"+RedisStorage.timeKey,json2.toString());
        String key1 = "quota:28:4:"+Constant.city+":2:"+RedisStorage.timeKey;
        redisTemplate.opsForValue().set(key1,json2.toString());
        RedisStorage.keys.add(key1);
        //统计区级低下所有机构
        if(m1!=null&&m1.size()>0){
            for(Map<String,Object> m:m1){
@ -988,7 +992,9 @@ public class CurrentDayAllQuotaJob implements Job {
                List<Map<String,Object>> m3 = getTownHoss(town);
                JSONObject json3 = new JSONObject();
                json3.put("data",m3);
                redisTemplate.opsForValue().set("quota:28:3:"+town+":2:"+RedisStorage.timeKey,json3.toString());
                String key2 ="quota:28:3:"+town+":2:"+RedisStorage.timeKey;
                redisTemplate.opsForValue().set(key2,json3.toString());
                RedisStorage.keys.add(key2);
            }
        }
        //得到所有机构
@ -1012,7 +1018,9 @@ public class CurrentDayAllQuotaJob implements Job {
                }
                JSONObject json = new JSONObject();
                json.put("data",hosTeams);
                redisTemplate.opsForValue().set("quota:28:2:"+code+":1:"+RedisStorage.timeKey,json.toString());
                String k = "quota:28:2:"+code+":1:"+RedisStorage.timeKey;
                redisTemplate.opsForValue().set(k,json.toString());
                RedisStorage.keys.add(k);
            }
        }
    }
@ -1055,7 +1063,7 @@ public class CurrentDayAllQuotaJob implements Job {
                    " FROM wlyy_doctor d " +
                    " RIGHT JOIN dm_hospital t on t.code = d.hospital " +
                    " LEFT JOIN wlyy_evaluate_score s ON d.code = s.doctor " +
                    " WHERE t.level = 2 AND t.del='1' AND t.city='"+Constant.city+"' GROUP BY d.hospital order by avgCount DESC ";
                    " WHERE t.level = 2 AND t.del='1' AND t.city='"+Constant.city+"' AND LENGTH(t.code)<=10 GROUP BY left(t.code,8) order by avgCount DESC ";
            return city_hos_SQL;
        }else if("town_hos_SQL".equals(code)){
            //统计区级各社区
@ -1063,7 +1071,7 @@ public class CurrentDayAllQuotaJob implements Job {
                    " FROM wlyy_doctor d " +
                    " RIGHT JOIN dm_hospital t on t.code = d.hospital " +
                    " LEFT JOIN wlyy_evaluate_score s ON d.code = s.doctor " +
                    " WHERE t.level = 2 AND t.del='1' AND t.town= ? GROUP BY d.hospital order by avgCount DESC ";
                    " WHERE t.level = 2 AND t.del='1' AND t.town= ? AND LENGTH(t.code)<=10 GROUP BY left(t.code,8) order by avgCount DESC ";
            return town_hos_SQL;
        }else if("team_SQL".equals(code)){
            //查找所有团队
@ -1071,11 +1079,12 @@ public class CurrentDayAllQuotaJob implements Job {
                    " FROM wlyy_doctor d " +
                    " RIGHT JOIN wlyy_admin_team t on t.leader_code = d.code " +
                    " LEFT JOIN wlyy_evaluate_score s ON d.code = s.doctor " +
                    " GROUP BY t.id order by avgCount DESC ";
                    " WHERE LENGTH(d.hospital)<=10 "+
                    " GROUP BY t.id,left(d.hospital,8) order by avgCount DESC ";
            return team_SQL;
        }else if("All_hos_SQL".equals(code)){
            //查找所有机构
            String All_hos_SQL = "SELECT t.code FROM dm_hospital t where t.level = 2 AND t.del='1' AND t.city ='"+Constant.city+"'";
            String All_hos_SQL = "SELECT t.code FROM dm_hospital t where t.level = 2 AND t.del='1' AND LENGTH(t.code)<=10 AND t.city ='"+Constant.city+"' GROUP BY left(t.code,8) ";
            return All_hos_SQL;
        }
    return "";