| | |
| | | " FloatChargeCurr float NOT NULL DEFAULT '0'," + |
| | | " OnlineVolLow float NOT NULL DEFAULT '0'," + |
| | | " GroupConnType int(11) NOT NULL DEFAULT '0'," + |
| | | " BattGroupCountSum int(11) NOT NULL DEFAULT '0'," + |
| | | " LiBattGroupCount int(11) NOT NULL DEFAULT '0'," + |
| | | " LiEachGroupBattCount int(11) NOT NULL DEFAULT '0'," + |
| | | " PRIMARY KEY (num)," + |
| | | " UNIQUE KEY index_dev_id_uniq (dev_id)" + |
| | | ") ENGINE=MEMORY 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); |
| | | |
| | | |
| | | //添加字段BattGroupCountSum |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_fbs9100_battparam'" |
| | | + " AND column_name='BattGroupCountSum'"); |
| | | if(false == res.next()) { |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100BattParam_Table |
| | | + " ADD COLUMN `BattGroupCountSum` int(11) NOT NULL DEFAULT '0' COMMENT '电池组总数(铅酸+锂电,只读)';"); |
| | | } |
| | | |
| | | //添加字段LiBattGroupCount |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_fbs9100_battparam'" |
| | | + " AND column_name='LiBattGroupCount'"); |
| | | if(false == res.next()) { |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100BattParam_Table |
| | | + " ADD COLUMN `LiBattGroupCount` int(11) NOT NULL DEFAULT '0' COMMENT '锂电组数';"); |
| | | } |
| | | |
| | | //添加字段LiEachGroupBattCount |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_fbs9100_battparam'" |
| | | + " AND column_name='LiEachGroupBattCount'"); |
| | | if(false == res.next()) { |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100BattParam_Table |
| | | + " ADD COLUMN `LiEachGroupBattCount` int(11) NOT NULL DEFAULT '0' COMMENT '锂电节数';"); |
| | | } |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | |
| | | sql.sqlMysqlExecute(sql_str02); |
| | | |
| | | |
| | | //添加字段mon_JH_curr |
| | | //添加字段op_cmd |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_bts_gprs_state'" |
| | |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if(null != res) { |
| | | try { |
| | | res.close(); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | sql.close_con(); |
| | | } |
| | | } |