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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.dy.pipIrrProject.video;
 
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoVi.ViCameraMapper;
import com.dy.pipIrrGlobal.pojoVi.ViCamera;
import com.dy.pipIrrGlobal.voVi.VoCamera;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import java.util.List;
import java.util.Map;
 
/**
 * @Author: liurunyu
 * @Date: 2025/6/9 9:01
 * @Description
 */
@Slf4j
@Service
public class CameraSv {
 
    @Autowired
    private ViCameraMapper dao;
 
    /**
     * 根据指定条件获取实体记录
     * @param queryQo 查询条件值对象
     * @return 实体记录列表
     */
    public QueryResultVo<List<VoCamera>> some(CameraQo queryQo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryQo);
        Long itemTotal = dao.selectTotal(params);
 
        QueryResultVo<List<VoCamera>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = queryQo.pageSize;
        rsVo.pageCurr = queryQo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = dao.selectSome(params);
        return rsVo;
    }
 
 
    /**
     * 得到一个实体
     * @param id 实体ID
     * @return 实体
     */
    public ViCamera selectById(Long id){
        return this.dao.selectById(id) ;
    }
    /**
     * 保存(添加)视频监控点
     * @param po
     * @return
     */
    @Transactional
    Integer save(ViCamera po) {
        return dao.insert(po);
    }
 
    /**
     * 修改实体
     * @param po 实体
     * @return 数量
     */
    @Transactional
    public int update(ViCamera po) {
        return this.dao.updateByPrimaryKeySelective(po);
    }
 
    /**
     * 保存修改实体
     * @param id 实体ID
     * @return 影响记录数量
     */
    @Transactional
    public int delete(Long id){
        return this.dao.deleteLogicById(id) ;
    }
 
}