优化目录订阅时父节点的更新
This commit is contained in:
@@ -247,4 +247,13 @@ public interface DeviceChannelMapper {
|
||||
"<foreach collection='channels' item='item' open='(' separator=',' close=')' > #{item.channelId}</foreach>" +
|
||||
" </script>"})
|
||||
int cleanChannelsNotInList(String deviceId, List<DeviceChannel> channels);
|
||||
|
||||
@Update(" update device_channel" +
|
||||
" set subCount = (select *" +
|
||||
" from (select count(0)" +
|
||||
" from device_channel" +
|
||||
" where deviceId = #{deviceId} and parentId = #{channelId}) as temp)" +
|
||||
" where deviceId = #{deviceId} " +
|
||||
" and channelId = #{channelId}")
|
||||
int updateChannelSubCount(String deviceId, String channelId);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ import java.util.*;
|
||||
@Component
|
||||
public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(VideoManagerStoragerImpl.class);
|
||||
private final Logger logger = LoggerFactory.getLogger(VideoManagerStoragerImpl.class);
|
||||
|
||||
@Autowired
|
||||
EventPublisher eventPublisher;
|
||||
@@ -171,6 +171,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||
}else {
|
||||
deviceChannelMapper.update(channel);
|
||||
}
|
||||
deviceChannelMapper.updateChannelSubCount(deviceId,channel.getParentId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user