WturMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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.WturMapper">
  6. <resultMap type="Wtur" id="WturResult">
  7. <result property="wturNo" column="wtur_no"/>
  8. <result property="windplantNo" column="windplant_no"/>
  9. <result property="wtgType" column="wtg_type"/>
  10. <result property="name" column="name"/>
  11. <result property="ref" column="ref"/>
  12. <result property="namplt" column="namplt"/>
  13. <result property="avltmrs" column="avltmrs"/>
  14. <result property="optmrs" column="optmrs"/>
  15. <result property="strcnt" column="strcnt"/>
  16. <result property="stopcnt" column="stopcnt"/>
  17. <result property="totwh" column="totwh"/>
  18. <result property="totvarh" column="totvarh"/>
  19. <result property="dmdwh" column="dmdwh"/>
  20. <result property="dmdvarh" column="dmdvarh"/>
  21. <result property="supwh" column="supwh"/>
  22. <result property="supvarh" column="supvarh"/>
  23. <result property="turst" column="turst"/>
  24. <result property="w" column="w"/>
  25. <result property="var" column="var"/>
  26. <result property="setturop" column="setturop"/>
  27. <result property="varovw" column="varovw"/>
  28. <result property="varrefpri" column="varrefpri"/>
  29. <result property="dmdw" column="dmdw"/>
  30. <result property="dmdvar" column="dmdvar"/>
  31. <result property="dmdpf" column="dmdpf"/>
  32. <result property="avgWsp" column="avg_wsp"/>
  33. <result property="avgTmp" column="avg_tmp"/>
  34. <result property="avgTimeDir" column="avg_time_dir"/>
  35. <result property="avgHumidity" column="avg_humidity"/>
  36. <result property="avgPressure" column="avg_pressure"/>
  37. <result property="avgRain" column="avg_rain"/>
  38. <result property="avgPower" column="avg_power"/>
  39. <result property="hubHeight" column="hub_height"/>
  40. <result property="rotorDiameter" column="rotor_diameter"/>
  41. <result property="longtitude" column="longtitude"/>
  42. <result property="latitude" column="latitude"/>
  43. <result property="elevation" column="elevation"/>
  44. <result property="orientation" column="orientation"/>
  45. <result property="cutInWspeed" column="cut_in_wspeed"/>
  46. <result property="ratedWspeed" column="rated_wspeed"/>
  47. <result property="cutOutWspeed" column="cut_out_wspeed"/>
  48. <result property="ratedPower" column="rated_power"/>
  49. <result property="statTag" column="stat_tag"/>
  50. </resultMap>
  51. <sql id="selectWturVo">
  52. select wtur_no, windplant_no, wtg_type, name, ref, namplt, avltmrs, optmrs, strcnt, stopcnt, totwh, totvarh, dmdwh, dmdvarh, supwh, supvarh, turst, w, var, setturop, varovw, varrefpri, dmdw, dmdvar, dmdpf, avg_wsp, avg_tmp, avg_time_dir, avg_humidity, avg_pressure, avg_rain, avg_power, hub_height, rotor_diameter, longtitude, latitude, elevation, orientation, cut_in_wspeed, rated_wspeed, cut_out_wspeed, rated_power, stat_tag from wtur
  53. </sql>
  54. <select id="selectWturList" parameterType="Wtur" resultMap="WturResult">
  55. select
  56. wt.*,
  57. win.name as "windplantName",
  58. wp.project_name as "projectName",
  59. cwp.wire_name as "collectorwireName",
  60. wpcw.wtg_issue as "wtgIssue",
  61. wte.type_name as "typeName",
  62. wttd.l_temperature as "lTemperature",
  63. wttd.h_temperature as "hTemperature",
  64. wpcw.windplant_no as "windplantNo",
  65. wpcw.project_no as "projectNo",
  66. wpcw.collectorwire_no as "collectorwireNo",
  67. m.mag
  68. from
  69. wtur wt
  70. left join wf_project_cw_wtg wpcw on wpcw.wtg_no = wt.wtur_no
  71. left join windplant win on win.windplant_no = wt.windplant_no
  72. left join area_config ac on ac.rtu_no = wt.windplant_no
  73. left join windplantproject wp on wp.project_no = wpcw.project_no
  74. left join collectorwireproject cwp on cwp.collectorwire_no = wpcw.collectorwire_no
  75. left join wtg_type wte on wte.type_no = wt.wtg_type
  76. left join wtg_type_temperature_def wttd on wttd.wtg_type = wt.wtg_type
  77. left join mv m on m.wtur_no = wt.wtur_no
  78. <where>
  79. <if test="wturNo != null ">and wt.wtur_no = #{wturNo}</if>
  80. <if test="windplantNo != null ">and wt.windplant_no = #{windplantNo}</if>
  81. <if test="wtgType != null ">and wt.wtg_type = #{wtgType}</if>
  82. <if test="name != null and name != ''">and wt.name like concat(concat('%', #{name}), '%')</if>
  83. <if test="ref != null and ref != ''">and wt.ref = #{ref}</if>
  84. <if test="namplt != null ">and wt.namplt = #{namplt}</if>
  85. <if test="avltmrs != null ">and wt.avltmrs = #{avltmrs}</if>
  86. <if test="optmrs != null ">and wt.optmrs = #{optmrs}</if>
  87. <if test="strcnt != null ">and wt.strcnt = #{strcnt}</if>
  88. <if test="stopcnt != null ">and wt.stopcnt = #{stopcnt}</if>
  89. <if test="totwh != null ">and wt.totwh = #{totwh}</if>
  90. <if test="totvarh != null ">and wt.totvarh = #{totvarh}</if>
  91. <if test="dmdwh != null ">and wt.dmdwh = #{dmdwh}</if>
  92. <if test="dmdvarh != null ">and wt.dmdvarh = #{dmdvarh}</if>
  93. <if test="supwh != null ">and wt.supwh = #{supwh}</if>
  94. <if test="supvarh != null ">and wt.supvarh = #{supvarh}</if>
  95. <if test="turst != null ">and wt.turst = #{turst}</if>
  96. <if test="w != null ">and wt.w = #{w}</if>
  97. <if test="var != null ">and wt.var = #{var}</if>
  98. <if test="setturop != null ">and wt.setturop = #{setturop}</if>
  99. <if test="varovw != null ">and wt.varovw = #{varovw}</if>
  100. <if test="varrefpri != null ">and wt.varrefpri = #{varrefpri}</if>
  101. <if test="dmdw != null ">and wt.dmdw = #{dmdw}</if>
  102. <if test="dmdvar != null ">and wt.dmdvar = #{dmdvar}</if>
  103. <if test="dmdpf != null ">and wt.dmdpf = #{dmdpf}</if>
  104. <if test="avgWsp != null ">and wt.avg_wsp = #{avgWsp}</if>
  105. <if test="avgTmp != null ">and wt.avg_tmp = #{avgTmp}</if>
  106. <if test="avgTimeDir != null ">and wt.avg_time_dir = #{avgTimeDir}</if>
  107. <if test="avgHumidity != null ">and wt.avg_humidity = #{avgHumidity}</if>
  108. <if test="avgPressure != null ">and wt.avg_pressure = #{avgPressure}</if>
  109. <if test="avgRain != null ">and wt.avg_rain = #{avgRain}</if>
  110. <if test="avgPower != null ">and wt.avg_power = #{avgPower}</if>
  111. <if test="hubHeight != null ">and wt.hub_height = #{hubHeight}</if>
  112. <if test="rotorDiameter != null ">and wt.rotor_diameter = #{rotorDiameter}</if>
  113. <if test="longtitude != null ">and wt.longtitude = #{longtitude}</if>
  114. <if test="latitude != null ">and wt.latitude = #{latitude}</if>
  115. <if test="elevation != null ">and wt.elevation = #{elevation}</if>
  116. <if test="orientation != null ">and wt.orientation = #{orientation}</if>
  117. <if test="cutInWspeed != null ">and wt.cut_in_wspeed = #{cutInWspeed}</if>
  118. <if test="ratedWspeed != null ">and wt.rated_wspeed = #{ratedWspeed}</if>
  119. <if test="cutOutWspeed != null ">and wt.cut_out_wspeed = #{cutOutWspeed}</if>
  120. <if test="ratedPower != null ">and wt.rated_power = #{ratedPower}</if>
  121. <if test="statTag != null ">and wt.stat_tag = #{statTag}</if>
  122. <if test="windplantNo != null ">and win.windplant_no = #{windplantNo}</if>
  123. <if test="projectNo != null ">and wp.project_no = #{projectNo}</if>
  124. <if test="collectorwireNo != null ">and cwp.collectorwire_no = #{collectorwireNo}</if>
  125. <if test="areaNo != null ">and ac.area_no = #{areaNo}</if>
  126. and m.MEASUREMENTTYPE_NO = 11
  127. </where>
  128. order by wt.windplant_no asc
  129. </select>
  130. <select id="selectWturById" parameterType="Long" resultMap="WturResult">
  131. select
  132. wt.*,
  133. win.name as "windplantName",
  134. wp.project_name as "projectName",
  135. cwp.wire_name as "collectorwireName",
  136. wpcw.wtg_issue as "wtgIssue",
  137. wte.type_name as "typeName",
  138. wttd.l_temperature as "lTemperature",
  139. wttd.h_temperature as "hTemperature",
  140. wpcw.windplant_no as "windplantNo",
  141. wpcw.project_no as "projectNo",
  142. wpcw.collectorwire_no as "collectorwireNo",
  143. m.mag
  144. from
  145. wtur wt
  146. left join wf_project_cw_wtg wpcw on wpcw.wtg_no = wt.wtur_no
  147. left join windplant win on win.windplant_no = wt.windplant_no
  148. left join windplantproject wp on wp.project_no = wpcw.project_no
  149. left join collectorwireproject cwp on cwp.collectorwire_no = wpcw.collectorwire_no
  150. left join wtg_type wte on wte.type_no = wt.wtg_type
  151. left join wtg_type_temperature_def wttd on wttd.wtg_type = wt.wtg_type
  152. left join mv m on m.wtur_no = wt.wtur_no
  153. where wt.wtur_no = #{wturNo} and m.MEASUREMENTTYPE_NO = 11
  154. </select>
  155. <select id="selectWturListByWindplantNo" parameterType="Long" resultMap="WturResult">
  156. select
  157. wt.*,
  158. win.name as "windplantName",
  159. m.mag
  160. from
  161. wtur wt
  162. left join windplant win on win.windplant_no = wt.windplant_no
  163. left join mv m on m.wtur_no = wt.wtur_no
  164. where wt.windplant_no = #{windplantNo} and m.MEASUREMENTTYPE_NO = 11 and wt.rated_power != 0
  165. order by wt.wtur_no asc
  166. </select>
  167. <select id="selectNewData" resultType="Long">
  168. SELECT * FROM ( SELECT wtur_no FROM wtur ORDER BY wtur_no DESC ) WHERE ROWNUM = 1
  169. </select>
  170. <insert id="insertWtur" parameterType="Wtur">
  171. insert into wtur
  172. <trim prefix="(" suffix=")" suffixOverrides=",">
  173. <if test="wturNo != null">wtur_no,</if>
  174. <if test="windplantNo != null">windplant_no,</if>
  175. <if test="wtgType != null">wtg_type,</if>
  176. <if test="name != null">name,</if>
  177. <if test="ref != null">ref,</if>
  178. <if test="namplt != null">namplt,</if>
  179. <if test="avltmrs != null">avltmrs,</if>
  180. <if test="optmrs != null">optmrs,</if>
  181. <if test="strcnt != null">strcnt,</if>
  182. <if test="stopcnt != null">stopcnt,</if>
  183. <if test="totwh != null">totwh,</if>
  184. <if test="totvarh != null">totvarh,</if>
  185. <if test="dmdwh != null">dmdwh,</if>
  186. <if test="dmdvarh != null">dmdvarh,</if>
  187. <if test="supwh != null">supwh,</if>
  188. <if test="supvarh != null">supvarh,</if>
  189. <if test="turst != null">turst,</if>
  190. <if test="w != null">w,</if>
  191. <if test="var != null">var,</if>
  192. <if test="setturop != null">setturop,</if>
  193. <if test="varovw != null">varovw,</if>
  194. <if test="varrefpri != null">varrefpri,</if>
  195. <if test="dmdw != null">dmdw,</if>
  196. <if test="dmdvar != null">dmdvar,</if>
  197. <if test="dmdpf != null">dmdpf,</if>
  198. <if test="avgWsp != null">avg_wsp,</if>
  199. <if test="avgTmp != null">avg_tmp,</if>
  200. <if test="avgTimeDir != null">avg_time_dir,</if>
  201. <if test="avgHumidity != null">avg_humidity,</if>
  202. <if test="avgPressure != null">avg_pressure,</if>
  203. <if test="avgRain != null">avg_rain,</if>
  204. <if test="avgPower != null">avg_power,</if>
  205. <if test="hubHeight != null">hub_height,</if>
  206. <if test="rotorDiameter != null">rotor_diameter,</if>
  207. <if test="longtitude != null">longtitude,</if>
  208. <if test="latitude != null">latitude,</if>
  209. <if test="elevation != null">elevation,</if>
  210. <if test="orientation != null">orientation,</if>
  211. <if test="cutInWspeed != null">cut_in_wspeed,</if>
  212. <if test="ratedWspeed != null">rated_wspeed,</if>
  213. <if test="cutOutWspeed != null">cut_out_wspeed,</if>
  214. <if test="ratedPower != null">rated_power,</if>
  215. <if test="statTag != null">stat_tag,</if>
  216. </trim>
  217. <trim prefix="values (" suffix=")" suffixOverrides=",">
  218. <if test="wturNo != null">#{wturNo},</if>
  219. <if test="windplantNo != null">#{windplantNo},</if>
  220. <if test="wtgType != null">#{wtgType},</if>
  221. <if test="name != null">#{name},</if>
  222. <if test="ref != null">#{ref},</if>
  223. <if test="namplt != null">#{namplt},</if>
  224. <if test="avltmrs != null">#{avltmrs},</if>
  225. <if test="optmrs != null">#{optmrs},</if>
  226. <if test="strcnt != null">#{strcnt},</if>
  227. <if test="stopcnt != null">#{stopcnt},</if>
  228. <if test="totwh != null">#{totwh},</if>
  229. <if test="totvarh != null">#{totvarh},</if>
  230. <if test="dmdwh != null">#{dmdwh},</if>
  231. <if test="dmdvarh != null">#{dmdvarh},</if>
  232. <if test="supwh != null">#{supwh},</if>
  233. <if test="supvarh != null">#{supvarh},</if>
  234. <if test="turst != null">#{turst},</if>
  235. <if test="w != null">#{w},</if>
  236. <if test="var != null">#{var},</if>
  237. <if test="setturop != null">#{setturop},</if>
  238. <if test="varovw != null">#{varovw},</if>
  239. <if test="varrefpri != null">#{varrefpri},</if>
  240. <if test="dmdw != null">#{dmdw},</if>
  241. <if test="dmdvar != null">#{dmdvar},</if>
  242. <if test="dmdpf != null">#{dmdpf},</if>
  243. <if test="avgWsp != null">#{avgWsp},</if>
  244. <if test="avgTmp != null">#{avgTmp},</if>
  245. <if test="avgTimeDir != null">#{avgTimeDir},</if>
  246. <if test="avgHumidity != null">#{avgHumidity},</if>
  247. <if test="avgPressure != null">#{avgPressure},</if>
  248. <if test="avgRain != null">#{avgRain},</if>
  249. <if test="avgPower != null">#{avgPower},</if>
  250. <if test="hubHeight != null">#{hubHeight},</if>
  251. <if test="rotorDiameter != null">#{rotorDiameter},</if>
  252. <if test="longtitude != null">#{longtitude},</if>
  253. <if test="latitude != null">#{latitude},</if>
  254. <if test="elevation != null">#{elevation},</if>
  255. <if test="orientation != null">#{orientation},</if>
  256. <if test="cutInWspeed != null">#{cutInWspeed},</if>
  257. <if test="ratedWspeed != null">#{ratedWspeed},</if>
  258. <if test="cutOutWspeed != null">#{cutOutWspeed},</if>
  259. <if test="ratedPower != null">#{ratedPower},</if>
  260. <if test="statTag != null">#{statTag},</if>
  261. </trim>
  262. </insert>
  263. <insert id="insertWturList">
  264. insert into wtur(wtur_no, windplant_no, wtg_type, name, ref, longtitude, latitude, rated_power, stat_tag)
  265. <foreach collection="list" item="item" separator="UNION ALL">
  266. SELECT
  267. #{item.wturNo},
  268. #{item.windplantNo},
  269. #{item.wtgType},
  270. #{item.name},
  271. #{item.ref},
  272. #{item.longtitude},
  273. #{item.latitude},
  274. #{item.ratedPower},
  275. #{item.statTag}
  276. FROM DUAL
  277. </foreach>
  278. </insert>
  279. <update id="updateWtur" parameterType="Wtur">
  280. update wtur
  281. <trim prefix="SET" suffixOverrides=",">
  282. <if test="windplantNo != null">windplant_no = #{windplantNo},</if>
  283. <if test="wtgType != null">wtg_type = #{wtgType},</if>
  284. <if test="name != null">name = #{name},</if>
  285. <if test="ref != null">ref = #{ref},</if>
  286. <if test="namplt != null">namplt = #{namplt},</if>
  287. <if test="avltmrs != null">avltmrs = #{avltmrs},</if>
  288. <if test="optmrs != null">optmrs = #{optmrs},</if>
  289. <if test="strcnt != null">strcnt = #{strcnt},</if>
  290. <if test="stopcnt != null">stopcnt = #{stopcnt},</if>
  291. <if test="totwh != null">totwh = #{totwh},</if>
  292. <if test="totvarh != null">totvarh = #{totvarh},</if>
  293. <if test="dmdwh != null">dmdwh = #{dmdwh},</if>
  294. <if test="dmdvarh != null">dmdvarh = #{dmdvarh},</if>
  295. <if test="supwh != null">supwh = #{supwh},</if>
  296. <if test="supvarh != null">supvarh = #{supvarh},</if>
  297. <if test="turst != null">turst = #{turst},</if>
  298. <if test="w != null">w = #{w},</if>
  299. <if test="var != null">var = #{var},</if>
  300. <if test="setturop != null">setturop = #{setturop},</if>
  301. <if test="varovw != null">varovw = #{varovw},</if>
  302. <if test="varrefpri != null">varrefpri = #{varrefpri},</if>
  303. <if test="dmdw != null">dmdw = #{dmdw},</if>
  304. <if test="dmdvar != null">dmdvar = #{dmdvar},</if>
  305. <if test="dmdpf != null">dmdpf = #{dmdpf},</if>
  306. <if test="avgWsp != null">avg_wsp = #{avgWsp},</if>
  307. <if test="avgTmp != null">avg_tmp = #{avgTmp},</if>
  308. <if test="avgTimeDir != null">avg_time_dir = #{avgTimeDir},</if>
  309. <if test="avgHumidity != null">avg_humidity = #{avgHumidity},</if>
  310. <if test="avgPressure != null">avg_pressure = #{avgPressure},</if>
  311. <if test="avgRain != null">avg_rain = #{avgRain},</if>
  312. <if test="avgPower != null">avg_power = #{avgPower},</if>
  313. <if test="hubHeight != null">hub_height = #{hubHeight},</if>
  314. <if test="rotorDiameter != null">rotor_diameter = #{rotorDiameter},</if>
  315. <if test="longtitude != null">longtitude = #{longtitude},</if>
  316. <if test="latitude != null">latitude = #{latitude},</if>
  317. <if test="elevation != null">elevation = #{elevation},</if>
  318. <if test="orientation != null">orientation = #{orientation},</if>
  319. <if test="cutInWspeed != null">cut_in_wspeed = #{cutInWspeed},</if>
  320. <if test="ratedWspeed != null">rated_wspeed = #{ratedWspeed},</if>
  321. <if test="cutOutWspeed != null">cut_out_wspeed = #{cutOutWspeed},</if>
  322. <if test="ratedPower != null">rated_power = #{ratedPower},</if>
  323. <if test="statTag != null">stat_tag = #{statTag},</if>
  324. </trim>
  325. where wtur_no = #{wturNo}
  326. </update>
  327. <delete id="deleteWturById" parameterType="Long">
  328. delete from wtur where wtur_no = #{wturNo}
  329. </delete>
  330. <delete id="deleteWturByIds" parameterType="String">
  331. delete from wtur where wtur_no in
  332. <foreach item="wturNo" collection="array" open="(" separator="," close=")">
  333. #{wturNo}
  334. </foreach>
  335. </delete>
  336. </mapper>