WindplantMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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.ruoyi.predict.mapper.WindplantMapper">
  6. <resultMap type="Windplant" id="WindplantResult">
  7. <result property="windplantNo" column="windplant_no"/>
  8. <result property="companyNo" column="company_no"/>
  9. <result property="loadareaNo" column="loadarea_no"/>
  10. <result property="subcontrolareaNo" column="subcontrolarea_no"/>
  11. <result property="subregionNo" column="subregion_no"/>
  12. <result property="installWtg" column="install_wtg"/>
  13. <result property="installPower" column="install_power"/>
  14. <result property="confirmPower" column="confirm_power"/>
  15. <result property="putintoWtg" column="putinto_wtg"/>
  16. <result property="putintoPower" column="putinto_power"/>
  17. <result property="joinWtg" column="join_wtg"/>
  18. <result property="joinPower" column="join_power"/>
  19. <result property="power" column="power"/>
  20. <result property="bsP" column="bs_p"/>
  21. <result property="bsQ" column="bs_q"/>
  22. <result property="bsV" column="bs_v"/>
  23. <result property="bsPf" column="bs_pf"/>
  24. <result property="runWtg" column="run_wtg"/>
  25. <result property="stopWtg" column="stop_wtg"/>
  26. <result property="wtgFault" column="wtg_fault"/>
  27. <result property="totalEnergy" column="total_energy"/>
  28. <result property="lastTotalEnergy" column="last_total_energy"/>
  29. <result property="todayEnergy" column="today_energy"/>
  30. <result property="avgWindSpeed" column="avg_wind_speed"/>
  31. <result property="avgTemperature" column="avg_temperature"/>
  32. <result property="name" column="name"/>
  33. <result property="pathname" column="pathname"/>
  34. <result property="aliasname" column="aliasname"/>
  35. <result property="description" column="description"/>
  36. <result property="statTag" column="stat_tag"/>
  37. <result property="dlFlag" column="dl_flag"/>
  38. <result property="glFlag" column="gl_flag"/>
  39. <result property="xhjyFlag" column="xhjy_flag"/>
  40. <result property="site" column="site"/>
  41. </resultMap>
  42. <sql id="selectWindplantVo">
  43. select windplant_no, company_no, loadarea_no, subcontrolarea_no, subregion_no, install_wtg, install_power, confirm_power, putinto_wtg, putinto_power, join_wtg, join_power, power, bs_p, bs_q, bs_v, bs_pf, run_wtg, stop_wtg, wtg_fault, total_energy, last_total_energy, today_energy, avg_wind_speed, avg_temperature, name, pathname, aliasname, description, stat_tag, dl_flag, gl_flag, xhjy_flag, site from windplant
  44. </sql>
  45. <select id="selectWindplantList" parameterType="Windplant" resultMap="WindplantResult">
  46. select
  47. w.*,
  48. a.name as "areaName",
  49. a.area_no as "areaNo",
  50. emi.item_name as "rtuTypeName",
  51. emi.item_val as "itemVal",
  52. w.windplant_no as "id",
  53. w.name as "stationName"
  54. from
  55. windplant w
  56. left join area_config ac on ac.rtu_no = w.windplant_no
  57. left join area a on a.area_no = ac.area_no
  58. left join rtu r on r.rtu_no = w.windplant_no
  59. left join enum_menu_item emi on emi.item_val = r.rtu_type and emi.menu_no = 115
  60. <where>
  61. <if test="windplantNo != null ">and w.windplant_no = #{windplantNo}</if>
  62. <if test="companyNo != null ">and w.company_no = #{companyNo}</if>
  63. <if test="loadareaNo != null ">and w.loadarea_no = #{loadareaNo}</if>
  64. <if test="subcontrolareaNo != null ">and w.subcontrolarea_no = #{subcontrolareaNo}</if>
  65. <if test="subregionNo != null ">and w.subregion_no = #{subregionNo}</if>
  66. <if test="installWtg != null ">and w.install_wtg = #{installWtg}</if>
  67. <if test="installPower != null ">and w.install_power = #{installPower}</if>
  68. <if test="confirmPower != null ">and w.confirm_power = #{confirmPower}</if>
  69. <if test="putintoWtg != null ">and w.putinto_wtg = #{putintoWtg}</if>
  70. <if test="putintoPower != null ">and w.putinto_power = #{putintoPower}</if>
  71. <if test="joinWtg != null ">and w.join_wtg = #{joinWtg}</if>
  72. <if test="joinPower != null ">and w.join_power = #{joinPower}</if>
  73. <if test="power != null ">and w.power = #{power}</if>
  74. <if test="bsP != null ">and w.bs_p = #{bsP}</if>
  75. <if test="bsQ != null ">and w.bs_q = #{bsQ}</if>
  76. <if test="bsV != null ">and w.bs_v = #{bsV}</if>
  77. <if test="bsPf != null ">and w.bs_pf = #{bsPf}</if>
  78. <if test="runWtg != null ">and w.run_wtg = #{runWtg}</if>
  79. <if test="stopWtg != null ">and w.stop_wtg = #{stopWtg}</if>
  80. <if test="wtgFault != null ">and w.wtg_fault = #{wtgFault}</if>
  81. <if test="totalEnergy != null ">and w.total_energy = #{totalEnergy}</if>
  82. <if test="lastTotalEnergy != null ">and w.last_total_energy = #{lastTotalEnergy}</if>
  83. <if test="todayEnergy != null ">and w.today_energy = #{todayEnergy}</if>
  84. <if test="avgWindSpeed != null ">and w.avg_wind_speed = #{avgWindSpeed}</if>
  85. <if test="avgTemperature != null ">and w.avg_temperature = #{avgTemperature}</if>
  86. <if test="name != null and name != ''">and w.name like concat(concat('%', #{name}), '%')</if>
  87. <if test="pathname != null and pathname != ''">and w.pathname like concat(concat('%', #{pathname}), '%')</if>
  88. <if test="aliasname != null and aliasname != ''">and w.aliasname like concat(concat('%', #{aliasname}),
  89. '%')
  90. </if>
  91. <if test="description != null and description != ''">and w.description = #{description}</if>
  92. <if test="site != null and site != ''">and w.site = #{site}</if>
  93. <if test="statTag != null ">and w.stat_tag = #{statTag}</if>
  94. <if test="dlFlag != null ">and w.dl_flag = #{dlFlag}</if>
  95. <if test="glFlag != null ">and w.gl_flag = #{glFlag}</if>
  96. <if test="xhjyFlag != null ">and w.xhjy_flag = #{xhjyFlag}</if>
  97. <if test="areaNo != null ">and a.area_no = #{areaNo}</if>
  98. </where>
  99. order by w.windplant_no asc
  100. </select>
  101. <select id="selectWindplantById" parameterType="Long" resultMap="WindplantResult">
  102. <include refid="selectWindplantVo"/>
  103. where windplant_no = #{windplantNo}
  104. </select>
  105. <select id="checkWindplantNoUnique" parameterType="Long" resultMap="WindplantResult">
  106. select windplant_no from windplant where windplant_no = #{windplantNo} and rownum <![CDATA[ <= ]]> 1
  107. </select>
  108. <select id="selectNewData" resultType="Long">
  109. SELECT * FROM ( SELECT windplant_no FROM windplant ORDER BY windplant_no DESC ) WHERE ROWNUM = 1
  110. </select>
  111. <select id="checkWindplantNameUnique" parameterType="String" resultType="int">
  112. select count(1) from windplant where name = #{windplantName} and rownum <![CDATA[ <= ]]> 1
  113. </select>
  114. <select id="selectWindplantListByGlFlag" resultMap="WindplantResult">
  115. select
  116. w.*,
  117. a.name as "areaName",
  118. a.area_no as "areaNo",
  119. emi.item_name as "rtuTypeName",
  120. emi.item_val as "itemVal",
  121. w.windplant_no as "id",
  122. w.name as "stationName"
  123. from
  124. windplant w
  125. left join area_config ac on ac.rtu_no = w.windplant_no
  126. left join area a on a.area_no = ac.area_no
  127. left join rtu r on r.rtu_no = w.windplant_no
  128. left join enum_menu_item emi on emi.item_val = r.rtu_type and emi.menu_no = 115
  129. where w.gl_flag = 1 order by w.windplant_no asc
  130. </select>
  131. <select id="selectWindplantListByDlFlag" resultMap="WindplantResult">
  132. select
  133. w.*,
  134. a.name as "areaName",
  135. a.area_no as "areaNo",
  136. emi.item_name as "rtuTypeName",
  137. emi.item_val as "itemVal",
  138. w.windplant_no as "id",
  139. w.name as "stationName"
  140. from
  141. windplant w
  142. left join area_config ac on ac.rtu_no = w.windplant_no
  143. left join area a on a.area_no = ac.area_no
  144. left join rtu r on r.rtu_no = w.windplant_no
  145. left join enum_menu_item emi on emi.item_val = r.rtu_type and emi.menu_no = 115
  146. where w.dl_flag = 1 order by w.windplant_no asc
  147. </select>
  148. <select id="selectWindplantListByXhjyFlag" resultMap="WindplantResult">
  149. select
  150. w.*,
  151. a.name as "areaName",
  152. a.area_no as "areaNo",
  153. emi.item_name as "rtuTypeName",
  154. emi.item_val as "itemVal",
  155. w.windplant_no as "id",
  156. w.name as "stationName"
  157. from
  158. windplant w
  159. left join area_config ac on ac.rtu_no = w.windplant_no
  160. left join area a on a.area_no = ac.area_no
  161. left join rtu r on r.rtu_no = w.windplant_no
  162. left join enum_menu_item emi on emi.item_val = r.rtu_type and emi.menu_no = 115
  163. where w.xhjy_flag = 1 order by w.windplant_no asc
  164. </select>
  165. <select id="selectWindplantByStationCode" parameterType="String" resultMap="WindplantResult">
  166. <include refid="selectWindplantVo"/>
  167. where pathname = #{stationCode}
  168. </select>
  169. <insert id="insertWindplant" parameterType="Windplant">
  170. insert into windplant
  171. <trim prefix="(" suffix=")" suffixOverrides=",">
  172. <if test="windplantNo != null">windplant_no,</if>
  173. <if test="companyNo != null">company_no,</if>
  174. <if test="loadareaNo != null">loadarea_no,</if>
  175. <if test="subcontrolareaNo != null">subcontrolarea_no,</if>
  176. <if test="subregionNo != null">subregion_no,</if>
  177. <if test="installWtg != null">install_wtg,</if>
  178. <if test="installPower != null">install_power,</if>
  179. <if test="confirmPower != null">confirm_power,</if>
  180. <if test="putintoWtg != null">putinto_wtg,</if>
  181. <if test="putintoPower != null">putinto_power,</if>
  182. <if test="joinWtg != null">join_wtg,</if>
  183. <if test="joinPower != null">join_power,</if>
  184. <if test="power != null">power,</if>
  185. <if test="bsP != null">bs_p,</if>
  186. <if test="bsQ != null">bs_q,</if>
  187. <if test="bsV != null">bs_v,</if>
  188. <if test="bsPf != null">bs_pf,</if>
  189. <if test="runWtg != null">run_wtg,</if>
  190. <if test="stopWtg != null">stop_wtg,</if>
  191. <if test="wtgFault != null">wtg_fault,</if>
  192. <if test="totalEnergy != null">total_energy,</if>
  193. <if test="lastTotalEnergy != null">last_total_energy,</if>
  194. <if test="todayEnergy != null">today_energy,</if>
  195. <if test="avgWindSpeed != null">avg_wind_speed,</if>
  196. <if test="avgTemperature != null">avg_temperature,</if>
  197. <if test="name != null">name,</if>
  198. <if test="pathname != null">pathname,</if>
  199. <if test="aliasname != null">aliasname,</if>
  200. <if test="description != null">description,</if>
  201. <if test="statTag != null">stat_tag,</if>
  202. <if test="dlFlag != null">dl_flag,</if>
  203. <if test="glFlag != null">gl_flag,</if>
  204. <if test="xhjyFlag != null">xhjy_flag,</if>
  205. <if test="site != null">site,</if>
  206. </trim>
  207. <trim prefix="values (" suffix=")" suffixOverrides=",">
  208. <if test="windplantNo != null">#{windplantNo},</if>
  209. <if test="companyNo != null">#{companyNo},</if>
  210. <if test="loadareaNo != null">#{loadareaNo},</if>
  211. <if test="subcontrolareaNo != null">#{subcontrolareaNo},</if>
  212. <if test="subregionNo != null">#{subregionNo},</if>
  213. <if test="installWtg != null">#{installWtg},</if>
  214. <if test="installPower != null">#{installPower},</if>
  215. <if test="confirmPower != null">#{confirmPower},</if>
  216. <if test="putintoWtg != null">#{putintoWtg},</if>
  217. <if test="putintoPower != null">#{putintoPower},</if>
  218. <if test="joinWtg != null">#{joinWtg},</if>
  219. <if test="joinPower != null">#{joinPower},</if>
  220. <if test="power != null">#{power},</if>
  221. <if test="bsP != null">#{bsP},</if>
  222. <if test="bsQ != null">#{bsQ},</if>
  223. <if test="bsV != null">#{bsV},</if>
  224. <if test="bsPf != null">#{bsPf},</if>
  225. <if test="runWtg != null">#{runWtg},</if>
  226. <if test="stopWtg != null">#{stopWtg},</if>
  227. <if test="wtgFault != null">#{wtgFault},</if>
  228. <if test="totalEnergy != null">#{totalEnergy},</if>
  229. <if test="lastTotalEnergy != null">#{lastTotalEnergy},</if>
  230. <if test="todayEnergy != null">#{todayEnergy},</if>
  231. <if test="avgWindSpeed != null">#{avgWindSpeed},</if>
  232. <if test="avgTemperature != null">#{avgTemperature},</if>
  233. <if test="name != null">#{name},</if>
  234. <if test="pathname != null">#{pathname},</if>
  235. <if test="aliasname != null">#{aliasname},</if>
  236. <if test="description != null">#{description},</if>
  237. <if test="statTag != null">#{statTag},</if>
  238. <if test="dlFlag != null">#{dlFlag},</if>
  239. <if test="glFlag != null">#{glFlag},</if>
  240. <if test="xhjyFlag != null">#{xhjyFlag},</if>
  241. <if test="site != null">#{site},</if>
  242. </trim>
  243. </insert>
  244. <update id="updateWindplant" parameterType="Windplant">
  245. update windplant
  246. <trim prefix="SET" suffixOverrides=",">
  247. <if test="companyNo != null">company_no = #{companyNo},</if>
  248. <if test="loadareaNo != null">loadarea_no = #{loadareaNo},</if>
  249. <if test="subcontrolareaNo != null">subcontrolarea_no = #{subcontrolareaNo},</if>
  250. <if test="subregionNo != null">subregion_no = #{subregionNo},</if>
  251. <if test="installWtg != null">install_wtg = #{installWtg},</if>
  252. <if test="installPower != null">install_power = #{installPower},</if>
  253. <if test="confirmPower != null">confirm_power = #{confirmPower},</if>
  254. <if test="putintoWtg != null">putinto_wtg = #{putintoWtg},</if>
  255. <if test="putintoPower != null">putinto_power = #{putintoPower},</if>
  256. <if test="joinWtg != null">join_wtg = #{joinWtg},</if>
  257. <if test="joinPower != null">join_power = #{joinPower},</if>
  258. <if test="power != null">power = #{power},</if>
  259. <if test="bsP != null">bs_p = #{bsP},</if>
  260. <if test="bsQ != null">bs_q = #{bsQ},</if>
  261. <if test="bsV != null">bs_v = #{bsV},</if>
  262. <if test="bsPf != null">bs_pf = #{bsPf},</if>
  263. <if test="runWtg != null">run_wtg = #{runWtg},</if>
  264. <if test="stopWtg != null">stop_wtg = #{stopWtg},</if>
  265. <if test="wtgFault != null">wtg_fault = #{wtgFault},</if>
  266. <if test="totalEnergy != null">total_energy = #{totalEnergy},</if>
  267. <if test="lastTotalEnergy != null">last_total_energy = #{lastTotalEnergy},</if>
  268. <if test="todayEnergy != null">today_energy = #{todayEnergy},</if>
  269. <if test="avgWindSpeed != null">avg_wind_speed = #{avgWindSpeed},</if>
  270. <if test="avgTemperature != null">avg_temperature = #{avgTemperature},</if>
  271. <if test="name != null">name = #{name},</if>
  272. <if test="pathname != null">pathname = #{pathname},</if>
  273. <if test="aliasname != null">aliasname = #{aliasname},</if>
  274. <if test="description != null">description = #{description},</if>
  275. <if test="statTag != null">stat_tag = #{statTag},</if>
  276. <if test="dlFlag != null">dl_flag = #{dlFlag},</if>
  277. <if test="glFlag != null">gl_flag = #{glFlag},</if>
  278. <if test="xhjyFlag != null">xhjy_flag = #{xhjyFlag},</if>
  279. <if test="site != null">site = #{site},</if>
  280. </trim>
  281. where windplant_no = #{windplantNo}
  282. </update>
  283. <delete id="deleteWindplantById" parameterType="Long">
  284. delete from windplant where windplant_no = #{windplantNo}
  285. </delete>
  286. </mapper>