123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.sooka.sponest.monitor.camera.mapper.CentermonitorTCameraMapper">
- <update id="updateBatchLawEnforcementInstrumentState">
- UPDATE centermonitor_t_camera
- SET working_status = CASE camera_code
- <foreach collection="list" item="item">
- WHEN (SELECT channel_code FROM centermonitor_t_camerachannel WHERE device_code = #{item.code} AND
- channel_type = 2 LIMIT 1) THEN
- CASE
- WHEN #{item.status} = '0' THEN '1'
- ELSE '0'
- END
- </foreach>
- END,
- offline_reason = ''
- WHERE camera_code IN (
- <foreach collection="list" item="item" separator=",">
- (SELECT channel_code FROM centermonitor_t_camerachannel WHERE device_code = #{item.code} AND channel_type =
- 2 LIMIT 1)
- </foreach>
- );
- </update>
- <update id="updateBatchVideoRecorderOfflineState">
- UPDATE centermonitor_t_camera
- SET working_status = 1
- WHERE camera_code in
- <foreach collection="list" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </update>
- <update id="updateBatchVideoRecorderOnlineState">
- UPDATE centermonitor_t_camera
- SET working_status = 0
- WHERE camera_code in
- <foreach collection="list" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </update>
- </mapper>
|