蓄电池监控管理平台数据库初始化程序
Administrator
2022-06-09 63f2a0fac2d9a27f17a99bf9cd0b1369eb1057c5
V1.27 edit at date 2022-06-08
1.'db_pwrdev_data_rt.tb_pwrdev_acdcdata'表新增字段,修复fg2.0电源信息显示bug
`acIn2_currA` float NOT NULL DEFAULT '0',
`acIn2_currB` float NOT NULL DEFAULT '0',
`acIn2_currC` float NOT NULL DEFAULT '0',
5个文件已修改
97 ■■■■■ 已修改文件
BattMonitor_DB_Builder/bin/com/version_inf/version_inf.txt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/config.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/src/com/database_util/DB_Pwrdev_Data_Rt.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/src/com/version_inf/version_inf.txt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/src/main/main_BTS_DB_Builder.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/bin/com/version_inf/version_inf.txt
@@ -461,4 +461,12 @@
V1.26 edit at date 2022-05-19
    1.修复'db_batt_testdata'数据库种表不初始化bug
    2.修改添加默认账号时插入异常bug
V1.27 edit at date 2022-06-08
    1.'db_pwrdev_data_rt.tb_pwrdev_acdcdata'表新增字段,修复fg2.0电源信息显示bug
          `acIn2_currA` float NOT NULL DEFAULT '0',
            `acIn2_currB` float NOT NULL DEFAULT '0',
          `acIn2_currC` float NOT NULL DEFAULT '0',
BattMonitor_DB_Builder/config.xml
@@ -2,7 +2,7 @@
<root>
  <mysql_ramdb_recreate_en>false</mysql_ramdb_recreate_en>
  <mysql_server_ip>192.168.10.80</mysql_server_ip>
  <mysql_server_ip>192.168.10.79</mysql_server_ip>
  <!--SOURCE_BATTDATA_TYPE_FBSDEV = 0-->
  <!--SOURCE_BATTDATA_TYPE_SQLSERVER = 1-->
  <!--SOURCE_BATTDATA_TYPE_C_INTERFACE = 2-->
BattMonitor_DB_Builder/src/com/database_util/DB_Pwrdev_Data_Rt.java
@@ -2081,6 +2081,36 @@
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Pwrdev_Acdcdata_Table 
                        + " ADD COLUMN `is_Smoke_CommErr3` tinyint(1) NOT NULL DEFAULT '0' COMMENT '烟感3通信故障';");
            }
            //添加acIn2_currA字段
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_pwrdev_data_rt'"
                    + " AND table_name='tb_pwrdev_acdcdata'"
                    + " AND column_name='acIn2_currA'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Pwrdev_Acdcdata_Table
                        + " ADD COLUMN `acIn2_currA` float NOT NULL DEFAULT '0';");
            }
            //添加acIn2_currB字段
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_pwrdev_data_rt'"
                    + " AND table_name='tb_pwrdev_acdcdata'"
                    + " AND column_name='acIn2_currB'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Pwrdev_Acdcdata_Table
                        + " ADD COLUMN `acIn2_currB` float NOT NULL DEFAULT '0';");
            }
            //添加acIn2_currC字段
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_pwrdev_data_rt'"
                    + " AND table_name='tb_pwrdev_acdcdata'"
                    + " AND column_name='acIn2_currC'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Pwrdev_Acdcdata_Table
                        + " ADD COLUMN `acIn2_currC` float NOT NULL DEFAULT '0';");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
@@ -2110,7 +2140,7 @@
                "  `is_dc1_under_vol` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_dc2_over_vol` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_dc2_under_vol` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_dc_monitorerr` tinyint(1) NOT NULL," +
                "  `is_dc_monitorerr` tinyint(1) NOT NULL DEFAULT '0'," +
                "  `is_tempalarm` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_acIn1_trip` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_acIn2_trip` tinyint(1) NOT NULL DEFAULT '0'," + 
@@ -2177,7 +2207,7 @@
                "  `is_acIn1_under_volA` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_acIn1_less_A` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_acIn1_over_volB` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_acIn1_under_volB` tinyint(1) NOT NULL," +
                "  `is_acIn1_under_volB` tinyint(1) NOT NULL DEFAULT '0'," +
                "  `is_acIn1_less_B` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_acIn1_over_volC` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `is_acIn1_under_volC` tinyint(1) NOT NULL DEFAULT '0'," + 
@@ -2221,15 +2251,52 @@
                "  KEY `index_powerdev_id` (`PowerDeviceId`)" + 
                ") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        ResultSet res = null;
        try {
            if(true == recreate) {            
                sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
            sql.sqlMysqlExecute(sql_str02);
            //添加acIn2_currA字段
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_pwrdev_data_rt'"
                    + " AND table_name='tb_pwrdev_acdata'"
                    + " AND column_name='acIn2_currA'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Pwrdev_Acdata_Table
                        + " ADD COLUMN `acIn2_currA` float NOT NULL DEFAULT '0';");
            }
            //添加acIn2_currB字段
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_pwrdev_data_rt'"
                    + " AND table_name='tb_pwrdev_acdata'"
                    + " AND column_name='acIn2_currB'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Pwrdev_Acdata_Table
                        + " ADD COLUMN `acIn2_currB` float NOT NULL DEFAULT '0';");
            }
            //添加acIn2_currC字段
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_pwrdev_data_rt'"
                    + " AND table_name='tb_pwrdev_acdata'"
                    + " AND column_name='acIn2_currC'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Pwrdev_Acdata_Table
                        + " ADD COLUMN `acIn2_currC` float NOT NULL DEFAULT '0';");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    public static void main(String[] args) {
        MysqlConnPool pool = new MysqlConnPool("192.168.10.112", 3360, 50);
        createPwrdev_Acdata_Table(pool, false);
    }
}
BattMonitor_DB_Builder/src/com/version_inf/version_inf.txt
@@ -461,4 +461,12 @@
V1.26 edit at date 2022-05-19
    1.修复'db_batt_testdata'数据库种表不初始化bug
    2.修改添加默认账号时插入异常bug
V1.27 edit at date 2022-06-08
    1.'db_pwrdev_data_rt.tb_pwrdev_acdcdata'表新增字段,修复fg2.0电源信息显示bug
          `acIn2_currA` float NOT NULL DEFAULT '0',
            `acIn2_currB` float NOT NULL DEFAULT '0',
          `acIn2_currC` float NOT NULL DEFAULT '0',
BattMonitor_DB_Builder/src/main/main_BTS_DB_Builder.java
@@ -29,7 +29,7 @@
    /**************************************************************************/
    /**************************************************************************/
    public final static boolean app_debug = false;
    public final static float m_VersionNum = (float) 2.26;
    public final static float m_VersionNum = (float) 2.27;
    public final static String m_Version = "Welcome To Use BTS DB BUILDER V" + m_VersionNum + " RC_20180908";
    /**************************************************************************/
    /**************************************************************************/