| 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); | 
|     } | 
| } |