MyBatis的<if>标签判空

String类型

<if test="str!=null and str!=''">
      ...
</if>

Integer类型

<if test="it!=null">
      ...
</if>

str!=''判断的写法只适合String类型,其他类型使用会报错

猜你喜欢

转载自www.cnblogs.com/liuyiyuan/p/12958777.html