src/main/resources/mapping/WeatherMapper.xml
@@ -13,12 +13,13 @@ <select id="query" resultMap="WeatherResult"> select * from yssh_weather <where> <if test="begin != null and begin != ''"> and Time >= #{begin} </if> <if test="end != null and end != ''"> and Time <= #{end} </if> 1 = 1 <if test="begin != null"> and str_to_date(time, '%Y-%m-%d-%H:%i:%S') >= #{begin} </if> <if test="end != null"> and str_to_date(time, '%Y-%m-%d-%H:%i:%S') <= #{end} </if> </where> </select>