wenminjie
2026-07-22 d5bbb65e86cdf731f16f6918b2db49a5312c30ed
访客机侧代码
2个文件已修改
28 ■■■■■ 已修改文件
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysVisitorMachineServiceImpl.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysVisitorMachineServiceImpl.java
@@ -176,7 +176,6 @@
        update.setOnlineStatus("ONLINE");  // 或 "ACTIVATED",根据你的枚举定义
        update.setUpdateTime(new Date());
        update.setFingerprint(fingerprint);
        return visitorMachineMapper.updateMachine(update);
    }
ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml
@@ -141,14 +141,29 @@
    <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="remark != null and remark != ''">
                remark = #{remark},
            </if>
            <!-- 以下两个字段始终更新,不加 if -->
            update_by = #{updateBy},
            update_time = sysdate()
        </set>
        where machine_id = #{machineId}
          and del_flag = '0'
    </update>