瀏覽代碼

设备编号查询,不可以使用模糊搜索,否则统计的时候,有可能会匹配到多个,导致查询异常

王苗苗 1 周之前
父節點
當前提交
0198ca6423
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      ruoyi-system/src/main/resources/mapper/business/BizDeviceMapper.xml

+ 3 - 1
ruoyi-system/src/main/resources/mapper/business/BizDeviceMapper.xml

@@ -46,7 +46,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectBizDeviceVo"/>
         <where>
             1 = 1
-            <if test="deviceNo != null  and deviceNo != ''"> and device_no like concat('%', #{deviceNo}, '%')</if>
+            <!--<if test="deviceNo != null  and deviceNo != ''"> and device_no like concat('%', #{deviceNo}, '%')</if>-->
+            <!-- 2025年04月22日10:16:33 设备编号查询,不可以使用模糊搜索,否则统计的时候,有可能会匹配到多个,导致查询异常 -->
+            <if test="deviceNo != null  and deviceNo != ''"> and device_no = #{deviceNo}</if>
             <if test="deviceName != null  and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
             <if test="deviceSn != null  and deviceSn != ''"> and device_sn like concat('%', #{deviceSn}, '%')</if>
             <if test="deviceModel != null  and deviceModel != ''"> and device_model = #{deviceModel}</if>