liurunyu
2024-11-08 e3aae0ec49b7423d4e8a9c903fe0b9852c89d6b6
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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 execute(Long id){
        return this.dao.executeById(id) ;
    }
 
    /**
     * 结束任务
     * @param id 实体ID
     * @return 数量
     */
    @Transactional
    public int over(Long id){
        return this.dao.overById(id) ;
    }
 
    /**
     * 执行任务
     * @param id 实体ID
     * @return 数量
     */
    @Transactional
    public int isExecute(Long id){
        return this.dao.isExecuteById(id) ;
    }
 
    /**
     * 结束任务
     * @param id 实体ID
     * @return 数量
     */
    @Transactional
    public int isOver(Long id){
        return this.dao.isOverById(id) ;
    }
 
    /**
     * 逻辑删除实体
     * @param id 实体ID
     * @return 数量
     */
    @Transactional
    public int delete(Long id){
        return this.dao.deleteLogicById(id) ;
    }
 
}