CentermonitorTCameraMapper.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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.sooka.sponest.monitor.camera.mapper.CentermonitorTCameraMapper">
  6. <update id="updateBatchLawEnforcementInstrumentState">
  7. UPDATE centermonitor_t_camera
  8. SET working_status = CASE camera_code
  9. <foreach collection="list" item="item">
  10. WHEN (SELECT channel_code FROM centermonitor_t_camerachannel WHERE device_code = #{item.code} AND
  11. channel_type = 2 LIMIT 1) THEN
  12. CASE
  13. WHEN #{item.status} = '0' THEN '1'
  14. ELSE '0'
  15. END
  16. </foreach>
  17. END,
  18. offline_reason = ''
  19. WHERE camera_code IN (
  20. <foreach collection="list" item="item" separator=",">
  21. (SELECT channel_code FROM centermonitor_t_camerachannel WHERE device_code = #{item.code} AND channel_type =
  22. 2 LIMIT 1)
  23. </foreach>
  24. );
  25. </update>
  26. <update id="updateBatchVideoRecorderOfflineState">
  27. UPDATE centermonitor_t_camera
  28. SET working_status = 1
  29. WHERE camera_code in
  30. <foreach collection="list" item="item" separator="," open="(" close=")">
  31. #{item}
  32. </foreach>
  33. </update>
  34. <update id="updateBatchVideoRecorderOnlineState">
  35. UPDATE centermonitor_t_camera
  36. SET working_status = 0
  37. WHERE camera_code in
  38. <foreach collection="list" item="item" separator="," open="(" close=")">
  39. #{item}
  40. </foreach>
  41. </update>
  42. </mapper>