From e68142dd60447fce6eb7cc251811c6b13311d3bc Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 26 四月 2023 14:49:44 +0800 Subject: [PATCH] 1 --- src/main/resources/mapping/WeatherMapper.xml | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/resources/mapping/WeatherMapper.xml b/src/main/resources/mapping/WeatherMapper.xml index 2ad757f..d7cf6e7 100644 --- a/src/main/resources/mapping/WeatherMapper.xml +++ b/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> -- Gitblit v1.9.3