ibatis中if多条件查询以及sql中不等于,等于的用法

1、if多条件满足写法用and拼接


2、sql中不等于写法,用 3 ]]>这种写法

例如字段xx不等于3:and   3 ]]>

3、当MyBatis 判断条件为等于的时候,常量需要加 .toString() 来转换,这种方法是稳定的,推荐使用,比如:

  1. <if test="newsImage != null and newsImage == '1'.toString()">  
  2.      0 ]]>  
  3. if>  


你可能感兴趣的:(mybatis)