解决方法:
<select id="selectIf" resultType="student">
SELECT id,name,age,score
FROM t_student
WHERE 1=1
<if test="arg0 != null and arg0 !=‘‘">
AND name LIKE ‘%‘ #{arg0} ‘%‘
</if>
<if test="arg1>=0">
AND age >= #{arg1}
</if>
</select>
出现异常情况:
如果用where就不用写1=1操作了
Parameter 'name' not found. Available parameters are [arg1, arg0, param1, param2]
原文地址:https://www.cnblogs.com/Koma-vv/p/10358566.html
时间: 2024-10-07 23:26:25