PrTheoryenergyDataMapper.xml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.PrTheoryenergyDataMapper">
  6. <resultMap type="PrTheoryenergyData" id="PrTheoryenergyDataResult">
  7. <result property="windplantNo" column="windplant_no" />
  8. <result property="projectNo" column="project_no" />
  9. <result property="dataTime" column="data_time" />
  10. <result property="theoryenergy" column="theoryenergy" />
  11. <result property="availableenergy" column="availableenergy" />
  12. <result property="dataFlag" column="data_flag" />
  13. </resultMap>
  14. <sql id="selectPrTheoryenergyDataVo">
  15. select windplant_no, project_no, data_time, theoryenergy, availableenergy, data_flag from pr_theoryenergy_data
  16. </sql>
  17. <select id="selectPrTheoryenergyDataList" parameterType="PrTheoryenergyData" resultMap="PrTheoryenergyDataResult">
  18. <include refid="selectPrTheoryenergyDataVo"/>
  19. <where>
  20. <if test="windplantNo != null ">and windplant_no = #{windplantNo}</if>
  21. <if test="projectNo != null ">and project_no = #{projectNo}</if>
  22. <if test="theoryenergy != null "> and theoryenergy = #{theoryenergy}</if>
  23. <if test="availableenergy != null "> and availableenergy = #{availableenergy}</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="selectPrTheoryenergyDataById" parameterType="Long" resultMap="PrTheoryenergyDataResult">
  33. <include refid="selectPrTheoryenergyDataVo"/>
  34. where windplant_no = #{windplantNo}
  35. </select>
  36. <select id="selectPrTheoryenergyData" parameterType="PrTheoryenergyData" resultMap="PrTheoryenergyDataResult">
  37. <include refid="selectPrTheoryenergyDataVo"/>
  38. where windplant_no = #{windplantNo} and project_no = #{projectNo} and data_time > #{dataTime}
  39. </select>
  40. </mapper>