liurunyu
2024-11-08 87a49ccc47abbb3505403d174001ceb3a2d2341d
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
85
86
87
88
89
90
91
92
package com.dy.pipIrrBase.rtuUpgrade.task;
 
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoRm.UgRtuTaskMapper;
import com.dy.pipIrrGlobal.pojoRm.UgRtuTask;
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: 2024/11/5 8:33
 * @Description
 */
@Slf4j
@Service
public class UgRtuTaskSv {
 
    @Autowired
    private UgRtuTaskMapper dao ;
 
    /**
     * 得到一个一些升级程序
     * @param id 一些升级程序ID
     * @return 一些升级程序实体
     */
    public UgRtuTask selectById(Long id){
        return this.dao.selectByPrimaryKey(id) ;
    }
 
    /**
     * 得到一些升级程序
     * @return 一些升级程序
     */
    public QueryResultVo<List<UgRtuTask>> selectSome(QueryTaskVo queryVo){
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ;
        Long itemTotal = this.dao.selectTotal(params) ;
 
        QueryResultVo<List<UgRtuTask>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = this.dao.selectSome(params) ;
 
        return rsVo ;
    }
 
    /**
     * 得到所有升级程序记录ID和文件名称
     * @return 一些升级程序
     */
    public QueryResultVo<List<UgRtuTask>> selectAll(){
        QueryResultVo<List<UgRtuTask>> rsVo = new QueryResultVo<>() ;
        rsVo.obj = this.dao.selectAll() ;
        return rsVo ;
    }
 
    /**
     * 新增保存分水口实体
     * @param po 实体
     * @return 数量
     */
    @Transactional
    public int save(UgRtuTask po){
        return this.dao.insertSelective(po) ;
    }
    /**
     * 保存修改实体
     * @param po 实体
     * @return 数量
     */
    @Transactional
    public int update(UgRtuTask po){
        return this.dao.updateByPrimaryKeySelective(po) ;
    }
 
    /**
     * 逻辑删除实体
     * @param id 实体ID
     * @return 数量
     */
    @Transactional
    public int delete(Long id){
        return this.dao.deleteLogicById(id) ;
    }
 
}