RemoteOpcMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.platform.dao.mapper.remote.RemoteOpcMapper">
  4. <sql id="Base_Column_List">
  5. opc.id,
  6. opc.sb_id,
  7. opc.sb_name,
  8. opc.position_num,
  9. opc.line,
  10. opc.type,
  11. opc.warn_first,
  12. opc.warn_second,
  13. opc.warn_third,
  14. opc.warn_four,
  15. opc.warn_first_color,
  16. opc.warn_second_color,
  17. opc.warn_third_color,
  18. opc.warn_four_color,
  19. opc.low,
  20. opc.high,
  21. opc.description,
  22. opc.result,
  23. opc.av_flag,
  24. opc.port_flag,
  25. opc.fetch_flag,
  26. opc.created_flag,
  27. opc.position_flag,
  28. opc.x_position,
  29. opc.y_position,
  30. opc.img_x_position,
  31. opc.img_y_position,
  32. opc.width,
  33. opc.height,
  34. opc.ratio,
  35. opc.unit,
  36. opc.info,
  37. opc.remark,
  38. opc.created_user_id,
  39. opc.update_user_id,
  40. opc.created_time,
  41. opc.update_time
  42. </sql>
  43. <sql id="Ref_Column_List">
  44. opc.sb_id,
  45. opc.sb_name,
  46. opc.position_num,
  47. opc.line,
  48. opc.type,
  49. opc.info,
  50. opc.warn_first,
  51. opc.warn_second,
  52. opc.warn_third,
  53. opc.warn_four,
  54. opc.low,
  55. opc.high,
  56. opc.description,
  57. opc.result,
  58. opc.av_flag,
  59. opc.port_flag,
  60. opc.fetch_flag,
  61. opc.created_flag,
  62. opc.position_flag,
  63. opc.x_position,
  64. opc.y_position,
  65. opc.img_x_position,
  66. opc.img_y_position,
  67. opc.width,
  68. opc.height,
  69. opc.ratio,
  70. opc.unit,
  71. opc.remark,
  72. </sql>
  73. <sql id="List_Condition">
  74. <if test="id != null and id != ''">
  75. and opc.id = #{id}
  76. </if>
  77. <if test="createdFlag != null">
  78. and opc.created_flag = #{createdFlag}
  79. </if>
  80. <if test="avFlag != null">
  81. and opc.av_flag = #{avFlag}
  82. </if>
  83. <if test="portFlag != null">
  84. and opc.port_flag = #{portFlag}
  85. </if>
  86. <if test="fetchFlag != null">
  87. and opc.fetch_flag = #{fetchFlag}
  88. </if>
  89. <if test="positionFlag != null">
  90. and opc.position_flag = #{positionFlag}
  91. </if>
  92. <if test="sbId != null and sbId != ''">
  93. and opc.sb_id = #{sbId}
  94. </if>
  95. <if test="sbName != null and sbName != ''">
  96. and opc.sb_name = #{sbName}
  97. </if>
  98. <if test="positionNum != null">
  99. and opc.position_num = #{positionNum}
  100. </if>
  101. <if test="line != null">
  102. and opc.line = #{line}
  103. </if>
  104. <if test="type != null">
  105. and opc.type = #{type}
  106. </if>
  107. <if test="description != null and description != ''">
  108. and opc.description = #{description}
  109. </if>
  110. <if test="result != null and result != ''">
  111. and opc.result = #{result}
  112. </if>
  113. <if test="ratio != null">
  114. and opc.ratio = #{ratio}
  115. </if>
  116. <if test="unit != null and unit != ''">
  117. and opc.unit = #{unit}
  118. </if>
  119. <if test="remark != null and remark != ''">
  120. and opc.remark = #{remark}
  121. </if>
  122. <if test="createdUserId != null and createdUserId != ''">
  123. and opc.created_user_id = #{createdUserId}
  124. </if>
  125. <if test="updateUserId != null and updateUserId != ''">
  126. and opc.update_user_id = #{updateUserId}
  127. </if>
  128. <if test="createdTimeStart != null">
  129. and opc.created_time <![CDATA[>=]]>; #{createdTimeStart}
  130. </if>
  131. <if test="createdTimeEnd != null">
  132. and opc.created_time <![CDATA[<=]]> #{createdTimeEnd}
  133. </if>
  134. <if test="createdTime != null">
  135. and opc.created_time = #{createdTime}
  136. </if>
  137. <if test="updateTimeStart != null">
  138. and opc.update_time <![CDATA[>=]]>; #{updateTimeStart}
  139. </if>
  140. <if test="updateTimeEnd != null">
  141. and opc.update_time <![CDATA[<=]]> #{updateTimeEnd}
  142. </if>
  143. <if test="updateTime != null">
  144. and opc.update_time = #{updateTime}
  145. </if>
  146. <if test="keyword != null and keyword != ''">
  147. and (
  148. opc.sb_name like concat(concat('%',#{keyword}),'%')
  149. or opc.position_num like concat(concat('%',#{keyword}),'%')
  150. )
  151. </if>
  152. <if test="ids != null">
  153. AND opc.id in
  154. <foreach item="item" index="index" collection="ids" open="(" close=")" separator=",">
  155. #{item}
  156. </foreach>
  157. </if>
  158. </sql>
  159. <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteOpcDTO"
  160. resultType="com.platform.dao.vo.query.remote.RemoteOpcVO">
  161. select opc.*, position.name as positionName
  162. from t_remote_opc as opc
  163. left join t_sb_position position on opc.line = position.id
  164. <where>
  165. <include refid="List_Condition"/>
  166. </where>
  167. </select>
  168. <update id="updateBatch" parameterType="java.util.List">
  169. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  170. update t_remote_opc
  171. <set>
  172. <if test="item.result != null and item.result != ''">
  173. result = #{item.result},
  174. </if>
  175. <if test="item.remark != null and item.remark != ''">
  176. remark = #{item.remark},
  177. </if>
  178. <if test="item.updateUserId != null">
  179. update_user_id = #{item.updateUserId},
  180. </if>
  181. <if test="item.updateTime != null">
  182. update_time = #{item.updateTime}
  183. </if>
  184. <if test="item.avFlag != null">
  185. av_flag = #{item.avFlag}
  186. </if>
  187. <if test="item.createdFlag != null">
  188. created_flag = #{item.createdFlag}
  189. </if>
  190. <if test="item.positionFlag != null">
  191. position_flag = #{item.positionFlag}
  192. </if>
  193. <if test="item.fetchFlag != null">
  194. fetch_flag = #{fetchFlag}
  195. </if>
  196. <if test="item.portFlag != null">
  197. port_flag = #{portFlag}
  198. </if>
  199. <if test="item.xPosition != null">
  200. x_position = #{item.xPosition}
  201. </if>
  202. <if test="item.yPosition != null">
  203. y_position = #{item.yPosition}
  204. </if>
  205. <if test="item.width != null">
  206. width = #{item.width}
  207. </if>
  208. <if test="item.height != null">
  209. height = #{item.height}
  210. </if>
  211. </set>
  212. where position_num = #{item.positionNum}
  213. </foreach>
  214. </update>
  215. </mapper>