| | |
| | | //批量升级插入(所有属性传到stationName中,文件大小的值放在num中)
|
| | | public boolean addPro(Object obj) {
|
| | | 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,dfu_data_blocksum) " +
|
| | | " SELECT DISTINCT fBSDeviceId,'avr_dfu.uc3',1,1,"+binf.getSize()+" FROM db_battinf.tb_battinf " +
|
| | | String sql=" REPLACE into db_ram_db.tb_fbs9100s_dfu_state(dev_id,dfu_wr_stat,dfu_data_blocknum) " +
|
| | | " SELECT DISTINCT fBSDeviceId,1,1 FROM db_battinf.tb_battinf " +
|
| | | " where fBSDeviceId not in(select DISTINCT dev_id from db_ram_db.tb_fbs9100s_dfu_state where dfu_en=true) ";
|
| | | //条件
|
| | | String sql0=" and stationid=? "; //具体机房
|
| | |
| | | //表格显示批量插入的机房信息
|
| | | public List serchInserStation(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="SELECT DISTINCT fBSDeviceId,fBSDeviceName,stationId,stationname,stationname1,stationname2,stationname3,stationname5 from db_battinf.tb_battinf " +
|
| | | " where ";
|
| | | String sql="SELECT DISTINCT fBSDeviceId,fBSDeviceName,stationId,stationname,stationname1,stationname2,stationname3,stationname5 " +
|
| | | ",db_ram_db.tb_fbs9100_state.dev_id,db_ram_db.tb_fbs9100_state.dev_version" +
|
| | | " from db_battinf.tb_battinf,db_ram_db.tb_fbs9100_state " +
|
| | | " where db_battinf.tb_battinf.fBSDeviceId=db_ram_db.tb_fbs9100_state.dev_id " +
|
| | | " and db_battinf.tb_battinf.station_install=1 " +
|
| | | " and ";
|
| | | //条件
|
| | | String sql0=" stationid=? "; //具体机房
|
| | | String sql1=" stationname1=? ";//省
|
| | |
| | | if(list!=null&&list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Fbs9100s_dfu_state dfu=list.get(i);
|
| | | String sql="update db_ram_db.tb_fbs9100s_dfu_state set dfu_en=true,dfu_wr_stat=1, dfu_data_blocknum=1 where dev_id="+dfu.getDev_id();
|
| | | String sql="update db_ram_db.tb_fbs9100s_dfu_state set dfu_en=true,dfu_wr_stat=1, dfu_data_blocknum=1,dfu_file="+dfu.getDfu_file()+" where dev_id="+dfu.getDev_id();
|
| | | sql_str.add(sql);
|
| | | {
|
| | | String msg="升级"+dfu.getDev_id()+"设备";
|
| | |
| | | return listAll;
|
| | | }
|
| | |
|
| | | //升级界面点击添加的时候查询出设备对应的版本号
|
| | | public List serchByInfo(Object obj) {
|
| | | return null;
|
| | | }
|
| | |
| | | list.add(910000534);
|
| | | BattInf binf=new BattInf();
|
| | | binf.setNum(1);
|
| | | binf.setStationName("湖北省");
|
| | | binf.setStationName("广西省");
|
| | |
|
| | | /*List<Fbs9100s_dfu_state> listAll=fimpl.serchByCondition(list);
|
| | | for (Fbs9100s_dfu_state dfu : listAll) {
|
| | |
| | | System.out.println(binf.getStationName3()+" "+binf.getFBSDeviceId());
|
| | | }*/
|
| | |
|
| | | boolean bl=fimpl.addPro(binf);
|
| | | System.out.println(bl);
|
| | | /*List<BattInf> listAll=fimpl.serchInserStation(binf);
|
| | | /*boolean bl=fimpl.addPro(binf);
|
| | | System.out.println(bl);*/
|
| | | List<BattInf> listAll=fimpl.serchInserStation(binf);
|
| | | for (BattInf b : listAll) {
|
| | | System.out.println(b.getStationName3()+" "+b.getFBSDeviceId());
|
| | | }*/
|
| | | }
|
| | | System.out.println(listAll.size());
|
| | | /*List<Fbs9100s_dfu_state> listAll=fimpl.searchAll();
|
| | | for (Fbs9100s_dfu_state dfu : listAll) {
|
| | | System.out.println(dfu);
|