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

    <select id="getFeederBaseByStruId" resultType="com.hdkj.lt.bf.entity.FeederBase">
        SELECT d.psr_id psrId ,
        d.name name,
        d.maint_org maintOrg,
        su.stru_id struId
        from SYS_STRU su inner join dwd_shb_ds_feeder_base d
        on d.maint_org = su.ISC_ORG_ID
        where
        d.pub_priv_flag = '0'
        and d.deploy_state ='20'
        and d.del_flag ='0'
        and su.del_flag='0'
        and su.stru_id in
        <foreach collection="struIdList" open="(" item="struId" separator="," close=")">
            #{struId}
        </foreach>
    </select>

    <select id="getFeederSwitchListById" resultType="com.hdkj.lt.core.bizms.modle.po.FeederTopo">
        select feeder, psr_id, `name`, start_kg_id, start_kg_name, normal_open, zxfz_type
        from t_feeder_topo where ifnull(normal_open,'false') != 'true'
        and psr_type in <foreach collection = 'kgPsrTypes' item = 'item' open = "('PD_31100000'," separator = ',' close = ')'>#{item}</foreach>
        and feeder in <foreach collection = 'lindIds' item = 'item' open = '(' separator = ',' close = ')'>#{item}</foreach>
    </select>
    <select id="getStationName" resultType="java.lang.String">
        SELECT DISTINCT sszf_name
        FROM t_feeder_topo
        WHERE psr_id = #{psrId}
    </select>
</mapper>
