Kaynağa Gözat

代码提交

chenweida 8 yıl önce
ebeveyn
işleme
101b1fcc31

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

@ -4406,6 +4406,50 @@ public class StatisticsService extends BaseService {
        return null;
    }
    public JSONObject getTeamRenewChangeLine(String teamCode,String startDate,String endDate,String type){
        startDate = startDate+" 00:00:00";
        endDate = endDate+" 23:59:59";
        String inSql ;
        String outSql;
        if("0".equals(type)){
            inSql ="SELECT left(r.apply_date,10) AS dateNo,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.admin_team_id ='"+teamCode+"' " +
                    " AND r.apply_date >= '"+startDate+"' " +
                    " AND r.apply_date <='"+endDate+"' " +
                    " AND r.old_admin_team_id <> r.admin_team_id " +
                    " GROUP BY dateNo ";
            outSql ="SELECT left(r.apply_date,10) AS dateNo,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.old_admin_team_id ='"+teamCode+"' " +
                    " AND r.apply_date >= '"+startDate+"' " +
                    " AND r.apply_date <='"+endDate+"' " +
                    " AND r.old_admin_team_id <> r.admin_team_id " +
                    " GROUP BY dateNo ";
        }else{
            inSql ="SELECT ( " +
                    "  DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS outCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.admin_team_id ='"+teamCode+"'  " +
                    " AND r.apply_date >= '"+startDate+"'  " +
                    " AND r.apply_date <='"+endDate+"'  " +
                    " AND r.old_admin_team_id <> r.admin_team_id " +
                    " GROUP BY weekOfMonth ";
            outSql ="SELECT ( " +
                    "  DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS outCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.old_admin_team_id ='"+teamCode+"'  " +
                    " AND r.apply_date >= '"+startDate+"'  " +
                    " AND r.apply_date <='"+endDate+"'  " +
                    " AND r.old_admin_team_id <> r.admin_team_id " +
                    " GROUP BY weekOfMonth ";
        }
        JSONObject rs = new JSONObject();
        List<Map<String,Object>> inList = jdbcTemplate.queryForList(inSql);
        rs.put("inLine",inList);
        List<Map<String,Object>> outList =jdbcTemplate.queryForList(outSql);
        rs.put("outLine",outList);
        return rs ;
    }
    //-----------------------------------通用方法-------------------------------
    /**

+ 13 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -1444,4 +1444,17 @@ public class StatisticsController extends BaseController {
        }
    }
    @RequestMapping("/getTeamRenewChangeLine")
    @ResponseBody
    public String getTeamRenewChangeLine(@RequestParam(required = true)String teamCode,
                                         @RequestParam(required = true)String startDate,
                                         @RequestParam(required = true)String endDate,
                                         @RequestParam(required = true)String type){
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamRenewChangeLine(teamCode,startDate,endDate,type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
}