WfProjectCwWtgMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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.WfProjectCwWtgMapper">
  6. <resultMap type="WfProjectCwWtg" id="WfProjectCwWtgResult">
  7. <result property="windplantNo" column="windplant_no"/>
  8. <result property="projectNo" column="project_no"/>
  9. <result property="collectorwireNo" column="collectorwire_no"/>
  10. <result property="wtgNo" column="wtg_no"/>
  11. <result property="wtgIssue" column="wtg_issue"/>
  12. </resultMap>
  13. <sql id="selectWfProjectCwWtgVo">
  14. select windplant_no, project_no, collectorwire_no, wtg_no, wtg_issue from wf_project_cw_wtg
  15. </sql>
  16. <select id="selectWfProjectCwWtgList" parameterType="WfProjectCwWtg" resultMap="WfProjectCwWtgResult">
  17. select
  18. wpcw.*,
  19. w.name as "windplantName",
  20. wp.project_name as "projectName",
  21. cwp.wire_name as "collectorwireName",
  22. wt.name as "wtgName"
  23. from
  24. wf_project_cw_wtg wpcw
  25. left join windplant w on w.windplant_no = wpcw.windplant_no
  26. left join windplantproject wp on wp.project_no = wpcw.project_no
  27. left join collectorwireproject cwp on cwp.collectorwire_no = wpcw.collectorwire_no
  28. left join wtur wt on wt.wtur_no = wpcw.wtg_no
  29. <where>
  30. <if test="windplantNo != null ">and wpcw.windplant_no = #{windplantNo}</if>
  31. <if test="projectNo != null ">and wpcw.project_no = #{projectNo}</if>
  32. <if test="collectorwireNo != null ">and wpcw.collectorwire_no = #{collectorwireNo}</if>
  33. <if test="wtgNo != null ">and wpcw.wtg_no = #{wtgNo}</if>
  34. <if test="wtgIssue != null ">and wpcw.wtg_issue = #{wtgIssue}</if>
  35. </where>
  36. order by wpcw.windplant_no asc
  37. </select>
  38. <select id="selectWfProjectCwWtgById" parameterType="Long" resultMap="WfProjectCwWtgResult">
  39. <include refid="selectWfProjectCwWtgVo"/>
  40. where wtg_no = #{wtgNo}
  41. </select>
  42. <select id="selectWfProjectCwWtgByWindplantNo" parameterType="Long" resultMap="WfProjectCwWtgResult">
  43. select
  44. wpcw.windplant_no,
  45. wpcw.project_no,
  46. wpcw.collectorwire_no,
  47. wpcw.wtg_no,
  48. wpcw.wtg_issue,
  49. m.mag
  50. from
  51. wf_project_cw_wtg wpcw
  52. left join mv m on m.wtur_no = wpcw.wtg_no
  53. where wpcw.windplant_no = #{windplantNo} and m.MEASUREMENTTYPE_NO = 11
  54. </select>
  55. <select id="selectWfProjectCwWtgByPojectNo" parameterType="Long" resultMap="WfProjectCwWtgResult">
  56. select
  57. wpcw.windplant_no,
  58. wpcw.project_no,
  59. wpcw.collectorwire_no,
  60. wpcw.wtg_no,
  61. wpcw.wtg_issue,
  62. m.mag,
  63. wt.name as "wtgName",
  64. wt.wtg_type as "wtgType"
  65. from
  66. wf_project_cw_wtg wpcw
  67. left join wtur wt on wt.wtur_no = wpcw.wtg_no
  68. left join mv m on m.wtur_no = wt.wtur_no
  69. where wpcw.windplant_no = #{windplantNo} and wpcw.project_no = #{projectNo} and m.MEASUREMENTTYPE_NO = 11
  70. </select>
  71. <select id="selectWfProjectCwWtgByCollectorwireNo" parameterType="Long" resultMap="WfProjectCwWtgResult">
  72. select
  73. wpcw.windplant_no,
  74. wpcw.project_no,
  75. wpcw.collectorwire_no,
  76. wpcw.wtg_no,
  77. wpcw.wtg_issue,
  78. m.mag,
  79. wt.name as "wtgName"
  80. from
  81. wf_project_cw_wtg wpcw
  82. left join wtur wt on wt.wtur_no = wpcw.wtg_no
  83. left join mv m on m.wtur_no = wt.wtur_no
  84. where wpcw.windplant_no = #{windplantNo} and wpcw.project_no = #{projectNo} and wpcw.collectorwire_no = #{collectorwireNo} and m.MEASUREMENTTYPE_NO = 11
  85. </select>
  86. <insert id="insertWfProjectCwWtg" parameterType="WfProjectCwWtg">
  87. insert into wf_project_cw_wtg
  88. <trim prefix="(" suffix=")" suffixOverrides=",">
  89. <if test="windplantNo != null">windplant_no,</if>
  90. <if test="projectNo != null">project_no,</if>
  91. <if test="collectorwireNo != null">collectorwire_no,</if>
  92. <if test="wtgNo != null">wtg_no,</if>
  93. <if test="wtgIssue != null">wtg_issue,</if>
  94. </trim>
  95. <trim prefix="values (" suffix=")" suffixOverrides=",">
  96. <if test="windplantNo != null">#{windplantNo},</if>
  97. <if test="projectNo != null">#{projectNo},</if>
  98. <if test="collectorwireNo != null">#{collectorwireNo},</if>
  99. <if test="wtgNo != null">#{wtgNo},</if>
  100. <if test="wtgIssue != null">#{wtgIssue},</if>
  101. </trim>
  102. </insert>
  103. <insert id="insertWfProjectCwWtgList">
  104. insert into wf_project_cw_wtg(wtg_no, windplant_no, project_no, collectorwire_no)
  105. <foreach collection="list" item="item" separator="UNION ALL">
  106. SELECT
  107. #{item.wtgNo},
  108. #{item.windplantNo},
  109. #{item.projectNo},
  110. #{item.collectorwireNo}
  111. FROM DUAL
  112. </foreach>
  113. </insert>
  114. <update id="updateWfProjectCwWtg" parameterType="WfProjectCwWtg">
  115. update wf_project_cw_wtg
  116. <trim prefix="SET" suffixOverrides=",">
  117. <if test="windplantNo != null">windplant_no = #{windplantNo},</if>
  118. <if test="projectNo != null">project_no = #{projectNo},</if>
  119. <if test="collectorwireNo != null">collectorwire_no = #{collectorwireNo},</if>
  120. <if test="wtgIssue != null">wtg_issue = #{wtgIssue},</if>
  121. </trim>
  122. where wtg_no = #{wtgNo}
  123. </update>
  124. <delete id="deleteWfProjectCwWtgById" parameterType="Long">
  125. delete from wf_project_cw_wtg where wtg_no = #{wtgNo}
  126. </delete>
  127. <delete id="deleteWfProjectCwWtgByIds" parameterType="String">
  128. delete from wf_project_cw_wtg where wtg_no in
  129. <foreach item="wtgNo" collection="array" open="(" separator="," close=")">
  130. #{wtgNo}
  131. </foreach>
  132. </delete>
  133. <delete id="deleteWfProjectCwWtgByWindplantNo" parameterType="Long">
  134. delete from wf_project_cw_wtg where windplant_no = #{windplantNo}
  135. </delete>
  136. <delete id="deleteWfProjectCwWtgByProjectNo" parameterType="Long">
  137. delete from wf_project_cw_wtg where windplant_no = #{windplantNo} and project_no = #{projectNo}
  138. </delete>
  139. <delete id="deleteWfProjectCwWtgByCollectorwireNo" parameterType="Long">
  140. delete from wf_project_cw_wtg where windplant_no = #{windplantNo} and project_no = #{projectNo} and collectorwire_no = #{collectorwireNo}
  141. </delete>
  142. </mapper>