From b61c4537a78d58412ef7ccd6e2c30152d807c5b7 Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期一, 29 七月 2024 11:04:54 +0800
Subject: [PATCH] 电磁锁密码查询去除上一组密码修改提交

---
 ard-work/src/main/resources/mapper/sy/ArdTankLockMapper.xml |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/ard-work/src/main/resources/mapper/sy/ArdTankLockMapper.xml b/ard-work/src/main/resources/mapper/sy/ArdTankLockMapper.xml
index bbd54d8..30b16ed 100644
--- a/ard-work/src/main/resources/mapper/sy/ArdTankLockMapper.xml
+++ b/ard-work/src/main/resources/mapper/sy/ArdTankLockMapper.xml
@@ -42,6 +42,26 @@
         </association>
     </resultMap>
 
+    <resultMap type="ArdTankLock" id="ArdTankLockWithPasswordResult">
+        <result property="id"    column="id"    />
+        <result property="lockNum"    column="lock_num"    />
+        <result property="lockName"    column="lock_name"    />
+        <result property="imgPositionTop"    column="img_position_top"    />
+        <result property="imgPositionLeft"    column="img_position_left"    />
+        <result property="carId"    column="car_id"    />
+        <result property="enable"    column="enable"    />
+        <result property="restartState"    column="restart_state"    />
+        <result property="onlineTime"    column="online_time"    />
+        <collection property="ardTankLockPasswords" ofType="com.ruoyi.sy.domain.ArdTankLockPassword">
+            <result property="id"    column="pid"    />
+            <result property="lockId"    column="lock_id"    />
+            <result property="password"    column="password"    />
+            <result property="no"    column="no"    />
+            <result property="createTime"    column="create_time"    />
+            <result property="useTime"    column="use_time"    />
+        </collection>
+    </resultMap>
+
     <sql id="selectArdTankLockVo">
         select id, lock_num, lock_name, img_position_top, img_position_left, car_id, enable, restart_state, online_time from ard_tank_lock
     </sql>
@@ -205,4 +225,12 @@
     <select id="getIdByLockNum" resultType="java.lang.String" parameterType="java.lang.String">
         select id from ard_tank_lock atl where atl.lock_num = #{lockNum}
     </select>
+
+    <select id="selectArdTankLockWithPassword" resultMap="ArdTankLockWithPasswordResult" >
+        select atl."id",atl.lock_num,atl.lock_name,atl.img_position_top,
+        atl.img_position_left,atl.car_id,atl."enable",atl.restart_state,
+        atl.online_time,atlp."id" as pid,atlp.lock_id,atlp."password",
+        atlp.create_time,atlp.use_time  from ard_tank_lock atl
+        left join ard_tank_lock_password atlp on atl.id = atlp.lock_id and use_time is null
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3