作者 也曾为你、像超人
提交者 Gitee

update ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml.

问题:查业务类型为其他(businessType = 0)的数据时,会查到所有数据

原因:当参数为 Integer 类型 0 时,MyBatis 会把 0 当做空字符串处理
@@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
39 <if test="title != null and title != ''"> 39 <if test="title != null and title != ''">
40 AND title like concat('%', #{title}, '%') 40 AND title like concat('%', #{title}, '%')
41 </if> 41 </if>
42 - <if test="businessType != null and businessType != ''"> 42 + <if test="businessType != null">
43 AND business_type = #{businessType} 43 AND business_type = #{businessType}
44 </if> 44 </if>
45 <if test="businessTypes != null and businessTypes.length > 0"> 45 <if test="businessTypes != null and businessTypes.length > 0">