mybaits xml 特殊转义字符

202 阅读1分钟

>  >  大于号 

> >= 大于等于号

&lt;  <  小于号

&lt;= <= 小于等于

&amp; & 和

&apos; ' 单引号

&quot; " 双引号

<select id="selectCoordinateInfo" resultMap="CoordinateInfo">
    SELECT
    *
    FROM
    user u
    INNER JOIN
    coordinate c
    ON u.id = #{id}
    <if test="start !=null and start != ''">
        and #{start} &lt;= date_format(c.arrival_time, '%Y-%m-%d')
    </if>
    <if test="end !=null and end != ''">
        and date_format(c.arrival_time, '%Y-%m-%d') &lt;= #{end}
    </if>
    AND u.id = c.id;
</select>