RemoteOpcMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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
  6. .
  7. id
  8. ,
  9. opc.sb_id,
  10. opc.sb_name,
  11. opc.position_num,
  12. opc.line,
  13. opc.type,
  14. opc.description,
  15. opc.result,
  16. opc.av_flag,
  17. opc.created_flag,
  18. opc.position_flag,
  19. opc.x_position,
  20. opc.y_position,
  21. opc.width,
  22. opc.height,
  23. opc.ratio,
  24. opc.unit,
  25. opc.info,
  26. opc.remark,
  27. opc.created_user_id,
  28. opc.update_user_id,
  29. opc.created_time,
  30. opc.update_time
  31. </sql>
  32. <sql id="Ref_Column_List">
  33. opc.sb_id,
  34. opc.sb_name,
  35. opc.position_num,
  36. opc.line,
  37. opc.type,
  38. opc.info,
  39. opc.description,
  40. opc.result,
  41. opc.av_flag,
  42. opc.created_flag,
  43. opc.position_flag,
  44. opc.x_position,
  45. opc.y_position,
  46. opc.width,
  47. opc.height,
  48. opc.ratio,
  49. opc.unit,
  50. opc.remark,
  51. </sql>
  52. <sql id="List_Condition">
  53. <if test="id != null and id != ''">
  54. and opc.id = #{id}
  55. </if>
  56. <if test="createdFlag != null and createdFlag != ''">
  57. and opc.created_flag = #{createdFlag}
  58. </if>
  59. <if test="avFlag != null and avFlag != ''">
  60. and opc.av_flag = #{avFlag}
  61. </if>
  62. <if test="positionFlag != null and positionFlag != ''">
  63. and opc.position_flag = #{positionFlag}
  64. </if>
  65. <if test="sbId != null and sbId != ''">
  66. and opc.sb_id = #{sbId}
  67. </if>
  68. <if test="sbName != null and sbName != ''">
  69. and opc.sb_name = #{sbName}
  70. </if>
  71. <if test="positionNum != null">
  72. and opc.position_num = #{positionNum}
  73. </if>
  74. <if test="line != null">
  75. and opc.line = #{line}
  76. </if>
  77. <if test="type != null">
  78. and opc.type = #{type}
  79. </if>
  80. <if test="description != null and description != ''">
  81. and opc.description = #{description}
  82. </if>
  83. <if test="result != null and result != ''">
  84. and opc.result = #{result}
  85. </if>
  86. <if test="ratio != null">
  87. and opc.ratio = #{ratio}
  88. </if>
  89. <if test="unit != null and unit != ''">
  90. and opc.unit = #{unit}
  91. </if>
  92. <if test="remark != null and remark != ''">
  93. and opc.remark = #{remark}
  94. </if>
  95. <if test="createdUserId != null and createdUserId != ''">
  96. and opc.created_user_id = #{createdUserId}
  97. </if>
  98. <if test="updateUserId != null and updateUserId != ''">
  99. and opc.update_user_id = #{updateUserId}
  100. </if>
  101. <if test="createdTimeStart != null">
  102. and opc.created_time <![CDATA[>=]]>; #{createdTimeStart}
  103. </if>
  104. <if test="createdTimeEnd != null">
  105. and opc.created_time <![CDATA[<=]]> #{createdTimeEnd}
  106. </if>
  107. <if test="createdTime != null">
  108. and opc.created_time = #{createdTime}
  109. </if>
  110. <if test="updateTimeStart != null">
  111. and opc.update_time <![CDATA[>=]]>; #{updateTimeStart}
  112. </if>
  113. <if test="updateTimeEnd != null">
  114. and opc.update_time <![CDATA[<=]]> #{updateTimeEnd}
  115. </if>
  116. <if test="updateTime != null">
  117. and opc.update_time = #{updateTime}
  118. </if>
  119. <if test="keyword != null and keyword != ''">
  120. and (
  121. opc.id like concat(concat('%',#{keyword}),'%')
  122. or opc.position_num like concat(concat('%',#{keyword}),'%')
  123. )
  124. </if>
  125. </sql>
  126. <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteOpcDTO"
  127. resultType="com.platform.dao.vo.query.remote.RemoteOpcVO">
  128. select opc.*
  129. from t_remote_opc as opc
  130. <where>
  131. <include refid="List_Condition"/>
  132. </where>
  133. </select>
  134. <update id="updateBatch" parameterType="java.util.List">
  135. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  136. update t_remote_opc
  137. <set>
  138. <if test="item.result != null and item.result != ''">
  139. result = #{item.result},
  140. </if>
  141. <if test="item.remark != null and item.remark != ''">
  142. remark = #{item.remark},
  143. </if>
  144. <if test="item.updateUserId != null">
  145. update_user_id = #{item.updateUserId},
  146. </if>
  147. <if test="item.updateTime != null">
  148. update_time = #{item.updateTime}
  149. </if>
  150. <if test="item.avFlag != null">
  151. av_flag = #{item.avFlag}
  152. </if>
  153. <if test="item.createdFlag != null">
  154. created_flag = #{item.createdFlag}
  155. </if>
  156. <if test="item.positionFlag != null">
  157. position_flag = #{item.positionFlag}
  158. </if>
  159. <if test="item.xPosition != null">
  160. x_position = #{item.xPosition}
  161. </if>
  162. <if test="item.yPosition != null">
  163. y_position = #{item.yPosition}
  164. </if>
  165. <if test="item.width != null">
  166. width = #{item.width}
  167. </if>
  168. <if test="item.height != null">
  169. height = #{item.height}
  170. </if>
  171. </set>
  172. where position_num = #{item.positionNum}
  173. </foreach>
  174. </update>
  175. </mapper>