DialIndicatorLogMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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.manage.mapper.DialIndicatorLogMapper">
  6. <resultMap type="DialIndicatorLog" id="DialIndicatorLogResult">
  7. <result property="logId" column="log_id" />
  8. <result property="ipAddress" column="ip_address" />
  9. <result property="portNo" column="port_no" />
  10. <result property="protocol" column="protocol" />
  11. <result property="channelId" column="channel_id" />
  12. <result property="channelName" column="channel_name" />
  13. <result property="eventType" column="event_type" />
  14. <result property="deviceId" column="device_id" />
  15. <result property="deviceUuid" column="device_uuid" />
  16. <result property="sceneId" column="scene_id" />
  17. <result property="ruleId" column="rule_id" />
  18. <result property="tagsetId" column="tagset_id" />
  19. <result property="photo" column="photo" />
  20. <result property="readingType" column="reading_type" />
  21. <result property="readingResult" column="reading_result" />
  22. <result property="statusResult" column="status_result" />
  23. <result property="pilotLampstate" column="pilot_lampState" />
  24. <result property="eightPositionSelectorKnobTate" column="eight_position_selector_knob_tate" />
  25. <result property="airSwitchCircuitBreakerState" column="air_switch_circuit_breaker_state" />
  26. <result property="relayProtectionControllerState" column="relay_protection_controller_state" />
  27. <result property="silicaGelBreatherState" column="silica_gel_breather_state" />
  28. <result property="charactersState" column="characters_state" />
  29. <result property="circuitBreakerState" column="circuit_breaker_state" />
  30. <result property="knifeSwitchState" column="knife_switch_state" />
  31. <result property="openSetTypeState" column="open_set_type_state" />
  32. <result property="delFlag" column="del_flag" />
  33. <result property="createBy" column="create_by" />
  34. <result property="createTime" column="create_time" />
  35. <result property="updateBy" column="update_by" />
  36. <result property="updateTime" column="update_time" />
  37. <result property="remark" column="remark" />
  38. </resultMap>
  39. <sql id="selectDialIndicatorLogVo">
  40. select log_id, ip_address, port_no, protocol, channel_id, channel_name, event_type, device_id, device_uuid, scene_id, rule_id, tagset_id, photo, reading_type, reading_result, status_result, pilot_lampState, eight_position_selector_knob_tate, air_switch_circuit_breaker_state, relay_protection_controller_state, silica_gel_breather_state, characters_state, circuit_breaker_state, knife_switch_state, open_set_type_state, del_flag, create_by, create_time, update_by, update_time, remark from dial_indicator_log
  41. </sql>
  42. <select id="selectDialIndicatorLogList" parameterType="DialIndicatorLog" resultMap="DialIndicatorLogResult">
  43. <include refid="selectDialIndicatorLogVo"/>
  44. <where>
  45. <if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
  46. <if test="portNo != null and portNo != ''"> and port_no = #{portNo}</if>
  47. <if test="protocol != null and protocol != ''"> and protocol = #{protocol}</if>
  48. <if test="channelId != null and channelId != ''"> and channel_id = #{channelId}</if>
  49. <if test="channelName != null and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
  50. <if test="eventType != null and eventType != ''"> and event_type = #{eventType}</if>
  51. <if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
  52. <if test="deviceUuid != null and deviceUuid != ''"> and device_uuid = #{deviceUuid}</if>
  53. <if test="sceneId != null and sceneId != ''"> and scene_id = #{sceneId}</if>
  54. <if test="ruleId != null and ruleId != ''"> and rule_id = #{ruleId}</if>
  55. <if test="tagsetId != null and tagsetId != ''"> and tagset_id = #{tagsetId}</if>
  56. <if test="photo != null and photo != ''"> and photo = #{photo}</if>
  57. <if test="readingType != null and readingType != ''"> and reading_type = #{readingType}</if>
  58. <if test="readingResult != null and readingResult != ''"> and reading_result = #{readingResult}</if>
  59. <if test="statusResult != null and statusResult != ''"> and status_result = #{statusResult}</if>
  60. <if test="pilotLampstate != null and pilotLampstate != ''"> and pilot_lampState = #{pilotLampstate}</if>
  61. <if test="eightPositionSelectorKnobTate != null and eightPositionSelectorKnobTate != ''"> and eight_position_selector_knob_tate = #{eightPositionSelectorKnobTate}</if>
  62. <if test="airSwitchCircuitBreakerState != null and airSwitchCircuitBreakerState != ''"> and air_switch_circuit_breaker_state = #{airSwitchCircuitBreakerState}</if>
  63. <if test="relayProtectionControllerState != null and relayProtectionControllerState != ''"> and relay_protection_controller_state = #{relayProtectionControllerState}</if>
  64. <if test="silicaGelBreatherState != null and silicaGelBreatherState != ''"> and silica_gel_breather_state = #{silicaGelBreatherState}</if>
  65. <if test="charactersState != null and charactersState != ''"> and characters_state = #{charactersState}</if>
  66. <if test="circuitBreakerState != null and circuitBreakerState != ''"> and circuit_breaker_state = #{circuitBreakerState}</if>
  67. <if test="knifeSwitchState != null and knifeSwitchState != ''"> and knife_switch_state = #{knifeSwitchState}</if>
  68. <if test="openSetTypeState != null and openSetTypeState != ''"> and open_set_type_state = #{openSetTypeState}</if>
  69. </where>
  70. </select>
  71. <select id="selectDialIndicatorLogByLogId" parameterType="Long" resultMap="DialIndicatorLogResult">
  72. <include refid="selectDialIndicatorLogVo"/>
  73. where log_id = #{logId}
  74. </select>
  75. <insert id="insertDialIndicatorLog" parameterType="DialIndicatorLog" useGeneratedKeys="true" keyProperty="logId">
  76. insert into dial_indicator_log
  77. <trim prefix="(" suffix=")" suffixOverrides=",">
  78. <if test="ipAddress != null">ip_address,</if>
  79. <if test="portNo != null">port_no,</if>
  80. <if test="protocol != null">protocol,</if>
  81. <if test="channelId != null">channel_id,</if>
  82. <if test="channelName != null">channel_name,</if>
  83. <if test="eventType != null">event_type,</if>
  84. <if test="deviceId != null">device_id,</if>
  85. <if test="deviceUuid != null">device_uuid,</if>
  86. <if test="sceneId != null">scene_id,</if>
  87. <if test="ruleId != null">rule_id,</if>
  88. <if test="tagsetId != null">tagset_id,</if>
  89. <if test="photo != null">photo,</if>
  90. <if test="readingType != null">reading_type,</if>
  91. <if test="readingResult != null">reading_result,</if>
  92. <if test="statusResult != null">status_result,</if>
  93. <if test="pilotLampstate != null">pilot_lampState,</if>
  94. <if test="eightPositionSelectorKnobTate != null">eight_position_selector_knob_tate,</if>
  95. <if test="airSwitchCircuitBreakerState != null">air_switch_circuit_breaker_state,</if>
  96. <if test="relayProtectionControllerState != null">relay_protection_controller_state,</if>
  97. <if test="silicaGelBreatherState != null">silica_gel_breather_state,</if>
  98. <if test="charactersState != null">characters_state,</if>
  99. <if test="circuitBreakerState != null">circuit_breaker_state,</if>
  100. <if test="knifeSwitchState != null">knife_switch_state,</if>
  101. <if test="openSetTypeState != null">open_set_type_state,</if>
  102. <if test="delFlag != null">del_flag,</if>
  103. <if test="createBy != null">create_by,</if>
  104. <if test="createTime != null">create_time,</if>
  105. <if test="updateBy != null">update_by,</if>
  106. <if test="updateTime != null">update_time,</if>
  107. <if test="remark != null">remark,</if>
  108. </trim>
  109. <trim prefix="values (" suffix=")" suffixOverrides=",">
  110. <if test="ipAddress != null">#{ipAddress},</if>
  111. <if test="portNo != null">#{portNo},</if>
  112. <if test="protocol != null">#{protocol},</if>
  113. <if test="channelId != null">#{channelId},</if>
  114. <if test="channelName != null">#{channelName},</if>
  115. <if test="eventType != null">#{eventType},</if>
  116. <if test="deviceId != null">#{deviceId},</if>
  117. <if test="deviceUuid != null">#{deviceUuid},</if>
  118. <if test="sceneId != null">#{sceneId},</if>
  119. <if test="ruleId != null">#{ruleId},</if>
  120. <if test="tagsetId != null">#{tagsetId},</if>
  121. <if test="photo != null">#{photo},</if>
  122. <if test="readingType != null">#{readingType},</if>
  123. <if test="readingResult != null">#{readingResult},</if>
  124. <if test="statusResult != null">#{statusResult},</if>
  125. <if test="pilotLampstate != null">#{pilotLampstate},</if>
  126. <if test="eightPositionSelectorKnobTate != null">#{eightPositionSelectorKnobTate},</if>
  127. <if test="airSwitchCircuitBreakerState != null">#{airSwitchCircuitBreakerState},</if>
  128. <if test="relayProtectionControllerState != null">#{relayProtectionControllerState},</if>
  129. <if test="silicaGelBreatherState != null">#{silicaGelBreatherState},</if>
  130. <if test="charactersState != null">#{charactersState},</if>
  131. <if test="circuitBreakerState != null">#{circuitBreakerState},</if>
  132. <if test="knifeSwitchState != null">#{knifeSwitchState},</if>
  133. <if test="openSetTypeState != null">#{openSetTypeState},</if>
  134. <if test="delFlag != null">#{delFlag},</if>
  135. <if test="createBy != null">#{createBy},</if>
  136. <if test="createTime != null">#{createTime},</if>
  137. <if test="updateBy != null">#{updateBy},</if>
  138. <if test="updateTime != null">#{updateTime},</if>
  139. <if test="remark != null">#{remark},</if>
  140. </trim>
  141. </insert>
  142. <update id="updateDialIndicatorLog" parameterType="DialIndicatorLog">
  143. update dial_indicator_log
  144. <trim prefix="SET" suffixOverrides=",">
  145. <if test="ipAddress != null">ip_address = #{ipAddress},</if>
  146. <if test="portNo != null">port_no = #{portNo},</if>
  147. <if test="protocol != null">protocol = #{protocol},</if>
  148. <if test="channelId != null">channel_id = #{channelId},</if>
  149. <if test="channelName != null">channel_name = #{channelName},</if>
  150. <if test="eventType != null">event_type = #{eventType},</if>
  151. <if test="deviceId != null">device_id = #{deviceId},</if>
  152. <if test="deviceUuid != null">device_uuid = #{deviceUuid},</if>
  153. <if test="sceneId != null">scene_id = #{sceneId},</if>
  154. <if test="ruleId != null">rule_id = #{ruleId},</if>
  155. <if test="tagsetId != null">tagset_id = #{tagsetId},</if>
  156. <if test="photo != null">photo = #{photo},</if>
  157. <if test="readingType != null">reading_type = #{readingType},</if>
  158. <if test="readingResult != null">reading_result = #{readingResult},</if>
  159. <if test="statusResult != null">status_result = #{statusResult},</if>
  160. <if test="pilotLampstate != null">pilot_lampState = #{pilotLampstate},</if>
  161. <if test="eightPositionSelectorKnobTate != null">eight_position_selector_knob_tate = #{eightPositionSelectorKnobTate},</if>
  162. <if test="airSwitchCircuitBreakerState != null">air_switch_circuit_breaker_state = #{airSwitchCircuitBreakerState},</if>
  163. <if test="relayProtectionControllerState != null">relay_protection_controller_state = #{relayProtectionControllerState},</if>
  164. <if test="silicaGelBreatherState != null">silica_gel_breather_state = #{silicaGelBreatherState},</if>
  165. <if test="charactersState != null">characters_state = #{charactersState},</if>
  166. <if test="circuitBreakerState != null">circuit_breaker_state = #{circuitBreakerState},</if>
  167. <if test="knifeSwitchState != null">knife_switch_state = #{knifeSwitchState},</if>
  168. <if test="openSetTypeState != null">open_set_type_state = #{openSetTypeState},</if>
  169. <if test="delFlag != null">del_flag = #{delFlag},</if>
  170. <if test="createBy != null">create_by = #{createBy},</if>
  171. <if test="createTime != null">create_time = #{createTime},</if>
  172. <if test="updateBy != null">update_by = #{updateBy},</if>
  173. <if test="updateTime != null">update_time = #{updateTime},</if>
  174. <if test="remark != null">remark = #{remark},</if>
  175. </trim>
  176. where log_id = #{logId}
  177. </update>
  178. <delete id="deleteDialIndicatorLogByLogId" parameterType="Long">
  179. delete from dial_indicator_log where log_id = #{logId}
  180. </delete>
  181. <delete id="deleteDialIndicatorLogByLogIds" parameterType="String">
  182. delete from dial_indicator_log where log_id in
  183. <foreach item="logId" collection="array" open="(" separator="," close=")">
  184. #{logId}
  185. </foreach>
  186. </delete>
  187. </mapper>