lxw
2023-03-07 bbf192dc5440606432cf311ac27f92dae3ae2dbe
监控层,运维层首页+跳转页
4个文件已修改
30 ■■■■■ 已修改文件
src/main/java/com/whyc/mapper/StationInfMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattInfService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/StationInfService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/StationInfMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/StationInfMapper.java
@@ -8,4 +8,7 @@
    //站点实时数据推送
    List<StationInf> getSystemAll(int userId);
    //总机房
    int geStation(int userId);
}
src/main/java/com/whyc/service/BattInfService.java
@@ -26,7 +26,6 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.sql.ResultSet;
import java.util.*;
import static com.whyc.util.ActionUtil.createFilefolderIFNotExist;
@@ -629,13 +628,18 @@
        try {
            Map<String, Integer> map = new HashMap<>();
            int battGroupCount = battInfMapper.getBattGroupNum(userId);
            //电源机房总数
            int powerNum = powerInfService.getNum(userId);
            int monNum = battInfMapper.getMonCount(userId);
            int stationNum = battInfMapper.geStationCount(userId);
            //电池机房总数
            int battStationNum = battInfMapper.geStationCount(userId);
            //总机房
            int stationNum = stationInfService.geStation(userId);
            map.put("monNum", monNum);//单体
            map.put("stationNum", stationNum);//站点
            map.put("battStationNum", battStationNum);//站点
            map.put("battGroupCount", battGroupCount);//电池组
            map.put("powerNum", powerNum);//电源
            map.put("stationNum", stationNum);//总机房
            return new Response().setII(1, true, map, "基础资源信息");
        } catch (Exception e) {
            return new Response<>().set(1, false, "发生异常:" + e.getCause());
src/main/java/com/whyc/service/StationInfService.java
@@ -105,4 +105,9 @@
        }
        return new Response().setII(1, true, map, "站点实时数据推送");
    }
    //总机房
    public int geStation(int userId) {
        return mapper.geStation(userId);
    }
}
src/main/resources/mapper/StationInfMapper.xml
@@ -65,4 +65,16 @@
            where tb_battinf.stationid = #{stationId}
        )
    </select>
    <select id="geStation" resultType="java.lang.Integer">
        select count(1)
        from db_battinf.tb_station_inf
        where StationId in (select distinct StationId
                            from db_user.tb_user_battgroup_baojigroup_battgroup
                               , db_user.tb_user_battgroup_baojigroup_usr
                               , db_user.tb_user_inf
                            where db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id =
                                  db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id
                              and db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid
                              and db_user.tb_user_inf.uid = #{userId})
    </select>
</mapper>