PvUspPfErrIntervalMapper.xml 6.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.PvUspPfErrIntervalMapper">
  6. <resultMap type="PvUspPfErrInterval" id="PvUspPfErrIntervalResult">
  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="maxInterval95" column="max_interval95" />
  12. <result property="maxInterval90" column="max_interval90" />
  13. <result property="maxInterval85" column="max_interval85" />
  14. <result property="maxInterval80" column="max_interval80" />
  15. <result property="maxInterval75" column="max_interval75" />
  16. <result property="maxInterval70" column="max_interval70" />
  17. <result property="maxInterval65" column="max_interval65" />
  18. <result property="maxInterval60" column="max_interval60" />
  19. <result property="maxInterval55" column="max_interval55" />
  20. <result property="maxInterval50" column="max_interval50" />
  21. <result property="minInterval95" column="min_interval95" />
  22. <result property="minInterval90" column="min_interval90" />
  23. <result property="minInterval85" column="min_interval85" />
  24. <result property="minInterval80" column="min_interval80" />
  25. <result property="minInterval75" column="min_interval75" />
  26. <result property="minInterval70" column="min_interval70" />
  27. <result property="minInterval65" column="min_interval65" />
  28. <result property="minInterval60" column="min_interval60" />
  29. <result property="minInterval55" column="min_interval55" />
  30. <result property="minInterval50" column="min_interval50" />
  31. <result property="maxValue" column="max_value" />
  32. <result property="minValue" column="min_value" />
  33. <result property="avgValue" column="avg_value" />
  34. <result property="mlValue" column="ml_value" />
  35. <result property="dataFlag" column="data_flag" />
  36. </resultMap>
  37. <sql id="selectPvUspPfErrIntervalVo">
  38. select pv_no, model_no, time_scale, data_time, max_interval95, max_interval90, max_interval85, max_interval80, max_interval75, max_interval70, max_interval65, max_interval60, max_interval55, max_interval50, min_interval95, min_interval90, min_interval85, min_interval80, min_interval75, min_interval70, min_interval65, min_interval60, min_interval55, min_interval50, max_value, min_value, avg_value, ml_value, data_flag from pv_usp_pf_err_interval
  39. </sql>
  40. <select id="selectPvUspPfErrIntervalList" parameterType="PvUspPfErrInterval" resultMap="PvUspPfErrIntervalResult">
  41. select
  42. pupei.*,
  43. wyhd1.yc_val as "p0",
  44. putpd.power as "value"
  45. from
  46. pv_usp_pf_err_interval pupei
  47. LEFT JOIN pv_power_station pps ON pps.pv_station_no = pupei.pv_no
  48. LEFT JOIN wf_yc_history_data1 wyhd1 ON wyhd1.analog_no = pps.ap_yc_no and wyhd1.data_time = pupei.data_time
  49. LEFT JOIN pv_usp_ts_period_data putpd ON putpd.pv_no = pupei.pv_no and putpd.model_no = pupei.model_no and putpd.time_scale = pupei.time_scale and putpd.data_time = pupei.data_time
  50. <where>
  51. <if test="pvNo != null ">and pupei.pv_no = #{pvNo}</if>
  52. <if test="modelNo != null ">and pupei.model_no = #{modelNo}</if>
  53. <if test="timeScale != null ">and pupei.time_scale = #{timeScale}</if>
  54. <if test="maxInterval95 != null "> and pupei.max_interval95 = #{maxInterval95}</if>
  55. <if test="maxInterval90 != null "> and pupei.max_interval90 = #{maxInterval90}</if>
  56. <if test="maxInterval85 != null "> and pupei.max_interval85 = #{maxInterval85}</if>
  57. <if test="maxInterval80 != null "> and pupei.max_interval80 = #{maxInterval80}</if>
  58. <if test="maxInterval75 != null "> and pupei.max_interval75 = #{maxInterval75}</if>
  59. <if test="maxInterval70 != null "> and pupei.max_interval70 = #{maxInterval70}</if>
  60. <if test="maxInterval65 != null "> and pupei.max_interval65 = #{maxInterval65}</if>
  61. <if test="maxInterval60 != null "> and pupei.max_interval60 = #{maxInterval60}</if>
  62. <if test="maxInterval55 != null "> and pupei.max_interval55 = #{maxInterval55}</if>
  63. <if test="maxInterval50 != null "> and pupei.max_interval50 = #{maxInterval50}</if>
  64. <if test="minInterval95 != null "> and pupei.min_interval95 = #{minInterval95}</if>
  65. <if test="minInterval90 != null "> and pupei.min_interval90 = #{minInterval90}</if>
  66. <if test="minInterval85 != null "> and pupei.min_interval85 = #{minInterval85}</if>
  67. <if test="minInterval80 != null "> and pupei.min_interval80 = #{minInterval80}</if>
  68. <if test="minInterval75 != null "> and pupei.min_interval75 = #{minInterval75}</if>
  69. <if test="minInterval70 != null "> and pupei.min_interval70 = #{minInterval70}</if>
  70. <if test="minInterval65 != null "> and pupei.min_interval65 = #{minInterval65}</if>
  71. <if test="minInterval60 != null "> and pupei.min_interval60 = #{minInterval60}</if>
  72. <if test="minInterval55 != null "> and pupei.min_interval55 = #{minInterval55}</if>
  73. <if test="minInterval50 != null "> and pupei.min_interval50 = #{minInterval50}</if>
  74. <if test="maxValue != null "> and pupei.max_value = #{maxValue}</if>
  75. <if test="minValue != null "> and pupei.min_value = #{minValue}</if>
  76. <if test="avgValue != null "> and pupei.avg_value = #{avgValue}</if>
  77. <if test="mlValue != null "> and pupei.ml_value = #{mlValue}</if>
  78. <if test="dataFlag != null "> and pupei.data_flag = #{dataFlag}</if>
  79. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  80. and pupei.data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  81. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  82. </if>
  83. </where>
  84. order by pupei.data_time asc
  85. </select>
  86. <select id="selectPvUspPfErrIntervalById" parameterType="Long" resultMap="PvUspPfErrIntervalResult">
  87. <include refid="selectPvUspPfErrIntervalVo"/>
  88. where pv_no = #{pvNo}
  89. </select>
  90. </mapper>