| | |
| | | }
|
| | | 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;
|
| | |
| | | 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);
|
| | | }
|
| | |
|