介绍两种可行方法:

1.转义法

大于:> 相当于 >

小于:&lt; 相当于 <

大于等于:&gt;= 相当于 >=

小于等于:&lt;= 相当于 <=

2. <![CDATA[ sql语句

]]>

<select id="selectByTime" resultType="Date" parameterType="map">
    SELECT
    stop_time
    FROM
    test    <![CDATA[
    WHERE  UNIX_TIMESTAMP(stop_time) >= UNIX_TIMESTAMP(#{startTime})
    AND UNIX_TIMESTAMP(stop_time) <= UNIX_TIMESTAMP(#{endTime}) ]]>
</select>


或者

<select id="selectByTime" resultType="Date" parameterType="map">
    SELECT
    stop_time
    FROM
    test   
    WHERE  UNIX_TIMESTAMP(stop_time) <![CDATA[ >= ]]> UNIX_TIMESTAMP(#{startTime})
    AND UNIX_TIMESTAMP(stop_time) <![CDATA[ <= ]]>  UNIX_TIMESTAMP(#{endTime}) 
</select>


Q.E.D.