From dd682d83d797cf99dc7568ccf27369e8015b7aa4 Mon Sep 17 00:00:00 2001 From: whyclj <1525436766@qq.com> Date: 星期一, 15 七月 2019 09:43:00 +0800 Subject: [PATCH] 在web_site 数据库中添加机房放电黑名单表 --- BattMonitor_DB_Builder/src/com/database_util/DB_web_site.java | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/BattMonitor_DB_Builder/src/com/database_util/DB_web_site.java b/BattMonitor_DB_Builder/src/com/database_util/DB_web_site.java index 0f91e0a..bfcee8a 100644 --- a/BattMonitor_DB_Builder/src/com/database_util/DB_web_site.java +++ b/BattMonitor_DB_Builder/src/com/database_util/DB_web_site.java @@ -47,6 +47,9 @@ createBattDischargePlan_Table(pool, recreate); //创建放电计划表 createBattMapInformation_Table(pool, recreate); //创建基站定位表 + + createBattDischarge_Table(pool,recreate); //创建基站故障表 + } /** @@ -758,7 +761,7 @@ " PRIMARY KEY (`num`)," + " UNIQUE KEY `stationId_num` (`stationId`) USING BTREE," + " KEY `index_num` (`num`)" + - ") ENGINE=InnoDB AUTO_INCREMENT=1171 DEFAULT CHARSET=utf8;"; + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { @@ -774,6 +777,34 @@ } } + /** + * 创建故障基站表 + */ + public static void createBattDischarge_Table(MysqlConnPool pool, boolean recreate) { + String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattDischarge_Table; + String sql_str02 = "CREATE TABLE IF NOT EXISTS "+Sql_Mysql.BattDischarge_Table+" (" + + " `num` int(11) NOT NULL AUTO_INCREMENT," + + " `uid` int(11) NOT NULL DEFAULT '1002'," + + " `dev_id` int(11) NOT NULL DEFAULT '910000001'," + + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00'," + + " `note` varchar(64) NOT NULL DEFAULT ''," + + " PRIMARY KEY (`num`)," + + " UNIQUE KEY `unique_dev_id_index` (`dev_id`) USING BTREE" + + ") 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); + } + 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); DB_web_site website = new DB_web_site(); -- Gitblit v1.9.1