| | |
| | | package com.database_util;
|
| | |
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | |
|
| | | import com.sql.MysqlConnPool;
|
| | |
| | | " KEY index_alm_cleared_type (alm_cleared_type)" +
|
| | | ") ENGINE=InnoDB AUTO_INCREMENT=18 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); |
| | | |
| | |
|
| | | //添加指定的work_flag列(派单管理)
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_alarm'"
|
| | | + " AND table_name='tb_devalarm_data'"
|
| | | + " AND column_name='work_flag'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Devalarm_Data_Table |
| | | + " ADD COLUMN `work_flag` tinyint NOT NULL DEFAULT 0;");
|
| | | }
|
| | | |
| | | //添加指定的msg_flag列(派单管理)
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_alarm'"
|
| | | + " AND table_name='tb_devalarm_data'"
|
| | | + " AND column_name='msg_flag'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Devalarm_Data_Table |
| | | + " ADD COLUMN `msg_flag` tinyint NOT NULL DEFAULT 0;");
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | |
| | | " KEY index_alm_level (alm_level)" +
|
| | | ") ENGINE=InnoDB AUTO_INCREMENT=1 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); |
| | | |
| | | //添加指定的work_flag列(派单管理)
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_alarm'"
|
| | | + " AND table_name='tb_battalarm_data'"
|
| | | + " AND column_name='work_flag'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Battalarm_Data_Table |
| | | + " ADD COLUMN `work_flag` tinyint NOT NULL DEFAULT 0;");
|
| | | }
|
| | | |
| | | //添加指定的msg_flag列(派单管理)
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_alarm'"
|
| | | + " AND table_name='tb_battalarm_data'"
|
| | | + " AND column_name='msg_flag'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Battalarm_Data_Table |
| | | + " ADD COLUMN `msg_flag` tinyint NOT NULL DEFAULT 0;");
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|