WfTheorypowerDataMapper.xml 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.WfTheorypowerDataMapper">
  6. <resultMap type="WfTheorypowerData" id="WfTheorypowerDataResult">
  7. <result property="windplantNo" column="windplant_no" />
  8. <result property="dataTime" column="data_time" />
  9. <result property="theorypower" column="theorypower" />
  10. <result property="availablepower" column="availablepower" />
  11. <result property="isLimit" column="is_limit" />
  12. <result property="dataFlag" column="data_flag" />
  13. </resultMap>
  14. <sql id="selectWfTheorypowerDataVo">
  15. select windplant_no, data_time, theorypower, availablepower, is_limit, data_flag from wf_theorypower_data
  16. </sql>
  17. <select id="selectWfTheorypowerDataList" parameterType="WfTheorypowerData" resultMap="WfTheorypowerDataResult">
  18. <include refid="selectWfTheorypowerDataVo"/>
  19. <where>
  20. <if test="windplantNo != null ">and windplant_no = #{windplantNo}</if>
  21. <if test="theorypower != null "> and theorypower = #{theorypower}</if>
  22. <if test="availablepower != null "> and availablepower = #{availablepower}</if>
  23. <if test="isLimit != null "> and is_limit = #{isLimit}</if>
  24. <if test="dataFlag != null "> and data_flag = #{dataFlag}</if>
  25. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  26. and data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  27. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  28. </if>
  29. <if test="dataTime != null ">and data_time = #{dataTime}</if>
  30. </where>
  31. </select>
  32. <select id="selectWfTheorypowerDataById" parameterType="Long" resultMap="WfTheorypowerDataResult">
  33. <include refid="selectWfTheorypowerDataVo"/>
  34. where windplant_no = #{windplantNo}
  35. </select>
  36. <select id="selectWfTheorypowerData" parameterType="WfTheorypowerData" resultMap="WfTheorypowerDataResult">
  37. <include refid="selectWfTheorypowerDataVo"/>
  38. where windplant_no = #{windplantNo} and data_time > #{dataTime}
  39. </select>
  40. <insert id="insertWfTheorypowerData" parameterType="WfTheorypowerData">
  41. insert into wf_theorypower_data
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="windplantNo != null">windplant_no,</if>
  44. <if test="dataTime != null">data_time,</if>
  45. <if test="theorypower != null">theorypower,</if>
  46. <if test="availablepower != null">availablepower,</if>
  47. <if test="isLimit != null">is_limit,</if>
  48. <if test="dataFlag != null">data_flag,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="windplantNo != null">#{windplantNo},</if>
  52. <if test="dataTime != null">#{dataTime},</if>
  53. <if test="theorypower != null">#{theorypower},</if>
  54. <if test="availablepower != null">#{availablepower},</if>
  55. <if test="isLimit != null">#{isLimit},</if>
  56. <if test="dataFlag != null">#{dataFlag},</if>
  57. </trim>
  58. </insert>
  59. <update id="updateWfTheorypowerData" parameterType="WfTheorypowerData">
  60. update wf_theorypower_data
  61. <trim prefix="SET" suffixOverrides=",">
  62. <if test="dataTime != null">data_time = #{dataTime},</if>
  63. <if test="theorypower != null">theorypower = #{theorypower},</if>
  64. <if test="availablepower != null">availablepower = #{availablepower},</if>
  65. <if test="isLimit != null">is_limit = #{isLimit},</if>
  66. <if test="dataFlag != null">data_flag = #{dataFlag},</if>
  67. </trim>
  68. where windplant_no = #{windplantNo}
  69. </update>
  70. <delete id="deleteWfTheorypowerDataById" parameterType="Long">
  71. delete from wf_theorypower_data where windplant_no = #{windplantNo}
  72. </delete>
  73. <delete id="deleteWfTheorypowerDataByIds" parameterType="String">
  74. delete from wf_theorypower_data where windplant_no in
  75. <foreach item="windplantNo" collection="array" open="(" separator="," close=")">
  76. #{windplantNo}
  77. </foreach>
  78. </delete>
  79. </mapper>