From 435b1cfe40ee2822381274d3a0a4f9066157b02b Mon Sep 17 00:00:00 2001 From: zhangzeli <123456> Date: 星期三, 05 一月 2022 09:26:17 +0800 Subject: [PATCH] 回复 --- xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java index a2dc8fb..f233c88 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java @@ -1,6 +1,7 @@ package cn.exrick.xboot.your.mapper; import cn.exrick.xboot.your.entity.AddOil; +import cn.exrick.xboot.your.vo.Month; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import cn.exrick.xboot.your.entity.OrderTask; @@ -45,4 +46,21 @@ @Select("select sum(time) as time2,send_date from t_order_task where date_sub(curdate(), interval 1 month) <= date(send_date) and area_section_id=#{arg0} GROUP BY send_date") @Results({@Result(column="time2", property="time", jdbcType = JdbcType.INTEGER)}) List<OrderTask> sumTime(String id); + + @Select("select \n" + + "sum(case month(t.send_date) when '1' then d.num else 0 end) as january,\n" + + "sum(case month(t.send_date) when '2' then d.num else 0 end) as february,\n" + + "sum(case month(t.send_date) when '3' then d.num else 0 end) as march,\n" + + "sum(case month(t.send_date) when '4' then d.num else 0 end) as april,\n" + + "sum(case month(t.send_date) when '5' then d.num else 0 end) as may,\n" + + "sum(case month(t.send_date) when '6' then d.num else 0 end) as june,\n" + + "sum(case month(t.send_date) when '7' then d.num else 0 end) as july,\n" + + "sum(case month(t.send_date) when '8' then d.num else 0 end) as august,\n" + + "sum(case month(t.send_date) when '9' then d.num else 0 end) as september,\n" + + "sum(case month(t.send_date) when '10' then d.num else 0 end) as october,\n" + + "sum(case month(t.send_date) when '11' then d.num else 0 end) as november,\n" + + "sum(case month(t.send_date) when '12' then d.num else 0 end) as december\n" + + "from t_order_task t LEFT JOIN t_order_detail d ON t.id=d.order_id\n" + + "where year(t.send_date)=#{year}") + Month getSendNum(@Param("year")int year); } \ No newline at end of file -- Gitblit v1.9.1