当前位置: 代码迷 >> 综合 >> MyBatis 中if 标签 判断字符串不生效
  详细解决方案

MyBatis 中if 标签 判断字符串不生效

热度:66   发布时间:2023-09-19 14:30:26.0

今天遇到if 标签判断字符串不生效,导致查询结果错误:

我原来的代码是:

<if test="auditStatus == '0' ">(xr.tbzt = '0' or xr.tbzt is null)</if>

后来发现得改为下面的才行:

<if test="auditStatus == '0'.toString() ">(xr.tbzt = '0' or xr.tbzt is null)</if>

 

  相关解决方案