<?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.gpsboot.mapper.fill.FillWaterMapper">

    <resultMap id="fillWaterMap" type="com.tofly.pojo.fill.FillWater">
        <id property="id" column="ID"/>
        <result property="recordTime" column="RECORD_TIME"/>
        <result property="codCr" column="COD_CR"/>
        <result property="bod5" column="BOD5"/>
        <result property="nh3n" column="NH3N"/>
        <result property="ss" column="SS"/>
        <result property="tn" column="TN"/>
        <result property="tp" column="TP"/>
        <result property="ph" column="PH"/>
        <result property="codCrOut" column="COD_CR_OUT"/>
        <result property="bod5Out" column="BOD5_OUT"/>
        <result property="nh3nOut" column="NH3N_OUT"/>
        <result property="ssOut" column="SS_OUT"/>
        <result property="tnOut" column="TN_OUT"/>
        <result property="tpOut" column="TP_OUT"/>
        <result property="phOut" column="PH_OUT"/>
        <result property="fillDept" column="FILL_DEPT"/>
        <result property="belongStationId" column="BELONG_STATION_ID"/>
        <result property="fillTime" column="FILL_TIME"/>
        <result property="fillUser" column="FILL_USER"/>
        <result property="updateTime" column="UPDATE_TIME"/>
        <result property="updateUser" column="UPDATE_USER"/>
        <association property="fillDeptName" column="FILL_DEPT" select="com.tofly.gpsboot.mapper.fill.FillEcMapper.getDName"/>
        <association property="belongStationName" column="BELONG_STATION_ID" select="getBelongStationName"/>
        <association property="fillUserName" column="FILL_USER" select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>
        <association property="updateUserName" column="UPDATE_USER" select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>
    </resultMap>

    <select id="getBelongStationName"  resultType="java.lang.String">
        select name belongStationName
        from tf_ywpn_monitor_stationsiteinfo_w
        where id = #{belongStationId}
    </select>
</mapper>
