From b23d80cdbc375643e6a94122c6507fca79e18103 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期四, 18 九月 2025 17:28:58 +0800
Subject: [PATCH] 新增要求出发时间

---
 service/src/main/resources/mapper/cwgl/SmartLockerApplicationMapper.xml |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/service/src/main/resources/mapper/cwgl/SmartLockerApplicationMapper.xml b/service/src/main/resources/mapper/cwgl/SmartLockerApplicationMapper.xml
index f1e237e..8936aac 100644
--- a/service/src/main/resources/mapper/cwgl/SmartLockerApplicationMapper.xml
+++ b/service/src/main/resources/mapper/cwgl/SmartLockerApplicationMapper.xml
@@ -22,10 +22,11 @@
         <result property="createBy"    column="create_by"    />
         <result property="updateBy"    column="update_by"    />
         <result property="deleted"    column="deleted"    />
+        <result property="deadlineTime"    column="deadline_time"    />
     </resultMap>
 
     <sql id="selectSmartLockerApplicationVo">
-        select thisTab.id, thisTab.command_type, thisTab.applicant_code, thisTab.applicant_name, thisTab.item_type, thisTab.item_name, thisTab.locker_no, thisTab.locker_port, thisTab.status, thisTab.cancel_time, thisTab.receive_time, thisTab.create_time, thisTab.update_time, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.deleted from smart_locker_application AS thisTab
+        select thisTab.id, thisTab.command_type, thisTab.applicant_code, thisTab.applicant_name, thisTab.item_type, thisTab.item_name, thisTab.locker_no, thisTab.locker_port, thisTab.status, thisTab.cancel_time, thisTab.receive_time, thisTab.create_time, thisTab.update_time, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.deleted, thisTab.deadline_time from smart_locker_application AS thisTab
     </sql>
     <sql id="selectSmartLockerApplicationVoCount">
         select count(0) from smart_locker_application as thisTab
@@ -65,6 +66,18 @@
         </where>
         order by thisTab.id desc
     </select>
+    <select id="selectSmartLockerApplication" resultMap="SmartLockerApplicationResult">
+        <include refid="selectSmartLockerApplicationVo"/>
+
+        where applicant_name = #{driverName}
+        and applicant_code = #{driverCode}
+        and status = 0
+        limit 1
+    </select>
+    <select id="selectCwByLicensePlateNumber" resultType="java.lang.Integer">
+
+        SELECT `NAME` from tms_vehicle WHERE LICENSE_PLATE_NUMBER = #{licensePlateNumber} and BE_DELETE =0 order by id asc LIMIT 1
+    </select>
 
     <!-- 鏂板 -->
     <insert id="insertSmartLockerApplication" parameterType="com.ruoyi.cwgl.domain.SmartLockerApplication"  useGeneratedKeys="true" keyProperty="id">
@@ -86,6 +99,7 @@
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="deleted != null">deleted,</if>
+            <if test="deadlineTime != null">deadline_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="commandType != null">#{commandType},</if>
@@ -104,17 +118,18 @@
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="deleted != null">#{deleted},</if>
+            <if test="deadlineTime != null">#{deadlineTime},</if>
          </trim>
     </insert>
 
     <insert id="insertSmartLockerApplicationBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
         insert into smart_locker_application
         <trim prefix="(" suffix=") values" suffixOverrides=",">
-            id,command_type,applicant_code,applicant_name,item_type,item_name,locker_no,locker_port,status,cancel_time,receive_time,create_time,update_time,remark,create_by,update_by,deleted,
+            id,command_type,applicant_code,applicant_name,item_type,item_name,locker_no,locker_port,status,cancel_time,receive_time,create_time,update_time,remark,create_by,update_by,deleted,deadline_time,
         </trim>
         <foreach item="item" index="index" collection="list" separator=",">
             <trim prefix="(" suffix=") " suffixOverrides=",">
-                #{item.id},#{item.commandType},#{item.applicantCode},#{item.applicantName},#{item.itemType},#{item.itemName},#{item.lockerNo},#{item.lockerPort},#{item.status},#{item.cancelTime},#{item.receiveTime},#{item.createTime},#{item.updateTime},#{item.remark},#{item.createBy},#{item.updateBy},#{item.deleted},
+                #{item.id},#{item.commandType},#{item.applicantCode},#{item.applicantName},#{item.itemType},#{item.itemName},#{item.lockerNo},#{item.lockerPort},#{item.status},#{item.cancelTime},#{item.receiveTime},#{item.createTime},#{item.updateTime},#{item.remark},#{item.createBy},#{item.updateBy},#{item.deleted},#{item.deadlineTime},
             </trim>
         </foreach>
     </insert>
@@ -139,6 +154,7 @@
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="deleted != null">deleted = #{deleted},</if>
+            <if test="deadlineTime != null">deadline_time = #{deadlineTime},</if>
         </trim>
         where id = #{id}
     </update>
@@ -163,10 +179,19 @@
                 <if test="item.createBy != null">create_by = #{item.createBy},</if>
                 <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                 <if test="item.deleted != null">deleted = #{item.deleted},</if>
+                <if test="item.deadlineTime != null">deadline_time = #{item.deadlineTime},</if>
             </trim>
         where id = #{item.id}
         </foreach>
     </update>
+    <update id="updateExpiredStatus">
+
+        UPDATE smart_locker_application
+        SET status = 3, update_time = NOW()
+        WHERE status = 0
+        AND deadline_time &lt;  NOW()
+
+    </update>
 
     <!--鍒犻櫎-->
     <delete id="deleteSmartLockerApplicationById" parameterType="Integer">

--
Gitblit v1.8.0