| | |
| | | " `inverterCOutputCurr` float NOT NULL DEFAULT '0' COMMENT '逆变器输出C相电流'," + |
| | | " `inverterCOutputFreq` float NOT NULL DEFAULT '0' COMMENT '逆变器输出C相频率'," + |
| | | " `inverterCOutputBackCurr` float NOT NULL DEFAULT '0' COMMENT '逆变器输出C相回馈电流'," + |
| | | |
| | | " `battTestTimeLong1` int(11) NOT NULL DEFAULT '0' COMMENT '电池1测试时长'," + |
| | | " `battTestTimeLong2` int(11) NOT NULL DEFAULT '0' COMMENT '电池2测试时长'," + |
| | | " `battTestCap1` float NOT NULL DEFAULT '0' COMMENT '电池组1测试容量'," + |
| | | " `battTestCap2` float NOT NULL DEFAULT '0' COMMENT '电池组2测试容量'," + |
| | | " `roomTemp1` float NOT NULL DEFAULT '0' COMMENT '电池组1环境温度'," + |
| | | " `roomTemp2` float NOT NULL DEFAULT '0' COMMENT '电池组2环境温度'," + |
| | | " `roomHumid1` float NOT NULL DEFAULT '0' COMMENT '电池组1环境湿度'," + |
| | | " `roomHumid2` float NOT NULL DEFAULT '0' COMMENT '电池组2环境湿度'," + |
| | | " `battRealCap1` float NOT NULL DEFAULT '0' COMMENT '组1预估实际容量'," + |
| | | " `battRealCap2` float NOT NULL DEFAULT '0' COMMENT '组2预估实际容量'," + |
| | | " `atresia` int(11) NOT NULL DEFAULT '0' COMMENT '闭锁状态【1:闭锁;0:未闭锁】'," + |
| | | " `emergencyStop` int(11) NOT NULL DEFAULT '0' COMMENT '紧急停止'," + |
| | | " `poweroff` int(11) NOT NULL DEFAULT '0' COMMENT '机房停电标识'," + |
| | | " PRIMARY KEY (`num`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='电操开关遥测实时状态表';"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | ResultSet res = null; |
| | | try { |
| | | if(true == recreate) { |
| | | sql.sqlMysqlExecute(sql_str01); |
| | | } |
| | | sql.sqlMysqlExecute(sql_str02); |
| | | |
| | | res = null; |
| | | //新增字段battTestTimeLong1 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='battTestTimeLong1'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `battTestTimeLong1` int(11) NOT NULL DEFAULT '0' COMMENT '电池1测试时长';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段battTestTimeLong2 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='battTestTimeLong2'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `battTestTimeLong2` int(11) NOT NULL DEFAULT '0' COMMENT '电池2测试时长';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段battTestCap1 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='battTestCap1'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `battTestCap1` float NOT NULL DEFAULT '0' COMMENT '电池组1测试容量';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段battTestCap2 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='battTestCap2'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `battTestCap2` float NOT NULL DEFAULT '0' COMMENT '电池组2测试容量';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段roomTemp1 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='roomTemp1'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `roomTemp1` float NOT NULL DEFAULT '0' COMMENT '电池组1环境温度';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段roomTemp2 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='roomTemp2'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `roomTemp2` float NOT NULL DEFAULT '0' COMMENT '电池组2环境温度';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段roomHumid1 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='roomHumid1'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `roomHumid1` float NOT NULL DEFAULT '0' COMMENT '电池组1环境湿度';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段roomHumid2 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='roomHumid2'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `roomHumid2` float NOT NULL DEFAULT '0' COMMENT '电池组2环境湿度';"); |
| | | } |
| | | |
| | | |
| | | res = null; |
| | | //新增字段battRealCap1 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='battRealCap1'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `battRealCap1` float NOT NULL DEFAULT '0' COMMENT '组1预估实际容量';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段battRealCap2 |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='battRealCap2'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `battRealCap2` float NOT NULL DEFAULT '0' COMMENT '组2预估实际容量';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段atresia |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='atresia'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `atresia` int(11) NOT NULL DEFAULT '0' COMMENT '闭锁状态【1:闭锁;0:未闭锁】';"); |
| | | } |
| | | |
| | | res = null; |
| | | //新增字段emergencyStop |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='emergencyStop'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `emergencyStop` int(11) NOT NULL DEFAULT '0' COMMENT '紧急停止';"); |
| | | } |
| | | res = null; |
| | | //新增字段poweroff |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_ram_db'" |
| | | + " AND table_name='tb_dev_60870_inverter_info'" |
| | | + " AND column_name='poweroff'"); |
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info |
| | | + " ADD COLUMN `poweroff` int(11) NOT NULL DEFAULT '0' COMMENT '机房停电标识';"); |
| | | } |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |