问题:
跟前端联调的时候,发现有的参数明明传值=0,但是sql没有.看了下判断非空方式。
mybatis
<if test="XX !=null and XX != ''">
还是得加上0这种特殊情况。
<if test="XX !=null and XX != '' or XX=='0'.toString() ">
还可以使用commons.lang包判断,这里没用。
问题:
跟前端联调的时候,发现有的参数明明传值=0,但是sql没有.看了下判断非空方式。
mybatis
<if test="XX !=null and XX != ''">
还是得加上0这种特殊情况。
<if test="XX !=null and XX != '' or XX=='0'.toString() ">
还可以使用commons.lang包判断,这里没用。