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

    <resultMap id="planyeardetailMap" type="com.tofly.pojo.plan.Planyeardetail">
        <id property="id" column="ID"/>
        <result property="yearId" column="YEAR_ID"/>
        <result property="year" column="YEAR"/>
        <result property="month" column="MONTH"/>
        <result property="planContent" column="PLAN_CONTENT"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="inspectTypeId" column="INSPECT_TYPE_ID"/>
        <association property="inspectTypeName" column="INSPECT_TYPE_ID" select="getInspectTypeName"/>
        <association property="createUserName" column="CREATE_USER"
                     select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>
    </resultMap>

        <select id="getInspectTypeName" resultType="string">
            select name as typeName from TF_YWPN_INSPECTTYPE_W where id = #{inspectTypeId}
        </select>

    <select id="getPlanYearDetailVoList" resultMap="planyeardetailMap">
        select * from  TF_YWPN_PLANYEARDETAIL_W where  YEAR_ID = #{id}
    </select>
</mapper>
