| | |
| | | createBattAttention_Table(pool, recreate); //创建电池组单体关注表
|
| | |
|
| | | createBattpowerOff_Table(pool,recreate); //创建机房停电表
|
| | | |
| | | createBadbattMon_Table(pool, recreate); //创建落后单体表
|
| | | |
| | | createBadbattMonFlag_Table(pool, recreate); //创建落后单体帮助控制表
|
| | | |
| | | createBattEndurance_Table(pool, recreate); //创建机房续航
|
| | | |
| | | createBattParamLow_Table(pool, recreate); //创建各种续航表
|
| | | |
| | | createBattDischargeParam_Table(pool, recreate); //创建放电计划参数表
|
| | | |
| | | createBattDischargePlan_Table(pool, recreate); //创建放电计划表
|
| | | |
| | | createBattMapInformation_Table(pool, recreate); //创建基站定位表
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | //添加主程序记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11001");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('1', '11001', 'BMS_FBSDEV', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV', '1', 'V1.585', '主程序线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('1', '11001', 'BMS_FBSDEV', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV', '1', 'V1.585', '主程序线程', '300');");
|
| | | }
|
| | | //添加电池告警进程记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11002");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('2', '11002', 'BMS_FBSDEV_ALARM_BATT', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_ALARM', '1', 'V1.109', '电池告警线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('2', '11002', 'BMS_FBSDEV_ALARM_BATT', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_ALARM', '1', 'V1.109', '电池告警线程', '300');");
|
| | | }
|
| | | //添加设备告警进程记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11003");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('3', '11003', 'BMS_FBSDEV_ALARM_DEV', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_ALARM', '1', 'V1.109', '设备告警线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('3', '11003', 'BMS_FBSDEV_ALARM_DEV', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_ALARM', '1', 'V1.109', '设备告警线程', '300');");
|
| | | }
|
| | | //添加落后单体进程记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11004");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('4', '11004', 'BMS_FBSDEV_BADBATT_MON', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_BADBATT', '1', 'v2.303', '落后单体线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('4', '11004', 'BMS_FBSDEV_BADBATT_MON', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_BADBATT', '1', 'v2.303', '落后单体线程', '300');");
|
| | | }
|
| | | //添加容量告警进程记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11005");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('5', '11005', 'BMS_FBSDEV_BADBATT_CAP', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_BADBATT', '1', 'v2.303', '容量告警线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('5', '11005', 'BMS_FBSDEV_BADBATT_CAP', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_BADBATT', '1', 'v2.303', '容量告警线程', '300');");
|
| | | }
|
| | | //添加放电计划进程记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11006");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('6', '11006', 'BMS_FBSDEV_PLAN', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_PLAN', '2', ' ', '放电计划线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('6', '11006', 'BMS_FBSDEV_PLAN', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_PLAN', '2', ' ', '放电计划线程', '300');");
|
| | | }
|
| | | //添加机房停电进程记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11007");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('7', '11007', 'BMS_FBSDEV_POWER_FAIL', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_POWER_FAIL', '2', ' ', '机房停电线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('7', '11007', 'BMS_FBSDEV_POWER_FAIL', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_POWER_FAIL', '2', ' ', '机房停电线程', '300');");
|
| | | }
|
| | | //添加线程监控进程记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11008");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('8', '11008', 'BMS_FBSDEV_LISTEN', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_LISTEN', '1', 'V1.101', '线程监控线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('8', '11008', 'BMS_FBSDEV_LISTEN', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBSDEV_LISTEN', '1', 'V1.101', '线程监控线程', '300');");
|
| | | }
|
| | | //添加61850进程记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11009");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('9', '11009', 'BMS_FBS61850_BATT', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBS61850_BATT', '2', 'V1.101', '61850通讯线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('9', '11009', 'BMS_FBS61850_BATT', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBS61850_BATT', '2', 'V1.101', '61850通讯线程', '300');");
|
| | | }
|
| | | //添加9600进程记录
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11010");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + " VALUES ('10', '11010', 'BMS_FBS9600_DISPLAY', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBS9600_DISPLAY', '2', 'v1.101', '9600显示模块线程', '300');");
|
| | | sql.sqlMysqlExecute("INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(num,ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('10', '11010', 'BMS_FBS9600_DISPLAY', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_FBS9600_DISPLAY', '2', 'v1.101', '9600显示模块线程', '300');");
|
| | | }
|
| | |
|
| | | } catch (SQLException e) {
|
| | |
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | /**
|
| | | * 创落后单体表
|
| | | */
|
| | | public static void createBadbattMon_Table(MysqlConnPool pool, boolean recreate) {
|
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BadbattMon_Table;
|
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BadbattMon_Table + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `battgroupid` int(11) NOT NULL DEFAULT '0'," + |
| | | " `mon_num` int(11) NOT NULL DEFAULT '0'," + |
| | | " `record_num` int(11) NOT NULL DEFAULT '0'," + |
| | | " `test_starttime` datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + |
| | | " `group_vol` float NOT NULL DEFAULT '0'," + |
| | | " `test_curr` float NOT NULL DEFAULT '0'," + |
| | | " `mon_vol` float NOT NULL DEFAULT '0'," + |
| | | " `real_cap` float NOT NULL DEFAULT '0'," + |
| | | " `stdcap` float NOT NULL DEFAULT '0'," + |
| | | " `note` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ' '," + |
| | | " PRIMARY KEY (`num`)," + |
| | | " KEY `index_num` (`battgroupid`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;";
|
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | try {
|
| | | if(true == recreate) { |
| | | //sql.sqlMysqlExecute(sql_str01);
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02); |
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | /**
|
| | | * 创落后单体控制表
|
| | | */
|
| | | public static void createBadbattMonFlag_Table(MysqlConnPool pool, boolean recreate) {
|
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BadbattMonFlag_Table;
|
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BadbattMonFlag_Table + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `count` int(11) NOT NULL DEFAULT '0'," + |
| | | " PRIMARY KEY (`num`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;";
|
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | try {
|
| | | if(true == recreate) { |
| | | //sql.sqlMysqlExecute(sql_str01);
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02); |
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 创建机房续航表
|
| | | */
|
| | | public static void createBattEndurance_Table(MysqlConnPool pool, boolean recreate) {
|
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattEndurance_Table;
|
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattEndurance_Table + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `deviceid` int(11) NOT NULL DEFAULT '0' COMMENT '设备id'," + |
| | | " `stationid` varchar(64) NOT NULL DEFAULT '0' COMMENT '机房id'," + |
| | | " `real_cap` float NOT NULL DEFAULT '0' COMMENT '实际容量'," + |
| | | " `moncapstd` float NOT NULL DEFAULT '0' COMMENT '标称容量'," + |
| | | " `real_curr` float NOT NULL DEFAULT '0' COMMENT '实际电流'," + |
| | | " `endurance_theory_timelong` float NOT NULL DEFAULT '0' COMMENT '理论续航时长(分钟)'," + |
| | | " `endurance_actual_timelong` float NOT NULL DEFAULT '0' COMMENT '平均实际续航时长(分钟)'," + |
| | | " `endurance_actual_timelong_min` float NOT NULL DEFAULT '0' COMMENT '最小实际续航时长(分钟)'," + |
| | | " `endurance_actual_timelong_max` float NOT NULL DEFAULT '0' COMMENT '最大实际续航时长(分钟)'," + |
| | | " `is_out_stand` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否掉站'," + |
| | | " `note` varchar(64) NOT NULL DEFAULT '' COMMENT '备注'," + |
| | | " `real_cap_group1` float NOT NULL DEFAULT '0' COMMENT '电池组1实际容量'," + |
| | | " `real_cap_group2` float NOT NULL DEFAULT '0' COMMENT '电池组2实际容量'," + |
| | | " `real_cap_group3` float NOT NULL DEFAULT '0' COMMENT '电池组3实际容量'," + |
| | | " `real_cap_group4` float NOT NULL DEFAULT '0' COMMENT '电池组4实际容量'," + |
| | | " PRIMARY KEY (`num`)," + |
| | | " UNIQUE KEY `unique_index_deviceid` (`deviceid`)," + |
| | | " KEY `index_stationid` (`stationid`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | try {
|
| | | if(true == recreate) { |
| | | //sql.sqlMysqlExecute(sql_str01);
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02); |
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 创建各种阀值参数表
|
| | | */
|
| | | public static void createBattParamLow_Table(MysqlConnPool pool, boolean recreate) {
|
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattParamLow_Table;
|
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattParamLow_Table + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `low_type` int(11) DEFAULT NULL," + |
| | | " `Low_nametype` int(11) DEFAULT NULL," + |
| | | " `Low_value` float DEFAULT NULL," + |
| | | " `low_method` int(11) DEFAULT NULL," + |
| | | " PRIMARY KEY (`num`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | try {
|
| | | if(true == recreate) { |
| | | sql.sqlMysqlExecute(sql_str01);
|
| | | sql.sqlMysqlExecute(sql_str02);
|
| | | }else {
|
| | | sql.sqlMysqlUseDB(Sql_Mysql.WEB_Site);
|
| | | if(sql.sqlMysqlCheckIfTableExist("tb_batt_param_low")) { |
| | | sql.sqlMysqlExecute("DELETE FROM " + Sql_Mysql.BattParamLow_Table);
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02);
|
| | | }
|
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.BattParamLow_Table+" VALUES ('1', '1', '0', '0.8', '1');");
|
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.BattParamLow_Table+" VALUES ('2', '1', '1', '0.9', '1');");
|
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.BattParamLow_Table+" VALUES ('3', '2', '0', '0.01', '0');");
|
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.BattParamLow_Table+" VALUES ('4', '2', '1', '0.1', '0');");
|
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.BattParamLow_Table+" VALUES ('5', '2', '2', '0.4', '0');");
|
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.BattParamLow_Table+" VALUES ('6', '2', '3', '0.5', '0');");
|
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.BattParamLow_Table+" VALUES ('7', '3', '2', '0.94', '1');");
|
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.BattParamLow_Table+" VALUES ('8', '3', '3', '0.01', '1');");
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 创建放电计划参数表
|
| | | */
|
| | | public static void createBattDischargeParam_Table(MysqlConnPool pool, boolean recreate) {
|
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattDischargeParam_Table;
|
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattDischargeParam_Table + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `preset_time` int(11) DEFAULT NULL," + |
| | | " `preset_cap` float NOT NULL DEFAULT '0'," + |
| | | " `preset_monvol` float NOT NULL DEFAULT '0'," + |
| | | " `preset_groupvol` float NOT NULL DEFAULT '0'," + |
| | | " `note` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT ' '," + |
| | | " `param_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL," + |
| | | " `preset_mon` int(11) NOT NULL DEFAULT '0'," + |
| | | " `preset_curr` float NOT NULL DEFAULT '0'," + |
| | | " `chargecurrset` float NOT NULL DEFAULT '0'," + |
| | | " `dcvolhighlimit` float NOT NULL DEFAULT '0'," + |
| | | " PRIMARY KEY (`num`)," + |
| | | " KEY `index_num` (`num`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | try {
|
| | | if(true == recreate) { |
| | | //sql.sqlMysqlExecute(sql_str01);
|
| | | //sql.sqlMysqlExecute(sql_str02);
|
| | | }else {
|
| | | |
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02); //创建放电计划参数表
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 创建放电计划表
|
| | | */
|
| | | public static void createBattDischargePlan_Table(MysqlConnPool pool, boolean recreate) {
|
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattDischargePlan_Table;
|
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattDischargePlan_Table + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `battgroupid` int(11) NOT NULL DEFAULT '0'," + |
| | | " `discharge_starttime` timestamp NOT NULL DEFAULT '1982-01-01 00:00:00'," + |
| | | " `discharge_stoptime` timestamp NOT NULL DEFAULT '1982-01-01 00:00:00'," + |
| | | " `discharge_state` int(11) NOT NULL DEFAULT '0'," + |
| | | " `discharge_reason` varchar(128) COLLATE utf8_unicode_ci NOT NULL DEFAULT ''," + |
| | | " `note` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT ''," + |
| | | " `discharge_cleartype` int(11) NOT NULL DEFAULT '1'," + |
| | | " `BattIndexInFbs` int(11) NOT NULL DEFAULT '0'," + |
| | | " `preset_time` int(11) NOT NULL DEFAULT '0'," + |
| | | " `preset_cap` float NOT NULL DEFAULT '0'," + |
| | | " `preset_monvol` float NOT NULL DEFAULT '0'," + |
| | | " `preset_groupvol` float NOT NULL DEFAULT '0'," + |
| | | " `preset_mon` int(11) NOT NULL DEFAULT '0'," + |
| | | " `preset_curr` float NOT NULL DEFAULT '0'," + |
| | | " `dcvolhighlimit` float NOT NULL DEFAULT '0'," + |
| | | " `chargecurrset` float NOT NULL DEFAULT '0'," + |
| | | " PRIMARY KEY (`num`)," + |
| | | " KEY `index_num` (`num`)" + |
| | | ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | try {
|
| | | if(true == recreate) { |
| | | //sql.sqlMysqlExecute(sql_str01);
|
| | | //sql.sqlMysqlExecute(sql_str02);
|
| | | }else {
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02); //创建放电计划表
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | /**
|
| | | * 创建基站定位表
|
| | | */
|
| | | public static void createBattMapInformation_Table(MysqlConnPool pool, boolean recreate) {
|
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattMapInformation_Table;
|
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattMapInformation_Table + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `stationId` varchar(128) NOT NULL," + |
| | | " `stationName` varchar(128) NOT NULL," + |
| | | " `address` varchar(128) NOT NULL," + |
| | | " `longitude` double(11,8) NOT NULL DEFAULT '0.00000000'," + |
| | | " `latitude` double(11,8) NOT NULL DEFAULT '0.00000000'," + |
| | | " `information` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''," + |
| | | " PRIMARY KEY (`num`)," + |
| | | " UNIQUE KEY `stationId_num` (`stationId`) USING BTREE," + |
| | | " KEY `index_num` (`num`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=1171 DEFAULT CHARSET=utf8;"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | try {
|
| | | if(true == recreate) { |
| | | //sql.sqlMysqlExecute(sql_str01);
|
| | | //sql.sqlMysqlExecute(sql_str02);
|
| | | }else {
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02); //创建基站定位表
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | |
|
| | | public static void main(String[] args) {
|
| | | MysqlConnPool pool = new MysqlConnPool("123.207.82.239", 3360, 10);
|