From a72e89fb45078cca405d7558897054addacfed07 Mon Sep 17 00:00:00 2001
From: whycxzp <glperry@163.com>
Date: 星期五, 13 六月 2025 16:54:51 +0800
Subject: [PATCH] 蓄电池品牌信息统计

---
 src/main/java/com/whyc/service/BattInfService.java |    4 ++++
 src/main/java/com/whyc/mapper/BattInfMapper.java   |    2 ++
 src/main/resources/mapper/BattInfMapper.xml        |    8 ++++++++
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/whyc/mapper/BattInfMapper.java b/src/main/java/com/whyc/mapper/BattInfMapper.java
index c36a67d..e2db4a1 100644
--- a/src/main/java/com/whyc/mapper/BattInfMapper.java
+++ b/src/main/java/com/whyc/mapper/BattInfMapper.java
@@ -54,4 +54,6 @@
     //鏈勾搴﹀凡/鏈斁鐢垫暟閲忕粺璁″彸渚у浘琛�(1.2.5)
     List<BattInf> getDischrChart(@Param("uid") Integer uid);
 
+    List<BattInf> getListByUserId(Integer userId);
+
 }
\ No newline at end of file
diff --git a/src/main/java/com/whyc/service/BattInfService.java b/src/main/java/com/whyc/service/BattInfService.java
index 534ae58..6bb82c4 100644
--- a/src/main/java/com/whyc/service/BattInfService.java
+++ b/src/main/java/com/whyc/service/BattInfService.java
@@ -473,4 +473,8 @@
     public List<BattInf> getDischrChart(Integer uid) {
         return mapper.getDischrChart(uid);
     }
+
+    public List<BattInf> getListByUserId(Integer userId) {
+        return mapper.getListByUserId(userId);
+    }
 }
\ No newline at end of file
diff --git a/src/main/resources/mapper/BattInfMapper.xml b/src/main/resources/mapper/BattInfMapper.xml
index 6d8f68f..380aaaa 100644
--- a/src/main/resources/mapper/BattInfMapper.xml
+++ b/src/main/resources/mapper/BattInfMapper.xml
@@ -418,4 +418,12 @@
             order by tb_batt_inf.dev_id asc,battgroup_id asc
         </where>
     </select>
+    <select id="getListByUserId" resultType="com.whyc.pojo.db_station.BattInf">
+        select * from db_station.tb_batt_inf where battgroup_id in(
+            select distinct battgroup_id from db_user.tb_baojigroup_usr bu,db_user.tb_baojigroup_power bp,db_station.tb_batt_inf bi
+            where bu.baoji_group_id = bp.baoji_group_id
+            and bp.station_id = bi.station_id
+            and bu.uid = #{userId}
+        )
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1