| | |
| | | //sql.sqlMysqlExecute(sql_str01);
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02);
|
| | | |
| | | /************************** 添加最大续航时长列 **************************************/
|
| | | String sql_str1 = " SELECT * FROM information_schema.columns "
|
| | | + " WHERE table_schema= 'web_site' "
|
| | | + " AND table_name='tb_batt_endurance' "
|
| | | + " AND column_name='endurance_actual_timelong_max'";
|
| | | //System.out.println(sql_str3);
|
| | | ResultSet rs = sql.sqlMysqlQuery(sql_str1);
|
| | | if(false == rs.next()) {
|
| | | sql.sqlMysqlExecute(" ALTER TABLE " + Sql_Mysql.BattEndurance_Table
|
| | | + " ADD COLUMN `endurance_actual_timelong_max` int(11) NOT NULL DEFAULT '0' COMMENT '最大实际续航时长(分钟)' AFTER `endurance_actual_timelong`;");
|
| | | }
|
| | | |
| | | /************************** 添加最小续航时长列 **************************************/
|
| | | String sql_str2 = " SELECT * FROM information_schema.columns "
|
| | | + " WHERE table_schema= 'web_site' "
|
| | | + " AND table_name='tb_batt_endurance' "
|
| | | + " AND column_name='endurance_actual_timelong_min'";
|
| | | //System.out.println(sql_str3);
|
| | | rs = sql.sqlMysqlQuery(sql_str2);
|
| | | if(false == rs.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattEndurance_Table |
| | | + " ADD COLUMN `endurance_actual_timelong_min` int(11) NOT NULL DEFAULT '0' COMMENT '最小实际续航时长(分钟)' AFTER `endurance_actual_timelong`;");
|
| | | }
|
| | | |
| | | /************************** 添加 电池组1实际容量 **************************************/
|
| | | String sql_str3 = " SELECT * FROM information_schema.columns "
|
| | | + " WHERE table_schema= 'web_site' "
|
| | | + " AND table_name='tb_batt_endurance' "
|
| | | + " AND column_name='real_cap_group1'";
|
| | | //System.out.println(sql_str3);
|
| | | rs = sql.sqlMysqlQuery(sql_str3);
|
| | | if(false == rs.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattEndurance_Table |
| | | + " ADD COLUMN `real_cap_group1` float NOT NULL DEFAULT '0' COMMENT '电池组1实际容量';");
|
| | | }
|
| | | /************************** 添加 电池组2实际容量 **************************************/
|
| | | String sql_str4 = " SELECT * FROM information_schema.columns "
|
| | | + " WHERE table_schema= 'web_site' "
|
| | | + " AND table_name='tb_batt_endurance' "
|
| | | + " AND column_name='real_cap_group2'";
|
| | | //System.out.println(sql_str3);
|
| | | rs = sql.sqlMysqlQuery(sql_str4);
|
| | | if(false == rs.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattEndurance_Table |
| | | + " ADD COLUMN `real_cap_group2` float NOT NULL DEFAULT '0' COMMENT '电池组2实际容量';");
|
| | | }
|
| | | /************************** 添加 电池组3实际容量 **************************************/
|
| | | String sql_str5 = " SELECT * FROM information_schema.columns "
|
| | | + " WHERE table_schema= 'web_site' "
|
| | | + " AND table_name='tb_batt_endurance' "
|
| | | + " AND column_name='real_cap_group3'";
|
| | | //System.out.println(sql_str3);
|
| | | rs = sql.sqlMysqlQuery(sql_str5);
|
| | | if(false == rs.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattEndurance_Table |
| | | + " ADD COLUMN `real_cap_group3` float NOT NULL DEFAULT '0' COMMENT '电池组3实际容量';");
|
| | | }
|
| | | /************************** 添加 电池组4实际容量 **************************************/
|
| | | String sql_str6 = " SELECT * FROM information_schema.columns "
|
| | | + " WHERE table_schema= 'web_site' "
|
| | | + " AND table_name='tb_batt_endurance' "
|
| | | + " AND column_name='real_cap_group4'";
|
| | | //System.out.println(sql_str3);
|
| | | rs = sql.sqlMysqlQuery(sql_str6);
|
| | | if(false == rs.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattEndurance_Table |
| | | + " ADD COLUMN `real_cap_group4` float NOT NULL DEFAULT '0' COMMENT '电池组4实际容量';");
|
| | | }
|
| | | /************************** 添加 电池组的标称容量 **************************************/
|
| | | String sql_str7 = " SELECT * FROM information_schema.columns "
|
| | | + " WHERE table_schema= 'web_site' "
|
| | | + " AND table_name='tb_batt_endurance' "
|
| | | + " AND column_name='batts_moncapstd'";
|
| | | //System.out.println(sql_str3);
|
| | | rs = sql.sqlMysqlQuery(sql_str7);
|
| | | if(false == rs.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattEndurance_Table |
| | | + " ADD COLUMN `batts_moncapstd` varchar(64) NOT NULL DEFAULT '' COMMENT '电池组的标称容量';");
|
| | | }
|
| | | /************************** 添加 电池组的核容时间 **************************************/
|
| | | String sql_str8 = " SELECT * FROM information_schema.columns "
|
| | | + " WHERE table_schema= 'web_site' "
|
| | | + " AND table_name='tb_batt_endurance' "
|
| | | + " AND column_name='batts_teststarttime'";
|
| | | rs = sql.sqlMysqlQuery(sql_str8);
|
| | | if(false == rs.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattEndurance_Table |
| | | + " ADD COLUMN `batts_teststarttime` varchar(250) NOT NULL DEFAULT '' COMMENT '电池组的核容时间';");
|
| | | }
|
| | | /************************** 添加 电池组的组数 **************************************/
|
| | | String sql_str9 = " SELECT * FROM information_schema.columns "
|
| | | + " WHERE table_schema= 'web_site' "
|
| | | + " AND table_name='tb_batt_endurance' "
|
| | | + " AND column_name='groupcount'";
|
| | | rs = sql.sqlMysqlQuery(sql_str9);
|
| | | if(false == rs.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattEndurance_Table |
| | | + " ADD COLUMN `groupcount` int NOT NULL DEFAULT '0' COMMENT '电池组的核容时间';");
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|