Forráskód Böngészése

Merge branch 'dev' of trick9191/patient-co-management into dev

trick9191 8 éve
szülő
commit
202c443eb4

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

@ -3552,8 +3552,8 @@ public class StatisticsService extends BaseService {
                    " wlyy_patient_health_guidance w " +
                    " WHERE " +
                    " w.admin_team_code = " +teamCode+
                    " AND w.czrq <= '"+startDate+"' " +
                    " AND w.czrq >= '"+endDate+"' " +
                    " AND w.czrq <= '"+endDate+"' " +
                    " AND w.czrq >= '"+startDate+"' " +
                    " GROUP BY dateNo";
        }else{
            //按月统计
@ -3589,8 +3589,8 @@ public class StatisticsService extends BaseService {
                    " WHERE " +
                    " w.admin_team_code = " +teamCode+
                    " AND w.doctor ='"+doctor+"'"+
                    " AND w.czrq <= '"+startDate+"' " +
                    " AND w.czrq >= '"+endDate+"' " +
                    " AND w.czrq <= '"+endDate+"' " +
                    " AND w.czrq >= '"+startDate+"' " +
                    " GROUP BY dateNo";
        }else{
            //按月统计
@ -3732,7 +3732,7 @@ public class StatisticsService extends BaseService {
                " WHERE " +
                " w.admin_team_code =  " +teamCode+
                " AND w.doctor ='"+doctor+"'" +
                " AND w.czrq >= '"+endDate+"'";
                " AND w.czrq <= '"+endDate+"' ";
        String addSQL ="SELECT " +
                " COUNT(1) AS addCount " +
@ -3741,8 +3741,8 @@ public class StatisticsService extends BaseService {
                " WHERE " +
                " w.admin_team_code =  " +teamCode+
                " AND w.doctor ='"+doctor+"'" +
                " AND w.czrq <= '"+startDate+"' " +
                " AND w.czrq >= '"+endDate+"'";
                " AND w.czrq <= '"+endDate+"' " +
                " AND w.czrq >= '"+startDate+"'";
        JSONObject rs = new JSONObject();
        Long guidanceCount =0L;
        Long addCount = 0L;

+ 33 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -698,7 +698,14 @@ public class PatientService extends TokenService {
            teamCodeSql=" and f.admin_team_code="+teamCode+" ";
        }
        // 获取总分组数量
        String totalGSql = "SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name AS serverTypeName FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"') AND f.`status`>0 AND f.server_type IS NOT NULL "+teamCodeSql+" GROUP BY f.server_type ORDER BY f.server_type ASC";
        String totalGSql ="SELECT d.`code` AS serverType,d.`name` AS serverTypeName,ifNULL(c.Amount,0) AS Amount FROM " +
                " wlyy_sign_dict d LEFT JOIN" +
                " ("+
                " SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name AS serverTypeName FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"') AND f.`status`>0 AND f.server_type IS NOT NULL "+teamCodeSql+" GROUP BY f.server_type ORDER BY f.server_type ASC"+
                " ) c ON d.code = c.serverType " +
                " WHERE d.`year`='"+DateUtil.getSignYear()+"' AND d.`code` NOT LIKE '%-%' ";
//        String totalGSql = "SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name AS serverTypeName FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"') AND f.`status`>0 AND f.server_type IS NOT NULL "+teamCodeSql+" GROUP BY f.server_type ORDER BY f.server_type ASC";
        List<Map<String,Object>> totalG = jdbcTemplate.queryForList(totalGSql);
        //获取关注量分组数量
@ -706,7 +713,31 @@ public class PatientService extends TokenService {
        List<Map<String,Object>> fousG = jdbcTemplate.queryForList(fousGSql);
        //获取二级节点分组总数
        String sesTotalSql ="SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name As serverTypeName ,f.special_population AS specialPopulation,f.special_population_name AS specialPopulationName  FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"')  "+teamCodeSql+" AND f.`status`>0  AND f.special_population Is NOT NULL AND f.server_type IS NOT NULL GROUP BY f.special_population ORDER BY f.special_population ASC ";
        String sesTotalSql ="SELECT " +
                " LEFT ( " +
                "  d.`code`, " +
                "  INSTR(d.`code`, '-') - 1 " +
                " ) AS serverType, " +
                " substring( " +
                "  d.`code`, " +
                "  INSTR(d.`code`, '-') + 1 " +
                " ) AS specialPopulation, " +
                " d.`name` AS specialPopulationName, " +
                " ifnull(c.Amount, 0) AS Amount " +
                " FROM " +
                " wlyy_sign_dict d " +
                " LEFT JOIN ( "+
                " SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name As serverTypeName ,f.special_population AS specialPopulation,f.special_population_name AS specialPopulationName ," +
                " CONCAT(" +
                " f.server_type," +
                " '-'," +
                " f.special_population" +
                " ) AS dcode FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"')  "+teamCodeSql+" AND f.`status`>0  AND f.special_population Is NOT NULL AND f.server_type IS NOT NULL GROUP BY f.special_population ORDER BY f.special_population ASC )" +
                " c ON c.dcode = d.code " +
                " WHERE\n" +
                " d.`year` = '"+DateUtil.getSignYear()+"'" +
                " AND d.`code` LIKE '%-%'";
        //String sesTotalSql ="SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name As serverTypeName ,f.special_population AS specialPopulation,f.special_population_name AS specialPopulationName  FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"')  "+teamCodeSql+" AND f.`status`>0  AND f.special_population Is NOT NULL AND f.server_type IS NOT NULL GROUP BY f.special_population ORDER BY f.special_population ASC ";
        List<Map<String,Object>> sesTotal = jdbcTemplate.queryForList(sesTotalSql);
        //获取二级节点分组数量