trick9191 преди 7 години
родител
ревизия
7087453c29
променени са 1 файла, в които са добавени 67 реда и са изтрити 3 реда
  1. 67 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

+ 67 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -4417,10 +4417,26 @@ public class StatisticsService extends BaseService {
    public JSONObject getConsultingStatisticsListYear(Integer level, String area, String lowlevel, String year) {
        JSONObject result = new JSONObject();
        Integer coutYear = Integer.parseInt(year)+1;
        return null;
        //及时回复数
        JSONArray rely = getQuotaList(level,lowlevel,area,coutYear,23);
        if(rely==null){
            return null;
        }
        //咨询总数
        JSONArray total = getQuotaList(level,lowlevel,area,coutYear,25);
        if(total==null){
            return null;
        }
        //未回复数
        JSONArray onRely =getQuotaList(level,lowlevel,area,coutYear,22);
        if(total==null){
            return null;
        }
        result.put("resultList", getCoutList(rely, total, onRely));
        return result;
    }
    public JSONObject getTeamRenewChangeLine(String teamCode, String startDate, String endDate, String type) {
@ -4541,5 +4557,53 @@ public class StatisticsService extends BaseService {
        return null;
    }
    /**
     * 通用指标方法,格式返回与redis一致
     * 查询个指标
     * 1.市级-区
     * 2.市级-机构
     * 3.区级-机构
     * 4.机构-团队
     * @param level
     * @param lovlevel
     * @param area
     * @param year
     * @param index
     * @return
     */
    public JSONArray getQuotaList(Integer level, String lovlevel, String area, Integer year, Integer index){
        String sql ;
        if(level==4){
            if(StringUtils.isBlank(lovlevel)){
                //市 区
                sql =" SELECT t.result As num,t.town_name AS name,t.town AS code,t.create_time AS date" +
                        " FROM wlyy_quota_result t " +
                        " WHERE t.city ='"+area+"' AND t.quato_code ='"+index+"' AND t.level1_type ='3'AND LEFT(t.create_time,10)='"+year+"-06-30'";
            }else{
                //市 机构
                sql = "SELECT t.result As num,t.org_name AS name,t.org_code AS code,t.create_time AS date" +
                        " FROM wlyy_quota_result t " +
                        " WHERE t.city ='"+area+"' AND t.quato_code ='"+index+"' AND t.level1_type ='2' AND LEFT(t.create_time,10)='"+year+"-06-30'";
            }
        }else if (level ==3){
            //区 机构
            sql = "SELECT t.result As num,t.org_name AS name,t.org_code AS code,t.create_time AS date " +
                    "FROM wlyy_quota_result t " +
                    "WHERE t.town ='"+area+"' AND t.quato_code ='"+index+"' AND t.level1_type ='2' AND LEFT(t.create_time,10)='"+year+"-06-30'";
        }else{
            //机构 团队
            sql ="SELECT t.result As num,t.qkdoctor_name AS name,t.qkdoctor_code AS code,t.create_time AS date " +
                    " FROM wlyy_quota_result t " +
                    " WHERE t.org_code ='"+area+"' AND t.quato_code ='"+index+"' AND t.level1_type ='1' AND LEFT(t.create_time,10)='"+year+"-06-30'";
        }
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null&&list.size()>0){
            return new JSONArray(list);
        }else{
            return null;
        }
    }
}