zhubaomin
2024-11-12 39be193dece5ad6314aa22a41a2c8675e8057be3
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
package com.dy.pipIrrRemote.rtuUpgrage;
 
import com.dy.pipIrrGlobal.daoRm.UgRtuControllerMapper;
import com.dy.pipIrrGlobal.daoRm.UgRtuProgramMapper;
import com.dy.pipIrrGlobal.daoRm.UgRtuTaskMapper;
import com.dy.pipIrrGlobal.pojoRm.UgRtuProgram;
import com.dy.pipIrrGlobal.pojoRm.UgRtuTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * @Author: liurunyu
 * @Date: 2024/11/12 8:33
 * @Description
 */
@Slf4j
@Service
public class RtuUpgradeSv {
    @Autowired
    private UgRtuTaskMapper tdao ;
    @Autowired
    private UgRtuProgramMapper pdao ;
    @Autowired
    private UgRtuControllerMapper cdao ;
 
    /**
     * 通信主键查询一个升级任务
     * @param id 主键
     * @return
     */
    public UgRtuTask selectTaskById(String taskId){
        return tdao.selectByPrimaryKey(Long.valueOf(taskId));
    }
 
    /**
     * 通信主键查询一个升级程序
     * @param id 主键
     * @return
     */
    public UgRtuProgram selectProgramById(Long id){
        return pdao.selectByPrimaryKey(id);
    }
 
    /**
     * 查询一个升级任务所有控制器地址
     * @return 一些一些控制器地址
     */
    public List<String> selectAllRtuAddrByTask(String taskId){
        return this.cdao.selectAllRtuAddrByTask(Long.valueOf(taskId)) ;
    }
}