WfLoadGrowMapper.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.WfLoadGrowMapper">
  6. <resultMap type="WfLoadGrow" id="WfLoadGrowResult">
  7. <result property="windplantNo" column="windplant_no"/>
  8. <result property="growTime" column="grow_time"/>
  9. <result property="load" column="load"/>
  10. </resultMap>
  11. <sql id="selectWfLoadGrowVo">
  12. select windplant_no, grow_time, load from wf_load_grow
  13. </sql>
  14. <select id="selectWfLoadGrowList" parameterType="WfLoadGrow" resultMap="WfLoadGrowResult">
  15. select
  16. wlg.*,
  17. win.name as "windplantName"
  18. from
  19. wf_load_grow wlg
  20. left join windplant win on win.windplant_no = wlg.windplant_no
  21. <where>
  22. <if test="windplantNo != null ">and wlg.windplant_no = #{windplantNo}</if>
  23. <if test="growTime != null ">and wlg.grow_time = #{growTime}</if>
  24. <if test="load != null ">and wlg.load = #{load}</if>
  25. </where>
  26. order by wlg.windplant_no asc
  27. </select>
  28. <select id="selectWfLoadGrowById" parameterType="Long" resultMap="WfLoadGrowResult">
  29. <include refid="selectWfLoadGrowVo"/>
  30. where windplant_no = #{windplantNo}
  31. </select>
  32. <select id="checkWindplantNoUnique" parameterType="Long" resultType="int">
  33. select count(1) from wf_load_grow where windplant_no = #{windplantNo} and rownum <![CDATA[ <= ]]> 1
  34. </select>
  35. <insert id="insertWfLoadGrow" parameterType="WfLoadGrow">
  36. insert into wf_load_grow
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="windplantNo != null">windplant_no,</if>
  39. <if test="growTime != null">grow_time,</if>
  40. <if test="load != null">load,</if>
  41. </trim>
  42. <trim prefix="values (" suffix=")" suffixOverrides=",">
  43. <if test="windplantNo != null">#{windplantNo},</if>
  44. <if test="growTime != null">#{growTime},</if>
  45. <if test="load != null">#{load},</if>
  46. </trim>
  47. </insert>
  48. <update id="updateWfLoadGrow" parameterType="WfLoadGrow">
  49. update wf_load_grow
  50. <trim prefix="SET" suffixOverrides=",">
  51. <if test="growTime != null">grow_time = #{growTime},</if>
  52. <if test="load != null">load = #{load},</if>
  53. </trim>
  54. where windplant_no = #{windplantNo}
  55. </update>
  56. <delete id="deleteWfLoadGrowById" parameterType="Long">
  57. delete from wf_load_grow where windplant_no = #{windplantNo}
  58. </delete>
  59. <delete id="deleteWfLoadGrowByIds" parameterType="String">
  60. delete from wf_load_grow where windplant_no in
  61. <foreach item="windplantNo" collection="array" open="(" separator="," close=")">
  62. #{windplantNo}
  63. </foreach>
  64. </delete>
  65. </mapper>