81041
2018-11-15 426ae9a57c515b37b0996f62bdf10079110ce488
gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100s_dfu_stateImpl.java
@@ -62,7 +62,7 @@
    //表格显示批量插入的机房信息
   public List serchInserStation(Object obj){
      BattInf binf=(BattInf) obj; 
      String sql="SELECT  DISTINCT fBSDeviceId,stationname,stationname1,stationname2,stationname3,stationname5 from db_battinf.tb_battinf " +
      String sql="SELECT  DISTINCT fBSDeviceId,fBSDeviceName,stationId,stationname,stationname1,stationname2,stationname3,stationname5 from db_battinf.tb_battinf " +
            " where ";
      //条件
      String sql0=" stationid=? "; //具体机房
@@ -100,6 +100,8 @@
                  binf.setStationName2(rs.getString("stationName2"));
                  binf.setStationName3(rs.getString("stationName3"));
                  binf.setStationName5(rs.getString("stationName5"));
                  binf.setStationId(rs.getString("stationId"));
                  binf.setFBSDeviceName(rs.getString("fBSDeviceName"));
                  list.add(binf);
               }
            } catch (SQLException e) {
@@ -114,7 +116,7 @@
   //批量升级前验证升级的设备必须处于在线监测状态(9100state的workstate为0)
   public List judgeStation(Object obj){
      List<Integer> list=(List<Integer>) obj;
      String sql=" select distinct dev_id,db_battinf.tb_battinf.stationname3 from db_ram_db.tb_fbs9100_state,db_battinf.tb_battinf  " +
      String sql=" select distinct dev_id,db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.stationname3 from db_ram_db.tb_fbs9100_state,db_battinf.tb_battinf  " +
            " where db_ram_db.tb_fbs9100_state.dev_id=db_battinf.tb_battinf.fBSDeviceId  and dev_workstate=0 and dev_id in(";
      String devSql="";
      Object[] object=new Object[list.size()];
@@ -140,6 +142,7 @@
               while(rs.next()){
                  BattInf binf=new BattInf();
                  binf.setFBSDeviceId(rs.getInt("dev_id"));
                  binf.setStationName(rs.getString("stationName"));
                  binf.setStationName3(rs.getString("stationName3"));
                  list.add(binf);
               }
@@ -184,10 +187,36 @@
      // TODO Auto-generated method stub
      return false;
   }
    //查询出所有处于升级的设备
   public List searchAll() {
      // TODO Auto-generated method stub
      return null;
      String sql=" select * from  db_ram_db.tb_fbs9100s_dfu_state where dfu_en=1";
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null , new CallBack() {
         public List getResults(ResultSet rs) {
            List list=new ArrayList();
            try {
               while(rs.next()){
                  Fbs9100s_dfu_state dfu=new Fbs9100s_dfu_state();
                  dfu.setDev_id(rs.getInt("dev_id"));
                  dfu.setSysVersion_new(rs.getInt("sysVersion_new"));
                  dfu.setSoftVersion_new(rs.getInt("softVersion_new"));
                  dfu.setSysVersion_dev(rs.getInt("sysVersion_dev"));
                  dfu.setSoftVersion_dev(rs.getInt("softVersion_dev"));
                  dfu.setDfu_file(rs.getString("dfu_file"));
                  dfu.setDfu_en(rs.getInt("dfu_en"));
                  dfu.setDfu_wr_stat(rs.getInt("dfu_wr_stat"));
                  dfu.setDfu_data_blocknum(rs.getInt("dfu_data_blocknum"));
                  dfu.setDfu_data_blocklen(rs.getInt("dfu_data_blocklen"));
                  list.add(dfu);
               }
            } catch (SQLException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
            }
            return list;
         }
      });
      return list;
   }
    //升级界面实时刷新
   public List serchByCondition(Object obj) {
@@ -239,7 +268,7 @@
      });
      return listAll;
   }
   public List serchByInfo(Object obj) {
      // TODO Auto-generated method stub
      return null;
@@ -265,9 +294,13 @@
   /*
   boolean bl=fimpl.addPro(binf);
   System.out.println(bl);*/
   List<BattInf> listAll=fimpl.serchInserStation(binf);
   /*List<BattInf> listAll=fimpl.serchInserStation(binf);
   for (BattInf b : listAll) {
      System.out.println(b.getStationName3()+" "+b.getFBSDeviceId());
   }*/
   List<Fbs9100s_dfu_state> listAll=fimpl.searchAll();
   for (Fbs9100s_dfu_state dfu : listAll) {
      System.out.println(dfu);
   }
}
}