From 50114c2feb0ae955bfaf1da8ce7be62344ebc110 Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.25>
Date: 星期三, 21 十一月 2018 12:35:22 +0800
Subject: [PATCH] 停电掉站饼状图修改
---
gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java | 2 ++
gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java | 2 +-
gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java | 37 +++++++++++++++++++++++++++++++++++--
3 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
index 657a51f..f11a5a4 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -1080,7 +1080,7 @@
" left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " +
" left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
" left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
- " where db_user.tb_user_inf.uid=? " +
+ " where db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.Station_install=1 " +
" limit 1";
List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
diff --git a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
index d4b99ab..26ef434 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
@@ -210,6 +210,38 @@
}
return nums;
}
+ //鏌ヨ褰撳墠鏈烘埧鎺夋垬鏁�
+ public int serchByState_diaozhan(Object obj) {
+ User_inf uinf=(User_inf) obj;
+ String sql=" select count(*) as nums from db_ram_db.tb_bts_station_state where station_stat&32>1 " +
+ " and tb_bts_station_state.station_id in (" +
+ " select distinct db_battinf.tb_battinf.stationid " +
+ " from db_battinf.tb_battinf " +
+ " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " +
+ " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
+ " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
+ " where db_user.tb_user_inf.uid=? ) " ;
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ list.add(rs.getInt("nums"));
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ int nums=0;//鎬绘暟
+ if(list!=null&&list.size()>0){
+ nums=(Integer) list.get(list.size()-1);
+ }
+ return nums;
+ }
//鏌ヨ褰撳墠鏈烘埧鍋滅數鏁�(鏍规嵁station_id )
public int serchByStationId(Object obj) {
BattMap_information binformation=(BattMap_information) obj;
@@ -264,9 +296,10 @@
System.out.println(bs);
}
/*int nums=bimpl.serchByState(uinf);*/
- BattMap_information bm=new BattMap_information();
+ /*BattMap_information bm=new BattMap_information();
bm.setStationId("42000570");
- int nums=bimpl.serchByStationId(bm);
+ int nums=bimpl.serchByStationId(bm);*/
+ int nums=bimpl.serchByState_diaozhan(uinf);
System.out.println(nums);
}
diff --git a/gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java b/gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java
index 30f1e9f..1416cc3 100644
--- a/gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java
+++ b/gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java
@@ -40,9 +40,11 @@
//鏈烘埧鏂數缁熻(棣栭〉涓婄殑楗肩姸鍥�)
public ServiceModel serchPowerOff(Object obj){
int powerNum=((Bts_station_stateImpl)dao).serchByState(obj); //鏂數瀹炴椂鏁�
+ int dianzhanNum=((Bts_station_stateImpl)dao).serchByState_diaozhan(obj); //鎺夌珯瀹炴椂鏁�
int devNum=(new BattInfImpl()).serchByDeviceId(obj); //鎬昏澶囨暟
model.setSum(powerNum);
model.setNewsum(devNum);
+ model.setCode(dianzhanNum);
return model;
}
}
--
Gitblit v1.9.1