WindplantPointMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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.WindplantPointMapper">
  6. <resultMap type="WindplantPoint" id="WindplantPointResult">
  7. <result property="windplantNo" column="windplant_no"/>
  8. <result property="statTime1" column="stat_time1"/>
  9. <result property="statTime2" column="stat_time2"/>
  10. <result property="statTime3" column="stat_time3"/>
  11. <result property="statDayTime1" column="stat_day_time1"/>
  12. <result property="statDayTime2" column="stat_day_time2"/>
  13. <result property="statDayTime3" column="stat_day_time3"/>
  14. <result property="statMonthTime1" column="stat_month_time1"/>
  15. <result property="statMonthTime2" column="stat_month_time2"/>
  16. <result property="statMonthTime3" column="stat_month_time3"/>
  17. <result property="exportTime1" column="export_time1"/>
  18. <result property="exportTime2" column="export_time2"/>
  19. </resultMap>
  20. <sql id="selectWindplantPointVo">
  21. select windplant_no, stat_time1, stat_time2, stat_time3, stat_day_time1, stat_day_time2, stat_day_time3, stat_month_time1, stat_month_time2, stat_month_time3, export_time1, export_time2 from windplant_point
  22. </sql>
  23. <select id="selectWindplantPointList" parameterType="WindplantPoint" resultMap="WindplantPointResult">
  24. select
  25. wp.*,
  26. w.name as "windplantName"
  27. from
  28. windplant_point wp
  29. left join windplant w on w.windplant_no = wp.windplant_no
  30. <where>
  31. <if test="windplantNo != null ">and wp.windplant_no = #{windplantNo}</if>
  32. <if test="statTime1 != null ">and wp.stat_time1 = #{statTime1}</if>
  33. <if test="statTime2 != null ">and wp.stat_time2 = #{statTime2}</if>
  34. <if test="statTime3 != null ">and wp.stat_time3 = #{statTime3}</if>
  35. <if test="statDayTime1 != null ">and wp.stat_day_time1 = #{statDayTime1}</if>
  36. <if test="statDayTime2 != null ">and wp.stat_day_time2 = #{statDayTime2}</if>
  37. <if test="statDayTime3 != null ">and wp.stat_day_time3 = #{statDayTime3}</if>
  38. <if test="statMonthTime1 != null ">and wp.stat_month_time1 = #{statMonthTime1}</if>
  39. <if test="statMonthTime2 != null ">and wp.stat_month_time2 = #{statMonthTime2}</if>
  40. <if test="statMonthTime3 != null ">and wp.stat_month_time3 = #{statMonthTime3}</if>
  41. <if test="exportTime1 != null ">and wp.export_time1 = #{exportTime1}</if>
  42. <if test="exportTime2 != null ">and wp.export_time2 = #{exportTime2}</if>
  43. </where>
  44. order by wp.windplant_no asc
  45. </select>
  46. <select id="selectWindplantPointById" parameterType="Long" resultMap="WindplantPointResult">
  47. <include refid="selectWindplantPointVo"/>
  48. where windplant_no = #{windplantNo}
  49. </select>
  50. <select id="checkWindplantNoUnique" parameterType="Long" resultType="int">
  51. select count(1) from windplant_point where windplant_no = #{windplantNo} and rownum <![CDATA[ <= ]]> 1
  52. </select>
  53. <insert id="insertWindplantPoint" parameterType="WindplantPoint">
  54. insert into windplant_point
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test="windplantNo != null">windplant_no,</if>
  57. <if test="statTime1 != null">stat_time1,</if>
  58. <if test="statTime2 != null">stat_time2,</if>
  59. <if test="statTime3 != null">stat_time3,</if>
  60. <if test="statDayTime1 != null">stat_day_time1,</if>
  61. <if test="statDayTime2 != null">stat_day_time2,</if>
  62. <if test="statDayTime3 != null">stat_day_time3,</if>
  63. <if test="statMonthTime1 != null">stat_month_time1,</if>
  64. <if test="statMonthTime2 != null">stat_month_time2,</if>
  65. <if test="statMonthTime3 != null">stat_month_time3,</if>
  66. <if test="exportTime1 != null">export_time1,</if>
  67. <if test="exportTime2 != null">export_time2,</if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides=",">
  70. <if test="windplantNo != null">#{windplantNo},</if>
  71. <if test="statTime1 != null">#{statTime1},</if>
  72. <if test="statTime2 != null">#{statTime2},</if>
  73. <if test="statTime3 != null">#{statTime3},</if>
  74. <if test="statDayTime1 != null">#{statDayTime1},</if>
  75. <if test="statDayTime2 != null">#{statDayTime2},</if>
  76. <if test="statDayTime3 != null">#{statDayTime3},</if>
  77. <if test="statMonthTime1 != null">#{statMonthTime1},</if>
  78. <if test="statMonthTime2 != null">#{statMonthTime2},</if>
  79. <if test="statMonthTime3 != null">#{statMonthTime3},</if>
  80. <if test="exportTime1 != null">#{exportTime1},</if>
  81. <if test="exportTime2 != null">#{exportTime2},</if>
  82. </trim>
  83. </insert>
  84. <update id="updateWindplantPoint" parameterType="WindplantPoint">
  85. update windplant_point
  86. <trim prefix="SET" suffixOverrides=",">
  87. <if test="statTime1 != null">stat_time1 = #{statTime1},</if>
  88. <if test="statTime2 != null">stat_time2 = #{statTime2},</if>
  89. <if test="statTime3 != null">stat_time3 = #{statTime3},</if>
  90. <if test="statDayTime1 != null">stat_day_time1 = #{statDayTime1},</if>
  91. <if test="statDayTime2 != null">stat_day_time2 = #{statDayTime2},</if>
  92. <if test="statDayTime3 != null">stat_day_time3 = #{statDayTime3},</if>
  93. <if test="statMonthTime1 != null">stat_month_time1 = #{statMonthTime1},</if>
  94. <if test="statMonthTime2 != null">stat_month_time2 = #{statMonthTime2},</if>
  95. <if test="statMonthTime3 != null">stat_month_time3 = #{statMonthTime3},</if>
  96. <if test="exportTime1 != null">export_time1 = #{exportTime1},</if>
  97. <if test="exportTime2 != null">export_time2 = #{exportTime2},</if>
  98. </trim>
  99. where windplant_no = #{windplantNo}
  100. </update>
  101. <delete id="deleteWindplantPointById" parameterType="Long">
  102. delete from windplant_point where windplant_no = #{windplantNo}
  103. </delete>
  104. <delete id="deleteWindplantPointByIds" parameterType="String">
  105. delete from windplant_point where windplant_no in
  106. <foreach item="windplantNo" collection="array" open="(" separator="," close=")">
  107. #{windplantNo}
  108. </foreach>
  109. </delete>
  110. </mapper>