蓄电池监控管理平台数据库初始化程序
whyclj
2019-01-15 42cd07fa9ef7d14db0f0e759a3a121b8d71843f5
给指定的列添加新增加的字段
4个文件已修改
21 ■■■■ 已修改文件
BattMonitor_DB_Builder/bin/com/battdata_rt/BattData_RT_RamDB_Thread_SQL.class 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/bin/com/dev/fbs9100/FBS9100_Task_Thread_SQL.class 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/src/com/battdata_rt/BattData_RT_RamDB_Thread_SQL.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/bin/com/battdata_rt/BattData_RT_RamDB_Thread_SQL.class
Binary files differ
BattMonitor_DB_Builder/bin/com/dev/fbs9100/FBS9100_Task_Thread_SQL.class
Binary files differ
BattMonitor_DB_Builder/src/com/battdata_rt/BattData_RT_RamDB_Thread_SQL.java
@@ -53,7 +53,7 @@
                    + " AND table_name='tb_batt_rtdata'"
                    + " AND column_name='mon_cap'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtData_Table
                                + " ADD COLUMN `mon_cap` FLOAT NOT NULL DEFAULT 0;");
            }
            //添加单体容量列
@@ -62,7 +62,7 @@
                    + " AND table_name='tb_batt_rtdata'"
                    + " AND column_name='mon_JH_curr'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtData_Table
                                + " ADD COLUMN `mon_JH_curr` FLOAT NOT NULL DEFAULT 0;");
            }
            ResultSet res_t = sql.sqlMysqlQuery("SELECT BattGroupId,MonCount FROM " + Sql_Mysql.BattInf_Table);
@@ -248,9 +248,11 @@
                sql.sqlMysqlExecute(sql_str0);
                sql.sqlMysqlExecute(sql_str1);
            } else {
                sql.sqlMysqlExecute("DELETE FROM " + Sql_Mysql.ServerState_Table);
                //sql.sqlMysqlExecute("DELETE FROM " + Sql_Mysql.ServerState_Table);
                sql.sqlMysqlExecute(sql_str1);
            }
            
            sql.sqlMysqlExecute(sql_str2);
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_ram_db'"
                    + " AND table_name='tb_server_state'"
@@ -296,7 +298,6 @@
                        + " ADD COLUMN `server_network_rate` FLOAT NOT NULL DEFAULT 0");
            }
            
            sql.sqlMysqlExecute(sql_str2);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java
@@ -168,7 +168,7 @@
                    + " AND table_name='tb_fbs9100_setparam'"
                    + " AND column_name='BattGroupNum'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table
                                + " ADD COLUMN `BattGroupNum` INT NOT NULL DEFAULT 0;");
            }
            //添加指定的OnlineVolLowAction列
@@ -177,7 +177,7 @@
                    + " AND table_name='tb_fbs9100_setparam'"
                    + " AND column_name='OnlineVolLowAction'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table
                                + " ADD COLUMN `OnlineVolLowAction` INT NOT NULL DEFAULT 0;");
            }
            //添加指定的 DCVolHighLimit 列
@@ -186,7 +186,7 @@
                    + " AND table_name='tb_fbs9100_setparam'"
                    + " AND column_name='DCVolHighLimit'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table
                                + " ADD COLUMN `DCVolHighLimit` FLOAT NOT NULL DEFAULT 0;");
            }
            //添加指定的 ChargeCurrSet 列
@@ -195,7 +195,7 @@
                    + " AND table_name='tb_fbs9100_setparam'"
                    + " AND column_name='ChargeCurrSet'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table
                                + " ADD COLUMN `ChargeCurrSet` FLOAT NOT NULL DEFAULT 0;");
            }
            //添加指定的 MonomerTmp_High 列
@@ -204,7 +204,7 @@
                    + " AND table_name='tb_fbs9100_setparam'"
                    + " AND column_name='MonomerTmp_High'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table
                                + " ADD COLUMN `MonomerTmp_High` FLOAT NOT NULL DEFAULT 0;");
            }
            //添加指定的 AutoTestStartVol 列
@@ -213,7 +213,7 @@
                    + " AND table_name='tb_fbs9100_setparam'"
                    + " AND column_name='AutoTestStartVol'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table
                                + " ADD COLUMN `AutoTestStartVol`  float NOT NULL DEFAULT 0;");
            }
        } catch (SQLException e) {