ProjectUspTsPeriodDataMapper.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.ProjectUspTsPeriodDataMapper">
  6. <resultMap type="ProjectUspTsPeriodData" id="ProjectUspTsPeriodDataResult">
  7. <result property="projectNo" column="project_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="windSpeed" column="wind_speed"/>
  12. <result property="modCoeff" column="mod_coeff"/>
  13. <result property="power" column="power"/>
  14. <result property="modPower" column="mod_power"/>
  15. <result property="dataFlag" column="data_flag"/>
  16. </resultMap>
  17. <sql id="selectProjectUspTsPeriodDataVo">
  18. select project_no, model_no, time_scale, data_time, wind_speed, mod_coeff, power, mod_power, data_flag from project_usp_ts_period_data
  19. </sql>
  20. <select id="selectProjectUspTsPeriodDataList" parameterType="ProjectUspTsPeriodData"
  21. resultMap="ProjectUspTsPeriodDataResult">
  22. <include refid="selectProjectUspTsPeriodDataVo"/>
  23. <where>
  24. <if test="projectNo != null ">and project_no = #{projectNo}</if>
  25. <if test="modelNo != null ">and model_no = #{modelNo}</if>
  26. <if test="timeScale != null ">and time_scale = #{timeScale}</if>
  27. <if test="windSpeed != null ">and wind_speed = #{windSpeed}</if>
  28. <if test="modCoeff != null ">and mod_coeff = #{modCoeff}</if>
  29. <if test="power != null ">and power = #{power}</if>
  30. <if test="modPower != null ">and mod_power = #{modPower}</if>
  31. <if test="dataFlag != null ">and data_flag = #{dataFlag}</if>
  32. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  33. and data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  34. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  35. </if>
  36. <if test="dataTime != null ">and data_time = #{dataTime}</if>
  37. </where>
  38. order by data_time asc
  39. </select>
  40. <select id="selectProjectUspTsPeriodDataById" parameterType="Long" resultMap="ProjectUspTsPeriodDataResult">
  41. <include refid="selectProjectUspTsPeriodDataVo"/>
  42. where project_no = #{projectNo}
  43. </select>
  44. <select id="selectProjectUspTsPeriodData" parameterType="ProjectUspTsPeriodData" resultMap="ProjectUspTsPeriodDataResult">
  45. <include refid="selectProjectUspTsPeriodDataVo"/>
  46. where project_no = #{projectNo} and model_no = #{modelNo} and time_scale = #{timeScale} and data_time > #{dataTime}
  47. </select>
  48. </mapper>