From 4f99f59668c9160ca60958b7347944def26f2228 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期日, 27 四月 2025 10:58:53 +0800 Subject: [PATCH] 回退配置 --- pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/FlowMonitoringSv.java | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 116 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/FlowMonitoringSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/FlowMonitoringSv.java new file mode 100644 index 0000000..e8b2224 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/FlowMonitoringSv.java @@ -0,0 +1,116 @@ +package com.dy.pipIrrProject.flowMonitoring; + +import com.dy.common.webUtil.QueryResultVo; +import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper; +import com.dy.pipIrrGlobal.daoPr.PrFlowMonitoringMapper; +import com.dy.pipIrrGlobal.pojoPr.PrFlowMonitoring; +import com.dy.pipIrrGlobal.voPr.VoFlowMonitoring; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.common.utils.PojoUtils; +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-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 getRecordCountOfFlowMonitoringByFlowMonitoringId(Long flowMonitoringId) { + return prFlowMonitoringMapper.getRecordCountOfFlowMonitoringByFlowMonitoringId(flowMonitoringId); + } + + /** + * 寰楀埌涓�涓祦閲忕洃娴嬬珯 + * @param id 鐩戞祴绔橧D + * @return 鐩戞祴绔欏疄浣� + */ + public PrFlowMonitoring selectById(Long id) { + return prFlowMonitoringMapper.selectByPrimaryKey(id); + } + + /** + * 寰楀埌鍏ㄩ儴娴侀噺鐩戞祴绔� + * @return 鐩戞祴绔欏疄浣撻泦鍚� + */ + public QueryResultVo<List<PrFlowMonitoring>> selectAll(){ + QueryResultVo<List<PrFlowMonitoring>> rsVo = new QueryResultVo<>() ; + rsVo.obj = this.prFlowMonitoringMapper.selectAll() ; + return rsVo ; + } + + + /** + * 鏍规嵁鎸囧畾鏉′欢寰楀埌娴侀噺鐩戞祴绔欏疄浣撹褰� + * @param queryVo 缁欑殑鏉′欢 + * @return 鐩戞祴绔欏疄浣撻泦鍚� + */ + public QueryResultVo<List<VoFlowMonitoring>> getPrFlowMonitorings(QueryVo queryVo){ + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ; + + QueryResultVo<List<VoFlowMonitoring>> rsVo = new QueryResultVo<>() ; + rsVo.pageSize = queryVo.pageSize ; + rsVo.pageCurr = queryVo.pageCurr ; + + // 璁$畻绗﹀悎鏉′欢鐨勮褰曟暟 + Integer itemTotal = prFlowMonitoringMapper.getRecordCountOfFlowMonitoring(params); + rsVo.calculateAndSet(itemTotal.longValue(), params); + rsVo.obj = prFlowMonitoringMapper.getPrFlowMonitoring(params); + + return rsVo ; + } + + /** + * 淇濆瓨淇敼涓�涓祦閲忕洃娴嬬珯瀹炰綋 + * @param po 淇敼鐨勫唴瀹癸紙id涓嶄负绌�) + * @return + */ + public int update (PrFlowMonitoring po){ + return prFlowMonitoringMapper.updateByPrimaryKeySelective(po); + } +} -- Gitblit v1.8.0