81041
2018-11-15 426ae9a57c515b37b0996f62bdf10079110ce488
gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100s_dfu_stateImpl.java
@@ -116,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()];
@@ -142,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);
               }
@@ -186,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) {
@@ -241,7 +268,7 @@
      });
      return listAll;
   }
   public List serchByInfo(Object obj) {
      // TODO Auto-generated method stub
      return null;
@@ -267,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);
   }
}
}