mybaits where 语句中使用<if></if>注意事项

来源:互联网 发布:知乎红色警戒2 编辑:程序博客网 时间:2024/06/05 10:08

看上去没什么错误 当运行时 有事会出现

check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4

出错原因

当 不传所有参数时,where  后没有任何条件  ,所以会报错

 解决办法

在where后面 加一句话  1=1



1 0