WfFileConfigMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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.WfFileConfigMapper">
  6. <resultMap type="WfFileConfig" id="WfFileConfigResult">
  7. <result property="windplantNo" column="windplant_no"/>
  8. <result property="abbrName" column="abbr_name"/>
  9. <result property="nwpFlag" column="nwp_flag"/>
  10. <result property="uspNwpNo" column="usp_nwp_no"/>
  11. <result property="wpfmodelNo" column="wpfmodel_no"/>
  12. <result property="uwpfmodelNo" column="uwpfmodel_no"/>
  13. <result property="wpfemodelNo" column="wpfemodel_no"/>
  14. <result property="uwpfemodelNo" column="uwpfemodel_no"/>
  15. </resultMap>
  16. <sql id="selectWfFileConfigVo">
  17. select windplant_no, abbr_name, nwp_flag, usp_nwp_no, wpfmodel_no, uwpfmodel_no, wpfemodel_no, uwpfemodel_no from wf_file_config
  18. </sql>
  19. <select id="selectWfFileConfigList" parameterType="WfFileConfig" resultMap="WfFileConfigResult">
  20. select
  21. wfc.*,
  22. w.name as "windplantName",
  23. pps.name as "pvPowerStationName",
  24. emi.item_name as "uspNwpNoName"
  25. from
  26. wf_file_config wfc
  27. left join windplant w on w.windplant_no = wfc.windplant_no
  28. left join pv_power_station pps on pps.pv_station_no = wfc.windplant_no
  29. left join enum_menu_item emi on emi.item_val = wfc.usp_nwp_no and emi.menu_no = 119
  30. <where>
  31. <if test="windplantNo != null ">and wfc.windplant_no = #{windplantNo}</if>
  32. <if test="abbrName != null and abbrName != ''">and wfc.abbr_name like concat(concat('%', #{abbrName}), '%')
  33. </if>
  34. <if test="nwpFlag != null ">and wfc.nwp_flag = #{nwpFlag}</if>
  35. <if test="uspNwpNo != null "> and wfc.usp_nwp_no = #{uspNwpNo}</if>
  36. <if test="wpfmodelNo != null "> and wfc.wpfmodel_no = #{wpfmodelNo}</if>
  37. <if test="uwpfmodelNo != null "> and wfc.uwpfmodel_no = #{uwpfmodelNo}</if>
  38. <if test="wpfemodelNo != null ">and wfc.wpfemodel_no = #{wpfemodelNo}</if>
  39. <if test="uwpfemodelNo != null ">and wfc.uwpfemodel_no = #{uwpfemodelNo}</if>
  40. <if test="windplantName != null and windplantName != ''">and w.name like concat(concat('%',
  41. #{windplantName}), '%')
  42. </if>
  43. </where>
  44. order by wfc.windplant_no asc
  45. </select>
  46. <select id="selectWfFileConfigById" parameterType="Long" resultMap="WfFileConfigResult">
  47. select
  48. wfc.*,
  49. w.name as "windplantName",
  50. pps.name as "pvPowerStationName"
  51. from
  52. wf_file_config wfc
  53. left join windplant w on w.windplant_no = wfc.windplant_no
  54. left join pv_power_station pps on pps.pv_station_no = wfc.windplant_no
  55. where wfc.windplant_no = #{windplantNo}
  56. </select>
  57. <select id="checkWindplantNoUnique" parameterType="Long" resultType="int">
  58. select count(1) from wf_file_config where windplant_no = #{windplantNo} and rownum <![CDATA[ <= ]]> 1
  59. </select>
  60. <insert id="insertWfFileConfig" parameterType="WfFileConfig">
  61. insert into wf_file_config
  62. <trim prefix="(" suffix=")" suffixOverrides=",">
  63. <if test="windplantNo != null">windplant_no,</if>
  64. <if test="abbrName != null">abbr_name,</if>
  65. <if test="nwpFlag != null">nwp_flag,</if>
  66. <if test="uspNwpNo != null">usp_nwp_no,</if>
  67. <if test="wpfmodelNo != null">wpfmodel_no,</if>
  68. <if test="uwpfmodelNo != null">uwpfmodel_no,</if>
  69. <if test="wpfemodelNo != null">wpfemodel_no,</if>
  70. <if test="uwpfemodelNo != null">uwpfemodel_no,</if>
  71. </trim>
  72. <trim prefix="values (" suffix=")" suffixOverrides=",">
  73. <if test="windplantNo != null">#{windplantNo},</if>
  74. <if test="abbrName != null">#{abbrName},</if>
  75. <if test="nwpFlag != null">#{nwpFlag},</if>
  76. <if test="uspNwpNo != null">#{uspNwpNo},</if>
  77. <if test="wpfmodelNo != null">#{wpfmodelNo},</if>
  78. <if test="uwpfmodelNo != null">#{uwpfmodelNo},</if>
  79. <if test="wpfemodelNo != null">#{wpfemodelNo},</if>
  80. <if test="uwpfemodelNo != null">#{uwpfemodelNo},</if>
  81. </trim>
  82. </insert>
  83. <update id="updateWfFileConfig" parameterType="WfFileConfig">
  84. update wf_file_config
  85. <trim prefix="SET" suffixOverrides=",">
  86. <if test="abbrName != null">abbr_name = #{abbrName},</if>
  87. <if test="nwpFlag != null">nwp_flag = #{nwpFlag},</if>
  88. <if test="uspNwpNo != null">usp_nwp_no = #{uspNwpNo},</if>
  89. <if test="wpfmodelNo != null">wpfmodel_no = #{wpfmodelNo},</if>
  90. <if test="uwpfmodelNo != null">uwpfmodel_no = #{uwpfmodelNo},</if>
  91. <if test="wpfemodelNo != null">wpfemodel_no = #{wpfemodelNo},</if>
  92. <if test="uwpfemodelNo != null">uwpfemodel_no = #{uwpfemodelNo},</if>
  93. </trim>
  94. where windplant_no = #{windplantNo}
  95. </update>
  96. <delete id="deleteWfFileConfigById" parameterType="Long">
  97. delete from wf_file_config where windplant_no = #{windplantNo}
  98. </delete>
  99. <delete id="deleteWfFileConfigByIds" parameterType="String">
  100. delete from wf_file_config where windplant_no in
  101. <foreach item="windplantNo" collection="array" open="(" separator="," close=")">
  102. #{windplantNo}
  103. </foreach>
  104. </delete>
  105. </mapper>