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

    <resultMap id="checkhistoryMap" type="com.tofly.pojo.plan.Checkhistory">
        <id property="id" column="ID"/>
        <result property="type" column="TYPE"/>
        <result property="checkId" column="CHECK_ID"/>
        <result property="auditResult" column="AUDIT_RESULT"/>
        <result property="auditNotes" column="AUDIT_NOTES"/>
        <result property="auditUser" column="AUDIT_USER"/>
        <result property="auditTime" column="AUDIT_TIME"/>
    </resultMap>



    <resultMap id="checkhistoryVoMap" type="com.tofly.pojo.plan.vo.CheckhistoryVo">
        <id property="id" column="ID"/>
        <result property="type" column="TYPE"/>
        <result property="checkId" column="CHECK_ID"/>
        <result property="auditResult" column="AUDIT_RESULT"/>
        <result property="auditNotes" column="AUDIT_NOTES"/>
        <result property="auditUser" column="AUDIT_USER"/>
        <result property="auditTime" column="AUDIT_TIME"/>
        <association property="auditResultName" column="AUDIT_RESULT" select="com.tofly.gpsboot.mapper.comm.AuditMapper.getAuditStateName"/>
        <association property="auditUserName" column="AUDIT_USER" select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>
    </resultMap>

    <select id="getCheckHistoryVoList" resultMap="checkhistoryVoMap">
        select * from TF_YWPN_CHECKHISTORY_W where  type = #{type} and CHECK_ID = #{id}
    </select>
</mapper>
