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

    <resultMap id="scadastaitemMap" type="com.tofly.xrtygis.entity.Scadastaitem">
        <id property="id" column="ID"/>
        <result property="itcd" column="ITCD"/>
        <result property="itnm" column="ITNM"/>
        <result property="unit" column="UNIT"/>
        <result property="itty" column="ITTY"/>
        <result property="precision" column="PRECISION"/>
        <result property="upLimit" column="UP_LIMIT"/>
        <result property="downLimit" column="DOWN_LIMIT"/>
        <result property="upNotes" column="UP_NOTES"/>
        <result property="downNotes" column="DOWN_NOTES"/>
        <result property="iscalcPass" column="ISCALC_PASS"/>
        <result property="passStandard" column="PASS_STANDARD"/>
        <result property="iscalcQuality" column="ISCALC_QUALITY"/>
        <result property="qualityStandard" column="QUALITY_STANDARD"/>
        <result property="stationId" column="STATION_ID"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="state" column="STATE"/>
        <result property="description" column="DESCRIPTION"/>
        <result property="tycd" column="TYCD"/>
        <result property="name" column="NAME"/>
        <result property="num" column="NUM"/>
        <association property="stationName" column="STATION_ID"
                     select="com.tofly.xrtygis.mapper.ScadastationMapper.stationName"/>
        <association property="createUserName" column="CREATE_USER"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"/>
        <association property="tynm" column="TYCD"
                     select="getTypeName"/>
    </resultMap>

    <select id="getTypeName" resultType="string">
        select cname from TF_YWPN_SYSCHILDCODE_D where pcid = 403 and ccode = #{tycd}
    </select>

</mapper>
