jinpengyong
2020-10-09 c60311f48e7ec07c56a4df31536f795ba62751ce
src/main/resources/mapper/AQIMapper.xml
@@ -24,6 +24,13 @@
        </foreach>
    </select>
    <select id="getO3ByTime" resultType="java.lang.String">
        select ifnull(aqi_json->'$.O3C',aqi_json->'$.O3') as 'O3'
        from hangzhou_aqi
        where city_code=#{cityCode}
        and DATE_FORMAT(time, #{typeFormat})=#{time}
    </select>
    <select id="getAqiByHour" resultType="java.util.Map">
        select DATE_FORMAT(time, '%Y-%m-%d %H:%i:%s') time,
        value
@@ -31,4 +38,11 @@
        where city_code=#{cityCode}
        and DATE_FORMAT(time, '%Y%H')=#{yearAndHour}
    </select>
    <select id="getO3FromHistory" resultType="java.lang.String">
        select value ->'$.O3C' as 'O3'
        from history_aqi_${timeUnits}
        where city_code=#{cityCode}
        and DATE_FORMAT(time, #{typeFormat})=#{time}
    </select>
</mapper>