<?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.unis.emergencySupportCenter.modular.esEdSceneRecord.mapper.EsEdSceneRecordMapper">

    <select id="selectMyMapsPage"  resultType="com.unis.emergencySupportCenter.modular.esEdSceneRecord.entity.VO.EsEdSceneRecordVO">
        SELECT
        c.id,
        c.es_ed_execution_process_id,
        c.create_time,
        c.create_user,
        c.update_time,
        c.update_user,
        a.drill_theme,
        a.responsible_leader,
        a.responsible_department,
        a.drill_personnel,
        a.drill_process,
        a.drill_content,
        a.attachment
        FROM
        biz_es_ed_process_design a
        INNER JOIN biz_es_ed_execution_process b ON a.id = b.es_ed_process_design_id
        INNER JOIN biz_es_ed_scene_record c ON b.id = c.es_ed_execution_process_id
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where ${ew.sqlSegment}
        </if>
        ORDER BY c.create_time desc
    </select>
    <select id="getDetail" resultType="com.unis.emergencySupportCenter.modular.esEdSceneRecord.entity.VO.EsEdSceneRecordVO">
       SELECT
        c.id,
        c.es_ed_execution_process_id,
        c.create_time,
        c.create_user,
        c.update_time,
        c.update_user,
        a.drill_theme,
        a.responsible_leader,
        a.responsible_department,
        a.drill_personnel,
        a.drill_process,
        a.drill_content,
        a.attachment
        FROM
        biz_es_ed_process_design a
        INNER JOIN biz_es_ed_execution_process b ON a.id = b.es_ed_process_design_id
        INNER JOIN biz_es_ed_scene_record c ON b.id = c.es_ed_execution_process_id
        where c.id  = #{id}
    </select>
</mapper>