MyBatis的<if>标签判空

String类型

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

Integer类型

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

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

posted @ 2020-05-25 18:14  liuyiyuan  阅读(5097)  评论(0编辑  收藏  举报