From b042d6a5ae1959ad79b489e1d0b01c057b68d5f6 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 19 六月 2025 10:45:44 +0800
Subject: [PATCH] 水肥机、墒情站、气象站增、改、查、删功能实现

---
 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherSv.java |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherSv.java
index 490e91c..6b93d7e 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherSv.java
@@ -1,10 +1,12 @@
 package com.dy.pipIrrProject.mqtt.weather;
 
 import com.dy.pipIrrGlobal.daoPr.PrStWeatherMapper;
+import com.dy.pipIrrGlobal.pojoPr.PrStWeather;
 import com.dy.pipIrrGlobal.voPr.VoMqttSimple;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -23,4 +25,43 @@
     public List<VoMqttSimple> allSimple(){
         return this.dao.selectAllSimple() ;
     }
+
+
+    /**
+     * 寰楀埌涓�涓疄浣�
+     * @param id 瀹炰綋ID
+     * @return 瀹炰綋
+     */
+    public PrStWeather selectById(Long id){
+        return this.dao.selectById(id) ;
+    }
+    /**
+     * 淇濆瓨锛堟坊鍔狅級瑙嗛鐩戞帶鐐�
+     * @param po
+     * @return
+     */
+    @Transactional
+    Integer save(PrStWeather po) {
+        return dao.insert(po);
+    }
+
+    /**
+     * 淇敼瀹炰綋
+     * @param po 瀹炰綋
+     * @return 鏁伴噺
+     */
+    @Transactional
+    public int update(PrStWeather po) {
+        return this.dao.updateByPrimaryKeySelective(po);
+    }
+
+    /**
+     * 淇濆瓨淇敼瀹炰綋
+     * @param id 瀹炰綋ID
+     * @return 褰卞搷璁板綍鏁伴噺
+     */
+    @Transactional
+    public int delete(Long id){
+        return this.dao.deleteLogicById(id) ;
+    }
 }

--
Gitblit v1.8.0