RemoteOpcLogMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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.RemoteOpcLogMapper">
  4. <sql id="Base_Column_List">
  5. opc_log.id,
  6. opc_log.sb_id,
  7. opc_log.sb_name,
  8. opc_log.position_num,
  9. opc_log.type,
  10. opc_log.description,
  11. opc_log.result,
  12. opc_log.ratio,
  13. opc_log.unit,
  14. opc_log.remark,
  15. opc_log.year,
  16. opc_log.month,
  17. opc_log.day,
  18. opc_log.hour,
  19. opc_log.minute,
  20. opc_log.info,
  21. opc_log.created_user_id,
  22. opc_log.update_user_id,
  23. opc_log.created_time,
  24. opc_log.update_time
  25. </sql>
  26. <sql id="Ref_Column_List">
  27. opc_log.sb_id,
  28. opc_log.sb_name,
  29. opc_log.position_num,
  30. opc_log.type,
  31. opc_log.description,
  32. opc_log.result,
  33. opc_log.year,
  34. opc_log.month,
  35. opc_log.day,
  36. opc_log.hour,
  37. opc_log.minute,
  38. opc_log.info,
  39. opc_log.ratio,
  40. opc_log.unit,
  41. opc_log.remark,
  42. </sql>
  43. <sql id="List_Condition">
  44. <if test="id != null and id != ''">
  45. and opc_log.id = #{id}
  46. </if>
  47. <if test="sbId != null and sbId != ''">
  48. and opc_log.sb_id = #{sbId}
  49. </if>
  50. <if test="year != null">
  51. and opc_log.year = #{year}
  52. </if>
  53. <if test="month != null">
  54. and opc_log.month = #{month}
  55. </if>
  56. <if test="day != null">
  57. and opc_log.day = #{day}
  58. </if>
  59. <if test="hour != null">
  60. and opc_log.hour = #{hour}
  61. </if>
  62. <if test="minute != null">
  63. and opc_log.minute = #{minute}
  64. </if>
  65. <if test="positionNum != null">
  66. and opc_log.position_num = #{positionNum}
  67. </if>
  68. <if test="type != null">
  69. and opc_log.type = #{type}
  70. </if>
  71. <if test="description != null and description != ''">
  72. and opc_log.description = #{description}
  73. </if>
  74. <if test="result != null and result != ''">
  75. and opc_log.result = #{result}
  76. </if>
  77. <if test="ratio != null">
  78. and opc_log.ratio = #{ratio}
  79. </if>
  80. <if test="unit != null and unit != ''">
  81. and opc_log.unit = #{unit}
  82. </if>
  83. <if test="remark != null and remark != ''">
  84. and opc_log.remark = #{remark}
  85. </if>
  86. <if test="createdUserId != null and createdUserId != ''">
  87. and opc_log.created_user_id = #{createdUserId}
  88. </if>
  89. <if test="updateUserId != null and updateUserId != ''">
  90. and opc_log.update_user_id = #{updateUserId}
  91. </if>
  92. <if test="createdTimeStart != null">
  93. and opc_log.created_time <![CDATA[>=]]> #{createdTimeStart}
  94. </if>
  95. <if test="createdTimeEnd != null">
  96. and opc_log.created_time <![CDATA[<=]]> #{createdTimeEnd}
  97. </if>
  98. <if test="createdTime != null">
  99. and opc_log.created_time = #{createdTime}
  100. </if>
  101. <if test="updateTimeStart != null">
  102. and opc_log.update_time <![CDATA[>=]]> #{updateTimeStart}
  103. </if>
  104. <if test="updateTimeEnd != null">
  105. and opc_log.update_time <![CDATA[<=]]> #{updateTimeEnd}
  106. </if>
  107. <if test="updateTime != null">
  108. and opc_log.update_time = #{updateTime}
  109. </if>
  110. <if test="keyword != null and keyword != ''">
  111. and opc_log.position_num like concat(concat('%',#{keyword}),'%')
  112. </if>
  113. </sql>
  114. <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteOpcLogDTO"
  115. resultType="com.platform.dao.vo.query.remote.RemoteOpcLogVO">
  116. select opc_log.*
  117. from t_remote_opc_log as opc_log
  118. <where>
  119. <include refid="List_Condition"/>
  120. </where>
  121. </select>
  122. <update id="updateBatch" parameterType="java.util.List">
  123. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  124. update t_remote_opc_log
  125. <set>
  126. remark=concat(remark,#{item.remark})
  127. </set>
  128. where position_num = #{item.positionNum}
  129. and year = #{item.year}
  130. and month = #{item.month}
  131. and day = #{item.day}
  132. </foreach>
  133. </update>
  134. </mapper>