Administrator
2024-01-16 80a4c2dee40aa6ed9ee750ebc431c0b4a3d8758f
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
package com.dy.pipIrrProject.intakeController;
 
import com.dy.pipIrrGlobal.daoPr.PrIntakeControllerMapper;
import com.dy.pipIrrGlobal.pojoPr.PrIntakeController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
import java.util.Map;
 
/**
 * @author ZhuBaoMin
 * @date 2024-01-02 9:19
 * @LastEditTime 2024-01-02 9:19
 * @Description
 */
 
@Slf4j
@Service
public class IntakeControllerSv {
    @Autowired
    private PrIntakeControllerMapper prIntakeControllerMapper;
 
    /**
     * 根据取水口编号、控制器编号、操作类别获取记录数量
     * 重复绑定、重复解绑都用该方法判断
     * @param intakeId 取水口ID
     * @param controllerId 控制器ID
     * @param operateType 操作类型 1-捆绑,2-解绑
     * @return 如何条件记录数
     */
    Integer getBindRecordCount(Long intakeId, Long controllerId, Byte operateType) {
        return prIntakeControllerMapper.getBindRecordCount(intakeId, controllerId, operateType);
    }
    /**
     * 添加取水口、控制器捆绑记录,1-捆绑,2-解绑
     * @param po 取水口/控制器实体对象
     * @return
     */
    Integer addRecord(PrIntakeController po) {
        return prIntakeControllerMapper.insert(po);
    }
 
    /**
     * 根据取水口编号获取绑定记录列表
     * @param intakeId 取水口编号
     * @return 取水口与控制器绑定列表
     */
    List<Map<String, Object>> getBindsByIntakeId(Long intakeId) {
        return prIntakeControllerMapper.getBindsByIntakeId(intakeId);
    }
 
    /**
     * 根据控制器编号获取绑定记录列表
     * @param controllerId 控制器编号
     * @return 取水口与控制器绑定列表
     */
    List<Map<String, Object>> getBindsByControllerId(Long controllerId) {
        return prIntakeControllerMapper.getBindsByControllerId(controllerId);
    }
}