mybatis-if标签

背景:xml文件中使用mybatis的if标签判断指定字符串(写死),equals 和 != 方法都不能正常判断生效。。。

mybatis 使用if 判断字符串示例:
正例1:

<if test="itemCode != null and itemCode !=''  and itemCode !='aaa'.toString()">

正例2:

<if test='itemCode != null and itemCode !=""  and itemCode !="aaa" '>

反例:

<if test="itemCode != null and itemCode !=''  and itemCode !='aaa' ">
posted @ 2020-10-13 15:16  空指针终结者  阅读(322)  评论(0)    收藏  举报