DwdShbDsSwitchBaseMapper.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.hdkj.lt.bf.mapper.DwdShbDsSwitchBaseMapper">
  6. <select id="getSwitchInfoPageByCondition" resultType="com.hdkj.lt.bf.entity.vo.SwitchInfoVO">
  7. select DISTINCT
  8. a.psr_Id switchId,
  9. a.name switchName,
  10. a.switch_role_name switchRoleName,
  11. a.feeder_name feederName,
  12. s.short_name maintOrgName,
  13. a.station_name stationName,
  14. c.oc1_value oc1Value,
  15. c.oc1_delay oc1Delay,
  16. c.oc1_setting oc1Setting,
  17. c.oc2_value oc2Value,
  18. c.oc2_delay oc2Delay,
  19. c.oc2_setting oc2Setting,
  20. c.oc3_value oc3Value,
  21. c.oc3_delay oc3Delay,
  22. c.oc3_setting oc3Setting,
  23. c.prot_enable_status protEnableStatus,
  24. c.reclose_enable_status recloseEnableStatus,
  25. c.hazard_type hazardType,
  26. c.hazard_desc hazardDesc,
  27. if(d.id is null ,'0','1') isContactSwitch,
  28. case
  29. when d.id is null then null
  30. when d.llsb_type = '0' then '0'
  31. when d.llsb_type = '1' then '0'
  32. when d.llsb_type = '2' then '1'
  33. when d.llsb_type = '3' then '1'
  34. else null
  35. end contactEffective
  36. from dwd_shb_ds_switch_base a
  37. left join fhzg_switch_protection_settings c on a.psr_id = c.device_prs_id
  38. left join t_disable_llkg_config d on a.psr_id= d.llsb_id
  39. left join sys_dept s on a.maint_org = s.isc_org_id
  40. <where>
  41. a.pub_priv_flag = '0' and a.psr_state = '20'
  42. <if test="params.feederName != null and params.feederName != ''">
  43. AND a.feeder_name LIKE CONCAT('%',#{params.feederName},'%')
  44. </if>
  45. <if test="params.feederId != null and params.feederId != ''">
  46. AND a.feeder = #{params.feederId}
  47. </if>
  48. <if test="params.switchName != null and params.switchName != ''">
  49. AND a.name LIKE CONCAT('%',#{params.switchName},'%')
  50. </if>
  51. <if test="params.switchId != null and params.switchId != ''">
  52. AND a.psr_id LIKE CONCAT('%',#{params.switchId},'%')
  53. </if>
  54. <if test="params.maintOrg != null and params.maintOrg != ''">
  55. AND a.maint_org = #{params.maintOrg}
  56. </if>
  57. <if test='params.isContactSwitch == "0" '>
  58. AND d.id is null
  59. </if>
  60. <if test='params.isContactSwitch == "1" '>
  61. AND d.id is not null
  62. </if>
  63. <if test='params.contactEffective == "0" '>
  64. AND d.llsb_type in ('0','1')
  65. </if>
  66. <if test='params.contactEffective == "1" '>
  67. AND d.llsb_type in ('2','3')
  68. </if>
  69. <if test="params.hazardType != null and params.hazardType != ''">
  70. AND c.hazard_type = #{params.hazardType}
  71. </if>
  72. </where>
  73. order by a.psr_id desc
  74. </select>
  75. <select id="getSwitchInfoByCondition" resultType="com.hdkj.lt.bf.entity.vo.SwitchInfoVO">
  76. select DISTINCT
  77. a.psr_Id switchId,
  78. a.name switchName,
  79. a.switch_role_name switchRoleName,
  80. a.feeder_name feederName,
  81. s.ORGAN_ALIAS maintOrgName,
  82. a.station_name stationName,
  83. c.oc1_value oc1Value,
  84. c.oc1_delay oc1Delay,
  85. c.oc1_setting oc1Setting,
  86. c.oc2_value oc2Value,
  87. c.oc2_delay oc2Delay,
  88. c.oc2_setting oc2Setting,
  89. c.oc3_value oc3Value,
  90. c.oc3_delay oc3Delay,
  91. c.oc3_setting oc3Setting,
  92. c.prot_enable_status protEnableStatus,
  93. c.reclose_enable_status recloseEnableStatus,
  94. c.hazard_type hazardType,
  95. c.hazard_desc hazardDesc,
  96. if(d.id is null ,'0','1') isContactSwitch,
  97. case
  98. when d.id is null then null
  99. when d.llsb_type = '0' then '0'
  100. when d.llsb_type = '1' then '0'
  101. when d.llsb_type = '2' then '1'
  102. when d.llsb_type = '3' then '1'
  103. else null
  104. end contactEffective
  105. from dwd_shb_ds_switch_base a
  106. left join fhzg_switch_protection_settings c on a.psr_id = c.device_prs_id
  107. left join t_disable_llkg_config d on a.psr_id= d.llsb_id
  108. left join SYS_STRU s on a.maint_org = s.ISC_ORG_ID
  109. <where>
  110. a.pub_priv_flag = '0' and a.psr_state = '20'
  111. <if test="params.feederName != null and params.feederName != ''">
  112. AND a.feeder_name LIKE CONCAT('%',#{params.feederName},'%')
  113. </if>
  114. <if test="params.feederId != null and params.feederId != ''">
  115. AND a.feeder = #{params.feederId}
  116. </if>
  117. <if test="params.switchName != null and params.switchName != ''">
  118. AND a.name LIKE CONCAT('%',#{params.switchName},'%')
  119. </if>
  120. <if test="params.switchId != null and params.switchId != ''">
  121. AND a.psr_id LIKE CONCAT('%',#{params.switchId},'%')
  122. </if>
  123. <if test="params.maintOrg != null and params.maintOrg != ''">
  124. AND a.maint_org = #{params.maintOrg}
  125. </if>
  126. <if test='params.isContactSwitch == "0" '>
  127. AND d.id is null
  128. </if>
  129. <if test='params.isContactSwitch == "1" '>
  130. AND d.id is not null
  131. </if>
  132. <if test='params.contactEffective == "0" '>
  133. AND d.llsb_type in ('0','1')
  134. </if>
  135. <if test='params.contactEffective == "1" '>
  136. AND d.llsb_type in ('2','3')
  137. </if>
  138. <if test="params.hazardType != null and params.hazardType != ''">
  139. AND c.hazard_type = #{params.hazardType}
  140. </if>
  141. </where>
  142. order by a.psr_id desc
  143. </select>
  144. <select id="getSwitchListByFeederId" resultType="com.hdkj.lt.bf.entity.vo.FeederSwitchInfoVO">
  145. select psr_id,
  146. pid,
  147. psr_type,
  148. name
  149. from t_feeder_topo
  150. where feeder = #{feederId}
  151. </select>
  152. <select id="getStartSwitchInfoByFeederId" resultType="com.hdkj.lt.bf.entity.vo.FeederSwitchInfoVO">
  153. select psr_id,
  154. pid,
  155. psr_type,
  156. name
  157. from t_feeder_topo
  158. where feeder = #{feederId}
  159. and is_start_kg = 1
  160. </select>
  161. <select id="getSwitchAndTransformerList" resultType="com.hdkj.lt.bf.entity.vo.SwitchOrTransformerVO">
  162. select distinct(a.psr_id),a.name as switchOrTransformerName,a.psr_type
  163. from t_feeder_topo a
  164. left join fhzg_dist_line_switch_section_show b ON a.psr_id=b.psr_id
  165. where a.feeder = #{feeder}
  166. and name LIKE CONCAT('%', #{name}, '%')
  167. and a.psr_type in
  168. <foreach collection='psrType' item='item' open='(' separator=',' close=')'>
  169. #{item}
  170. </foreach>
  171. </select>
  172. <select id="getShowSwitch" resultType="com.hdkj.lt.bf.entity.vo.SwitchOrTransformerVO">
  173. SELECT show_switch_id AS startSwitchId,
  174. psr_id
  175. FROM fhzg_dist_line_switch_section_show
  176. WHERE obj_id = #{feederId}
  177. and psr_Id = #{psrId}
  178. </select>
  179. <select id="getTree" resultType="com.hdkj.lt.bf.entity.dto.TopoDTO">
  180. SELECT psr_id, pid, feeder, sf_fz_sdkg, normal_open, psr_type
  181. FROM t_feeder_topo
  182. where feeder = #{feederId};
  183. </select>
  184. </mapper>