From be396e19af86f49cc2c966c73b5f59cd36c7402e Mon Sep 17 00:00:00 2001
From: wjli <591616088@qq.com>
Date: 星期二, 09 五月 2023 16:09:15 +0800
Subject: [PATCH] 1.增加手持客户端当天签收率接口 2.增加后端月签收率接口

---
 xboot-modules/xboot-your/src/main/resources/mapper/OrderTaskMapper.xml |   78 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 77 insertions(+), 1 deletions(-)

diff --git a/xboot-modules/xboot-your/src/main/resources/mapper/OrderTaskMapper.xml b/xboot-modules/xboot-your/src/main/resources/mapper/OrderTaskMapper.xml
index 4f01f66..0fc3dcd 100644
--- a/xboot-modules/xboot-your/src/main/resources/mapper/OrderTaskMapper.xml
+++ b/xboot-modules/xboot-your/src/main/resources/mapper/OrderTaskMapper.xml
@@ -1,5 +1,81 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.exrick.xboot.your.mapper.OrderTaskMapper">
+    <select id="countStatus" resultType="cn.exrick.xboot.your.entity.OrderStatusCount">
 
-</mapper>
\ No newline at end of file
+        SELECT
+        <if test="StatisticalType!=null and StatisticalType !='' and StatisticalType == '1'.toString()">
+            DATE(DATE_FORMAT(DATE_SUB(a.send_date,INTERVAL 1 DAY),'%Y-%m-%d')) warntime,
+        </if>
+        <if test="StatisticalType!=null and StatisticalType !='' and StatisticalType == '2'.toString()">
+            WEEK(DATE_FORMAT(DATE_SUB(a.send_date,INTERVAL 1 DAY),'%Y-%m-%d')) warntime,
+        </if>
+        <if test="StatisticalType!=null and StatisticalType !='' and StatisticalType == '3'.toString()">
+           MONTH(DATE_FORMAT(DATE_SUB(a.send_date,INTERVAL 1 DAY),'%Y-%m-%d')) warntime,
+        </if>
+        <if test="StatisticalType!=null and StatisticalType !='' and StatisticalType == '4'.toString()">
+            YEAR(DATE_FORMAT(DATE_SUB(a.send_date,INTERVAL 1 DAY),'%Y-%m-%d')) warntime,
+        </if>
+        b.car_no AS carName,
+        c.NAME AS line,
+        d.NAME AS batch,
+        a.send_date,
+        e.nickname as username,
+        a.id,
+        count( a.area_section_id ) AS amount,
+        sum( CASE WHEN a.STATUS = 0 THEN 1 ELSE 0 END ) AS notSignCount,
+        sum( CASE WHEN a.STATUS = 1 THEN 1 ELSE 0 END ) AS signCount ,
+        ( count( a.status = 1 OR NULL )/ count(a.status >= 0 OR NULL ) * 100 ) AS proportion
+
+        FROM
+        t_order_task a
+        LEFT JOIN t_car b ON a.car_id = b.id
+        LEFT JOIN t_area c ON a.area_id = c.id
+        LEFT JOIN t_area_ection d ON a.area_section_id = d.id
+        LEFT JOIN t_user e ON e.id = b.user_id
+        <where>
+            1=1
+            <if test="carId != null and carId != ''" >
+                AND a.car_id = #{carId}
+            </if>
+            <if test="carNo != null and carNo != ''" >
+                AND b.car_no = #{carNo}
+            </if>
+            <if test="name != null and name != ''" >
+                AND d.NAME = #{name}
+            </if>
+            <if test="sendDate != null and sendDate != ''">
+                AND  DATE_FORMAT(a.send_date,'%Y-%m-%d') = #{sendDate}
+            </if>
+            <if test="sendDateStart != null and sendDateStart != ''">
+                AND send_date >= #{createTimeFrom}
+            </if>
+            <if test="sendDateEnd != null and sendDateEnd != ''">
+                AND send_date &lt; #{createTimeTo}
+            </if>
+        </where>
+        GROUP BY
+        <if test="StatisticalType!=null and StatisticalType !='' and StatisticalType == '1'.toString()">
+            DATE(a.send_date),
+        </if>
+        <if test="StatisticalType!=null and StatisticalType !='' and StatisticalType == '2'.toString()">
+            WEEK(a.send_date,1),
+        </if>
+        <if test="StatisticalType!=null and StatisticalType !='' and StatisticalType == '3'.toString()">
+            MONTH(a.send_date),
+        </if>
+        <if test="StatisticalType!=null and StatisticalType !='' and StatisticalType == '4'.toString()">
+            YEAR(a.send_date),
+        </if>
+        a.area_section_id,
+        b.car_no,
+        c.NAME,
+        d.NAME,
+        a.send_date,
+        e.nickname,
+        a.id
+        ORDER BY
+        c.NAME ASC,
+        a.send_date asc
+    </select>
+</mapper>

--
Gitblit v1.9.1