From 2938172b377e5ed7a55e5dde4a218244445e8a6e Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期三, 15 五月 2024 17:10:12 +0800
Subject: [PATCH] 田间灌溉项目管理 修改项目信息接口 修改项目状态接口

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

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectSv.java
index 3a5ce63..3d9e86d 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectSv.java
@@ -67,4 +67,50 @@
         }
             return 1;
     }
+
+    /**
+     * 淇敼椤圭洰淇℃伅
+     * @param po
+     * @return
+     */
+    public Integer updateProject(IrProject po){
+        po.setOperateDt(new Date());
+        if (po.getVillageId() != null) {
+            po.setTownId(irProjectMapper.getSupperByVillageId(po.getVillageId()));
+            po.setCountyId(irProjectMapper.getSupperByVillageId(po.getTownId()));
+            po.setCityId(irProjectMapper.getSupperByVillageId(po.getCountyId()));
+            po.setProvinceId(irProjectMapper.getSupperByVillageId(po.getCityId()));
+        }
+        if (po.getTownId() != null) {
+            po.setCountyId(irProjectMapper.getSupperByVillageId(po.getTownId()));
+            po.setCityId(irProjectMapper.getSupperByVillageId(po.getCountyId()));
+            po.setProvinceId(irProjectMapper.getSupperByVillageId(po.getCityId()));
+        }
+        if (po.getCountyId() != null) {
+            po.setCityId(irProjectMapper.getSupperByVillageId(po.getCountyId()));
+            po.setProvinceId(irProjectMapper.getSupperByVillageId(po.getCityId()));
+        }
+        if (po.getCityId() != null) {
+            po.setProvinceId(irProjectMapper.getSupperByVillageId(po.getCityId()));
+        }
+        int rows = irProjectMapper.updateByPrimaryKeySelective(po);
+        if (rows == 0){
+            return 0;
+        }
+        return 1;
+    }
+
+    /**
+     * 淇敼椤圭洰鐘舵��
+     * @param po
+     * @return
+     */
+    public Integer updateProjectState(IrProject po){
+        po.setOperateDt(new Date());
+        int rows = irProjectMapper.updateProjectState(po);
+        if (rows == 0){
+            return 0;
+        }
+        return 1;
+    }
 }

--
Gitblit v1.8.0