<?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="com.its.vms.dao.mapper.VmsAtmpMapper">

    <select id="selectVmsAtmpInfo" resultType="com.its.vms.dto.TbVmsAtmpDto">
    <![CDATA[
        select t1.atmp_sttn_nmbr AS atmpSttnNmbr,
               t1.atmp_sttn_nm   AS atmpSttnNm,
               t1.vms_disp_nm    AS vmsDispNm,
               t1.del_yn         AS delYn,
               nvl(trim(t2.msrm_dt), '')         AS msrmDt,
               nvl(trim(t2.msrm_syst_nm), '0')   AS msrmSystNm,
               nvl(trim(t2.co_val), '0')         AS coVal,
               nvl(trim(t2.so2_val), '0')        AS so2Val,
               nvl(trim(t2.no2_val), '0')        AS no2Val,
               nvl(trim(t2.o3_val), '0')         AS o3Val,
               nvl(trim(t2.pm10_val), '0')       AS pm10Val,
               nvl(trim(t2.pm10_24hh_val), '0')  AS pm1024hhVal,
               nvl(trim(t2.pm25_val), '0')       AS pm25Val,
               nvl(trim(t2.pm25_24hh_val), '0')  AS pm2524hhVal,
               nvl(trim(t2.intg_atmp_val), '0')  AS intgAtmpVal,
               nvl(trim(t2.intg_atmp_grad), '0') AS intgAtmpGrad,
               nvl(trim(t2.so2_grad), '0')       AS so2Grad,
               nvl(trim(t2.co_grad), '0')        AS coGrad,
               nvl(trim(t2.o3_grad), '0')        AS o3Grad,
               nvl(trim(t2.no2_grad), '0')       AS no2Grad,
               nvl(trim(t2.pm10_24hh_grad), '0') AS pm1024hhGrad,
               nvl(trim(t2.pm25_24hh_grad), '0') AS pm2524hhGrad,
               nvl(trim(t2.pm10_1hh_grad), '0')  AS pm101hhGrad,
               nvl(trim(t2.pm25_1hh_grad), '0')  AS pm251hhGrad,
               nvl(trim(t2.updt_dt), '')         AS updtDt
        from tb_atmp_pltn_sttn t1
         left outer join tb_atmp_pltn_rt_pnst t2
         on t1.atmp_sttn_nmbr = t2.atmp_sttn_nmbr
         and t2.msrm_dt >= to_char(sysdate-120/1440, 'YYYYMMDDHH24MISS')
        ]]>
    </select>

</mapper>
