package com.ycl.service.video.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.entity.video.VideoPoint;
import com.ycl.mapper.video.VideoPointMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.vo.equipment.HandheldTerminalVo;
import com.ycl.vo.equipment.VideoPointVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
*
* 点位管理 服务实现类
*
*
* @author zhanghua
* @since 2022-09-26
*/
@Service
public class VideoPointServiceImpl extends ServiceImpl implements IVideoPointService {
@Override
public IPage getList(Integer streetId, Integer communityId, Integer type, Integer current, Integer size) {
return baseMapper.search(new Page<>(current, size), streetId, communityId, type);
}
@Override
public VideoPoint getByCode(String code) {
VideoPoint videoPoint = null;
LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper()
.eq(VideoPoint::getPlatResourceId, code)
.or().eq(VideoPoint::getCode, code);
List pointList = this.list(queryWrapper);
if (pointList.size() > 0) {
videoPoint = pointList.get(0);
}
return videoPoint;
}
@Override
public VideoPoint getByChannelId(Integer channelId) {
VideoPoint videoPoint = null;
LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper()
.eq(VideoPoint::getChannelId, channelId);
List pointList = this.list(queryWrapper);
if (pointList.size() > 0) {
videoPoint = pointList.get(0);
}
return videoPoint;
}
}