From 67bfacb03541ef2ee4c1496f4cc7600014cd1005 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期二, 18 四月 2023 17:37:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/OrderMapper.xml | 94 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 93 insertions(+), 1 deletions(-)
diff --git a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/OrderMapper.xml b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/OrderMapper.xml
index f465499..c54cda9 100644
--- a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/OrderMapper.xml
+++ b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/OrderMapper.xml
@@ -59,6 +59,7 @@
<result column="oldState" property="oldState"/>
<result column="status" property="status" />
<result column="createTime" property="createTime" />
+ <result column="routeRecord" property="routeRecord"/>
</resultMap>
@@ -84,7 +85,7 @@
a.startPrice
from t_order a
left join t_app_user b on (a.userId = b.id)
- where a.`status` = 1 and a.hallOrder = 1 order by a.createTime desc
+ where a.`status` = 1 and a.hallOrder = 1 and a.state = 101 order by a.createTime desc
</select>
@@ -116,4 +117,95 @@
left join t_app_user b on (a.userId = b.id)
where a.id = #{orderId}
</select>
+
+
+ <select id="queryDriverOrderList" resultType="com.supersavedriving.driver.modular.system.warpper.DriverOrderListWarpper">
+ select
+ id,
+ '超省新代驾订单' as title,
+ UNIX_TIMESTAMP(createTime) * 1000 as createTime,
+ startAddress,
+ endAddress,
+ state,
+ source
+ from t_order where status = 1 and driverId = #{driverId}
+ <if test="null != state and 107 == state">
+ and state = #{state}
+ </if>
+ <if test="null != state and 109 == state">
+ and state in (108, 109)
+ </if>
+ <if test="null != state and 301 == state">
+ and state = #{state}
+ </if>
+ order by createTime desc limit #{pageNum}, #{pageSize}
+ </select>
+
+
+ <select id="queryInviteList" resultType="com.supersavedriving.driver.modular.system.warpper.InviteListWarpper">
+ select * from (
+ select
+ a.id,
+ a.nickname,
+ min(UNIX_TIMESTAMP(b.createTime) * 1000) as time,
+ 1 as type
+ from t_app_user a
+ left join t_order b on (a.id = b.userId)
+ where a.`status` = 1 and a.inviterType = 2 and a.inviterId = #{driverId}
+ <if test="null != time and '' != time">
+ and DATE_FORMAT(b.createTime, '%Y年%m月') = #{time}
+ </if>
+ group by a.id, a.nickname
+
+ union all
+
+ select
+ a.id,
+ a.`name`,
+ min(UNIX_TIMESTAMP(b.createTime) * 1000) as time,
+ 2 as type
+ from t_driver a
+ left join t_order b on (a.id = b.driverId)
+ where a.`status` = 1 and a.approvalStatus = 2 and a.inviterType = 2 and a.inviterId = #{driverId}
+ <if test="null != time and '' != time">
+ and DATE_FORMAT(b.createTime, '%Y年%m月') = #{time}
+ </if>
+ group by a.id, a.`name`
+ ) as aa where aa.time is not null order by aa.time desc limit #{pageNum}, #{pageSize}
+ </select>
+
+
+ <select id="queryDriverRank" resultType="com.supersavedriving.driver.modular.system.warpper.PerformanceRankingWarpper">
+ select
+ aa.driverId,
+ aa.name,
+ UNIX_TIMESTAMP(aa.createTime) * 1000 as createTime,
+ aa.number as amountOfData
+ from (
+ select
+ a.driverId,
+ b.`name`,
+ MAX(a.createTime) as createTime,
+ count(1) as number
+ from t_order a
+ left join t_driver b on (a.driverId = b.id)
+ where a.state in (107, 108, 108) and a.`status` = 1
+ <if test="null != dayType and 1 == dayType"><!--天-->
+ <if test="null != time and '' != time">
+ and DATE_FORMAT(a.createTime, '%Y年%m月%d日') = #{time}
+ </if>
+ </if>
+ <if test="null != dayType and 2 == dayType"><!--月-->
+ <if test="null != time and '' != time">
+ and DATE_FORMAT(a.createTime, '%Y年%m月') = #{time}
+ </if>
+ </if>
+ <if test="null != dayType and 3 == dayType"><!--年-->
+ <if test="null != time and '' != time">
+ and DATE_FORMAT(a.createTime, '%Y年') = #{time}
+ </if>
+ </if>
+ group by a.driverId,b.`name`
+ ) as aa order by aa.number desc
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.7.1