"script"里才需要转换 CDDATA 块!
符号 | 转换 |
---|---|
& |
& |
< |
< |
> |
> |
" |
" |
' |
' |
- | - | - | - |
---|---|---|---|
小于等于 | a<=b | a <= b |
a <![CDATA[<= ]]> b |
大于等于 | a>=b | a >= b |
a <![CDATA[>= ]]> b |
不等于 | a!=b | a<![CDATA[ <> ]]> b |
a <![CDATA[!= ]]> b |
例子:
<if test="provinceId != null">
AND <![CDATA[ province_id = #{provinceId} ]]>
</if>
<if test="id != null">
AND <![CDATA[ id <> #{id} ]]>
</if>