正文:
加上.toString()
<if test="name!= null and name!= '' and name!= '无'.toString()"> AND NAME = #{name} </if>
参考博客:
Mybatis中xml对if标签中文判断的处理 - 每天进步一点点 - 优快云博客
https://blog.youkuaiyun.com/weisong530624687/article/details/50728310
本文介绍在MyBatis中使用XML进行IF条件判断时,如何正确处理字符串比较,特别是涉及中文的情况。通过示例代码展示如何避免NULL指针异常和空字符串误判的问题。
正文:
加上.toString()
<if test="name!= null and name!= '' and name!= '无'.toString()"> AND NAME = #{name} </if>
参考博客:
Mybatis中xml对if标签中文判断的处理 - 每天进步一点点 - 优快云博客
https://blog.youkuaiyun.com/weisong530624687/article/details/50728310
转载于:https://www.cnblogs.com/huashengweilong/p/10991895.html
您可能感兴趣的与本文相关的镜像
Stable-Diffusion-3.5
Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率
1136
1370
775

被折叠的 条评论
为什么被折叠?