BcrMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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.BcrMapper">
  6. <resultMap type="Bcr" id="BcrResult">
  7. <result property="windplantNo" column="windplant_no"/>
  8. <result property="bcrNo" column="bcr_no"/>
  9. <result property="wturNo" column="wtur_no"/>
  10. <result property="oftype" column="oftype"/>
  11. <result property="name" column="name"/>
  12. <result property="ref" column="ref"/>
  13. <result property="presence" column="presence"/>
  14. <result property="actval" column="actval"/>
  15. <result property="frval" column="frval"/>
  16. <result property="frtime" column="frtime"/>
  17. <result property="incval" column="incval"/>
  18. <result property="bcrType" column="bcr_type"/>
  19. <result property="q" column="q"/>
  20. <result property="t" column="t"/>
  21. <result property="statFlag" column="stat_flag"/>
  22. <result property="unifiedPoint" column="unified_point"/>
  23. </resultMap>
  24. <sql id="selectBcrVo">
  25. select windplant_no, bcr_no, wtur_no, oftype, name, ref, presence, actval, frval, frtime, incval, bcr_type, q, t, stat_flag, unified_point from bcr
  26. </sql>
  27. <select id="selectBcrList" parameterType="Bcr" resultMap="BcrResult">
  28. select
  29. b.*,
  30. w.name as "windplantName",
  31. wt.name as "wturName"
  32. from
  33. bcr b
  34. left join windplant w on w.windplant_no = b.windplant_no
  35. left join wtur wt on wt.wtur_no = b.wtur_no
  36. <where>
  37. <if test="windplantNo != null ">and b.windplant_no = #{windplantNo}</if>
  38. <if test="bcrNo != null ">and b.bcr_no = #{bcrNo}</if>
  39. <if test="wturNo != null ">and b.wtur_no = #{wturNo}</if>
  40. <if test="oftype != null ">and b.oftype = #{oftype}</if>
  41. <if test="name != null and name != ''">and b.name like concat(concat('%', #{name}), '%')</if>
  42. <if test="ref != null and ref != ''">and b.ref = #{ref}</if>
  43. <if test="presence != null ">and b.presence = #{presence}</if>
  44. <if test="actval != null ">and b.actval = #{actval}</if>
  45. <if test="frval != null ">and b.frval = #{frval}</if>
  46. <if test="frtime != null ">and b.frtime = #{frtime}</if>
  47. <if test="incval != null ">and b.incval = #{incval}</if>
  48. <if test="bcrType != null ">and b.bcr_type = #{bcrType}</if>
  49. <if test="q != null ">and b.q = #{q}</if>
  50. <if test="t != null ">and b.t = #{t}</if>
  51. <if test="statFlag != null ">and b.stat_flag = #{statFlag}</if>
  52. <if test="unifiedPoint != null ">and b.unified_point = #{unifiedPoint}</if>
  53. </where>
  54. order by b.windplant_no asc
  55. </select>
  56. <select id="selectBcrById" parameterType="Long" resultMap="BcrResult">
  57. <include refid="selectBcrVo"/>
  58. where bcr_no = #{bcrNo}
  59. </select>
  60. <select id="selectBcrByWturNo" parameterType="Long" resultMap="BcrResult">
  61. <include refid="selectBcrVo"/>
  62. where wtur_no = #{wturNo} order by bcr_no asc
  63. </select>
  64. <select id="selectBcrListIsNot0" parameterType="Bcr" resultMap="BcrResult">
  65. select
  66. b.*,
  67. w.name as "windplantName",
  68. wt.name as "wturName"
  69. from
  70. bcr b
  71. left join windplant w on w.windplant_no = b.windplant_no
  72. left join wtur wt on wt.wtur_no = b.wtur_no
  73. <where>
  74. <if test="windplantNo != null ">and b.windplant_no = #{windplantNo}</if>
  75. <if test="bcrNo != null ">and b.bcr_no = #{bcrNo}</if>
  76. and b.wtur_no != 0
  77. <if test="oftype != null ">and b.oftype = #{oftype}</if>
  78. <if test="name != null and name != ''">and b.name like concat(concat('%', #{name}), '%')</if>
  79. <if test="ref != null and ref != ''">and b.ref = #{ref}</if>
  80. <if test="presence != null ">and b.presence = #{presence}</if>
  81. <if test="actval != null ">and b.actval = #{actval}</if>
  82. <if test="frval != null ">and b.frval = #{frval}</if>
  83. <if test="frtime != null ">and b.frtime = #{frtime}</if>
  84. <if test="incval != null ">and b.incval = #{incval}</if>
  85. <if test="bcrType != null ">and b.bcr_type = #{bcrType}</if>
  86. <if test="q != null ">and b.q = #{q}</if>
  87. <if test="t != null ">and b.t = #{t}</if>
  88. <if test="statFlag != null ">and b.stat_flag = #{statFlag}</if>
  89. <if test="unifiedPoint != null ">and b.unified_point = #{unifiedPoint}</if>
  90. </where>
  91. order by b.windplant_no asc
  92. </select>
  93. <insert id="insertBcrList">
  94. insert into bcr(windplant_no, bcr_no, wtur_no, name, ref, incval, bcr_type, unified_point)
  95. <foreach collection="list" item="item" separator="UNION ALL">
  96. SELECT
  97. #{item.windplantNo},
  98. #{item.bcrNo},
  99. #{item.wturNo},
  100. #{item.name},
  101. #{item.ref},
  102. #{item.incval},
  103. #{item.bcrType},
  104. #{item.unifiedPoint}
  105. FROM DUAL
  106. </foreach>
  107. </insert>
  108. <delete id="deleteBcrById" parameterType="Long">
  109. delete from bcr where bcr_no = #{bcrNo}
  110. </delete>
  111. </mapper>