AreaMapper.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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.AreaMapper">
  6. <resultMap type="Area" id="AreaResult">
  7. <result property="areaNo" column="area_no"/>
  8. <result property="areaType" column="area_type"/>
  9. <result property="status" column="status"/>
  10. <result property="power" column="power"/>
  11. <result property="wfCnt" column="wf_cnt"/>
  12. <result property="runWf" column="run_wf"/>
  13. <result property="stopWf" column="stop_wf"/>
  14. <result property="installWtg" column="install_wtg"/>
  15. <result property="installPower" column="install_power"/>
  16. <result property="putintoWtg" column="putinto_wtg"/>
  17. <result property="putintoPower" column="putinto_power"/>
  18. <result property="joinWtg" column="join_wtg"/>
  19. <result property="joinPower" column="join_power"/>
  20. <result property="runWtg" column="run_wtg"/>
  21. <result property="stopWtg" column="stop_wtg"/>
  22. <result property="procTime" column="proc_time"/>
  23. <result property="procDayTime" column="proc_day_time"/>
  24. <result property="procMonthTime" column="proc_month_time"/>
  25. <result property="name" column="name"/>
  26. <result property="pathname" column="pathname"/>
  27. <result property="aliasname" column="aliasname"/>
  28. <result property="description" column="description"/>
  29. </resultMap>
  30. <sql id="selectAreaVo">
  31. select area_no, area_type, status, power, wf_cnt, run_wf, stop_wf, install_wtg, install_power, putinto_wtg, putinto_power, join_wtg, join_power, run_wtg, stop_wtg, proc_time, proc_day_time, proc_month_time, name, pathname, aliasname, description from area
  32. </sql>
  33. <select id="selectAreaList" parameterType="Area" resultMap="AreaResult">
  34. <include refid="selectAreaVo"/>
  35. <where>
  36. <if test="areaType != null ">and area_type = #{areaType}</if>
  37. <if test="status != null ">and status = #{status}</if>
  38. <if test="power != null ">and power = #{power}</if>
  39. <if test="wfCnt != null ">and wf_cnt = #{wfCnt}</if>
  40. <if test="runWf != null ">and run_wf = #{runWf}</if>
  41. <if test="stopWf != null ">and stop_wf = #{stopWf}</if>
  42. <if test="installWtg != null ">and install_wtg = #{installWtg}</if>
  43. <if test="installPower != null ">and install_power = #{installPower}</if>
  44. <if test="putintoWtg != null ">and putinto_wtg = #{putintoWtg}</if>
  45. <if test="putintoPower != null ">and putinto_power = #{putintoPower}</if>
  46. <if test="joinWtg != null ">and join_wtg = #{joinWtg}</if>
  47. <if test="joinPower != null ">and join_power = #{joinPower}</if>
  48. <if test="runWtg != null ">and run_wtg = #{runWtg}</if>
  49. <if test="stopWtg != null ">and stop_wtg = #{stopWtg}</if>
  50. <if test="procTime != null ">and proc_time = #{procTime}</if>
  51. <if test="procDayTime != null ">and proc_day_time = #{procDayTime}</if>
  52. <if test="procMonthTime != null ">and proc_month_time = #{procMonthTime}</if>
  53. <if test="name != null and name != ''">and name like concat(concat('%', #{name}), '%')</if>
  54. <if test="pathname != null and pathname != ''">and pathname like concat(concat('%', #{pathname}), '%')</if>
  55. <if test="aliasname != null and aliasname != ''">and aliasname like concat(concat('%', #{aliasname}),
  56. '%')
  57. </if>
  58. <if test="description != null and description != ''">and description = #{description}</if>
  59. </where>
  60. order by area_no desc
  61. </select>
  62. <select id="selectAreaById" parameterType="Long" resultMap="AreaResult">
  63. <include refid="selectAreaVo"/>
  64. where area_no = #{areaNo}
  65. </select>
  66. <select id="selectNewData" resultType="Long">
  67. SELECT * FROM ( SELECT area_no FROM area ORDER BY area_no DESC ) WHERE ROWNUM = 1
  68. </select>
  69. <insert id="insertArea" parameterType="Area">
  70. insert into area
  71. <trim prefix="(" suffix=")" suffixOverrides=",">
  72. <if test="areaNo != null">area_no,</if>
  73. <if test="areaType != null">area_type,</if>
  74. <if test="status != null">status,</if>
  75. <if test="power != null">power,</if>
  76. <if test="wfCnt != null">wf_cnt,</if>
  77. <if test="runWf != null">run_wf,</if>
  78. <if test="stopWf != null">stop_wf,</if>
  79. <if test="installWtg != null">install_wtg,</if>
  80. <if test="installPower != null">install_power,</if>
  81. <if test="putintoWtg != null">putinto_wtg,</if>
  82. <if test="putintoPower != null">putinto_power,</if>
  83. <if test="joinWtg != null">join_wtg,</if>
  84. <if test="joinPower != null">join_power,</if>
  85. <if test="runWtg != null">run_wtg,</if>
  86. <if test="stopWtg != null">stop_wtg,</if>
  87. <if test="procTime != null">proc_time,</if>
  88. <if test="procDayTime != null">proc_day_time,</if>
  89. <if test="procMonthTime != null">proc_month_time,</if>
  90. <if test="name != null">name,</if>
  91. <if test="pathname != null">pathname,</if>
  92. <if test="aliasname != null">aliasname,</if>
  93. <if test="description != null">description,</if>
  94. </trim>
  95. <trim prefix="values (" suffix=")" suffixOverrides=",">
  96. <if test="areaNo != null">#{areaNo},</if>
  97. <if test="areaType != null">#{areaType},</if>
  98. <if test="status != null">#{status},</if>
  99. <if test="power != null">#{power},</if>
  100. <if test="wfCnt != null">#{wfCnt},</if>
  101. <if test="runWf != null">#{runWf},</if>
  102. <if test="stopWf != null">#{stopWf},</if>
  103. <if test="installWtg != null">#{installWtg},</if>
  104. <if test="installPower != null">#{installPower},</if>
  105. <if test="putintoWtg != null">#{putintoWtg},</if>
  106. <if test="putintoPower != null">#{putintoPower},</if>
  107. <if test="joinWtg != null">#{joinWtg},</if>
  108. <if test="joinPower != null">#{joinPower},</if>
  109. <if test="runWtg != null">#{runWtg},</if>
  110. <if test="stopWtg != null">#{stopWtg},</if>
  111. <if test="procTime != null">#{procTime},</if>
  112. <if test="procDayTime != null">#{procDayTime},</if>
  113. <if test="procMonthTime != null">#{procMonthTime},</if>
  114. <if test="name != null">#{name},</if>
  115. <if test="pathname != null">#{pathname},</if>
  116. <if test="aliasname != null">#{aliasname},</if>
  117. <if test="description != null">#{description},</if>
  118. </trim>
  119. </insert>
  120. <update id="updateArea" parameterType="Area">
  121. update area
  122. <trim prefix="SET" suffixOverrides=",">
  123. <if test="areaType != null">area_type = #{areaType},</if>
  124. <if test="status != null">status = #{status},</if>
  125. <if test="power != null">power = #{power},</if>
  126. <if test="wfCnt != null">wf_cnt = #{wfCnt},</if>
  127. <if test="runWf != null">run_wf = #{runWf},</if>
  128. <if test="stopWf != null">stop_wf = #{stopWf},</if>
  129. <if test="installWtg != null">install_wtg = #{installWtg},</if>
  130. <if test="installPower != null">install_power = #{installPower},</if>
  131. <if test="putintoWtg != null">putinto_wtg = #{putintoWtg},</if>
  132. <if test="putintoPower != null">putinto_power = #{putintoPower},</if>
  133. <if test="joinWtg != null">join_wtg = #{joinWtg},</if>
  134. <if test="joinPower != null">join_power = #{joinPower},</if>
  135. <if test="runWtg != null">run_wtg = #{runWtg},</if>
  136. <if test="stopWtg != null">stop_wtg = #{stopWtg},</if>
  137. <if test="procTime != null">proc_time = #{procTime},</if>
  138. <if test="procDayTime != null">proc_day_time = #{procDayTime},</if>
  139. <if test="procMonthTime != null">proc_month_time = #{procMonthTime},</if>
  140. <if test="name != null">name = #{name},</if>
  141. <if test="pathname != null">pathname = #{pathname},</if>
  142. <if test="aliasname != null">aliasname = #{aliasname},</if>
  143. <if test="description != null">description = #{description},</if>
  144. </trim>
  145. where area_no = #{areaNo}
  146. </update>
  147. <delete id="deleteAreaById" parameterType="Long">
  148. delete from area where area_no = #{areaNo}
  149. </delete>
  150. </mapper>