普通的拼写方式为:
<if test="remark != null and remark != ''">and remark like '%'+#{remark}+'%'</if>
如果遇到变量名刚好是数据库的关键字,拼写方式如下所示:
<if test="action != null and action != ''">
<![CDATA[
and action like '%'+#{action}+'%'
]]>
</if>
<if test="remark != null and remark != ''">and remark like '%'+#{remark}+'%'</if>
如果遇到变量名刚好是数据库的关键字,拼写方式如下所示:
<if test="action != null and action != ''">
<![CDATA[
and action like '%'+#{action}+'%'
]]>
</if>