From 6eabba8dec8c7d7e6f858f2c6dbccd30a9a775ca Mon Sep 17 00:00:00 2001
From: lxw <810412026@qq.com>
Date: 星期三, 26 十月 2022 11:48:19 +0800
Subject: [PATCH] 修改yml

---
 src/main/java/com/whyc/service/StationInfoService.java |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/whyc/service/StationInfoService.java b/src/main/java/com/whyc/service/StationInfoService.java
index c113cae..63f7ee5 100644
--- a/src/main/java/com/whyc/service/StationInfoService.java
+++ b/src/main/java/com/whyc/service/StationInfoService.java
@@ -291,7 +291,9 @@
                 return new Response().set(1,false,"鏂囦欢涓嶅瓨鍦�");
             }else{
                 //3.鍒犻櫎fileid瀵瑰簲鐨勬暟鎹�(stationId,fileId)
-                dataMapper.deleteDataAndInfo(stationId,fileId);
+                //dataMapper.deleteDataAndInfo(stationId,fileId);
+                //3鏍规嵁(stationId,fileId)鍒犻櫎groupinfo鍜実roupdata鏁版嵁
+                deleteDataAndInfo(stationId,fileId);
 
                 //4.鍒犻櫎fileid瀵瑰簲鐨勫弬鏁�
                 paramMapper.deleteParamByFileId(fileId);
@@ -302,7 +304,26 @@
             }
         }
     }
-
+    //3鏍规嵁(stationId,fileId)鍒犻櫎groupinfo鍜実roupdata鏁版嵁
+    public void deleteDataAndInfo(int stationId,int fileId){
+        //鍏堟煡璇㈠嚭瀵瑰簲鐨勭數姹犵粍id鐒跺悗鍒犻櫎
+        QueryWrapper wrapper=new QueryWrapper();
+        wrapper.eq("station_id",stationId);
+        wrapper.eq("file_id",fileId);
+        List<BattgroupInfo> list=groupInfoMapper.selectList(wrapper);
+        if(list!=null&&list.size()>0){
+            for (BattgroupInfo ginfo:list) {
+                UpdateWrapper dataWrapper=new UpdateWrapper();
+                dataWrapper.eq("battGroup_id",ginfo.getBattgroupId());
+                dataMapper.delete(dataWrapper);
+            }
+        }
+        //鍐嶅垹闄roupinfo
+        UpdateWrapper infoWrapper=new UpdateWrapper();
+        infoWrapper.eq("station_id",stationId);
+        infoWrapper.eq("file_id",fileId);
+        groupInfoMapper.delete(infoWrapper);
+    }
     public StationInfo getByFileId(String fileId) {
         return mapper.getByFileId(fileId);
     }

--
Gitblit v1.9.1