- 错误还原:在查询的过程中,传入的workType为0时,该条件不起作用
<select id="xxx">
SELECT di.id, di.name, di.work_type, di.updated...
<where>
<if test="name != null and name != ''">
and di.name like concat('%',#{name},'%')
</if>
<if test="Id != null and Id != ''">
and di.id = #{Id}
</if>
<if test="workType != null and workType != ''">
and di.work_type = #{workType}
</if>
</where>
order by di.updated desc
</select>
- 解决方案,修改为如下
<if test="workType != null">
and di.work_type = #{workType}
</if>
标签:name,di,不起作用,work,Plus,Mybatis,type,workType
From: https://www.cnblogs.com/dogleftover/p/17338233.html