您的位置:首页 > 其它

mybatis 之 if test 条件,参数为0时,查询条件未输出

2017-07-17 12:07 447 查看
解决方法:


<if test=" null != tagtype and ‘’!= tagtype">
            AND tagtype = #{tagtype}
</if>
修改为

<if test=" null != tagtype and ''
 0 != tagtype">
            AND tagtype = #{tagtype}
</if>

原因就是 忽略了参数为 0  就代表参数类型时int 默认值应该是 0 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: