81041
2018-10-22 4dfc0379caa108688f89cbdc595152c97ed3a7a8
gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
@@ -111,12 +111,34 @@
      }
      return list;
   }
    //查询当前机房停电数
   public int serchByState() {
      String sql=" select count(*) as nums from db_ram_db.tb_bts_station_state where station_stat&2>1  ";
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, 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;
   }
   public List serchByInfo(Object obj) {
      // TODO Auto-generated method stub
      return null;
   }
   public static void main(String[] args) {
      Bts_station_stateImpl bimpl=new Bts_station_stateImpl();
      BattInf binf=new BattInf();
@@ -128,10 +150,14 @@
      p.setPageCurr(1);
      p.setPageSize(1);
      binf.setPage(p);
      List<Bts_station_state> list=bimpl.serchByCondition(binf);
      /*List<Bts_station_state> list=bimpl.serchByCondition(binf);
      for (Bts_station_state bs : list) {
         //System.out.println(bs.getStation_stat_diaozhan()+"  "+bs.getStation_stat_dooropen()+"  "+bs.getStation_stat_fadian()+"   "+bs.getStation_stat_xuhang()+"  "+bs.getStation_stat_poff());
          System.out.println(bs);
      }
      }*/
      int nums=bimpl.serchByState();
      System.out.println(nums);
   }
}