项目中遇到的反人类需求,需要if/else的条件判断,在xml中这样用起来很方便,重点是单引号和双引号不能写反
<if test='name != "" and name != null ' >
<choose>
<when test='name == "无"'>
AND d.fullname is null
</when>
<otherwise>
AND d.fullname LIKE CONCAT('%',#{name},'%')
</otherwise>
</choose>
</if>