From a0afbd1e36f74cb521c4d51b08a54f6a1fe538f2 Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期四, 31 八月 2023 12:01:54 +0800
Subject: [PATCH] broker 司机端

---
 src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml |  134 +++++++++++++++++++++++---------------------
 1 files changed, 70 insertions(+), 64 deletions(-)

diff --git a/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml b/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml
index 2f69af8..1900ca5 100644
--- a/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml
+++ b/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml
@@ -68,6 +68,9 @@
                                     create_time
                                     ) value (null ,#{orderId},#{url},#{name},now())
     </insert>
+    <insert id="saveLonLat">
+        insert into t_order_lonlat(id,orderId,lon,lat) value (null,#{id},#{lon},#{lat})
+     </insert>
 
     <update id="agreePay">
         update t_order set pay_audit =1 where id=#{number}
@@ -219,7 +222,7 @@
         left JOIN t_country t5 on t1.e_state = t5.id
         LEFT JOIN t_goods t6 on t6.order_id = t1.id
         left join t_user t7 on t1.user_id = t7.id
-        where (t1.s_driverId = #{id})
+        where (t1.s_driverId = #{id} or t1.s_driverId_one=#{id} or t1.e_driverId_one = #{id} or t1.e_driverId = #{id} )
         <if test="containerNo !=null and containerNo !=''">
             and t6.container_number like concat("%",#{containerNo},"%")
         </if>
@@ -232,69 +235,72 @@
         <if test="type !=1">
             and t1.status =1
         </if>
-        union all
-        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,2 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber ,t1.type sendType from t_order t1
-        left JOIN t_port t2 on t1.`port` = t2.id
-        LEFT JOIN t_country t3 on t2.city =t3.id
-        left JOIN t_country t4 on t1.e_city =t4.id
-        left JOIN t_country t5 on t1.e_state = t5.id
-        LEFT JOIN t_goods t6 on t6.order_id = t1.id
-        left join t_user t7 on t1.user_id = t7.id
-        where (t1.s_driverId_one = #{id} )
-        <if test="containerNo !=null and containerNo !=''">
-            and t6.container_number like concat("%",#{containerNo},"%")
-        </if>
-        <if test="sTime !=null">
-            and t1.shipment_date between #{sTime} and #{eTime}
-        </if>
-        <if test="type ==1">
-            and t1.status !=1
-        </if>
-        <if test="type !=1">
-            and t1.status =1
-        </if>
-        union all
-        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,3 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber,t1.type sendType from t_order t1
-        left JOIN t_port t2 on t1.`port` = t2.id
-        LEFT JOIN t_country t3 on t2.city =t3.id
-        left JOIN t_country t4 on t1.e_city =t4.id
-        left JOIN t_country t5 on t1.e_state = t5.id
-        LEFT JOIN t_goods t6 on t6.order_id = t1.id
-        left join t_user t7 on t1.user_id = t7.id
-        where ( t1.e_driverId_one = #{id})
-        <if test="containerNo !=null and containerNo !=''">
-            and t6.container_number like concat("%",#{containerNo},"%")
-        </if>
-        <if test="sTime !=null">
-            and t1.shipment_date between #{sTime} and #{eTime}
-        </if>
-        <if test="type ==1">
-            and t1.status !=1
-        </if>
-        <if test="type !=1">
-            and t1.status =1
-        </if>
-        union all
-        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,4 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber ,t1.type sendType from t_order t1
-        left JOIN t_port t2 on t1.`port` = t2.id
-        LEFT JOIN t_country t3 on t2.city =t3.id
-        left JOIN t_country t4 on t1.e_city =t4.id
-        left JOIN t_country t5 on t1.e_state = t5.id
-        LEFT JOIN t_goods t6 on t6.order_id = t1.id
-        left join t_user t7 on t1.user_id = t7.id
-        where ( t1.e_driverId = #{id} )
-        <if test="containerNo !=null and containerNo !=''">
-            and t6.container_number like concat("%",#{containerNo},"%")
-        </if>
-        <if test="sTime !=null">
-            and t1.shipment_date between #{sTime} and #{eTime}
-        </if>
-        <if test="type ==1">
-            and t1.status !=1
-        </if>
-        <if test="type !=1">
-            and t1.status =1
-        </if>
+<!--        union all-->
+<!--        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,2 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber ,t1.type sendType from t_order t1-->
+<!--        left JOIN t_port t2 on t1.`port` = t2.id-->
+<!--        LEFT JOIN t_country t3 on t2.city =t3.id-->
+<!--        left JOIN t_country t4 on t1.e_city =t4.id-->
+<!--        left JOIN t_country t5 on t1.e_state = t5.id-->
+<!--        LEFT JOIN t_goods t6 on t6.order_id = t1.id-->
+<!--        left join t_user t7 on t1.user_id = t7.id-->
+<!--        where (t1.s_driverId_one = #{id} )-->
+<!--        <if test="containerNo !=null and containerNo !=''">-->
+<!--            and t6.container_number like concat("%",#{containerNo},"%")-->
+<!--        </if>-->
+<!--        <if test="sTime !=null">-->
+<!--            and t1.shipment_date between #{sTime} and #{eTime}-->
+<!--        </if>-->
+<!--        <if test="type ==1">-->
+<!--            and t1.status !=1-->
+<!--        </if>-->
+<!--        <if test="type !=1">-->
+<!--            and t1.status =1-->
+<!--        </if>-->
+<!--        union all-->
+<!--        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,3 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber,t1.type sendType from t_order t1-->
+<!--        left JOIN t_port t2 on t1.`port` = t2.id-->
+<!--        LEFT JOIN t_country t3 on t2.city =t3.id-->
+<!--        left JOIN t_country t4 on t1.e_city =t4.id-->
+<!--        left JOIN t_country t5 on t1.e_state = t5.id-->
+<!--        LEFT JOIN t_goods t6 on t6.order_id = t1.id-->
+<!--        left join t_user t7 on t1.user_id = t7.id-->
+<!--        where ( t1.e_driverId_one = #{id})-->
+<!--        <if test="containerNo !=null and containerNo !=''">-->
+<!--            and t6.container_number like concat("%",#{containerNo},"%")-->
+<!--        </if>-->
+<!--        <if test="sTime !=null">-->
+<!--            and t1.shipment_date between #{sTime} and #{eTime}-->
+<!--        </if>-->
+<!--        <if test="type ==1">-->
+<!--            and t1.status !=1-->
+<!--        </if>-->
+<!--        <if test="type !=1">-->
+<!--            and t1.status =1-->
+<!--        </if>-->
+<!--        union all-->
+<!--        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,4 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber ,t1.type sendType from t_order t1-->
+<!--        left JOIN t_port t2 on t1.`port` = t2.id-->
+<!--        LEFT JOIN t_country t3 on t2.city =t3.id-->
+<!--        left JOIN t_country t4 on t1.e_city =t4.id-->
+<!--        left JOIN t_country t5 on t1.e_state = t5.id-->
+<!--        LEFT JOIN t_goods t6 on t6.order_id = t1.id-->
+<!--        left join t_user t7 on t1.user_id = t7.id-->
+<!--        where ( t1.e_driverId = #{id} )-->
+<!--        <if test="containerNo !=null and containerNo !=''">-->
+<!--            and t6.container_number like concat("%",#{containerNo},"%")-->
+<!--        </if>-->
+<!--        <if test="sTime !=null">-->
+<!--            and t1.shipment_date between #{sTime} and #{eTime}-->
+<!--        </if>-->
+<!--        <if test="type ==1">-->
+<!--            and t1.status !=1-->
+<!--        </if>-->
+<!--        <if test="type !=1">-->
+<!--            and t1.status =1-->
+<!--        </if>-->
+    </select>
+    <select id="getLonLat" resultType="java.util.Map">
+        select lon,lat from t_order_lonlat where orderId =#{orderId}
     </select>
 
 </mapper>

--
Gitblit v1.7.1