PvDaPfPeriodDataMapper.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.PvDaPfPeriodDataMapper">
  6. <resultMap type="PvDaPfPeriodData" id="PvDaPfPeriodDataResult">
  7. <result property="pvNo" column="pv_no" />
  8. <result property="modelNo" column="model_no" />
  9. <result property="timeScale" column="time_scale" />
  10. <result property="dataTime" column="data_time" />
  11. <result property="radiation" column="radiation" />
  12. <result property="power" column="power" />
  13. <result property="dataFlag" column="data_flag" />
  14. </resultMap>
  15. <sql id="selectPvDaPfPeriodDataVo">
  16. select pv_no, model_no, time_scale, data_time, radiation, power, data_flag from pv_da_pf_period_data
  17. </sql>
  18. <select id="selectPvDaPfPeriodDataList" parameterType="PvDaPfPeriodData" resultMap="PvDaPfPeriodDataResult">
  19. <include refid="selectPvDaPfPeriodDataVo"/>
  20. <where>
  21. <if test="pvNo != null ">and pv_no = #{pvNo}</if>
  22. <if test="modelNo != null ">and model_no = #{modelNo}</if>
  23. <if test="timeScale != null ">and time_scale = #{timeScale}</if>
  24. <if test="radiation != null "> and radiation = #{radiation}</if>
  25. <if test="power != null "> and power = #{power}</if>
  26. <if test="dataFlag != null "> and data_flag = #{dataFlag}</if>
  27. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  28. and data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  29. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  30. </if>
  31. <if test="dataTime != null ">and data_time = #{dataTime}</if>
  32. </where>
  33. </select>
  34. <select id="selectPvDaPfPeriodDataById" parameterType="Long" resultMap="PvDaPfPeriodDataResult">
  35. <include refid="selectPvDaPfPeriodDataVo"/>
  36. where pv_no = #{pvNo}
  37. </select>
  38. <select id="selectPvDaPfPeriodData" parameterType="PvDaPfPeriodData" resultMap="PvDaPfPeriodDataResult">
  39. <include refid="selectPvDaPfPeriodDataVo"/>
  40. where pv_no = #{pvNo} and model_no = #{modelNo} and data_time = #{dataTime}
  41. </select>
  42. </mapper>