Mybatis在Mapper.xml使用转义字符替代大于号小于号的方法

版权声明:本文由洛北辰南原创,转载请注明原创地址,谢谢。 https://blog.csdn.net/qq_18941713/article/details/87936944

记录一下,怕忘了

转义字符替代">“和”<"。

mapper文件示例代码:

即 select * from project where id > 'id'
<select id="GetList" parameterType="com.dsp.model.Project" resultType="com.model.Project">
    select *
    from project
    where id &gt; #{id,jdbcType=INTEGER}
</select>
即 select * from project where id < 'id'
<select id="GetList" parameterType="com.dsp.model.Project" resultType="com.model.Project">
    select *
    from project
    where id &lt; #{id,jdbcType=INTEGER}
</select>

附:XML转义字符

![在这里插入图片描述](https://img-blog.csdnimg.cn/201902261600292.png

猜你喜欢

转载自blog.csdn.net/qq_18941713/article/details/87936944