From 74432331d7130a2d2798d0217ee9b688de55d811 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期三, 27 八月 2025 17:55:30 +0800
Subject: [PATCH] 新增前后端

---
 service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml b/service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml
index 4255608..85a9bd2 100644
--- a/service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml
+++ b/service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml
@@ -79,6 +79,54 @@
         </where>
         order by thisTab.id desc
     </select>
+    <select id="selectCwData" resultType="com.ruoyi.cwgl.domain.KeyCollectionInfo">
+SELECT
+	customer.`NAME` as customerName,
+	bp.`NAME` as carrier,
+	ts.DISPATCH_NO as dispatchNo,
+	driver_m.`NAME` as driverName,
+	driver_m.MOBILE as driverMobile,
+	vhc.LICENSE_PLATE_NUMBER as licensePlateNumber,
+	ord.ORDER_TIME as orderTime,
+	ord.CREATED_TIME as orderCreatedTime,
+	ts.CREATED_TIME as dispatchCreatedTime,
+	now() as keyCollectionTime, -- 鏀捐姹傛煡璇㈠埌鐨勬椂闂�
+	ord.ESTIMATED_DEPARTURE_TIME as estimatedDepartureTime,
+	ord.CONSIGNOR_ADDRESS_ADDR_INFO as consignorAddress,
+	ord.CONSIGNEE_ADDRESS_ADDR_INFO as consigneeAddress,
+	driver_m.`NAME` as mainDriver,
+	ts.POINT_NUM as pointNum,
+	ts.TRANSPORT_MODE as transportMode,
+	driver_a.`NAME` as assistantDriver,
+	ts.QUANTITY as quantity,
+	ts.REQUIRED_ARRIVAL_TIME as ,
+	ts.DISPATCH_QUANTITY as dispatchQuantity,
+	ts.REMARK as remark,
+	TIMESTAMPDIFF(HOUR, ord.ORDER_TIME, ord.CREATED_TIME) as schedulingTimeout,
+	TIMESTAMPDIFF(HOUR, ord.ESTIMATED_DEPARTURE_TIME, NOW()) as keyTimeout
+
+FROM
+  tms_shipment ts
+  left JOIN oms_order ord ON ts.DISPATCH_NO = ord.DISPATCH_CODE
+  LEFT JOIN base_customer customer ON customer.ID = ord.CUSTOMER_ID
+  LEFT JOIN tms_vehicle vhc ON ts.VEHICLE_ID = vhc.id
+  LEFT JOIN base_provider bp ON bp.ID = ts.CARRIER_ID
+  LEFT JOIN tms_driver driver_m ON driver_m.ID = ts.MAIN_DRIVER_ID
+  LEFT JOIN tms_driver driver_a ON driver_a.ID = ts.ASSISTANT_DRIVER_ID
+WHERE
+  ts.`STATUS` = 'A'
+  <if test="driverCode != null and driverCode != '' ">
+      and driver_m.MOBILE = #{driverCode}
+  </if>
+  <if test="driverName != null and driverName != ''">
+      and driver_m.NAME = #{driverName}
+  </if>
+ORDER BY ord.ESTIMATED_DEPARTURE_TIME asc
+LIMIT 1
+
+
+
+    </select>
 
     <!-- 鏂板 -->
     <insert id="insertKeyCollectionInfo" parameterType="com.ruoyi.cwgl.domain.KeyCollectionInfo"  useGeneratedKeys="true" keyProperty="id">

--
Gitblit v1.8.0