From d6a14beb93cb572247db0edff3f25f99e217fcf1 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 22 八月 2025 15:34:17 +0800
Subject: [PATCH] 修改bug

---
 DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverServiceMapper.xml |  135 ++++++++-------------------------------------
 1 files changed, 24 insertions(+), 111 deletions(-)

diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverServiceMapper.xml b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverServiceMapper.xml
index 826a9f4..464e1b3 100644
--- a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverServiceMapper.xml
+++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverServiceMapper.xml
@@ -24,8 +24,8 @@
         1 as type,
         insertTime as orderTime,
         id as orderId,
-        boardingAddress as startAddress,
-        getoffAddress as endAddress,
+        startAddress as startAddress,
+        endAddress as endAddress,
         state,
         orderMoney
         from t_order_private_car
@@ -41,8 +41,8 @@
         2 as type,
         insertTime as orderTime,
         id as orderId,
-        boardingAddress as startAddress,
-        getoffAddress as endAddress,
+        startAddress as startAddress,
+        endAddress as endAddress,
         state,
         orderMoney
         from t_order_taxi
@@ -58,8 +58,8 @@
         3 as type,
         insertTime as orderTime,
         id as orderId,
-        boardingAddress as startAddress,
-        getoffAddress as endAddress,
+        startAddress as startAddress,
+        endAddress as endAddress,
         state,
         orderMoney
         from t_order_cross_city
@@ -78,57 +78,17 @@
 
     </select>
     <select id="queryOrderMoneyDataFromDriver" resultType="com.stylefeng.guns.modular.system.model.vo.DriverOrderDataNextVo">
-        select * from (
         select
-        orderNum,
-        1 as type,
+        incomeId as orderId,
+        orderType as type,
         insertTime as orderTime,
-        id as orderId,
-        boardingAddress as startAddress,
-        getoffAddress as endAddress,
-        state,
-        orderMoney
-        from t_order_private_car
-        where driverId = #{uid} and state in (8,9)
+        money as orderMoney
+        from t_income
+        where userType =2  and objectId = #{uid} and type =2
         <if test="sTime !=null">
             and insertTime between #{sTime} and #{eTime}
         </if>
-
-        union all
-
-        select
-        orderNum,
-        2 as type,
-        insertTime as orderTime,
-        id as orderId,
-        boardingAddress as startAddress,
-        getoffAddress as endAddress,
-        state,
-        orderMoney
-        from t_order_taxi
-        where driverId = #{uid} and state in (8,9)
-        <if test="sTime !=null">
-            and insertTime between #{sTime} and #{eTime}
-        </if>
-
-        union all
-
-        select
-        orderNum,
-        3 as type,
-        insertTime as orderTime,
-        id as orderId,
-        boardingAddress as startAddress,
-        getoffAddress as endAddress,
-        state,
-        orderMoney
-        from t_order_cross_city
-        where driverId = #{uid} and state in (8,9)
-        <if test="sTime !=null">
-            and insertTime between #{sTime} and #{eTime}
-        </if>
-        ) t1
-        order by t1.orderTime desc
+        order by insertTime desc
 
 
 
@@ -138,65 +98,18 @@
 
     </select>
     <select id="queryOrderMoneyDataFromDriverAll" resultType="com.stylefeng.guns.modular.system.model.vo.DriverOrderDataNextVo">
-        select * from (
         select
-        orderNum,
-        1 as type,
+        orderType as type,
         insertTime as orderTime,
-        id as orderId,
-        boardingAddress as startAddress,
-        getoffAddress as endAddress,
-        state,
-        orderMoney
-        from t_order_private_car
-        where driverId = #{uid} and state in (8,9)
+        money as orderMoney
+        from t_income
+        where userType =2  and objectId = #{uid} and type =2
         <if test="sTime !=null">
             and insertTime between #{sTime} and #{eTime}
         </if>
-
-        union all
-
-        select
-        orderNum,
-        2 as type,
-        insertTime as orderTime,
-        id as orderId,
-        boardingAddress as startAddress,
-        getoffAddress as endAddress,
-        state,
-        orderMoney
-        from t_order_taxi
-        where driverId = #{uid} and state in (8,9)
-        <if test="sTime !=null">
-            and insertTime between #{sTime} and #{eTime}
-        </if>
-
-        union all
-
-        select
-        orderNum,
-        3 as type,
-        insertTime as orderTime,
-        id as orderId,
-        boardingAddress as startAddress,
-        getoffAddress as endAddress,
-        state,
-        orderMoney
-        from t_order_cross_city
-        where driverId = #{uid} and state in (8,9)
-        <if test="sTime !=null">
-            and insertTime between #{sTime} and #{eTime}
-        </if>
-        ) t1
-        order by t1.orderTime desc
-
-
-
-
-
-
-
+        order by insertTime desc
     </select>
+
     <select id="queryOrderPromotionFromDriver" resultType="com.stylefeng.guns.modular.system.model.vo.DriverOrderDataNextVo">
         select * from (
         select
@@ -209,7 +122,7 @@
         state,
         promotionMoney as orderMoney
         from t_order_private_car
-        where promotionDriverId = #{uid} and state in (8,9)
+        where promotionDriverId = #{uid} and state in (8,9)  and successTime is not null
         <if test="sTime !=null">
             and successTime between #{sTime} and #{eTime}
         </if>
@@ -226,7 +139,7 @@
         state,
         promotionMoney as orderMoney
         from t_order_taxi
-        where promotionDriverId = #{uid} and state in (8,9)
+        where promotionDriverId = #{uid} and state in (8,9) and successTime is not null
         <if test="sTime !=null">
             and successTime between #{sTime} and #{eTime}
         </if>
@@ -243,7 +156,7 @@
         state,
         promotionMoney as orderMoney
         from t_order_cross_city
-        where promotionDriverId = #{uid} and state in (8,9)
+        where promotionDriverId = #{uid} and state in (8,9) and successTime is not null
         <if test="sTime !=null">
             and successTime between #{sTime} and #{eTime}
         </if>
@@ -270,7 +183,7 @@
         state,
         promotionMoney as orderMoney
         from t_order_private_car
-        where promotionDriverId = #{uid} and state in (8,9)
+        where promotionDriverId = #{uid} and state in (8,9) and successTime is not null
         <if test="sTime !=null">
             and successTime between #{sTime} and #{eTime}
         </if>
@@ -287,7 +200,7 @@
         state,
         promotionMoney as orderMoney
         from t_order_taxi
-        where promotionDriverId = #{uid} and state in (8,9)
+        where promotionDriverId = #{uid} and state in (8,9) and successTime is not null
         <if test="sTime !=null">
             and successTime between #{sTime} and #{eTime}
         </if>
@@ -304,7 +217,7 @@
         state,
         promotionMoney as orderMoney
         from t_order_cross_city
-        where promotionDriverId = #{uid} and state in (8,9)
+        where promotionDriverId = #{uid} and state in (8,9) and successTime is not null
         <if test="sTime !=null">
             and successTime between #{sTime} and #{eTime}
         </if>

--
Gitblit v1.7.1