BattMonitor_DB_Builder/bin/.gitignore
@@ -1,2 +1 @@ /com/ /main/ BattMonitor_DB_Builder/bin/com/dev/fbs9100/FBS9100_Task_Thread_SQL.classBinary files differ
BattMonitor_DB_Builder/bin/com/sql/Sql_Mysql.classBinary files differ
BattMonitor_DB_Builder/bin/main/main_BTS_DB_Builder.classBinary files differ
BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java
@@ -260,7 +260,7 @@ ResultSet rs = null; try { rs= sql.sqlMysqlQuery(sql_str1); System.out.println(sql_str1); //System.out.println(sql_str1); boolean hasInsertStation = false;; while(rs.next()) { int dev_id = rs.getInt("FBSDeviceId"); @@ -282,4 +282,51 @@ sql.close_con(); } } /** * 创建设备的系统参数表 * @param con_pool * @param recreate_tb */ public static void createFBS9100SysParam_TableOnRam(MysqlConnPool con_pool,boolean recreate_tb) { String sql_str0 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100SysParam_Table + "; "; String sql_str1 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100SysParam_Table + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, " + "`dev_ip` varchar(20) NOT NULL DEFAULT '127.0.0.0', " + "`dev_id` BIGINT NOT NULL DEFAULT 0, " + "`op_cmd` INT NOT NULL DEFAULT 0, " + "`IPADDR` varchar(20) NOT NULL DEFAULT '127.0.0.0', " + "`SubIPADDR` varchar(20) NOT NULL DEFAULT '127.0.0.0', " + "`NetGateADDR` varchar(20) NOT NULL DEFAULT '127.0.0.0', " + "`GroupVolRange` INT NOT NULL DEFAULT 0, " + "`GroupVolSorce` INT NOT NULL DEFAULT 0, " + "`CurrentRange` INT NOT NULL DEFAULT 0, " + "`CurrentTyte` INT NOT NULL DEFAULT 0, " + "`MonomerOrder` INT NOT NULL DEFAULT 0, " + "`BackLightTime` INT NOT NULL DEFAULT 0, " + "`MACADDR` varchar(30) NOT NULL DEFAULT '0.0.0.0.0.0', " + "`LoaderCount` INT NOT NULL DEFAULT 0, " + "`DtCardCount` INT NOT NULL DEFAULT 0, " + "`PowerBreakChargeCurr` FLOAT NOT NULL DEFAULT 0, " + "`MajorBattGroupNum` INT NOT NULL DEFAULT 0, " + "`POF_BG_Boost_Cnt` INT NOT NULL DEFAULT 0, " + "`POF_BG_Boost_VolStop` FLOAT NOT NULL DEFAULT 0, " + "`POF_BG_Boost_VolStart` FLOAT NOT NULL DEFAULT 0, " + " UNIQUE INDEX index_dev_id_uniq (`dev_id`), " + " PRIMARY KEY (`num`) ) " + " ENGINE=MEMORY DEFAULT CHARSET=utf8"; Sql_Mysql sql = new Sql_Mysql(con_pool.getConn()); try { if(true == recreate_tb) { sql.sqlMysqlExecute(sql_str0); } else { //sql.sqlMysqlExecute("DELETE FROM " + Sql_Mysql.FBS9100SysParam_Table); } sql.sqlMysqlExecute(sql_str1); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } } BattMonitor_DB_Builder/src/com/sql/Sql_Mysql.java
@@ -76,6 +76,8 @@ public final static String RamDB_CMCC_POWER_Data = DB_RamDB + ".`cmcc_power_data`"; public final static String BTSStationState_Table = DB_RamDB + ".`tb_bts_station_state`"; //机房状态表 public final static String FBS9100SysParam_Table = DB_RamDB + ".`tb_fbs9100_sysparam`"; // //--------------------------------------------------------------------------------------------// //--------------------------------------------------------------------------------------------// public final static String AppSys_Table = DB_AppSys + ".`tb_app_sys`"; @@ -84,6 +86,8 @@ public final static String BattCurrInf_Table = DB_BATT_INF + ".`tb_battcurr_inf`"; public final static String BattMainInf_Table = DB_BATT_INF + ".`tb_batt_maint_inf`"; public final static String BattMainProcess_Table = DB_BATT_INF + ".`tb_batt_maint_process`"; public final static String DEVERRORRECORD_Table = DB_BATT_INF + ".`tb_deverror_record`"; //设备异常记录表 public final static String BattTestDataInf_Table = DB_BATT_TESTDATA + ".`tb_batttestdata_inf`"; @@ -239,6 +243,23 @@ + "PRIMARY KEY (`num`)) " + "ENGINE=InnoDB DEFAULT CHARSET=utf8;"; String table_2_1 = "CREATE TABLE IF NOT EXISTS "+DEVERRORRECORD_Table+" (" + " `num` int(11) NOT NULL AUTO_INCREMENT," + " `stationid` varchar(64) NOT NULL DEFAULT '42000001'," + " `record_time` datetime NOT NULL DEFAULT '2018-01-01 00:00:00'," + " `error_descript` longtext NOT NULL," + " `uid` int(11) NOT NULL DEFAULT '1002'," + " `error_en` int(11) NOT NULL DEFAULT '0'," + " `note` varchar(64) NOT NULL DEFAULT ''," + " `picture_one` blob," + " `picture_two` blob," + " `picture_three` blob," + " `picture_four` blob," + " `picture_num` int(11) NOT NULL DEFAULT '0'," + " PRIMARY KEY (`num`)," + " KEY `stationid_index` (`stationid`)" + ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;"; String table_3 = "CREATE TABLE IF NOT EXISTS " + BattMainInf_Table + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, " + "`BattGroupId` INT NOT NULL DEFAULT 0, " @@ -279,6 +300,8 @@ + "INDEX index_batt_maint_rec_id (`batt_maint_rec_id`), " + " PRIMARY KEY (`num`)) " + "ENGINE=InnoDB DEFAULT CHARSET=utf8;"; String table_3_2 = "CREATE TABLE IF NOT EXISTS " + UsrBattMaintCheck_Table + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, " @@ -464,6 +487,7 @@ sqlMysqlExecute(table_1); sqlMysqlExecute(table_2); sqlMysqlExecute(table_2_1); sqlMysqlExecute(table_3); sqlMysqlExecute(table_3_1); sqlMysqlExecute(table_3_2); BattMonitor_DB_Builder/src/main/main_BTS_DB_Builder.java
@@ -65,6 +65,8 @@ BattData_RT_RamDB_Thread_SQL.createBattData_RT_RamDB_Table(GB_MysqlConnPool, recreate_tb); //创建tb_server_state表并且设置表中的值 BattData_RT_RamDB_Thread_SQL.createServerState_RamDB_Table(GB_MysqlConnPool, recreate_tb); /*********************************************************************************/ System.out.println("Recreate RamDB Tables State Is '" + recreate_tb + "'"); if(true == recreate_tb) { @@ -83,6 +85,8 @@ FBS9100_Task_Thread_SQL.createBTSStationState_TableOnRam(GB_MysqlConnPool); } FBS9100_Task_Thread_SQL.createFBS9100SysParam_TableOnRam(GB_MysqlConnPool,recreate_tb); //创建设备状态表 FBS9100_Task_Thread_SQL.insertBTSStationState_TableOnRam(GB_MysqlConnPool); //初始化录入机房状态