AreaConfigMapper.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.AreaConfigMapper">
  6. <resultMap type="AreaConfig" id="AreaConfigResult">
  7. <result property="areaNo" column="area_no"/>
  8. <result property="rtuNo" column="rtu_no"/>
  9. </resultMap>
  10. <sql id="selectAreaConfigVo">
  11. select area_no, rtu_no from area_config
  12. </sql>
  13. <select id="selectAreaConfigByRtuNo" parameterType="Long" resultMap="AreaConfigResult">
  14. <include refid="selectAreaConfigVo"/>
  15. where rtu_no = #{rtuNo}
  16. </select>
  17. <select id="selectWindplantListByAreaNo" parameterType="Long" resultMap="AreaConfigResult">
  18. select
  19. ac.*,
  20. w.name as "name"
  21. from
  22. area_config ac
  23. left join windplant w on w.windplant_no = ac.rtu_no
  24. where ac.area_no = #{areaNo}
  25. </select>
  26. <insert id="insertAreaConfig" parameterType="AreaConfig">
  27. insert into area_config
  28. <trim prefix="(" suffix=")" suffixOverrides=",">
  29. <if test="areaNo != null">area_no,</if>
  30. <if test="rtuNo != null">rtu_no,</if>
  31. </trim>
  32. <trim prefix="values (" suffix=")" suffixOverrides=",">
  33. <if test="areaNo != null">#{areaNo},</if>
  34. <if test="rtuNo != null">#{rtuNo},</if>
  35. </trim>
  36. </insert>
  37. <update id="updateAreaConfig" parameterType="AreaConfig">
  38. update area_config
  39. <trim prefix="SET" suffixOverrides=",">
  40. <if test="areaNo != null">area_no = #{areaNo},</if>
  41. </trim>
  42. where rtu_no = #{rtuNo}
  43. </update>
  44. <delete id="deleteAreaConfigByRtuNo" parameterType="Long">
  45. delete from area_config where rtu_no = #{rtuNo}
  46. </delete>
  47. </mapper>