MyBatis xml文件中SQL处理大于、小于号
MyBatis mapper文件是xml文件,需要特殊字符如大于号、小于号后需要转义。
原字符 | 转义后字符 |
< | < |
<= | <= |
> | > |
> | >= |
<select id="queryInfo" parameterType="com.xx" resultType="com.xx.xx">
select * from table where a > #{a,jdbcType=INTEGER} and b < #{b,jdbcType=INTEGER}
</select>