WfNwpDataMapper.xml 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.WfNwpDataMapper">
  6. <resultMap type="WfNwpData" id="WfNwpDataResult">
  7. <result property="windplantNo" column="windplant_no"/>
  8. <result property="nwpType" column="nwp_type"/>
  9. <result property="fileTime" column="file_time"/>
  10. <result property="dataTime" column="data_time"/>
  11. <result property="windSpeed" column="wind_speed"/>
  12. <result property="temperature" column="temperature"/>
  13. <result property="windDir" column="wind_dir"/>
  14. <result property="humidity" column="humidity"/>
  15. <result property="airPressure" column="air_pressure"/>
  16. </resultMap>
  17. <sql id="selectWfNwpDataVo">
  18. select windplant_no, nwp_type, file_time, data_time, wind_speed, temperature, wind_dir, humidity, air_pressure from wf_nwp_data
  19. </sql>
  20. <select id="selectWfNwpDataList" parameterType="WfNwpData" resultMap="WfNwpDataResult">
  21. select
  22. wnd.windplant_no,
  23. wnd.nwp_type,
  24. wnd.file_time,
  25. wnd.data_time,
  26. wnd.wind_speed,
  27. wnd.temperature,
  28. wnd.wind_dir,
  29. wnd.humidity,
  30. wnd.air_pressure,
  31. emi.item_name as "itemName"
  32. from
  33. wf_nwp_data wnd
  34. LEFT JOIN ENUM_MENU_ITEM emi ON emi.ITEM_NO = wnd.NWP_TYPE AND MENU_NO = 119
  35. <where>
  36. <if test="windplantNo != null ">and wnd.windplant_no = #{windplantNo}</if>
  37. <if test="nwpType != null ">and wnd.nwp_type = #{nwpType}</if>
  38. <if test="fileTime != null ">and wnd.file_time = #{fileTime}</if>
  39. <if test="windSpeed != null ">and wnd.wind_speed = #{windSpeed}</if>
  40. <if test="temperature != null ">and wnd.temperature = #{temperature}</if>
  41. <if test="windDir != null ">and wnd.wind_dir = #{windDir}</if>
  42. <if test="humidity != null ">and wnd.humidity = #{humidity}</if>
  43. <if test="airPressure != null ">and wnd.air_pressure = #{airPressure}</if>
  44. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  45. and wnd.data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  46. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  47. </if>
  48. <if test="dataTime != null ">and wnd.data_time = #{dataTime}</if>
  49. </where>
  50. ORDER BY data_time asc
  51. </select>
  52. <select id="selectWfNwpDataById" parameterType="Long" resultMap="WfNwpDataResult">
  53. <include refid="selectWfNwpDataVo"/>
  54. where windplant_no = #{windplantNo}
  55. </select>
  56. <select id="selectWfNwpData" parameterType="WfNwpData" resultMap="WfNwpDataResult">
  57. select
  58. wnd.windplant_no,
  59. wnd.nwp_type,
  60. wnd.file_time,
  61. wnd.data_time,
  62. wnd.wind_speed,
  63. wnd.temperature,
  64. wnd.wind_dir,
  65. wnd.humidity,
  66. wnd.air_pressure,
  67. emi.item_name as "itemName"
  68. from
  69. wf_nwp_data wnd
  70. LEFT JOIN ENUM_MENU_ITEM emi ON emi.ITEM_NO = wnd.NWP_TYPE AND MENU_NO = 119
  71. where wnd.windplant_no = #{windplantNo} and wnd.nwp_type = #{nwpType} and wnd.data_time > #{dataTime}
  72. </select>
  73. <select id="selectWfNwpDataByWindDir" parameterType="WfNwpData" resultMap="WfNwpDataResult">
  74. select
  75. wnd.windplant_no,
  76. wnd.nwp_type,
  77. wnd.file_time,
  78. wnd.data_time,
  79. wnd.wind_speed,
  80. wnd.temperature,
  81. wnd.wind_dir,
  82. wnd.humidity,
  83. wnd.air_pressure,
  84. emi.item_name as "itemName"
  85. from
  86. wf_nwp_data wnd
  87. LEFT JOIN ENUM_MENU_ITEM emi ON emi.ITEM_NO = wnd.NWP_TYPE AND MENU_NO = 119
  88. where wnd.windplant_no = #{windplantNo} and wnd.nwp_type = #{nwpType} and wnd.data_time = #{dataTime}
  89. and wnd.wind_dir between #{params.beginData} and #{params.endData}
  90. </select>
  91. </mapper>