蓄电池监控管理平台数据库初始化程序
LiJun
2018-10-18 9348f97afb69f6c65e8b456ae6ac585bf9789477
机房状态表中添加续航列以及创建机房状态历史记录表
5个文件已修改
500 ■■■■ 已修改文件
BattMonitor_DB_Builder/bin/com/dev/fbs9100/FBS9100_Task_Thread_SQL.class 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/bin/com/sql/Sql_Mysql.class 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/config.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java 477 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/src/com/sql/Sql_Mysql.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/bin/com/dev/fbs9100/FBS9100_Task_Thread_SQL.class
Binary files differ
BattMonitor_DB_Builder/bin/com/sql/Sql_Mysql.class
Binary files differ
BattMonitor_DB_Builder/config.xml
@@ -2,7 +2,7 @@
<root>
  <mysql_ramdb_recreate_en>false</mysql_ramdb_recreate_en>
  <mysql_server_ip>127.0.0.1</mysql_server_ip>
  <mysql_server_ip>123.207.82.239</mysql_server_ip>
  <!--SOURCE_BATTDATA_TYPE_FBSDEV = 0-->
  <!--SOURCE_BATTDATA_TYPE_SQLSERVER = 1-->
  <!--SOURCE_BATTDATA_TYPE_C_INTERFACE = 2-->
BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java
@@ -1,238 +1,239 @@
package com.dev.fbs9100;
import java.sql.SQLException;
import com.sql.MysqlConnPool;
import com.sql.Sql_Mysql;
public class FBS9100_Task_Thread_SQL {
    /**
     * 创建 tb_fbs9100_state 表并且将设备id和设备hip插入到表中
     * @param con_pool
     * @param al_param
     */
    public static void createFBS9100StateTableOnRam(MysqlConnPool con_pool)
    {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100State_Table;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100State_Table
                    + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, "
                    + "`dev_ip` varchar(20) NOT NULL DEFAULT '127.0.0.0', "
                    + "`dev_version` varchar(20) NOT NULL DEFAULT '0', "
                    + "`dev_id` BIGINT NOT NULL DEFAULT 0, "
                    + "`op_cmd` INT NOT NULL DEFAULT 0, "
                    + "`record_datetime` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                    + "`dev_datetime` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                    + "`dev_testtype` INT NOT NULL DEFAULT 0, "
                    + "`dev_testgroupnum` INT NOT NULL DEFAULT 0, "
                    + "`dev_workstate` INT NOT NULL DEFAULT 0, "
                    + "`dev_alarmstate` INT NOT NULL DEFAULT 0, "
                    + "`dev_temp` float NOT NULL DEFAULT 0, "
                    + "`dev_res_test_state` INT NOT NULL DEFAULT 0, "        //内阻测试状态
                    + "`dev_onlinevollow` BOOLEAN NOT NULL DEFAULT false, "
                    + "`dev_eachgroup_battsum` INT NOT NULL DEFAULT 0, "
                    + "`dev_captest_onlinevol` float NOT NULL DEFAULT 0, "
                    + "`dev_captest_groupvol` float NOT NULL DEFAULT 0, "
                    + "`dev_captest_curr` float NOT NULL DEFAULT 0, "
                    + "`dev_captest_cap` float NOT NULL DEFAULT 0, "
                    + "`dev_captest_timelong` INT NOT NULL DEFAULT 0, "
                    + "`dev_restest_count` INT NOT NULL DEFAULT 0, "
                    + "`dev_restest_moncount` INT NOT NULL DEFAULT 0, "
                    + "`dev_restest_monindex` INT NOT NULL DEFAULT 0, "
                    + "`dev_commcount` INT NOT NULL DEFAULT 0, "
                    + "`dev_errcommcount` INT NOT NULL DEFAULT 0, "
                    + "`dev_rxnullerrcount` INT NOT NULL DEFAULT 0, "
                    + "`dev_last_captest_stop_type` INT NOT NULL DEFAULT 0, "
                    + "`dev_concurr`  float NOT NULL DEFAULT 0, "
                    + "`dev_condvoldp`  float NOT NULL DEFAULT 0, "
                    + "`dev_conresist`  float NOT NULL DEFAULT 0, "
                    + "`dev_condcurr`  float NOT NULL DEFAULT 0, "
                    + "`dev_61850alarms`  varchar(64) NOT NULL DEFAULT '', "
                    + "`dev_batt_xuhang_tlong` INT NOT NULL DEFAULT 0, "                //续航时长
                    + "`dev_station_poff_tlong` INT NOT NULL DEFAULT 0, "                //停电时长
                    + "`dev_station_poff_cnt` INT NOT NULL DEFAULT 0, "                    //停电次数
                    + "`dev_data_flowsum` BIGINT NOT NULL DEFAULT 0, "                    //机房流量
                    + " UNIQUE INDEX index_dev_id_uniq (`dev_id`), "
                    + " PRIMARY KEY (`num`) ) "
                    + " ENGINE=InnoDB DEFAULT CHARSET=utf8";
        /*
        String str3 = "INSERT INTO " + Sql_Mysql.FBS9100State_Table + " (dev_ip, dev_id) ";
        str3 += " SELECT dev_ip, dev_id FROM " + Sql_Mysql.BattInf_Table;
        */
        Sql_Mysql sql = new Sql_Mysql(con_pool.getConn());
        try {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
            //sql.sqlMysqlExecute(str3);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /**
     * 创建 tb_fbs9100s_dcdc_data 表并且将设备id和设备ip插入到表中
     * @param con_pool
     * @param al_param
     */
    public static void createFBS9100S_DCDC_DataTableOnRam(MysqlConnPool con_pool)
    {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100S_DcDcState_Table;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100S_DcDcState_Table
                    + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, "
                    + "`dev_id` BIGINT NOT NULL DEFAULT 0, "
                    + "`dcdc_num` BIGINT NOT NULL DEFAULT 0, "
                    + "`dcdc_Vsys` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Vout` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Vbat` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Iout` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Ibuck` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Tmp_Dis` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Tmp_Chr` float NOT NULL DEFAULT 0, "
                    + "`dcdc_SMR_Alarm1` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_SMR_Alarm2` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_version` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_ModeSetComm` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_RunSetComm` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_BuckISet` float NOT NULL DEFAULT 0, "
                    + "`dcdc_DisVolSet` float NOT NULL DEFAULT 0, "
                    + "`dcdc_DisCurrSet` float NOT NULL DEFAULT 0, "
                    + "`dcdc_CommTxCnt` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_CommRxCnt` INT NOT NULL DEFAULT 0, "
                    + " UNIQUE INDEX index_dcdc_num_uniq (`dcdc_num`), "
                    + " PRIMARY KEY (`num`) ) "
                    + " ENGINE=MEMORY DEFAULT CHARSET=utf8";
        Sql_Mysql sql = new Sql_Mysql(con_pool.getConn());
        try {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /**
     * 创建 tb_fbs9100_setparam 表,并且将设备id和设备ip插入到表中
     * @param con_pool
     * @param al_param
     */
    public static void createFBS9100SetTestParamTableOnRam(MysqlConnPool con_pool)
    {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100SetParam_Table;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100SetParam_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, "
                    + "`TestCmd` INT NOT NULL DEFAULT 0, "
                    + "`HourRate` INT NOT NULL DEFAULT 0, "
                    + "`DisCurr` FLOAT NOT NULL DEFAULT 0, "
                    + "`DisCap` FLOAT NOT NULL DEFAULT 0, "
                    + "`DisTime` INT NOT NULL DEFAULT 0, "
                    + "`GroupVol_LOW` FLOAT NOT NULL DEFAULT 0, "
                    + "`MonomerVol_LOW` FLOAT NOT NULL DEFAULT 0, "
                    + "`MonomerLowCount` INT NOT NULL DEFAULT 0, "
                    + "`BattGroupNum` INT NOT NULL DEFAULT 0, "
                    + "`OnlineVolLowAction` INT NOT NULL DEFAULT 0, "
                    + "`DCVolHighLimit` FLOAT NOT NULL DEFAULT 0, "
                    + "`ChargeCurrSet` FLOAT NOT NULL DEFAULT 0, "
                    + "`MonomerTmp_High` FLOAT NOT NULL DEFAULT 0, "
                    + "`AutoTestStartVol`  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 {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /**
     * 创建 Sql_Mysql.RamDB_CMCC_POWER_Data 表并且将设备id插入到表中
     * @param con_pool
     * @param al_param
     */
    public static void createFBS9100CmccPowerDataOnRam(MysqlConnPool con_pool)
    {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.RamDB_CMCC_POWER_Data;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.RamDB_CMCC_POWER_Data
                    + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, "
                    + "`dev_id` BIGINT NOT NULL DEFAULT 0, "
                    + "`vol1` float NOT NULL DEFAULT 0, "
                    + "`vol2` float NOT NULL DEFAULT 0, "
                    + "`vol3` float NOT NULL DEFAULT 0, "
                    + "`vol4` float NOT NULL DEFAULT 0, "
                    + "`vol5` float NOT NULL DEFAULT 0, "
                    + "`curr1` float NOT NULL DEFAULT 0, "
                    + "`curr2` float NOT NULL DEFAULT 0, "
                    + "`curr3` float NOT NULL DEFAULT 0, "
                    + "`curr4` float NOT NULL DEFAULT 0, "
                    + "`curr5` float NOT NULL DEFAULT 0, "
                    + " UNIQUE INDEX index_dev_id_uniq (`dev_id`), "
                    + " PRIMARY KEY (`num`) ) "
                    + " ENGINE=InnoDB DEFAULT CHARSET=utf8";
        Sql_Mysql sql = new Sql_Mysql(con_pool.getConn());
        try {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /***********************************************************************************/
    /**
     *
     * @param gB_MysqlConnPool
     */
    public static void createBTSStationState_TableOnRam(MysqlConnPool con_pool) {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.BTSStationState_Table;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BTSStationState_Table
                + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, "
                + "`station_id` BIGINT NOT NULL DEFAULT 0, "
                + "`dev_id` BIGINT NOT NULL DEFAULT 0, "
                + "`record_datetime` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                + "`station_stat` INT NOT NULL DEFAULT 0, "
                + "`station_poff_start_time` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                + "`station_poff_tlong` INT NOT NULL DEFAULT 0, "
                + "`station_fadian_start_time` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                + "`station_fadian_tlong` INT NOT NULL DEFAULT 0, "
                + "`station_diaozhan_start_time` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                + "`station_diaozhan_tlong` INT NOT NULL DEFAULT 0, "
                + "`station_temp` float NOT NULL DEFAULT 0, "    //温度
                + "`station_damp` float NOT NULL DEFAULT 0, "    //湿度
                + "`station_dooropen_start_time` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                + "`station_dooropen_tlong` INT NOT NULL DEFAULT 0, "
                + " UNIQUE INDEX index_station_id_uniq (`station_id`), "
                + " PRIMARY KEY (`num`) ) "
                + " ENGINE=InnoDB DEFAULT CHARSET=utf8";
        Sql_Mysql sql = new Sql_Mysql(con_pool.getConn());
        try {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
}
package com.dev.fbs9100;
import java.sql.SQLException;
import com.sql.MysqlConnPool;
import com.sql.Sql_Mysql;
public class FBS9100_Task_Thread_SQL {
    /**
     * 创建 tb_fbs9100_state 表并且将设备id和设备hip插入到表中
     * @param con_pool
     * @param al_param
     */
    public static void createFBS9100StateTableOnRam(MysqlConnPool con_pool)
    {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100State_Table;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100State_Table
                    + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, "
                    + "`dev_ip` varchar(20) NOT NULL DEFAULT '127.0.0.0', "
                    + "`dev_version` varchar(20) NOT NULL DEFAULT '0', "
                    + "`dev_id` BIGINT NOT NULL DEFAULT 0, "
                    + "`op_cmd` INT NOT NULL DEFAULT 0, "
                    + "`record_datetime` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                    + "`dev_datetime` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                    + "`dev_testtype` INT NOT NULL DEFAULT 0, "
                    + "`dev_testgroupnum` INT NOT NULL DEFAULT 0, "
                    + "`dev_workstate` INT NOT NULL DEFAULT 0, "
                    + "`dev_alarmstate` INT NOT NULL DEFAULT 0, "
                    + "`dev_temp` float NOT NULL DEFAULT 0, "
                    + "`dev_res_test_state` INT NOT NULL DEFAULT 0, "        //内阻测试状态
                    + "`dev_onlinevollow` BOOLEAN NOT NULL DEFAULT false, "
                    + "`dev_eachgroup_battsum` INT NOT NULL DEFAULT 0, "
                    + "`dev_captest_onlinevol` float NOT NULL DEFAULT 0, "
                    + "`dev_captest_groupvol` float NOT NULL DEFAULT 0, "
                    + "`dev_captest_curr` float NOT NULL DEFAULT 0, "
                    + "`dev_captest_cap` float NOT NULL DEFAULT 0, "
                    + "`dev_captest_timelong` INT NOT NULL DEFAULT 0, "
                    + "`dev_restest_count` INT NOT NULL DEFAULT 0, "
                    + "`dev_restest_moncount` INT NOT NULL DEFAULT 0, "
                    + "`dev_restest_monindex` INT NOT NULL DEFAULT 0, "
                    + "`dev_commcount` INT NOT NULL DEFAULT 0, "
                    + "`dev_errcommcount` INT NOT NULL DEFAULT 0, "
                    + "`dev_rxnullerrcount` INT NOT NULL DEFAULT 0, "
                    + "`dev_last_captest_stop_type` INT NOT NULL DEFAULT 0, "
                    + "`dev_concurr`  float NOT NULL DEFAULT 0, "
                    + "`dev_condvoldp`  float NOT NULL DEFAULT 0, "
                    + "`dev_conresist`  float NOT NULL DEFAULT 0, "
                    + "`dev_condcurr`  float NOT NULL DEFAULT 0, "
                    + "`dev_61850alarms`  varchar(64) NOT NULL DEFAULT '', "
                    + "`dev_batt_xuhang_tlong` INT NOT NULL DEFAULT 0, "                //续航时长
                    + "`dev_station_poff_tlong` INT NOT NULL DEFAULT 0, "                //停电时长
                    + "`dev_station_poff_cnt` INT NOT NULL DEFAULT 0, "                    //停电次数
                    + "`dev_data_flowsum` BIGINT NOT NULL DEFAULT 0, "                    //机房流量
                    + " UNIQUE INDEX index_dev_id_uniq (`dev_id`), "
                    + " PRIMARY KEY (`num`) ) "
                    + " ENGINE=InnoDB DEFAULT CHARSET=utf8";
        /*
        String str3 = "INSERT INTO " + Sql_Mysql.FBS9100State_Table + " (dev_ip, dev_id) ";
        str3 += " SELECT dev_ip, dev_id FROM " + Sql_Mysql.BattInf_Table;
        */
        Sql_Mysql sql = new Sql_Mysql(con_pool.getConn());
        try {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
            //sql.sqlMysqlExecute(str3);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /**
     * 创建 tb_fbs9100s_dcdc_data 表并且将设备id和设备ip插入到表中
     * @param con_pool
     * @param al_param
     */
    public static void createFBS9100S_DCDC_DataTableOnRam(MysqlConnPool con_pool)
    {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100S_DcDcState_Table;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100S_DcDcState_Table
                    + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, "
                    + "`dev_id` BIGINT NOT NULL DEFAULT 0, "
                    + "`dcdc_num` BIGINT NOT NULL DEFAULT 0, "
                    + "`dcdc_Vsys` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Vout` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Vbat` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Iout` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Ibuck` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Tmp_Dis` float NOT NULL DEFAULT 0, "
                    + "`dcdc_Tmp_Chr` float NOT NULL DEFAULT 0, "
                    + "`dcdc_SMR_Alarm1` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_SMR_Alarm2` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_version` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_ModeSetComm` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_RunSetComm` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_BuckISet` float NOT NULL DEFAULT 0, "
                    + "`dcdc_DisVolSet` float NOT NULL DEFAULT 0, "
                    + "`dcdc_DisCurrSet` float NOT NULL DEFAULT 0, "
                    + "`dcdc_CommTxCnt` INT NOT NULL DEFAULT 0, "
                    + "`dcdc_CommRxCnt` INT NOT NULL DEFAULT 0, "
                    + " UNIQUE INDEX index_dcdc_num_uniq (`dcdc_num`), "
                    + " PRIMARY KEY (`num`) ) "
                    + " ENGINE=MEMORY DEFAULT CHARSET=utf8";
        Sql_Mysql sql = new Sql_Mysql(con_pool.getConn());
        try {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /**
     * 创建 tb_fbs9100_setparam 表,并且将设备id和设备ip插入到表中
     * @param con_pool
     * @param al_param
     */
    public static void createFBS9100SetTestParamTableOnRam(MysqlConnPool con_pool)
    {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100SetParam_Table;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100SetParam_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, "
                    + "`TestCmd` INT NOT NULL DEFAULT 0, "
                    + "`HourRate` INT NOT NULL DEFAULT 0, "
                    + "`DisCurr` FLOAT NOT NULL DEFAULT 0, "
                    + "`DisCap` FLOAT NOT NULL DEFAULT 0, "
                    + "`DisTime` INT NOT NULL DEFAULT 0, "
                    + "`GroupVol_LOW` FLOAT NOT NULL DEFAULT 0, "
                    + "`MonomerVol_LOW` FLOAT NOT NULL DEFAULT 0, "
                    + "`MonomerLowCount` INT NOT NULL DEFAULT 0, "
                    + "`BattGroupNum` INT NOT NULL DEFAULT 0, "
                    + "`OnlineVolLowAction` INT NOT NULL DEFAULT 0, "
                    + "`DCVolHighLimit` FLOAT NOT NULL DEFAULT 0, "
                    + "`ChargeCurrSet` FLOAT NOT NULL DEFAULT 0, "
                    + "`MonomerTmp_High` FLOAT NOT NULL DEFAULT 0, "
                    + "`AutoTestStartVol`  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 {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /**
     * 创建 Sql_Mysql.RamDB_CMCC_POWER_Data 表并且将设备id插入到表中
     * @param con_pool
     * @param al_param
     */
    public static void createFBS9100CmccPowerDataOnRam(MysqlConnPool con_pool)
    {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.RamDB_CMCC_POWER_Data;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.RamDB_CMCC_POWER_Data
                    + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, "
                    + "`dev_id` BIGINT NOT NULL DEFAULT 0, "
                    + "`vol1` float NOT NULL DEFAULT 0, "
                    + "`vol2` float NOT NULL DEFAULT 0, "
                    + "`vol3` float NOT NULL DEFAULT 0, "
                    + "`vol4` float NOT NULL DEFAULT 0, "
                    + "`vol5` float NOT NULL DEFAULT 0, "
                    + "`curr1` float NOT NULL DEFAULT 0, "
                    + "`curr2` float NOT NULL DEFAULT 0, "
                    + "`curr3` float NOT NULL DEFAULT 0, "
                    + "`curr4` float NOT NULL DEFAULT 0, "
                    + "`curr5` float NOT NULL DEFAULT 0, "
                    + " UNIQUE INDEX index_dev_id_uniq (`dev_id`), "
                    + " PRIMARY KEY (`num`) ) "
                    + " ENGINE=InnoDB DEFAULT CHARSET=utf8";
        Sql_Mysql sql = new Sql_Mysql(con_pool.getConn());
        try {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /***********************************************************************************/
    /**
     *
     * @param gB_MysqlConnPool
     */
    public static void createBTSStationState_TableOnRam(MysqlConnPool con_pool) {
        String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.BTSStationState_Table;
        String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BTSStationState_Table
                + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, "
                + "`station_id` BIGINT NOT NULL DEFAULT 0, "
                + "`dev_id` BIGINT NOT NULL DEFAULT 0, "
                + "`record_datetime` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                + "`station_stat` INT NOT NULL DEFAULT 0, "
                + "`station_poff_start_time` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                //+ "`station_poff_tlong` INT NOT NULL DEFAULT 0, "
                + "`station_fadian_start_time` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                //+ "`station_fadian_tlong` INT NOT NULL DEFAULT 0, "
                + "`station_diaozhan_start_time` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                //+ "`station_diaozhan_tlong` INT NOT NULL DEFAULT 0, "
                + "`station_temp` float NOT NULL DEFAULT 0, "    //温度
                + "`station_damp` float NOT NULL DEFAULT 0, "    //湿度
                + "`station_dooropen_start_time` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                //+ "`station_dooropen_tlong` INT NOT NULL DEFAULT 0, "
                + "`station_xuhang_start_time` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                + " UNIQUE INDEX index_station_id_uniq (`station_id`), "
                + " PRIMARY KEY (`num`) ) "
                + " ENGINE=InnoDB DEFAULT CHARSET=utf8";
        Sql_Mysql sql = new Sql_Mysql(con_pool.getConn());
        try {
            sql.sqlMysqlExecute(str1);
            sql.sqlMysqlExecute(str2);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
}
BattMonitor_DB_Builder/src/com/sql/Sql_Mysql.java
@@ -113,6 +113,9 @@
    public final static String UserPermitGroupTable = DB_USER + ".`tb_user_permitgroup`";
    public final static String UserPermitGroupDataTable = DB_USER + ".`tb_user_permitgroup_data`";
    public final static String UserJieJiaRiTable = DB_USER + ".`tb_user_jiejiari`";
    public final static String BTSStationEvent_Table = DB_ALARM + ".`tb_bts_station_event`";                            //机房状态历史表
    //--------------------------------------------------------------------------------------------//
    //--------------------------------------------------------------------------------------------//
    public Connection mysql_con;
@@ -396,6 +399,23 @@
                        + "INDEX index_dev_id (`dev_id`), "
                        + "PRIMARY KEY (`num`)) "
                        + "ENGINE=InnoDB DEFAULT CHARSET=utf8;";
        String table_9 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BTSStationEvent_Table
                        + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, "
                        + "`station_id` BIGINT NOT NULL DEFAULT 0, "
                        + "`dev_id` BIGINT NOT NULL DEFAULT 0, "
                        + "`record_datetime` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', "
                        + "`station_event_type` INT NOT NULL DEFAULT 0, "
                        + "`station_event_trig` INT NOT NULL DEFAULT 0, "
                        + " INDEX index_dev_id (`dev_id`), "
                        + " INDEX index_station_id (`station_id`), "
                        + " PRIMARY KEY (`num`) ) "
                        + " ENGINE=InnoDB DEFAULT CHARSET=utf8";
        //-------------------------------------------------------------------------------------//
        //-------------------------------------------------------------------------------------//
        sqlMysqlUseDB(Sql_Mysql.DB_AppSys);
@@ -453,6 +473,7 @@
        sqlMysqlExecute(table_6);
        sqlMysqlExecute(table_7);
        sqlMysqlExecute(table_8);
        sqlMysqlExecute(table_9);
        
        //---------------------------------------------------------------------------------------------//
        ResultSet res = sqlMysqlQuery("show index from " + BattInf_Table + " where column_name='BattGroupId'");