CollectorwireprojectMapper.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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.CollectorwireprojectMapper">
  6. <resultMap type="Collectorwireproject" id="CollectorwireprojectResult">
  7. <result property="wpNo" column="wp_no"/>
  8. <result property="projectNo" column="project_no"/>
  9. <result property="collectorwireNo" column="collectorwire_no"/>
  10. <result property="wireName" column="wire_name"/>
  11. <result property="wireIssue" column="wire_issue"/>
  12. <result property="wireCapacity" column="wire_capacity"/>
  13. <result property="analogNo" column="analog_no"/>
  14. <result property="bcrNo" column="bcr_no"/>
  15. <result property="statSpeedTime" column="stat_speed_time"/>
  16. <result property="unitsNumber" column="units_number"/>
  17. </resultMap>
  18. <sql id="selectCollectorwireprojectVo">
  19. select wp_no, project_no, collectorwire_no, wire_name, wire_issue, wire_capacity, analog_no, bcr_no, stat_speed_time, units_number from collectorwireproject
  20. </sql>
  21. <select id="selectCollectorwireprojectList" parameterType="Collectorwireproject"
  22. resultMap="CollectorwireprojectResult">
  23. select
  24. cwp.*,
  25. w.name as "windplantName",
  26. pps.name as "pvStationName",
  27. wp.project_name as "projectName"
  28. from
  29. collectorwireproject cwp
  30. left join windplant w on w.windplant_no = cwp.wp_no
  31. left join pv_power_station pps on pps.pv_station_no = cwp.wp_no
  32. left join windplantproject wp on wp.project_no = cwp.project_no
  33. <where>
  34. <if test="wpNo != null ">and cwp.wp_no = #{wpNo}</if>
  35. <if test="projectNo != null ">and cwp.project_no = #{projectNo}</if>
  36. <if test="collectorwireNo != null ">and cwp.collectorwire_no = #{collectorwireNo}</if>
  37. <if test="wireName != null and wireName != ''">and cwp.wire_name like concat(concat('%', #{wireName}), '%')
  38. </if>
  39. <if test="wireIssue != null and wireIssue != ''">and cwp.wire_issue like concat(concat('%', #{wireIssue}), '%')
  40. </if>
  41. <if test="wireCapacity != null ">and cwp.wire_capacity = #{wireCapacity}</if>
  42. <if test="analogNo != null ">and cwp.analog_no = #{analogNo}</if>
  43. <if test="bcrNo != null ">and cwp.bcr_no = #{bcrNo}</if>
  44. <if test="statSpeedTime != null ">and cwp.stat_speed_time = #{statSpeedTime}</if>
  45. <if test="unitsNumber != null ">and cwp.units_number = #{unitsNumber}</if>
  46. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  47. and cwp.stat_speed_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  48. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  49. </if>
  50. </where>
  51. order by cwp.wp_no asc
  52. </select>
  53. <select id="selectCollectorwireprojectById" parameterType="Long" resultMap="CollectorwireprojectResult">
  54. <include refid="selectCollectorwireprojectVo"/>
  55. where collectorwire_no = #{collectorwireNo}
  56. </select>
  57. <select id="selectCollectorwireproject" parameterType="Long" resultMap="CollectorwireprojectResult">
  58. <include refid="selectCollectorwireprojectVo"/>
  59. where wp_no = #{windplantNo} and project_no = #{projectNo} and collectorwire_no = #{collectorwireNo}
  60. </select>
  61. <select id="selectCollectorwireprojectByProjectNo" parameterType="Long" resultMap="CollectorwireprojectResult">
  62. <include refid="selectCollectorwireprojectVo"/>
  63. where wp_no = #{windplantNo} and project_no = #{projectNo}
  64. </select>
  65. <select id="selectNewData" resultType="Long">
  66. SELECT * FROM ( SELECT collectorwire_no FROM collectorwireproject ORDER BY collectorwire_no DESC ) WHERE ROWNUM = 1
  67. </select>
  68. <select id="selectCollectorwireprojectByWindplantNo" parameterType="Long" resultMap="CollectorwireprojectResult">
  69. <include refid="selectCollectorwireprojectVo"/>
  70. where wp_no = #{windplantNo}
  71. </select>
  72. <insert id="insertCollectorwireproject" parameterType="Collectorwireproject">
  73. insert into collectorwireproject
  74. <trim prefix="(" suffix=")" suffixOverrides=",">
  75. <if test="wpNo != null">wp_no,</if>
  76. <if test="projectNo != null">project_no,</if>
  77. <if test="collectorwireNo != null">collectorwire_no,</if>
  78. <if test="wireName != null">wire_name,</if>
  79. <if test="wireIssue != null">wire_issue,</if>
  80. <if test="wireCapacity != null">wire_capacity,</if>
  81. <if test="analogNo != null">analog_no,</if>
  82. <if test="bcrNo != null">bcr_no,</if>
  83. <if test="statSpeedTime != null">stat_speed_time,</if>
  84. <if test="unitsNumber != null">units_number,</if>
  85. </trim>
  86. <trim prefix="values (" suffix=")" suffixOverrides=",">
  87. <if test="wpNo != null">#{wpNo},</if>
  88. <if test="projectNo != null">#{projectNo},</if>
  89. <if test="collectorwireNo != null">#{collectorwireNo},</if>
  90. <if test="wireName != null">#{wireName},</if>
  91. <if test="wireIssue != null">#{wireIssue},</if>
  92. <if test="wireCapacity != null">#{wireCapacity},</if>
  93. <if test="analogNo != null">#{analogNo},</if>
  94. <if test="bcrNo != null">#{bcrNo},</if>
  95. <if test="statSpeedTime != null">#{statSpeedTime},</if>
  96. <if test="unitsNumber != null">#{unitsNumber},</if>
  97. </trim>
  98. </insert>
  99. <insert id="insertCollectorwireprojectList">
  100. insert into collectorwireproject(collectorwire_no, wp_no, project_no, wire_name, wire_capacity, analog_no, stat_speed_time)
  101. <foreach collection="list" item="item" separator="UNION ALL">
  102. SELECT
  103. #{item.collectorwireNo},
  104. #{item.wpNo},
  105. #{item.projectNo},
  106. #{item.wireName},
  107. #{item.wireCapacity},
  108. #{item.analogNo},
  109. #{item.statSpeedTime}
  110. FROM DUAL
  111. </foreach>
  112. </insert>
  113. <update id="updateCollectorwireproject" parameterType="Collectorwireproject">
  114. update collectorwireproject
  115. <trim prefix="SET" suffixOverrides=",">
  116. <if test="wpNo != null">wp_no = #{wpNo},</if>
  117. <if test="projectNo != null">project_no = #{projectNo},</if>
  118. <if test="wireName != null">wire_name = #{wireName},</if>
  119. <if test="wireIssue != null">wire_issue = #{wireIssue},</if>
  120. <if test="wireCapacity != null">wire_capacity = #{wireCapacity},</if>
  121. <if test="analogNo != null">analog_no = #{analogNo},</if>
  122. <if test="bcrNo != null">bcr_no = #{bcrNo},</if>
  123. <if test="statSpeedTime != null">stat_speed_time = #{statSpeedTime},</if>
  124. <if test="unitsNumber != null">units_number = #{unitsNumber},</if>
  125. </trim>
  126. where collectorwire_no = #{collectorwireNo}
  127. </update>
  128. <delete id="deleteCollectorwireprojectById" parameterType="Long">
  129. delete from collectorwireproject where collectorwire_no = #{collectorwireNo}
  130. </delete>
  131. <delete id="deleteCollectorwireprojectByWindplantNo" parameterType="Long">
  132. delete from collectorwireproject where wp_no = #{windplantNo}
  133. </delete>
  134. <delete id="deleteCollectorwireprojectByProjectNo" parameterType="Long">
  135. delete from collectorwireproject where project_no = #{projectNo}
  136. </delete>
  137. </mapper>