bug
zhangzeli
2022-01-10 601d2f9df6efa3de3bbc261d5f63628d8e8be6a9
bug
3个文件已修改
61 ■■■■■ 已修改文件
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/Statistic2Controller.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/CarMapper.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/CustomerMapper.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/Statistic2Controller.java
@@ -44,10 +44,13 @@
        int year = cal.get(Calendar.YEAR);
        QueryWrapper<Car> wrapper = new QueryWrapper<>();
        int m = cal.get(Calendar.MONTH) + 1;
        Month month= iCarService.getCarCount(year);
        if (month==null) {
            month = new Month();
        }
        List<Integer> list = new ArrayList<>();
        list.add(month.getJanuary());
        list.add(month.getFebruary());
@@ -61,6 +64,10 @@
        list.add(month.getOctober());
        list.add(month.getNovember());
        list.add(month.getDecember());
        for (int i=m;i<12;i++){
            list.set(i,0);
        }
        return new ResultUtil<Object>().setData(list);
    }
@@ -70,6 +77,8 @@
        Calendar cal = Calendar.getInstance();
        int year = cal.get(Calendar.YEAR);
        QueryWrapper<Car> wrapper = new QueryWrapper<>();
        int m = cal.get(Calendar.MONTH) + 1;
        Month month= iCustomerService.getCustomerCount(year);
        if (month==null) {
@@ -88,6 +97,10 @@
        list.add(month.getOctober());
        list.add(month.getNovember());
        list.add(month.getDecember());
        for (int i=m;i<12;i++){
            list.set(i,0);
        }
        return new ResultUtil<Object>().setData(list);
    }
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/CarMapper.java
@@ -43,18 +43,18 @@
    List<Car> getCarInfo2(@Param(Constants.WRAPPER) QueryWrapper<Car> wrapper);
    @Select("select \n" +
            "sum(case when create_time <= '${year}-01' then 1 else 0 end) as january,\n" +
            "sum(case when create_time <= '${year}-02' then 1 else 0 end) as february,\n" +
            "sum(case when create_time <= '${year}-03' then 1 else 0 end) as march,\n" +
            "sum(case when create_time <= '${year}-04' then 1 else 0 end) as april,\n" +
            "sum(case when create_time <= '${year}-05' then 1 else 0 end) as may,\n" +
            "sum(case when create_time <= '${year}-06' then 1 else 0 end) as june,\n" +
            "sum(case when create_time <= '${year}-07' then 1 else 0 end) as july,\n" +
            "sum(case when create_time <= '${year}-08' then 1 else 0 end) as august,\n" +
            "sum(case when create_time <= '${year}-09' then 1 else 0 end) as september,\n" +
            "sum(case when create_time <= '${year}-10' then 1 else 0 end) as october,\n" +
            "sum(case when create_time <= '${year}-11' then 1 else 0 end) as november,\n" +
            "sum(case when create_time <= '${year}-12' then 1 else 0 end) as december\n" +
            "sum(case when create_time < '${year}-02' then 1 else 0 end) as january,\n" +
            "sum(case when create_time < '${year}-03' then 1 else 0 end) as february,\n" +
            "sum(case when create_time < '${year}-04' then 1 else 0 end) as march,\n" +
            "sum(case when create_time < '${year}-05' then 1 else 0 end) as april,\n" +
            "sum(case when create_time < '${year}-06' then 1 else 0 end) as may,\n" +
            "sum(case when create_time < '${year}-07' then 1 else 0 end) as june,\n" +
            "sum(case when create_time < '${year}-08' then 1 else 0 end) as july,\n" +
            "sum(case when create_time < '${year}-09' then 1 else 0 end) as august,\n" +
            "sum(case when create_time < '${year}-10' then 1 else 0 end) as september,\n" +
            "sum(case when create_time < '${year}-11' then 1 else 0 end) as october,\n" +
            "sum(case when create_time < '${year}-12' then 1 else 0 end) as november,\n" +
            "sum(case when create_time < '${year}-13' then 1 else 0 end) as december\n" +
            "from t_car")
    Month getCarCount(@Param("year")Integer year);
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/CustomerMapper.java
@@ -16,18 +16,18 @@
    int count();
    @Select("select \n" +
            "sum(case when create_time < '${year}-01' then 1 else 0 end) as january,\n" +
            "sum(case when create_time < '${year}-02' then 1 else 0 end) as february,\n" +
            "sum(case when create_time < '${year}-03' then 1 else 0 end) as march,\n" +
            "sum(case when create_time < '${year}-04' then 1 else 0 end) as april,\n" +
            "sum(case when create_time < '${year}-05' then 1 else 0 end) as may,\n" +
            "sum(case when create_time < '${year}-06' then 1 else 0 end) as june,\n" +
            "sum(case when create_time < '${year}-07' then 1 else 0 end) as july,\n" +
            "sum(case when create_time < '${year}-08' then 1 else 0 end) as august,\n" +
            "sum(case when create_time < '${year}-09' then 1 else 0 end) as september,\n" +
            "sum(case when create_time < '${year}-10' then 1 else 0 end) as october,\n" +
            "sum(case when create_time < '${year}-11' then 1 else 0 end) as november,\n" +
            "sum(case when create_time < '${year}-12' then 1 else 0 end) as december\n" +
            "sum(case when create_time < '${year}-02' then 1 else 0 end) as january,\n" +
            "sum(case when create_time < '${year}-03' then 1 else 0 end) as february,\n" +
            "sum(case when create_time < '${year}-04' then 1 else 0 end) as march,\n" +
            "sum(case when create_time < '${year}-05' then 1 else 0 end) as april,\n" +
            "sum(case when create_time < '${year}-06' then 1 else 0 end) as may,\n" +
            "sum(case when create_time < '${year}-07' then 1 else 0 end) as june,\n" +
            "sum(case when create_time < '${year}-08' then 1 else 0 end) as july,\n" +
            "sum(case when create_time < '${year}-09' then 1 else 0 end) as august,\n" +
            "sum(case when create_time < '${year}-10' then 1 else 0 end) as september,\n" +
            "sum(case when create_time < '${year}-11' then 1 else 0 end) as october,\n" +
            "sum(case when create_time < '${year}-12' then 1 else 0 end) as november,\n" +
            "sum(case when create_time < '${year}-13' then 1 else 0 end) as december\n" +
            "from t_customer")
    Month getCustomerCount(@Param("year")Integer year);