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

    <resultMap id="tfPipeMaterialConfigMap" type="com.tofly.xrtygis.entity.TfPipeMaterialConfig">
        <id property="id" column="ID"/>
        <result property="materialCode" column="MATERIAL_CODE"/>
        <result property="materialValue" column="MATERIAL_VALUE"/>
        <result property="noticeUser" column="NOTICE_USER"/>
        <result property="remark" column="REMARK"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="updateUser" column="UPDATE_USER"/>
        <result property="updateTime" column="UPDATE_TIME"/>
        <association property="materialName" column="MATERIAL_CODE"
                     select="getMaterialName"></association>
        <association property="createUserName" column="CREATE_USER"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"></association>
        <association property="updateUserName" column="UPDATE_USER"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"></association>
    </resultMap>

    <select id="getMaterialName" resultType="string">
        select cname from TF_YWPN_SYSCHILDCODE_D
        where pcid=66402 and ccode=#{materialCode}

    </select>

</mapper>
