| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrProject.flowMonitoring; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.daoPr.PrMonitoringFlowmeterMapper; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoPr.PrMonitoringFlowmeter; | 
|---|
|  |  |  | 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-05 10:25 | 
|---|
|  |  |  | * @LastEditTime 2024-01-05 10:25 | 
|---|
|  |  |  | * @Description 管网流量监测站、流量计关联管理服务类 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | public class MoniFlowSv { | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private PrMonitoringFlowmeterMapper prMonitoringFlowmeterMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 添加流量监测站、流量计关联关系 | 
|---|
|  |  |  | * @param po | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Integer addRecord(PrMonitoringFlowmeter po) { | 
|---|
|  |  |  | return prMonitoringFlowmeterMapper.insert(po); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 根据流量监测站、流量计、操作类型获取记录数量 | 
|---|
|  |  |  | * @param monitoringId 监测站编号 | 
|---|
|  |  |  | * @param flowmeterId 流量计编号 | 
|---|
|  |  |  | * @param operateType 操作类型 1-捆绑,2-解绑 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | Integer getBindRecordCount(Long monitoringId, Long flowmeterId, Byte operateType) { | 
|---|
|  |  |  | return prMonitoringFlowmeterMapper.getBindRecordCount(monitoringId, flowmeterId, operateType); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 根据 流量监测站编号 获取 绑定记录 按操作时间降序 | 
|---|
|  |  |  | * @param monitoringId | 
|---|
|  |  |  | * @return  PrMonitoringFlowmeter | 
|---|
|  |  |  | * */ | 
|---|
|  |  |  | public List<Map<String, Object>> getBingRecordsByMonitoringId(String monitoringId){ | 
|---|
|  |  |  | return prMonitoringFlowmeterMapper.getBingRecordsByMonitoringId(monitoringId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|