zhanghua
2024-09-28 7873c6f56380d28e1ae6958f77a84081797c817f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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;
    }
}