| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <?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.DwdShbDsSwitchBaseMapper">
- <select id="getSwitchInfoPageByCondition" resultType="com.hdkj.lt.bf.entity.vo.SwitchInfoVO">
- select DISTINCT
- a.psr_Id switchId,
- a.name switchName,
- a.switch_role_name switchRoleName,
- a.feeder_name feederName,
- s.short_name maintOrgName,
- a.station_name stationName,
- c.oc1_value oc1Value,
- c.oc1_delay oc1Delay,
- c.oc1_setting oc1Setting,
- c.oc2_value oc2Value,
- c.oc2_delay oc2Delay,
- c.oc2_setting oc2Setting,
- c.oc3_value oc3Value,
- c.oc3_delay oc3Delay,
- c.oc3_setting oc3Setting,
- c.prot_enable_status protEnableStatus,
- c.reclose_enable_status recloseEnableStatus,
- c.hazard_type hazardType,
- c.hazard_desc hazardDesc,
- if(d.id is null ,'0','1') isContactSwitch,
- case
- when d.id is null then null
- when d.llsb_type = '0' then '0'
- when d.llsb_type = '1' then '0'
- when d.llsb_type = '2' then '1'
- when d.llsb_type = '3' then '1'
- else null
- end contactEffective
- from dwd_shb_ds_switch_base a
- left join fhzg_switch_protection_settings c on a.psr_id = c.device_prs_id
- left join t_disable_llkg_config d on a.psr_id= d.llsb_id
- left join sys_dept s on a.maint_org = s.isc_org_id
- <where>
- a.pub_priv_flag = '0' and a.psr_state = '20'
- <if test="params.feederName != null and params.feederName != ''">
- AND a.feeder_name LIKE CONCAT('%',#{params.feederName},'%')
- </if>
- <if test="params.feederId != null and params.feederId != ''">
- AND a.feeder = #{params.feederId}
- </if>
- <if test="params.switchName != null and params.switchName != ''">
- AND a.name LIKE CONCAT('%',#{params.switchName},'%')
- </if>
- <if test="params.switchId != null and params.switchId != ''">
- AND a.psr_id LIKE CONCAT('%',#{params.switchId},'%')
- </if>
- <if test="params.maintOrg != null and params.maintOrg != ''">
- AND a.maint_org = #{params.maintOrg}
- </if>
- <if test='params.isContactSwitch == "0" '>
- AND d.id is null
- </if>
- <if test='params.isContactSwitch == "1" '>
- AND d.id is not null
- </if>
- <if test='params.contactEffective == "0" '>
- AND d.llsb_type in ('0','1')
- </if>
- <if test='params.contactEffective == "1" '>
- AND d.llsb_type in ('2','3')
- </if>
- <if test="params.hazardType != null and params.hazardType != ''">
- AND c.hazard_type = #{params.hazardType}
- </if>
- </where>
- order by a.psr_id desc
- </select>
- <select id="getSwitchInfoByCondition" resultType="com.hdkj.lt.bf.entity.vo.SwitchInfoVO">
- select DISTINCT
- a.psr_Id switchId,
- a.name switchName,
- a.switch_role_name switchRoleName,
- a.feeder_name feederName,
- s.ORGAN_ALIAS maintOrgName,
- a.station_name stationName,
- c.oc1_value oc1Value,
- c.oc1_delay oc1Delay,
- c.oc1_setting oc1Setting,
- c.oc2_value oc2Value,
- c.oc2_delay oc2Delay,
- c.oc2_setting oc2Setting,
- c.oc3_value oc3Value,
- c.oc3_delay oc3Delay,
- c.oc3_setting oc3Setting,
- c.prot_enable_status protEnableStatus,
- c.reclose_enable_status recloseEnableStatus,
- c.hazard_type hazardType,
- c.hazard_desc hazardDesc,
- if(d.id is null ,'0','1') isContactSwitch,
- case
- when d.id is null then null
- when d.llsb_type = '0' then '0'
- when d.llsb_type = '1' then '0'
- when d.llsb_type = '2' then '1'
- when d.llsb_type = '3' then '1'
- else null
- end contactEffective
- from dwd_shb_ds_switch_base a
- left join fhzg_switch_protection_settings c on a.psr_id = c.device_prs_id
- left join t_disable_llkg_config d on a.psr_id= d.llsb_id
- left join SYS_STRU s on a.maint_org = s.ISC_ORG_ID
- <where>
- a.pub_priv_flag = '0' and a.psr_state = '20'
- <if test="params.feederName != null and params.feederName != ''">
- AND a.feeder_name LIKE CONCAT('%',#{params.feederName},'%')
- </if>
- <if test="params.feederId != null and params.feederId != ''">
- AND a.feeder = #{params.feederId}
- </if>
- <if test="params.switchName != null and params.switchName != ''">
- AND a.name LIKE CONCAT('%',#{params.switchName},'%')
- </if>
- <if test="params.switchId != null and params.switchId != ''">
- AND a.psr_id LIKE CONCAT('%',#{params.switchId},'%')
- </if>
- <if test="params.maintOrg != null and params.maintOrg != ''">
- AND a.maint_org = #{params.maintOrg}
- </if>
- <if test='params.isContactSwitch == "0" '>
- AND d.id is null
- </if>
- <if test='params.isContactSwitch == "1" '>
- AND d.id is not null
- </if>
- <if test='params.contactEffective == "0" '>
- AND d.llsb_type in ('0','1')
- </if>
- <if test='params.contactEffective == "1" '>
- AND d.llsb_type in ('2','3')
- </if>
- <if test="params.hazardType != null and params.hazardType != ''">
- AND c.hazard_type = #{params.hazardType}
- </if>
- </where>
- order by a.psr_id desc
- </select>
- <select id="getSwitchListByFeederId" resultType="com.hdkj.lt.bf.entity.vo.FeederSwitchInfoVO">
- select psr_id,
- pid,
- psr_type,
- name
- from t_feeder_topo
- where feeder = #{feederId}
- </select>
- <select id="getStartSwitchInfoByFeederId" resultType="com.hdkj.lt.bf.entity.vo.FeederSwitchInfoVO">
- select psr_id,
- pid,
- psr_type,
- name
- from t_feeder_topo
- where feeder = #{feederId}
- and is_start_kg = 1
- </select>
- <select id="getSwitchAndTransformerList" resultType="com.hdkj.lt.bf.entity.vo.SwitchOrTransformerVO">
- select distinct(a.psr_id),a.name as switchOrTransformerName,a.psr_type
- from t_feeder_topo a
- left join fhzg_dist_line_switch_section_show b ON a.psr_id=b.psr_id
- where a.feeder = #{feeder}
- and name LIKE CONCAT('%', #{name}, '%')
- and a.psr_type in
- <foreach collection='psrType' item='item' open='(' separator=',' close=')'>
- #{item}
- </foreach>
- </select>
- <select id="getShowSwitch" resultType="com.hdkj.lt.bf.entity.vo.SwitchOrTransformerVO">
- SELECT show_switch_id AS startSwitchId,
- psr_id
- FROM fhzg_dist_line_switch_section_show
- WHERE obj_id = #{feederId}
- and psr_Id = #{psrId}
- </select>
- <select id="getTree" resultType="com.hdkj.lt.bf.entity.dto.TopoDTO">
- SELECT psr_id, pid, feeder, sf_fz_sdkg, normal_open, psr_type
- FROM t_feeder_topo
- where feeder = #{feederId};
- </select>
- </mapper>
|