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>
