jinpengyong
2020-08-05 6956fffa1f06b01375081689c5da5a23a30963db
src/main/resources/mapper/ForecastWeatherMapper.xml
@@ -7,7 +7,7 @@
    <select id="getForecastHour" resultType="java.util.Map">
        SELECT
        DATE_FORMAT(time, #{typeFormat}) time,
        (case when result is null then json->'$.tem' else result end) result
        (case when result is null then json->'$.temp' else result end) result
        from forecast_weather
        where time >= #{start}
        AND time <![CDATA[<]]> #{end}
@@ -30,4 +30,16 @@
        where monitor_point_id=#{monitorPointId}
        and time=#{time}
    </update>
    <select id="getPrecip6Hour" resultType="java.util.Map">
    select
    round(sum(json->'$.precip'),2) 'precip6'
    FROM
    forecast_weather
    WHERE
    time >= #{start}
    AND time <![CDATA[<]]> #{end}
    AND monitor_point_id = #{monitorPointId}
    </select>
</mapper>