trick9191 8 роки тому
батько
коміт
4521a46ee3

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

@ -609,13 +609,13 @@ public class StatisticsService extends BaseService {
     * @param index     指标
     * @param index     指标
     * @return
     * @return
     */
     */
    public JSONArray getDateIncrementDetail(String startDate, String endDate, int interval, String area, int level, String index) throws Exception {
    public JSONArray getDateIncrementDetail(String startDate, String endDate, int interval, String area, int level, String index,String level2_type) throws Exception {
        if (interval == 1) {
        if (interval == 1) {
            return dateStatistics(startDate, endDate, area, level, index);
            return dateStatistics(startDate, endDate, area, level, index,level2_type);
        } else if (interval == 2) {
        } else if (interval == 2) {
            return weekStatistics(startDate, endDate, area, level, index);
            return weekStatistics(startDate, endDate, area, level, index,level2_type);
        } else if (interval == 3) {
        } else if (interval == 3) {
            return monthStatistics(startDate, endDate, area, level, index);
            return monthStatistics(startDate, endDate, area, level, index,level2_type);
        }
        }
        return new JSONArray();
        return new JSONArray();
@ -631,7 +631,7 @@ public class StatisticsService extends BaseService {
     * @param index
     * @param index
     * @return
     * @return
     */
     */
    private JSONArray dateStatistics(String startDate, String endDate, String area, int level, String index) {
    private JSONArray dateStatistics(String startDate, String endDate, String area, int level, String index,String level2_type) {
        String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        String areaField = "";
        String areaField = "";
        String sql = "";
        String sql = "";
@ -721,8 +721,12 @@ public class StatisticsService extends BaseService {
                "   and level1_type = '" + level + "' and del = '1' " +
                "   and level1_type = '" + level + "' and del = '1' " +
                "   and quota_date >= '" + startDate + "' " +
                "   and quota_date >= '" + startDate + "' " +
                "   and quota_date <= '" + endDate + "' " +
                "   and quota_date <= '" + endDate + "' " +
                "   and " + areaField + " = '" + area + "' " +
                "   group by quota_date ";
                "   and " + areaField + " = '" + area + "' " ;
                if(StringUtils.isNotBlank(level2_type)){
                     sql=sql + " and level2_type ='"+level2_type+"' ";
                }
                sql=sql + "   group by quota_date ";
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql);
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql);
@ -767,7 +771,7 @@ public class StatisticsService extends BaseService {
     * @param index
     * @param index
     * @return
     * @return
     */
     */
    private JSONArray weekStatistics(String startDate, String endDate, String area, int level, String index) throws Exception {
    private JSONArray weekStatistics(String startDate, String endDate, String area, int level, String index,String level2_type) throws Exception {
        String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        String areaField = "";
        String areaField = "";
        String sql = "";
        String sql = "";
@ -894,8 +898,12 @@ public class StatisticsService extends BaseService {
                "   and level1_type = '" + level + "' and del = '1' " +
                "   and level1_type = '" + level + "' and del = '1' " +
                "   and quota_date >= '" + startDate + "' " +
                "   and quota_date >= '" + startDate + "' " +
                "   and quota_date <= '" + endDate + "' " +
                "   and quota_date <= '" + endDate + "' " +
                "   and " + areaField + " = '" + area + "' " +
                "   group by quota_date ";
                "   and " + areaField + " = '" + area + "' " ;
                if(StringUtils.isNotBlank(level2_type)){
                    sql=sql + " and level2_type ='"+level2_type+"' ";
                }
                sql=sql + "   group by quota_date ";
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql);
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql);
@ -972,7 +980,7 @@ public class StatisticsService extends BaseService {
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    private JSONArray monthStatistics(String startDate, String endDate, String area, int level, String index) throws Exception {
    private JSONArray monthStatistics(String startDate, String endDate, String area, int level, String index,String level2_type) throws Exception {
        String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        String areaField = "";
        String areaField = "";
        String sql = "";
        String sql = "";
@ -1096,8 +1104,11 @@ public class StatisticsService extends BaseService {
                "   and level1_type = '" + level + "' and del = '1' " +
                "   and level1_type = '" + level + "' and del = '1' " +
                "   and quota_date >= '" + startDate + "' " +
                "   and quota_date >= '" + startDate + "' " +
                "   and quota_date <= '" + endDate + "' " +
                "   and quota_date <= '" + endDate + "' " +
                "   and " + areaField + " = '" + area + "' " +
                "   group by quota_date ";
                "   and " + areaField + " = '" + area + "' ";
                if(StringUtils.isNotBlank(level2_type)){
                    sql=sql + " and level2_type ='"+level2_type+"' ";
                }
                sql=sql + "   group by quota_date ";
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql);
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql);

+ 3 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -65,7 +65,8 @@ public class StatisticsController extends BaseController {
                                @RequestParam(required = true) int interval,
                                @RequestParam(required = true) int interval,
                                @RequestParam(required = true) String area,
                                @RequestParam(required = true) String area,
                                @RequestParam(required = true) int level,
                                @RequestParam(required = true) int level,
                                @RequestParam(required = true) String index) {
                                @RequestParam(required = true) String index,
                                @RequestParam(required = false) String level2_type) {
        String tag = "";
        String tag = "";
        try {
        try {
            String[] indexes = index.split(",");
            String[] indexes = index.split(",");
@ -73,7 +74,7 @@ public class StatisticsController extends BaseController {
            if (index != null) {
            if (index != null) {
                for (String idx : indexes) {
                for (String idx : indexes) {
                    result.put("index_" + idx, statisticsService.getDateIncrementDetail(startDate, endDate, interval, area, level, idx));
                    result.put("index_" + idx, statisticsService.getDateIncrementDetail(startDate, endDate, interval, area, level,idx,level2_type));
                }
                }
            }
            }