From 816b9bf9282e72bd39a40c90a100b9e0dfb06a60 Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期三, 20 八月 2025 23:29:09 +0800 Subject: [PATCH] feat(order): 查询我的订单列表增加司机视角 --- UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/shunfeng/dao/mapping/OrderRideMapper.xml | 50 ++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 40 insertions(+), 10 deletions(-) diff --git a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/shunfeng/dao/mapping/OrderRideMapper.xml b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/shunfeng/dao/mapping/OrderRideMapper.xml index 33c664f..33c3e41 100644 --- a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/shunfeng/dao/mapping/OrderRideMapper.xml +++ b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/shunfeng/dao/mapping/OrderRideMapper.xml @@ -90,15 +90,45 @@ </select> <select id="queryMyOrderList" resultType="java.util.Map"> - select - id as orderId, - DATE_FORMAT(addTime, '%Y-%m-%d %H:%i') as orderTime, - DATE_FORMAT(startTime, '%m月%d日 %H:%i') as time, - startName as startAddress, - endName as endAddress, - driverId as driverId, - (8) as orderType, - state as state - from app_order_ride where userId = #{uid} order by addTime desc limit #{pageNum}, #{size} + SELECT + * + FROM + ( + SELECT + id AS orderId, + DATE_FORMAT( addTime, '%Y-%m-%d %H:%i' ) AS orderTime, + DATE_FORMAT( startTime, '%m月%d日 %H:%i' ) AS TIME, + startName AS startAddress, + endName AS endAddress, + driverId AS driverId, + ( 8 ) AS orderType, + 1 AS rideUserType, + state AS state + FROM + app_order_ride + WHERE + userId = #{uid} + + UNION all + + SELECT + t1.id AS orderId, + DATE_FORMAT( t1.addTime, '%Y-%m-%d %H:%i' ) AS orderTime, + DATE_FORMAT( t1.startTime, '%m月%d日 %H:%i' ) AS TIME, + t1.startName AS startAddress, + t1.endName AS endAddress, + t1.driverId AS driverId, + ( 8 ) AS orderType, + 2 AS rideUserType, + t1.state AS state + FROM + app_order_travel t1 + LEFT JOIN t_user t2 ON t1.driverId = t2.driverId + WHERE + t2.id = #{uid} + ) as t + ORDER BY + t.orderTime DESC + LIMIT #{pageNum}, #{size} </select> </mapper> -- Gitblit v1.7.1