From 3ee306e4a8db75680960f5eb4eec9fb7d05b5f29 Mon Sep 17 00:00:00 2001
From: zjk <852185829@qq.com>
Date: 星期五, 24 七月 2026 16:21:54 +0800
Subject: [PATCH] Merge branch 'master' into electron_dev

---
 ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml
index 917ff20..89d55c5 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml
@@ -12,6 +12,7 @@
         <result property="deviceId"     column="device_id" />
         <result property="enabled"      column="enabled" />
         <result property="onlineStatus" column="online_status" />
+        <result property="fingerprint"  column="fingerprint" />
         <result property="delFlag"      column="del_flag" />
         <result property="remark"       column="remark" />
         <result property="createBy"     column="create_by" />
@@ -27,6 +28,7 @@
         <result property="deviceName"   column="device_name" />
         <result property="brand"        column="brand" />
         <result property="deviceId"     column="device_id" />
+        <result property="fingerprint"  column="fingerprint" />
         <result property="enabled"      column="enabled" />
         <result property="onlineStatus" column="online_status" />
         <result property="remark"       column="remark" />
@@ -41,6 +43,7 @@
                device_id,
                enabled,
                online_status,
+               fingerprint,
                del_flag,
                remark,
                create_by,
@@ -57,6 +60,7 @@
                m.device_name,
                m.brand,
                m.device_id,
+               m.fingerprint,
                m.enabled,
                m.online_status,
                m.remark,
@@ -141,14 +145,35 @@
 
     <update id="updateMachine" parameterType="SysVisitorMachine">
         update t_visitor_machine
-        set area_id = #{areaId},
-            device_name = #{deviceName},
-            brand = #{brand},
-            device_id = #{deviceId},
-            enabled = #{enabled},
-            remark = #{remark},
+        <set>
+            <if test="areaId != null and areaId != ''">
+                area_id = #{areaId},
+            </if>
+            <if test="deviceName != null and deviceName != ''">
+                device_name = #{deviceName},
+            </if>
+            <if test="brand != null and brand != ''">
+                brand = #{brand},
+            </if>
+            <if test="deviceId != null and deviceId != ''">
+                device_id = #{deviceId},
+            </if>
+            <if test="enabled != null">
+                enabled = #{enabled},    <!-- 注意:enabled 可能是 Boolean 或 Integer,若允许 false 或 0,则只判 null -->
+            </if>
+            <if test="onlineStatus != null and onlineStatus != ''">
+                online_status = #{onlineStatus},
+            </if>
+            <if test="fingerprint != null and fingerprint != ''">
+                fingerprint = #{fingerprint},
+            </if>
+            <if test="remark != null and remark != ''">
+                remark = #{remark},
+            </if>
+            <!-- 以下两个字段始终更新,不加 if -->
             update_by = #{updateBy},
             update_time = sysdate()
+        </set>
         where machine_id = #{machineId}
           and del_flag = '0'
     </update>

--
Gitblit v1.7.1