燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2024-03-27 9d3afe6ccb9cabe5d0f8ce86dfbf81a82f989962
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}