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;
|
|
/**
|
* <p>
|
* 点位管理 服务实现类
|
* </p>
|
*
|
* @author zhanghua
|
* @since 2022-09-26
|
*/
|
@Service
|
public class VideoPointServiceImpl extends ServiceImpl<VideoPointMapper, VideoPoint> implements IVideoPointService {
|
|
@Override
|
public IPage<VideoPointVo> 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<VideoPoint> queryWrapper = new LambdaQueryWrapper<VideoPoint>()
|
.eq(VideoPoint::getPlatResourceId, code)
|
.or().eq(VideoPoint::getCode, code);
|
List<VideoPoint> pointList = this.list(queryWrapper);
|
if (pointList.size() > 0) {
|
videoPoint = pointList.get(0);
|
}
|
return videoPoint;
|
}
|
|
@Override
|
public VideoPoint getByChannelId(Integer channelId) {
|
VideoPoint videoPoint = null;
|
LambdaQueryWrapper<VideoPoint> queryWrapper = new LambdaQueryWrapper<VideoPoint>()
|
.eq(VideoPoint::getChannelId, channelId);
|
List<VideoPoint> pointList = this.list(queryWrapper);
|
if (pointList.size() > 0) {
|
videoPoint = pointList.get(0);
|
}
|
return videoPoint;
|
}
|
}
|