mybatis test把参数传整数0不生效

问题:

   跟前端联调的时候,发现有的参数明明传值=0,但是sql没有.看了下判断非空方式。

   mybatis 

 <if test="XX !=null  and XX != ''">

还是得加上0这种特殊情况。

<if test="XX !=null  and XX != ''  or XX=='0'.toString() ">

还可以使用commons.lang包判断,这里没用。

发布了521 篇原创文章 · 获赞 94 · 访问量 56万+

猜你喜欢

转载自blog.csdn.net/bohu83/article/details/103245981