81041
2018-11-19 e24744ff8b8aaa16ec75f33dd67a31e8fb94979d
gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100s_dfu_stateImpl.java
@@ -33,12 +33,12 @@
      BattInf binf=(BattInf) obj;
      String sql=" REPLACE into db_ram_db.tb_fbs9100s_dfu_state(dev_id,dfu_file,dfu_wr_stat,dfu_data_blocknum) " +
            " SELECT  DISTINCT fBSDeviceId,'avr_dfu.uc3',1,1 FROM  db_battinf.tb_battinf " +
            " where ";
            " where fBSDeviceId not in(select DISTINCT dev_id from db_ram_db.tb_fbs9100s_dfu_state where dfu_en=true)  ";
      //条件
      String sql0=" stationid=? "; //具体机房
      String sql1=" stationname1=? ";//省
      String sql2=" stationname2=? ";//市
      String sql5=" stationname5=? ";//区县
      String sql0=" and stationid=? "; //具体机房
      String sql1=" and stationname1=? ";//省
      String sql2=" and stationname2=? ";//市
      String sql5=" and stationname5=? ";//区县
      switch (binf.getNum()) {
      case 0:
         sql+=sql0;
@@ -65,10 +65,10 @@
      String sql="SELECT  DISTINCT fBSDeviceId,fBSDeviceName,stationId,stationname,stationname1,stationname2,stationname3,stationname5 from db_battinf.tb_battinf " +
            " where ";
      //条件
      String sql0=" stationid=? "; //具体机房
      String sql1=" stationname1=? ";//省
      String sql2=" stationname2=? ";//市
      String sql5=" stationname5=? ";//区县
      String sql0="  stationid=? "; //具体机房
      String sql1="  stationname1=? ";//省
      String sql2="  stationname2=? ";//市
      String sql5="  stationname5=? ";//区县
      switch (binf.getNum()) {
      case 0:
         sql+=sql0;
@@ -189,7 +189,9 @@
   }
    //查询出所有处于升级的设备
   public List searchAll() {
      String sql=" select * from  db_ram_db.tb_fbs9100s_dfu_state where dfu_en=1";
      String sql=" select distinct dev_id,db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.stationId,db_battinf.tb_battinf.fBSDeviceName,sysVersion_new,softVersion_new,sysVersion_dev,softVersion_dev,dfu_file,dfu_en,dfu_wr_stat,dfu_data_blocknum,dfu_data_blocklen " +
            " from  db_ram_db.tb_fbs9100s_dfu_state,db_battinf.tb_battinf " +
            " where db_ram_db.tb_fbs9100s_dfu_state.dev_id=db_battinf.tb_battinf.fBSDeviceId  and dfu_en=1";
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null , new CallBack() {
         
         public List getResults(ResultSet rs) {
@@ -207,6 +209,9 @@
                  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"));
                  dfu.setStationName(rs.getString("stationName"));
                  dfu.setStationId(rs.getString("stationId"));
                  dfu.setfBSDeviceName(rs.getString("fBSDeviceName"));
                  list.add(dfu);
               }
            } catch (SQLException e) {
@@ -291,16 +296,16 @@
   for (BattInf binf : listAll) {
      System.out.println(binf.getStationName3()+" "+binf.getFBSDeviceId());
   }*/
   /*
   boolean bl=fimpl.addPro(binf);
   System.out.println(bl);*/
   System.out.println(bl);
   /*List<BattInf> listAll=fimpl.serchInserStation(binf);
   for (BattInf b : listAll) {
      System.out.println(b.getStationName3()+" "+b.getFBSDeviceId());
   }*/
   List<Fbs9100s_dfu_state> listAll=fimpl.searchAll();
   /*List<Fbs9100s_dfu_state> listAll=fimpl.searchAll();
   for (Fbs9100s_dfu_state dfu : listAll) {
      System.out.println(dfu);
   }
   }*/
}
}