<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.cecep.talroad.mapper.TCodStationDataAirMapper">

    <select id="selectReal" resultType="cn.cecep.talroad.domain.TCodStationDataAir">
        select
            id,
            station_id,
            monitor_time,
            data_type,
            aqi,
            pm25,
            pm10,
            so2,
            no2,
            o3,
            co,
            temperature,
            humidity,
            pressure,
            wind_power,
            wind_direction,
            pollutant,
            air_qualityclass,
            tvoc,
            tsp
        from t_cod_station_data_air_real
        <where>
            <if test="stationId != null and stationId != ''">
                AND station_id = #{stationId}
            </if>
            <if test="dataType != null and dataType != ''">
                AND data_type = #{dataType}
            </if>
        </where>
        ORDER BY monitor_time DESC
        limit 1
    </select>

</mapper>
