以前还记得,总是忘记,使用文章记录一下。
大致就是两种写法:
第一种:
<if test='type=="y"'>
and status = 1
</if>
第二种:
<if test="type == 'y'.toString()">
and status = 1
</if>
题外话:如果传进来的不是字符而是数字的话,就没这么麻烦了。
<if test="type == 1">
and status = 1
</if>