mybatis遇到的Integer status坑
发布日期:2021-06-29 11:47:00 浏览次数:3 分类:技术文章

本文共 185 字,大约阅读时间需要 1 分钟。

private Integer status;

<if test="status !=null and status != '' or status==0">

            AND op.status = #{status}

</if>

如果status字段值为0,mybatis会默认status为空,就不会有添加AND条件了, 所有 在if里面加上or status ==0 解决

转载地址:https://blog.csdn.net/zzchances/article/details/105393423 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:前端传时间类型报400
下一篇:同IP不同端口导致session冲突的解决方法

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月13日 11时51分10秒