From 1a2b07f01ba4616fd9e894dddf474b56d020158c Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期一, 07 四月 2025 15:18:51 +0800
Subject: [PATCH] 整理版本

---
 pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrIrrigateSchedulingSv.java |   97 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrIrrigateSchedulingSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrIrrigateSchedulingSv.java
new file mode 100644
index 0000000..cd4dbe7
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrIrrigateSchedulingSv.java
@@ -0,0 +1,97 @@
+package com.dy.pipIrrIrrigate.irrigateScheduling;
+
+import com.dy.common.webUtil.QueryResultVo;
+import com.dy.pipIrrGlobal.daoIr.IrIrrigateSchedulingMapper;
+import com.dy.pipIrrGlobal.pojoIr.IrIrrigateScheduling;
+import com.dy.pipIrrGlobal.voIr.VoScheduling;
+import com.dy.pipIrrGlobal.voIr.VoSchedulingOne;
+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.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author :WuZeYu
+ * @Date :2024/5/27  10:12
+ * @LastEditTime :2024/5/27  10:12
+ * @Description
+ */
+@Slf4j
+@Service
+public class IrIrrigateSchedulingSv {
+
+    @Autowired
+    private IrIrrigateSchedulingMapper irIrrigateSchedulingMapper;
+
+    /**
+     * 娣诲姞浣滅墿鐏屾簤鍒跺害
+     *
+     * @param po
+     * @return
+     */
+    public Integer addScheduling(IrIrrigateScheduling po) {
+        po.setDeleted((byte) 0);
+        po.setOperateDt(new Date());
+        int rows = irIrrigateSchedulingMapper.insertSelective(po);
+        if (rows == 0) {
+            return 0;
+        }
+        return 1;
+    }
+    /**
+     * 鍒犻櫎浣滅墿鐏屾簤鍒跺害
+     *
+     * @param id
+     */
+    public Integer deleteScheduling(Long id) {
+        int rows = irIrrigateSchedulingMapper.deleteLogicById(id);
+        if (rows == 0) {
+            return 0;
+        }
+        return 1;
+    }
+
+    /**
+     * 淇敼浣滅墿鐏屾簤鍒跺害
+     * @param po
+     * @return
+     */
+    public Integer updateScheduling(IrIrrigateScheduling po){
+        int rows = irIrrigateSchedulingMapper.updateByPrimaryKeySelective(po);
+        if (rows == 0){
+            return 0;
+        }
+        return 1;
+    }
+
+    /**
+     * 鍒嗛〉鏌ヨ浣滅墿鐏屾簤鍒跺害
+     * @param queryVo
+     * @return
+     */
+    public QueryResultVo<List<VoScheduling>> getSchedulings(QueryVo queryVo){
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
+        Long itemTotal = irIrrigateSchedulingMapper.getRecordCount(params);
+
+        QueryResultVo<List<VoScheduling>> rsVo = new QueryResultVo<>();
+        rsVo.pageSize = queryVo.pageSize;
+        rsVo.pageCurr = queryVo.pageCurr;
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = irIrrigateSchedulingMapper.getSchedulings(params);
+        return rsVo;
+    }
+
+    /**
+     * 鑾峰彇涓�涓綔鐗╃亴婧夊埗搴︽暟鎹�
+     * @param id
+     * @return
+     */
+    public VoSchedulingOne selectById(Long id){
+        VoSchedulingOne irCrop = irIrrigateSchedulingMapper.selectById(id);
+        return irCrop;
+    }
+}

--
Gitblit v1.8.0