<?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.TCodStationDataWaterMapper">

    <select id="selectReal" resultType="cn.cecep.talroad.domain.TCodStationDataWater">
        select
            id,
            station_id,
            monitor_time,
            data_type,
            water_level,
            cod,
            ammonia_nitrogen,
            total_nitrogen,
            total_phosphorus
        from t_cod_station_data_water_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>
