RemoteOpcMapper.xml 9.1 KB

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