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

  <resultMap id="tfYwpnStationReportMap" type="com.tofly.pojo.plan.TfYwpnStationReport">
                <id property="id" column="id"/>
                    <result property="createTime" column="create_time"/>
                      <result property="createUser" column="create_user"/>
                      <result property="planFactoryId" column="plan_factory_id"/>
                      <result property="isReport" column="is_report"/>
                      <result property="reportUserIds" column="report_user_ids"/>
                      <result property="reportUserNames" column="report_user_names"/>
                      <result property="reportContent" column="report_content"/>
                      <result property="deptId" column="dept_id"/>
      <association property="createUserName" column="CREATE_USER" select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>
      <association property="deptName" column="dept_id" select="getDeptName"/>
    </resultMap>

    <select id="getDeptName"  resultType="java.lang.String">
        select NAME deptName
        from tf_smpn_department_x
        where ID = #{id}
    </select>

                                            
</mapper>
