1.判断字符串是否含有另一个字符串:
<if test="String1.indextOf('String2') != -1"></if>
2.判断字符串的值:
<if test='string1 == "haha"'></if>或者<if test="string1 == 'haha'.toString()"></if>
3.连接模糊查询字段:
and mc like concat(concat('%',#{mc}),'%')
4.循环数组:
<when test="mcs!= null and mcs.size != 0">
and a.mc in
<foreach item="item" index="index" collection="mcs" open="(" separator="," close=")">
#{item}
</foreach>
</when>
<otherwise>
and 1=2
</otherwise>