From 1707d15796d7dc78812f19b9c34868c8cb38a714 Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期日, 15 十月 2023 17:56:57 +0800
Subject: [PATCH] broker 卡车公司端

---
 src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 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 550946f..f5caa11 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
@@ -65,8 +65,8 @@
                                     order_id,
                                     file,
                                     name,
-                                    create_time
-                                    ) value (null ,#{orderId},#{url},#{name},now())
+                                    create_time,category
+                                    ) value (null ,#{orderId},#{url},#{name},now(),4)
     </insert>
 
     <update id="agreePay">
@@ -83,7 +83,7 @@
 
     <select id="getReceivable" resultType="com.stylefeng.guns.modular.system.model.ReceivableVo">
         select t1.id,t1.create_time invoiceDate,t1.company_id userId,sum(t1.pay_money) as total,t2.name userName from t_order t1 left join t_company t2 on t1.company_id=t2.id
-        where t1.status !=0
+        where t1.status !=0 and t1.company_id =#{id}
         <if test="name !=null and name !=''">
             and  t2.name like concat("%",#{name},"%")
         </if>
@@ -101,7 +101,7 @@
     <select id="getPayList" resultType="com.stylefeng.guns.modular.system.model.ShouldPayVo">
         select t1.id,t1.success_time billDate,t1.carriers_id userId,sum(t1.pay_money) as total,
         t2.company_name userName from t_order t1 left join t_carriers t2 on t1.carriers_id=t2.id
-        where t1.status !=0
+        where t1.status !=0 and t1.company_id =#{id}
         <if test="name !=null and name !=''">
             and  t2.company_name like concat("%",#{name},"%")
         </if>
@@ -116,7 +116,7 @@
     <select id="listOfReceivables" resultType="com.stylefeng.guns.modular.system.model.ReceivablesList">
         select t1.invoice_number invoiceNumber,t1.id orderId,t1.user_id userId,t1.pay_money total,t1.pay_time invoicesTime,t2.company_name userName
          from t_order t1 LEFT JOIN t_user t2 on t1.user_id=t2.id
-        where t1.status = 1
+        where t1.status = 1 and t1.company_id=#{id}
         <if test="sTime !=null ">
             and t1.pay_time between #{sTime} and #{eTime}
         </if>
@@ -138,11 +138,11 @@
 
     </select>
     <select id="getPayStatus" resultType="java.lang.Integer">
-        select id from t_order where pay_status =1
+        select id from t_order where pay_status =1 and id =#{orderId}
     </select>
     <select id="listOfPay" resultType="com.stylefeng.guns.modular.system.model.PayList">
         select t1.id orderId,t1.carriers_id companyId,t2.company_name companyName,t1.pay_carriers_time billTime,t1.pay_time dueDate,t1.carriers_pay_status paystatus,t1.pay_audit payAudit,(t1.pay_money*(t2.commission/100) ) as total  FROM t_order  t1 LEFT JOIN t_carriers t2 on t1.carriers_id =t2.id
-        where t1.status = 1
+        where t1.status = 1 and t1.company_id=#{id}
         <if test="sTime !=null">
             and t1.pay_carriers_time between #{sTime} and #{eTime}
         </if>
@@ -174,14 +174,15 @@
 	t1.shipment_date pickupDate,
 	t1.delivery_date deliveryDate,
 	t1.status status,
-	t1.e_address destination
+	t1.e_address destination,
+	t2.kg kg
 FROM
 	t_order t1
 	LEFT JOIN t_goods t2 ON t1.id = t2.order_id
 	LEFT JOIN t_user t3 on t1.user_id =t3.id
 	LEFT JOIN t_port t4 on t1.`port` = t4.id
     LEFT JOIN t_group t5 on t3.group_id = t5.id
-	where t1.company_id = #{companyId} and t1.order_type=#{type}
+	where t1.company_id = #{companyId} and t1.order_type=#{type} and t1.status != 17
 	<if test="sTime !=null">
         and (t1.shipment_date between  #{sTime} and #{eTime} or t1.delivery_date between  #{sTime} and #{eTime})
     </if>
@@ -202,6 +203,7 @@
     </if>
 GROUP BY
 	t1.id
+	order by t1.create_time desc
 
 
     </select>
@@ -211,5 +213,21 @@
             and success_time BETWEEN #{sTime} and #{eTime}
         </if>
     </select>
+    <select id="queryAllOrderDatas" resultType="java.util.Map">
+        SELECT too.id,
+               tc.`name`,
+               too.s_email as mailAddr,
+               tp.car_price    as amount,
+               tp.price    as unitPrice
+        FROM `t_order` AS too
+                 JOIN t_user tu ON too.user_id = tu.id
+                 JOIN t_company tc ON too.company_id = tc.id
+                 join t_price tp on too.id = tp.order_id
+        WHERE too.STATUS = 1
+    </select>
+
+    <select id="getLonLat" resultType="java.util.Map">
+        select lon,lat from t_order_lonlat where orderId =#{orderId}
+    </select>
 
 </mapper>

--
Gitblit v1.7.1