From 441f4fd8652a5d51c386d19eb27a7dbb2140b10b Mon Sep 17 00:00:00 2001
From: whyclxw <810412026@qq.com>
Date: 星期六, 17 五月 2025 14:03:17 +0800
Subject: [PATCH] 查询机房,电源,电池组信息

---
 src/main/resources/mapper/BattInfMapper.xml |   77 +++++++++++++++++++++++++++++++++++---
 1 files changed, 70 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/mapper/BattInfMapper.xml b/src/main/resources/mapper/BattInfMapper.xml
index ccb2acd..6775f47 100644
--- a/src/main/resources/mapper/BattInfMapper.xml
+++ b/src/main/resources/mapper/BattInfMapper.xml
@@ -15,11 +15,11 @@
         select ifnull(max(battgroup_num),0) from  db_station.tb_batt_inf where dev_id=#{devId};
     </select>
 
-    <select id="getBatt" resultType="com.whyc.pojo.db_station.BattInf">
-        select tb_batt_inf.*,tb_station_inf.station_name,tb_power_inf.power_name
-        from db_station.tb_power_inf,db_station.tb_station_inf,db_station.tb_batt_inf
-        where tb_batt_inf.station_id=tb_station_inf.station_id
-          and tb_batt_inf.power_id=tb_power_inf.power_id
+    <select id="getInfo" resultType="com.whyc.dto.InfoDto">
+        SELECT * from  db_station.tb_station_inf
+        LEFT JOIN  db_station.tb_power_inf on tb_station_inf.station_id=tb_power_inf.station_id
+        LEFT JOIN  db_station.tb_batt_inf on tb_batt_inf.station_id=tb_station_inf.station_id and tb_power_inf.power_id=tb_batt_inf.power_id
+        <where>
         <if test="provice!=null">
             and tb_station_inf.provice=#{provice}
         </if>
@@ -29,7 +29,7 @@
         <if test="country!=null">
             and tb_station_inf.country=#{country}
         </if>
-        <if test="stationName!=null">
+       <!-- <if test="stationName!=null">
             and tb_station_inf.station_name like concat('%',#{stationName},'%')
         </if>
         <if test="powerName!=null">
@@ -37,7 +37,7 @@
         </if>
         <if test="battgroupName!=null">
             and tb_batt_inf.battgroup_name like concat('%',#{battgroupName},'%')
-        </if>
+        </if>-->
         <if test="uid>100">
             and tb_power_inf.power_id in(
             select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr
@@ -45,6 +45,69 @@
             and tb_baojigroup_usr.uid=#{uid}
             )
         </if>
+        </where>
+    </select>
+    <select id="getProductByUid" resultType="java.lang.String">
+        select distinct product from db_station.tb_batt_inf
+        <where>
+            <if test="uid>100">
+                and tb_batt_inf.power_id in(
+                select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr
+                where   tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id
+                and tb_baojigroup_usr.uid=#{uid}
+                )
+            </if>
+        </where>
+    </select>
+    <select id="getMonVolByUid" resultType="java.lang.String">
+        select distinct monvolstd from db_station.tb_batt_inf
+        <where>
+            <if test="uid>100">
+                and tb_batt_inf.power_id in(
+                select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr
+                where   tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id
+                and tb_baojigroup_usr.uid=#{uid}
+                )
+            </if>
+        </where>
+    </select>
+    <select id="getDevTypeByUid" resultType="java.lang.String">
+        select distinct dev_type from db_station.tb_batt_inf
+        <where>
+            <if test="uid>100">
+                and tb_batt_inf.power_id in(
+                select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr
+                where   tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id
+                and tb_baojigroup_usr.uid=#{uid}
+                )
+            </if>
+        </where>
+    </select>
+
+    <select id="getMonCapByUid" resultType="java.lang.String">
+        select distinct moncapstd from db_station.tb_batt_inf
+        <where>
+            <if test="uid>100">
+                and tb_batt_inf.power_id in(
+                select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr
+                where   tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id
+                and tb_baojigroup_usr.uid=#{uid}
+                )
+            </if>
+        </where>
+    </select>
+
+    <select id="getMonResByUid" resultType="java.lang.String">
+        select distinct monresstd from db_station.tb_batt_inf
+        <where>
+            <if test="uid>100">
+                and tb_batt_inf.power_id in(
+                select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr
+                where   tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id
+                and tb_baojigroup_usr.uid=#{uid}
+                )
+            </if>
+        </where>
     </select>
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1