<?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.testor.module.emergency.dao.TContingencyPlanRecordDao">
    <!-- 开启二级缓存 -->
    <!-- <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> -->
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.testor.module.emergency.model.domain.TContingencyPlanRecord">
        <id column="record_content" property="recordContent"/>
        <id column="record_time" property="recordTime"/>
        <id column="accessory_name" property="accessoryName"/>
        <id column="accessory_path" property="accessoryPath"/>
        <id column="plan_id" property="planId"/>
        <id column="accessory_id" property="accessoryId"/>
        <id column="id" property="id"/>
        <id column="org_id" property="orgId"/>
    </resultMap>
    <select id="getEditHistory" resultType="com.testor.module.emergency.model.vo.TContingencyPlanRecordVO">
        select
            a.record_content,
            a.record_time,
            a.accessory_name,
            a.accessory_path,
            a.plan_id,
            a.accessory_id,
            a.org_id,
            a.id ,
            a.update_date,
            b.user_name as orgName
        from t_contingency_plan_record a left join t_sys_user b on a.create_by = b.user_id
        where a.status = 0 and  a.plan_id = #{id}
    </select>
</mapper>