mybaits的xxMapper.xml文件中大于号和小于号处理

    xiaoxiao2021-03-25  103

    mybaits的xxMapper.xml文件中大于号和小于号处理

    07net01.com 发布于 2014-09-11 09:21:24分类:IT技术阅读(593)评论

    用了转义字符把>和<替换掉。 mapper文件示例代码:

    <select id="selectMonthAdvertise" resultMap="ResultMap"> select * from ad_n_advertise_t where user_id in <foreach item="item" index="index" collection="userIdList" open="(" separator="," close=")"> #{item} </foreach> and isdelete=#{isdelete,jdbcType=TINYINT} and date_sub(curdate(), INTERVAL 30 DAY) <= date(crt_time) order by crt_time desc </select>

    附:转义字符表。

    < < 小于号 > > 大于号 & & ' 单引号   " " 双引号
    转载请注明原文地址: https://ju.6miu.com/read-25943.html

    最新回复(0)