From ae64126733bedc1a15a0177b105fec7f499ada81 Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期一, 05 八月 2024 11:01:01 +0800
Subject: [PATCH] 电磁锁加入使能修改及判断提交

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

diff --git a/ard-work/src/main/resources/mapper/sy/ArdTankLockMapper.xml b/ard-work/src/main/resources/mapper/sy/ArdTankLockMapper.xml
index 5dd0480..0a21a5e 100644
--- a/ard-work/src/main/resources/mapper/sy/ArdTankLockMapper.xml
+++ b/ard-work/src/main/resources/mapper/sy/ArdTankLockMapper.xml
@@ -170,7 +170,8 @@
         case atls.lock_state
           when '鍏抽攣鐘舵��' then false
           when '寮傚父鐘舵��' then false
-          when '鍔ㄤ綔鐘舵��' then false
+          /*when '鍔ㄤ綔鐘舵��' then false*/
+          when '鎿嶆帶涓�...' then false
           when '寮�閿佺姸鎬�' then true
           else false
           end as lock_state_mark,
@@ -257,7 +258,8 @@
         case atls.lock_state
             when '鍏抽攣鐘舵��' then false
             when '寮傚父鐘舵��' then false
-            when '鍔ㄤ綔鐘舵��' then false
+            /*when '鍔ㄤ綔鐘舵��' then false*/
+            when '鎿嶆帶涓�...' then false
             when '寮�閿佺姸鎬�' then true
             else false
             end as lock_state_mark,
@@ -265,4 +267,27 @@
         from ard_tank_lock atl
         left join ard_tank_lock_state atls on atl."id" = atls.lock_id)t where t.rn = 1
     </select>
+
+    <select id="getArdTankLockCount" resultType="java.lang.Long" >
+        select count(*) from ard_tank_lock
+    </select>
+
+    <select id="getArdTankLockWithStateByCarId" resultMap="ArdTankLockWithStateResult" >
+        select t.id,t.lock_num,t.lock_name,t.img_position_top,t.img_position_left,
+        t.car_id,t.enable,t.restart_state,t.online_time,t.sid,t.lock_id,t.slock_num,
+        t.lock_state,t.lock_position_state,t.lock_shell_state,t.srestart_state,
+        t.batter_voltage,t.power_voltage,t.upload_time,t.unique_mark from (
+        select atl.*,atls.id as sid,atls.lock_id,atls.lock_num as slock_num,atls.lock_state,
+        atls.lock_position_state,atls.lock_shell_state,atls.restart_state as srestart_state,
+        atls.batter_voltage,atls.power_voltage,atls.upload_time,atls.unique_mark,
+        rank() over(partition by atl.lock_num,atl.online_time order by atls.upload_time desc) rn
+        from ard_tank_lock atl
+        left join ard_tank_lock_state atls on atl.lock_num = atls.lock_num
+        where atl.car_id = #{carId})t where t.rn = 1
+    </select>
+
+    <update id="updateLockEnableByCarId" parameterType="java.lang.String">
+        update ard_tank_lock set enable = #{enable}
+        where car_id = #{carId}
+    </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3