<?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.hdkj.lt.bf.mapper.FhzgFaultSwitchInfoListMapper">

    <resultMap id="BaseResultMap" type="com.hdkj.lt.core.bizms.modle.po.fault.FhzgFaultSwitchInfoList">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="faultId" column="fault_id" jdbcType="BIGINT"/>
        <result property="allSwitchInfoListJson" column="all_switch_info_list_json" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        id
        ,fault_id,all_switch_info_list_json
    </sql>
    <select id="querySectionsSwitchByFaultId" resultType="com.hdkj.lt.bf.entity.vo.FhzgFaultPowerCutSectionVO">
        select pc.fault_no, pc.id fault_id, pc.fault_source, pc.power_on_success,
               cs.start_switch, cs.end_switch,
               pc.create_time, pc.section_status, pc.scheme_create_time, pc.scheme_create_duration
        from
            fhzg_fault_power_cut pc
                INNER JOIN fhzg_fault_power_cut_switch cs on cs.fault_id=pc.id
        <where>
            cs.fault_id in
            <foreach collection="faultIdList" open="(" item="faultId" separator="," close=")">
                #{faultId}
            </foreach>
        </where>
    </select>

</mapper>
