package com.dy.pipIrrProject.flowMonitoring;
|
|
import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper;
|
import com.dy.pipIrrGlobal.daoPr.PrFlowMonitoringMapper;
|
import com.dy.pipIrrGlobal.pojoPr.PrFlowMonitoring;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.Map;
|
|
/**
|
* @author ZhuBaoMin
|
* @date 2024-01-04 16:11
|
* @LastEditTime 2024-01-04 16:11
|
* @Description
|
*/
|
|
@Slf4j
|
@Service
|
public class FlowMonitoringSv {
|
@Autowired
|
private PrFlowMonitoringMapper prFlowMonitoringMapper;
|
|
@Autowired
|
private BaDistrictMapper baDistrictMapper;
|
|
/**
|
* 根据村编号获取5级区划信息
|
* @param villageId 村编号(主键)
|
* @return 5级行政区划信息
|
*/
|
public Map getDistrictsByVillageId(Long villageId) {
|
return baDistrictMapper.getDistrictsByVillageId(villageId);
|
}
|
|
/**
|
* 添加管网流量监测站
|
* @param prFlowMonitoring 流量监测站实体
|
* @return
|
*/
|
public Integer addFlowMonitoring(PrFlowMonitoring prFlowMonitoring) {
|
return prFlowMonitoringMapper.insert(prFlowMonitoring);
|
}
|
|
/**
|
* 根据监测站编号删除监测站
|
* @param flowMonitoringId
|
* @return
|
*/
|
public Integer deleteFlowMonitoring(Long flowMonitoringId) {
|
return prFlowMonitoringMapper.deleteFlowMonitoringById(flowMonitoringId);
|
}
|
|
/**
|
* 根据监测站编号获取未删除的监测站数量
|
* @param flowMonitoringId 流量监测站编号
|
* @return
|
*/
|
public Integer getRecordCountOfFlowMonitoring(Long flowMonitoringId) {
|
return prFlowMonitoringMapper.getRecordCountOfFlowMonitoring(flowMonitoringId);
|
}
|
|
}
|