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

    <resultMap id="dmatableMap" type="com.tofly.xrtygis.entity.Dmatable">
        <id property="id" column="ID"/>
        <result property="usfl" column="USFL"/>
<!--        <result property="schCode" column="SCH_CODE"/>-->
        <result property="sch" column="SCH"/>
<!--        <result property="schName" column="SCH_NAME"/>-->
<!--        <result property="bore" column="BORE"/>-->
<!--        <result property="phenotype" column="PHENOTYPE"/>-->
<!--        <result property="factory" column="FACTORY"/>-->
        <result property="minFlow" column="MIN_FLOW"/>
        <result property="isflow" column="ISFLOW"/>
        <result property="ispress" column="ISPRESS"/>
<!--        <result property="address" column="ADDRESS"/>-->
<!--        <result property="lgtd" column="LGTD"/>-->
<!--        <result property="lttd" column="LTTD"/>-->
        <result property="createUser" column="CREATE_USER"/>
        <result property="createTime" column="CREATE_TIME"/>
        <association property="bore" column="SCH" select="getBore"/>
        <association property="schCode" column="SCH" select="getSchCode"/>
        <association property="schName" column="SCH" select="getSchName"/>
        <association property="phenotype" column="SCH" select="getPhenotype"/>
        <association property="factory" column="SCH" select="getFactory"/>
        <association property="address" column="SCH" select="getAddress"/>
        <association property="lgtd" column="SCH" select="getX"/>
        <association property="lttd" column="SCH" select="getY"/>
        <association property="createUserName" column="CREATE_USER"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"/>
    </resultMap>

    <select id="getBore" resultType="string">
        select BORE
        from TF_DEVICE_ARCHIVE_MANAGE
        where to_char(ID) = #{sch}
    </select>
    <select id="getSchCode" resultType="string">
        select CODE
        from TF_DEVICE_ARCHIVE_MANAGE
        where to_char(ID) = #{sch}
    </select>

    <select id="getSchName" resultType="string">
        select NAME
        from TF_DEVICE_ARCHIVE_MANAGE
        where to_char(ID) = #{sch}
    </select>

    <select id="getPhenotype" resultType="string">
        select MODEL_SPECIFICATION
        from TF_DEVICE_ARCHIVE_MANAGE
        where to_char(ID) = #{sch}
    </select>

    <select id="getFactory" resultType="string">
        select MANUFACTURER
        from TF_DEVICE_ARCHIVE_MANAGE
        where to_char(ID) = #{sch}
    </select>

    <select id="getAddress" resultType="string">
        select ADDRESS
        from TF_DEVICE_ARCHIVE_MANAGE
        where to_char(ID) = #{sch}
    </select>

    <select id="getX" resultType="java.lang.Double">
        select LONGITUDE
        from TF_DEVICE_ARCHIVE_MANAGE
        where to_char(ID) = #{sch}
    </select>

    <select id="getY" resultType="java.lang.Double">
        select LATITUDE
        from TF_DEVICE_ARCHIVE_MANAGE
        where to_char(ID) = #{sch}
    </select>
</mapper>
