From 203223860baa19deb6860eb2ba3181910d662980 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期四, 17 四月 2025 14:22:59 +0800
Subject: [PATCH] 1. 轮灌组被终止时灌溉时长为实际数值。2. 计划历史表按照创建时间倒排序。3. 发布计划时判断是否同项目下未完成计划,是否其他项目下使用了本计划的轮灌组且计划未完成。4. 根据计划ID获取计划最新状态。

---
 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/clientType/ClientTypeSv.java |  115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 115 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/clientType/ClientTypeSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/clientType/ClientTypeSv.java
new file mode 100644
index 0000000..cd15604
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/clientType/ClientTypeSv.java
@@ -0,0 +1,115 @@
+package com.dy.pipIrrBase.clientType;
+
+import com.dy.common.webUtil.QueryResultVo;
+import com.dy.pipIrrBase.user.QueryVo;
+import com.dy.pipIrrGlobal.daoBa.BaClientMapper;
+import com.dy.pipIrrGlobal.daoBa.BaClientTypeMapper;
+import com.dy.pipIrrGlobal.pojoBa.BaClientType;
+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 org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@Service
+public class ClientTypeSv {
+
+    private BaClientTypeMapper dao;
+    private BaClientMapper cdao;
+
+    @Autowired
+    private void setDao(BaClientTypeMapper dao){
+        this.dao = dao;
+    }
+
+    @Autowired
+    private void setDao(BaClientMapper dao){
+        this.cdao = dao;
+    }
+
+    /**
+     * 鏌ヨ鏌愮被鍨嬪啘鎴锋�绘暟
+     * @param typeId 鍐滄埛绫诲瀷ID
+     * @return 鎬绘暟
+     */
+    public Long selectClientByType(Long typeId){
+        return this.cdao.selectCountByType(typeId) ;
+    }
+
+    /**
+     * 寰楀埌鎵�鏈夊啘鎴风被鍨�
+     * @return 鎵�鏈夊啘鎴风被鍨嬮泦鍚�
+     */
+    public QueryResultVo<List<BaClientType>> selectAll(){
+        QueryResultVo<List<BaClientType>> rsVo = new QueryResultVo<>() ;
+        rsVo.obj = this.dao.selectAll() ;
+        return rsVo ;
+    }
+
+
+    /**
+     * 寰楀埌涓�涓啘鎴风被鍨�
+     * @param id 鍐滄埛绫诲瀷ID
+     * @return 鍐滄埛绫诲瀷瀹炰綋
+     */
+    public BaClientType selectById(Long id){
+        return this.dao.selectById(id) ;
+    }
+
+
+    /**
+     * 寰楀埌涓�涓敤鎴�
+     * @param vo 鏌ヨ鏉′欢鍊煎璞�
+     * @return 鐢ㄦ埛瀹炰綋
+     */
+    @SuppressWarnings("unchecked")
+    public QueryResultVo<List<BaClientType>> selectSome(QueryVo vo){
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ;
+        Long itemTotal = this.dao.selectTotal(params) ;
+
+        QueryResultVo<List<BaClientType>> rsVo = new QueryResultVo<>() ;
+        rsVo.pageSize = vo.pageSize ;
+        rsVo.pageCurr = vo.pageCurr ;
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = this.dao.selectSome(params) ;
+
+        return rsVo ;
+    }
+
+    /**
+     * 淇濆瓨瀹炰綋
+     * @param po 瀹炰綋
+     * @return 褰卞搷璁板綍鏁伴噺
+     */
+    @Transactional
+    public int save(BaClientType po){
+        return this.dao.insertSelective(po) ;
+    }
+
+    /**
+     * 淇濆瓨淇敼瀹炰綋
+     * @param po 瀹炰綋
+     * @return 褰卞搷璁板綍鏁伴噺
+     */
+    @Transactional
+    public int update(BaClientType po){
+        return this.dao.updateByPrimaryKeySelective(po) ;
+    }
+
+
+    /**
+     * 淇濆瓨淇敼瀹炰綋
+     * @param id 瀹炰綋ID
+     * @return 褰卞搷璁板綍鏁伴噺
+     */
+    @Transactional
+    public int delete(Long id){
+        return this.dao.deleteById(id) ;
+    }
+
+
+}

--
Gitblit v1.8.0