From 9d3afe6ccb9cabe5d0f8ce86dfbf81a82f989962 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 27 三月 2024 11:00:20 +0800 Subject: [PATCH] 添加缓存设置 --- src/main/resources/mapper/WeatherMapper.xml | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/src/main/resources/mapper/WeatherMapper.xml b/src/main/resources/mapper/WeatherMapper.xml index 3f32373..9eacbe3 100644 --- a/src/main/resources/mapper/WeatherMapper.xml +++ b/src/main/resources/mapper/WeatherMapper.xml @@ -9,11 +9,20 @@ <id column="weather_condition" property="weatherCondition" javaType="java.lang.String" jdbcType="VARCHAR"/> <id column="temperature" property="temperature" javaType="java.lang.String" jdbcType="VARCHAR"/> </resultMap> - + <select id="query" resultMap="WeatherResult"> select id, time, format(wind_speed, 2) "wind_speed", wind_direction, weather_condition, format(temperature, 2) "temperature" from yssh_weather <where> + time between #{begin} and #{end} + </where> + order by time; + </select> + + <select id="query2" resultMap="WeatherResult"> + select id, time, format(wind_speed, 2) "wind_speed", wind_direction, weather_condition, format(temperature, 2) "temperature" + from yssh_weather + <where> 1 = 1 <if test="begin != null"> and str_to_date(time, '%Y-%m-%d-%H:%i:%S') >= #{begin} -- Gitblit v1.9.3