From 346b480ab7848c742065e9bf989abaf43b515613 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期一, 21 四月 2025 15:05:26 +0800
Subject: [PATCH] 获取轮灌组详情

---
 pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java |  166 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 166 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java
new file mode 100644
index 0000000..057c467
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java
@@ -0,0 +1,166 @@
+package com.dy.pipIrrSell.client;
+
+import com.dy.common.webUtil.QueryResultVo;
+import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper;
+import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper;
+import com.dy.pipIrrGlobal.daoSe.SeClientMapper;
+import com.dy.pipIrrGlobal.daoSe.SeOpenIdMapper;
+import com.dy.pipIrrGlobal.pojoSe.SeClient;
+import com.dy.pipIrrGlobal.pojoSe.SeOpenId;
+import com.dy.pipIrrGlobal.voSe.VoClient;
+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 2023/12/21 19:17
+ * @LastEditTime 2023/12/21 19:17
+ * @Description
+ */
+
+@Slf4j
+@Service
+public class ClientSv {
+    @Autowired
+    private SeClientMapper seClientMapper;
+
+    @Autowired
+    private BaDistrictMapper baDistrictMapper;
+
+    @Autowired
+    private BaSettingsMapper baSettingsMapper;
+
+    @Autowired
+    private SeOpenIdMapper seOpenIdMapper;
+
+    /**
+     * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏁版嵁
+     * @param queryVo
+     * @return
+     */
+    public QueryResultVo<List<VoClient>> getClients(QueryVo queryVo){
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ;
+
+        Long itemTotal = (long)seClientMapper.getRecordCount(params).size();
+        QueryResultVo<List<VoClient>> rsVo = new QueryResultVo<>() ;
+        rsVo.pageSize = queryVo.pageSize ;
+        rsVo.pageCurr = queryVo.pageCurr ;
+
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = seClientMapper.getClients(params);
+
+        return rsVo ;
+    }
+
+    /**
+     * 鏍规嵁涓婚敭鑾峰彇鍐滄埛瀵硅薄
+     * @param id 鍐滄埛涓婚敭
+     * @return 鍐滄埛瀵硅薄
+     */
+    public VoClient getOneClient(Long id) {
+        SeClient seClient = seClientMapper.selectByPrimaryKey(id);
+        VoClient voClient = SeClientToVoClient.INSTANCT.po2vo(seClient);
+        return voClient;
+    }
+    /**
+     * 澧炲紑鍐滄埛
+     * @param po
+     * @return
+     */
+    public Integer addClient(SeClient po) {
+        return seClientMapper.insertSelective(po);
+    }
+
+    /**
+     * 鏍规嵁6浣嶅尯鍒掍覆妯$硦鏌ヨ鍐滄埛缂栧彿
+     * @param district6
+     * @return
+     */
+    public String getClientNumOfMax(String district6) {
+        return seClientMapper.getClientNumOfMax(district6);
+    }
+
+    /**
+     * 鏍规嵁鏉戠紪鍙疯幏鍙�5绾у尯鍒掍俊鎭�
+     * @param villageId 鏉戠紪鍙凤紙涓婚敭锛�
+     * @return 5绾ц鏀垮尯鍒掍俊鎭�
+     */
+    public Map getDistrictsByVillageId(Long villageId) {
+        return baDistrictMapper.getDistrictsByVillageId(villageId);
+    }
+
+    /**
+     * 鏍规嵁鍐滄埛ID閫昏緫鍒犻櫎鍐滄埛
+     */
+    public Integer deleteClientById(Long id) {
+        return seClientMapper.deleteClientById(id);
+    }
+
+    /**
+     * 淇敼鍐滄埛瀵硅薄
+     * @param po 鍐滄埛瀵硅薄
+     * @return 淇敼璁板綍鏉℃暟
+     */
+    public Integer updateByPrimaryKey(SeClient po) {
+        return seClientMapper.updateByPrimaryKey(po);
+    }
+
+    /**
+     * 鏍规嵁涓婚敭鑾峰彇鏉慖D
+     * @param id
+     * @return
+     */
+    public Long getVillageIdById(Long id) {
+        return seClientMapper.getVillageIdById(id);
+    }
+
+    /**
+     * 鑾峰彇铏氭嫙鍗″彿鏈�澶у��
+     * @return
+     */
+    public Long getMa1xVirtualId() {
+        return seClientMapper.getMa1xVirtualId();
+    }
+
+    /**
+     * 鑾峰彇鐢ㄦ按鏂瑰紡鍒楄〃
+     * @return
+     */
+    public List<Map<String, Object>> getWaterTypes() {
+        return seClientMapper.getWaterTypes();
+    }
+
+    /**
+     * 鏍规嵁閰嶇疆椤硅幏鍙栭厤缃」鍊�
+     * @param itemName
+     * @return
+     */
+    public String getItemValue(String itemName) {
+        return baSettingsMapper.getItemValue(itemName);
+    }
+
+    /**
+     * 鏍规嵁鐢佃瘽鍙风爜鑾峰彇鍐滄埛ID
+     * @param phoneNumber
+     * @return
+     */
+    public Long getClientIdByPhone(String phoneNumber) {
+        return seClientMapper.getClientIdByPhone(phoneNumber);
+    }
+
+    /**
+     * 娣诲姞寰俊鐢ㄦ埛璐︽埛璁板綍
+     * @param po
+     * @return
+     */
+    public Long addOpenId(SeOpenId po) {
+        seOpenIdMapper.insert(po);
+        //return po.getClientId();
+        return po.getId();
+    }
+}

--
Gitblit v1.8.0