From cef6ee12bbbb42b8674fc3f9353d08df013115d7 Mon Sep 17 00:00:00 2001
From: zhangzeli <123456>
Date: 星期二, 11 一月 2022 15:32:10 +0800
Subject: [PATCH] bug

---
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 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 f233c88..f29b9c2 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
@@ -48,19 +48,27 @@
     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" +
+            "sum(case month(t.send_date) when '1' then t.num else 0 end) as january,\n" +
+            "sum(case month(t.send_date) when '2' then t.num else 0 end) as february,\n" +
+            "sum(case month(t.send_date) when '3' then t.num else 0 end) as march,\n" +
+            "sum(case month(t.send_date) when '4' then t.num else 0 end) as april,\n" +
+            "sum(case month(t.send_date) when '5' then t.num else 0 end) as may,\n" +
+            "sum(case month(t.send_date) when '6' then t.num else 0 end) as june,\n" +
+            "sum(case month(t.send_date) when '7' then t.num else 0 end) as july,\n" +
+            "sum(case month(t.send_date) when '8' then t.num else 0 end) as august,\n" +
+            "sum(case month(t.send_date) when '9' then t.num else 0 end) as september,\n" +
+            "sum(case month(t.send_date) when '10' then t.num else 0 end) as october,\n" +
+            "sum(case month(t.send_date) when '11' then t.num else 0 end) as november,\n" +
+            "sum(case month(t.send_date) when '12' then t.num else 0 end) as december\n" +
+            "from t_order_task t\n" +
             "where year(t.send_date)=#{year}")
     Month getSendNum(@Param("year")int year);
+
+    @Select("select b.name as name1,avg(a.time) as num1,min(a.time) as num2,max(a.time) as num3 from t_order_task a LEFT JOIN t_customer b on a.customer_id=b.id where date_sub(curdate(), interval 1 month) <= date(a.send_date) and a.status=1 and a.area_id=#{arg0} and a.area_section_id=#{arg1} GROUP BY b.name")
+    @Results({
+            @Result(column="name1", property="customerName", jdbcType = JdbcType.VARCHAR),
+            @Result(column="num1", property="time", jdbcType = JdbcType.INTEGER),
+            @Result(column="num2", property="num", jdbcType = JdbcType.INTEGER),
+            @Result(column="num3", property="level", jdbcType = JdbcType.INTEGER)})
+    List<OrderTask> groupByTime(String areaId, String selectId);
 }
\ No newline at end of file

--
Gitblit v1.9.1