<?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.tofly.xrtygis.mapper.WarnMapper">

    <resultMap id="warnMap" type="com.tofly.xrtygis.entity.Warn">
        <id property="id" column="ID"/>
        <result property="itcd" column="ITCD"/>
        <result property="warnType" column="WARN_TYPE"/>
        <result property="isloc" column="ISLOC"/>
        <result property="notes" column="NOTES"/>
        <result property="address" column="ADDRESS"/>
        <result property="duration" column="DURATION"/>
        <result property="num" column="NUM"/>
        <result property="isconfirm" column="ISCONFIRM"/>
        <result property="isclear" column="ISCLEAR"/>
        <result property="confirmTime" column="CONFIRM_TIME"/>
        <result property="confirmUser" column="CONFIRM_USER"/>
        <result property="scadaTime" column="SCADA_TIME"/>
        <result property="createTime" column="CREATE_TIME"/>
        <association property="warnTypeName" column="WARN_TYPE"
                     select="getWarnTypeName"/>
        <association property="confirmUserName" column="CONFIRM_USER"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"/>
    </resultMap>

    <select id="getWarnTypeName" resultType="string">
        select CNAME from TF_YWPN_SYSCHILDCODE_D where PCID = 845 and CCODE = #{warnType}
    </select>

</mapper>
