| | |
| | |
|
| | | public static void updateFBOFIleExportFlag(MysqlConnPool pool, FGCD_TestFBOFile fbofile) {
|
| | | String sql_str = " Update " + Sql_Mysql.Tb_Fgcd_Filedownload_Table +
|
| | | " Set download_state = " + fbofile.getDownload_state();
|
| | | " Set ";
|
| | | for(int i=0;i<fbofile.files.length;i++) {
|
| | | sql_str += " ,download_flag"+(i+1)+" = "+fbofile.files[i].download_flag+""
|
| | | if(i>0) {
|
| | | sql_str += ",";
|
| | | }
|
| | | sql_str += " download_flag"+(i+1)+" = "+fbofile.files[i].download_flag+""
|
| | | + " ,download_state"+(i+1)+" =" +fbofile.files[i].download_state;
|
| | | }
|
| | | sql_str += " WHERE dev_id = " + fbofile.dev_id;
|
| | |
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 更新当前下载状态,以及异常结束原因
|
| | | * @param pool
|
| | | * @param file
|
| | | */
|
| | | public static void updateFgcd_Filedownload_TableCmdByDevId(MysqlConnPool pool,FGCD_TestFBOFile file) {
|
| | | String sql_str = " UPDATE " + Sql_Mysql.Tb_Fgcd_Filedownload_Table +
|
| | | " SET op_cmd = " + file.op_cmd +
|
| | | " ,stop_reason = " + file.getStop_reason() +
|
| | | " WHERE dev_id = " + file.dev_id;
|
| | | Sql_Mysql sql = new Sql_Mysql(pool);
|
| | | try {
|
| | | sql.sqlMysqlExecute(sql_str);
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新当前设备的下载状态
|
| | | * @param pool
|
| | | * @param fbofile
|
| | | */
|
| | | public static void updateFgcd_FiledownloadState_TableByDevId(MysqlConnPool pool, FGCD_TestFBOFile fbofile) {
|
| | | String sql_str_base = " update " + Sql_Mysql.Tb_Fgcd_Filedownload_Table + " Set stop_reason = " + fbofile.getStop_reason();
|
| | | for(int i=0;i<fbofile.files.length;i++) {
|
| | | FBOFile file = fbofile.files[i];
|
| | | sql_str_base += " ,download_flag"+(i+1) + " = "+file.download_flag+","
|
| | | + " download_state"+(i+1) + " = "+file.download_state;
|
| | | }
|
| | | sql_str_base += " WHERE dev_id = " + fbofile.dev_id;
|
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | try {
|
| | | sql.sqlMysqlExecute(sql_str_base);
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | }
|