瀏覽代碼

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

linzhuo 8 年之前
父節點
當前提交
3b8aeb62fb

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

@ -619,13 +619,13 @@ public class StatisticsService extends BaseService {
     * @param index     指标
     * @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) {
            return dateStatistics(startDate, endDate, area, level, index);
            return dateStatistics(startDate, endDate, area, level, index,level2_type);
        } else if (interval == 2) {
            return weekStatistics(startDate, endDate, area, level, index);
            return weekStatistics(startDate, endDate, area, level, index,level2_type);
        } else if (interval == 3) {
            return monthStatistics(startDate, endDate, area, level, index);
            return monthStatistics(startDate, endDate, area, level, index,level2_type);
        }
        return new JSONArray();
@ -641,7 +641,7 @@ public class StatisticsService extends BaseService {
     * @param index
     * @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 areaField = "";
        String sql = "";
@ -731,8 +731,12 @@ public class StatisticsService extends BaseService {
                "   and level1_type = '" + level + "' and del = '1' " +
                "   and quota_date >= '" + startDate + "' " +
                "   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);
@ -777,7 +781,7 @@ public class StatisticsService extends BaseService {
     * @param index
     * @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 areaField = "";
        String sql = "";
@ -904,8 +908,12 @@ public class StatisticsService extends BaseService {
                "   and level1_type = '" + level + "' and del = '1' " +
                "   and quota_date >= '" + startDate + "' " +
                "   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);
@ -982,7 +990,7 @@ public class StatisticsService extends BaseService {
     * @return
     * @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 areaField = "";
        String sql = "";
@ -1106,8 +1114,11 @@ public class StatisticsService extends BaseService {
                "   and level1_type = '" + level + "' and del = '1' " +
                "   and quota_date >= '" + startDate + "' " +
                "   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);

+ 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) String area,
                                @RequestParam(required = true) int level,
                                @RequestParam(required = true) String index) {
                                @RequestParam(required = true) String index,
                                @RequestParam(required = false) String level2_type) {
        String tag = "";
        try {
            String[] indexes = index.split(",");
@ -73,7 +74,7 @@ public class StatisticsController extends BaseController {
            if (index != null) {
                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));
                }
            }