| | |
| | | * @param con_pool
|
| | | * @param al_param
|
| | | */
|
| | | public static void createFBS9100SetTestParamTableOnRam(MysqlConnPool con_pool)
|
| | | public static void createFBS9100SetTestParamTableOnRam(MysqlConnPool con_pool,boolean recreate_tb)
|
| | | {
|
| | | String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100SetParam_Table;
|
| | | String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100SetParam_Table
|
| | |
| | | + " ENGINE=MEMORY DEFAULT CHARSET=utf8";
|
| | |
|
| | | Sql_Mysql sql = new Sql_Mysql(con_pool.getConn());
|
| | | ResultSet res = null;
|
| | | try {
|
| | | sql.sqlMysqlExecute(str1);
|
| | | if(true == recreate_tb) {
|
| | | sql.sqlMysqlExecute(str1); //重建表 |
| | | }
|
| | | sql.sqlMysqlExecute(str2);
|
| | | //添加指定的BattGroupNum列
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_ram_db'"
|
| | | + " AND table_name='tb_fbs9100_setparam'"
|
| | | + " AND column_name='BattGroupNum'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table |
| | | + " ADD COLUMN `BattGroupNum` INT NOT NULL DEFAULT 0;");
|
| | | }
|
| | | //添加指定的OnlineVolLowAction列
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_ram_db'"
|
| | | + " AND table_name='tb_fbs9100_setparam'"
|
| | | + " AND column_name='OnlineVolLowAction'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table |
| | | + " ADD COLUMN `OnlineVolLowAction` INT NOT NULL DEFAULT 0;");
|
| | | }
|
| | | //添加指定的 DCVolHighLimit 列
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_ram_db'"
|
| | | + " AND table_name='tb_fbs9100_setparam'"
|
| | | + " AND column_name='DCVolHighLimit'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table |
| | | + " ADD COLUMN `DCVolHighLimit` FLOAT NOT NULL DEFAULT 0;");
|
| | | }
|
| | | //添加指定的 ChargeCurrSet 列
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_ram_db'"
|
| | | + " AND table_name='tb_fbs9100_setparam'"
|
| | | + " AND column_name='ChargeCurrSet'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table |
| | | + " ADD COLUMN `ChargeCurrSet` FLOAT NOT NULL DEFAULT 0;");
|
| | | }
|
| | | //添加指定的 MonomerTmp_High 列
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_ram_db'"
|
| | | + " AND table_name='tb_fbs9100_setparam'"
|
| | | + " AND column_name='MonomerTmp_High'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table |
| | | + " ADD COLUMN `MonomerTmp_High` FLOAT NOT NULL DEFAULT 0;");
|
| | | }
|
| | | //添加指定的 AutoTestStartVol 列
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_ram_db'"
|
| | | + " AND table_name='tb_fbs9100_setparam'"
|
| | | + " AND column_name='AutoTestStartVol'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table |
| | | + " ADD COLUMN `AutoTestStartVol` float NOT NULL DEFAULT 0;");
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|