| | |
| | | createBattDischargePlan_Table(pool, recreate); //创建放电计划表
|
| | |
|
| | | createBattMapInformation_Table(pool, recreate); //创建基站定位表
|
| | | |
| | | createBattDischarge_Table(pool,recreate); //创建基站故障表
|
| | | |
| | | }
|
| | |
|
| | | /**
|
| | |
| | | " 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) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 创建故障基站表
|
| | | */
|
| | | 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();
|