WfStatPeriodDataMapper.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.WfStatPeriodDataMapper">
  6. <resultMap type="WfStatPeriodData" id="WfStatPeriodDataResult">
  7. <result property="windplantNo" column="windplant_no"/>
  8. <result property="dataTime" column="data_time"/>
  9. <result property="p1" column="p1"/>
  10. <result property="p2" column="p2"/>
  11. <result property="p0" column="p0"/>
  12. <result property="avgWindSpeed" column="avg_wind_speed"/>
  13. <result property="avgTemp" column="avg_temp"/>
  14. <result property="energy" column="energy"/>
  15. <result property="dataFlag" column="data_flag"/>
  16. </resultMap>
  17. <sql id="selectWfStatPeriodDataVo">
  18. select windplant_no, data_time, p1, p2, p0, avg_wind_speed, avg_temp, energy, data_flag from wf_stat_period_data
  19. </sql>
  20. <select id="selectWfStatPeriodDataList" parameterType="WfStatPeriodData" resultMap="WfStatPeriodDataResult">
  21. <include refid="selectWfStatPeriodDataVo"/>
  22. <where>
  23. <if test="windplantNo != null ">and windplant_no = #{windplantNo}</if>
  24. <if test="p1 != null ">and p1 = #{p1}</if>
  25. <if test="p2 != null ">and p2 = #{p2}</if>
  26. <if test="p0 != null ">and p0 = #{p0}</if>
  27. <if test="avgWindSpeed != null ">and avg_wind_speed = #{avgWindSpeed}</if>
  28. <if test="avgTemp != null ">and avg_temp = #{avgTemp}</if>
  29. <if test="energy != null ">and energy = #{energy}</if>
  30. <if test="dataFlag != null ">and data_flag = #{dataFlag}</if>
  31. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  32. and data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  33. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  34. </if>
  35. <if test="dataTime != null ">and data_time = #{dataTime}</if>
  36. </where>
  37. order by data_time asc
  38. </select>
  39. <select id="selectWfStatPeriodDataById" parameterType="Long" resultMap="WfStatPeriodDataResult">
  40. <include refid="selectWfStatPeriodDataVo"/>
  41. where windplant_no = #{windplantNo} order by data_time asc
  42. </select>
  43. <select id="selectWfStatPeriodData" parameterType="WfStatPeriodData" resultMap="WfStatPeriodDataResult">
  44. <include refid="selectWfStatPeriodDataVo"/>
  45. where windplant_no = #{windplantNo} and data_time = #{dataTime}
  46. </select>
  47. <select id="selectWfStatPeriodData1" parameterType="WfStatPeriodData" resultMap="WfStatPeriodDataResult">
  48. <include refid="selectWfStatPeriodDataVo"/>
  49. where windplant_no = #{windplantNo} and data_time > #{dataTime}
  50. </select>
  51. </mapper>