WfTheoryenergyDataMapper.xml 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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.WfTheoryenergyDataMapper">
  6. <resultMap type="WfTheoryenergyData" id="WfTheoryenergyDataResult">
  7. <result property="windplantNo" column="windplant_no" />
  8. <result property="dataTime" column="data_time" />
  9. <result property="theoryenergy" column="theoryenergy" />
  10. <result property="availableenergy" column="availableenergy" />
  11. <result property="dataFlag" column="data_flag" />
  12. </resultMap>
  13. <sql id="selectWfTheoryenergyDataVo">
  14. select windplant_no, data_time, theoryenergy, availableenergy, data_flag from wf_theoryenergy_data
  15. </sql>
  16. <select id="selectWfTheoryenergyDataList" parameterType="WfTheoryenergyData" resultMap="WfTheoryenergyDataResult">
  17. <include refid="selectWfTheoryenergyDataVo"/>
  18. <where>
  19. <if test="windplantNo != null "> and windplant_no = #{windplantNo}</if>
  20. <if test="theoryenergy != null "> and theoryenergy = #{theoryenergy}</if>
  21. <if test="availableenergy != null "> and availableenergy = #{availableenergy}</if>
  22. <if test="dataFlag != null "> and data_flag = #{dataFlag}</if>
  23. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  24. and data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  25. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  26. </if>
  27. <if test="dataTime != null ">and data_time = #{dataTime}</if>
  28. </where>
  29. </select>
  30. <select id="selectWfTheoryenergyDataById" parameterType="Long" resultMap="WfTheoryenergyDataResult">
  31. <include refid="selectWfTheoryenergyDataVo"/>
  32. where windplant_no = #{windplantNo}
  33. </select>
  34. <select id="selectWfTheoryenergyData" parameterType="WfTheoryenergyData" resultMap="WfTheoryenergyDataResult">
  35. <include refid="selectWfTheoryenergyDataVo"/>
  36. where windplant_no = #{windplantNo} and data_time > #{dataTime}
  37. </select>
  38. <insert id="insertWfTheoryenergyData" parameterType="WfTheoryenergyData">
  39. insert into wf_theoryenergy_data
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="windplantNo != null">windplant_no,</if>
  42. <if test="dataTime != null">data_time,</if>
  43. <if test="theoryenergy != null">theoryenergy,</if>
  44. <if test="availableenergy != null">availableenergy,</if>
  45. <if test="dataFlag != null">data_flag,</if>
  46. </trim>
  47. <trim prefix="values (" suffix=")" suffixOverrides=",">
  48. <if test="windplantNo != null">#{windplantNo},</if>
  49. <if test="dataTime != null">#{dataTime},</if>
  50. <if test="theoryenergy != null">#{theoryenergy},</if>
  51. <if test="availableenergy != null">#{availableenergy},</if>
  52. <if test="dataFlag != null">#{dataFlag},</if>
  53. </trim>
  54. </insert>
  55. <update id="updateWfTheoryenergyData" parameterType="WfTheoryenergyData">
  56. update wf_theoryenergy_data
  57. <trim prefix="SET" suffixOverrides=",">
  58. <if test="dataTime != null">data_time = #{dataTime},</if>
  59. <if test="theoryenergy != null">theoryenergy = #{theoryenergy},</if>
  60. <if test="availableenergy != null">availableenergy = #{availableenergy},</if>
  61. <if test="dataFlag != null">data_flag = #{dataFlag},</if>
  62. </trim>
  63. where windplant_no = #{windplantNo}
  64. </update>
  65. <delete id="deleteWfTheoryenergyDataById" parameterType="Long">
  66. delete from wf_theoryenergy_data where windplant_no = #{windplantNo}
  67. </delete>
  68. <delete id="deleteWfTheoryenergyDataByIds" parameterType="String">
  69. delete from wf_theoryenergy_data where windplant_no in
  70. <foreach item="windplantNo" collection="array" open="(" separator="," close=")">
  71. #{windplantNo}
  72. </foreach>
  73. </delete>
  74. </mapper>