<?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.plan.PlanyearMapper">

    <resultMap id="planyearMap" type="com.tofly.pojo.plan.Planyear">
        <id property="id" column="ID"/>
        <result property="year" column="YEAR"/>
        <result property="issubmit" column="ISSUBMIT"/>
        <result property="submitTime" column="SUBMIT_TIME"/>
        <result property="submitUser" column="SUBMIT_USER"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="planYearName" column="PLAN_YEAR_NAME"/>
        <result property="planState" column="PLAN_STATE"/>
        <result property="note" column="NOTE"/>
    </resultMap>

    <resultMap id="planyearVoMap" type="com.tofly.pojo.plan.vo.PlanyearVo">
        <id property="id" column="ID"/>
        <result property="year" column="YEAR"/>
        <result property="issubmit" column="ISSUBMIT"/>
        <result property="submitTime" column="SUBMIT_TIME"/>
        <result property="submitUser" column="SUBMIT_USER"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="planYearName" column="PLAN_YEAR_NAME"/>
        <result property="planState" column="PLAN_STATE"/>
        <result property="note" column="NOTE"/>
        <association property="issubmitName" column="ISSUBMIT" select="com.tofly.gpsboot.mapper.maintain.RepairplanMapper.getIssubmitName"/>
        <association property="submitUserName" column="SUBMIT_USER" select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>
        <association property="createUserName" column="CREATE_USER" select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>
        <collection property="auditVoList" column="ID" select="com.tofly.gpsboot.mapper.comm.AuditMapper.getPlanYearAuditVoList"/>
        <collection property="planyeardetailList" column="ID" select="com.tofly.gpsboot.mapper.plan.PlanyeardetailMapper.getPlanYearDetailVoList"/>
    </resultMap>

    <select id="getPlanYearVoList" resultMap="planyearVoMap">
        select * from  TF_YWPN_PLANYEAR_W where id = #{id}
    </select>
</mapper>
