where条件中大于号和小于号需要用  <![CDATA[  ]]> 包起来(当然也可以用转义字符,但是感觉还是直接包起来直观明了)

1.Mapper接口文件:

 List<String> func1(@Param("maxSeconds")Integer seconds);

2.xml文件:

    <select id="func1" resultType="java.lang.String">
        SELECT t.thesis_id
        FROM thesis t
        <where> 
       timestampdiff(SECOND,t.update_time,NOW()) <![CDATA[ >  ]]> #{maxSeconds}
        </where>
    </select>

 

相关文章: