From ce93cfa1ec475d84cee19de6c7594a49135a2215 Mon Sep 17 00:00:00 2001 From: whycrzg <ruanzhigang@whycst.com> Date: 星期一, 08 十一月 2021 14:38:53 +0800 Subject: [PATCH] V1.90 edit at date 2021-11-8 1:修改`db_battinf`.`tb_battinf` 表下字段 去掉 NOT NULL属性 --- BattMonitor_DB_Builder/src/com/database_util/DB_battinf.java | 368 +++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 274 insertions(+), 94 deletions(-) diff --git a/BattMonitor_DB_Builder/src/com/database_util/DB_battinf.java b/BattMonitor_DB_Builder/src/com/database_util/DB_battinf.java index bdeae2d..6c9a6e6 100644 --- a/BattMonitor_DB_Builder/src/com/database_util/DB_battinf.java +++ b/BattMonitor_DB_Builder/src/com/database_util/DB_battinf.java @@ -560,89 +560,93 @@ public static void createBattInf_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattInf_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattInf_Table + " (" + - " `num` int(11) NOT NULL AUTO_INCREMENT," + - " `StationId` varchar(20) NOT NULL DEFAULT '0'," + - " `charge_curr_max` float DEFAULT '20'," + - " `StationId_ex` varchar(20) DEFAULT '0'," + - " `StationName` varchar(100) NOT NULL DEFAULT ' '," + - " `StationName1` varchar(100) NOT NULL DEFAULT ' '," + - " `StationName2` varchar(100) NOT NULL DEFAULT ' '," + - " `StationName3` varchar(100) NOT NULL DEFAULT ' '," + - " `StationName4` varchar(100) NOT NULL DEFAULT ' '," + - " `StationName5` varchar(100) NOT NULL DEFAULT ' '," + - " `StationName6` varchar(100) NOT NULL DEFAULT ' '," + - " `StationName7` varchar(100) NOT NULL DEFAULT ' '," + - " `StationName8` varchar(100) NOT NULL DEFAULT ' '," + - " `StationName9` varchar(100) NOT NULL DEFAULT ' '," + - " `StationIP` varchar(20) NOT NULL DEFAULT '0'," + - " `FBSDeviceId` bigint(11) NOT NULL DEFAULT '0'," + - " `FBSDeviceIp` varchar(50) NOT NULL DEFAULT '192.168.0.88'," + - " `FBSDeviceName` varchar(100) NOT NULL DEFAULT '0'," + - " `GroupIndexInFBSDevice` int(11) NOT NULL DEFAULT '0'," + - " `BattModel` varchar(100) NOT NULL DEFAULT ' '," + - " `BattGroupId` int(11) NOT NULL DEFAULT '0'," + - " `BattGroupNum` int(11) NOT NULL DEFAULT '0'," + - " `BattGroupName` varchar(100) NOT NULL DEFAULT ' '," + - " `BattGroupName1` varchar(100) NOT NULL DEFAULT ' '," + - " `BattGroupName2` varchar(100) NOT NULL DEFAULT ' '," + - " `BattGroupName3` varchar(100) NOT NULL DEFAULT ' '," + - " `BattGroupName4` varchar(100) NOT NULL DEFAULT ' '," + - " `BattGroupName5` varchar(100) NOT NULL DEFAULT ' '," + - " `BattGroupName6` varchar(100) NOT NULL DEFAULT ' '," + - " `FloatVolLevel` float NOT NULL DEFAULT '1.12'," + - " `OfflineVolLevel` float NOT NULL DEFAULT '1.06'," + - " `BattFloatCurrent` float NOT NULL DEFAULT '0'," + - " `DeviceId` varchar(20) NOT NULL DEFAULT '0'," + - " `DeviceName` varchar(100) NOT NULL DEFAULT '0'," + - " `MonCount` int(11) NOT NULL DEFAULT '0'," + - " `MonCapStd` float NOT NULL DEFAULT '0'," + - " `MonVolStd` float NOT NULL DEFAULT '0'," + - " `MonResStd` float NOT NULL DEFAULT '0'," + - " `MonSerStd` float NOT NULL DEFAULT '0'," + - " `MonTmpStd` float NOT NULL DEFAULT '0'," + - " `MonVolLowToAvg` float NOT NULL DEFAULT '0'," + - " `MonNum` int(11) NOT NULL DEFAULT '0'," + - " `BattProducer` varchar(45) NOT NULL DEFAULT '0'," + - " `BattProductDate` date NOT NULL DEFAULT '2006-07-06'," + - " `BattInUseDate` date NOT NULL DEFAULT '2006-07-06'," + - " `BattGuarantDayCount` int(11) NOT NULL DEFAULT '1095'," + - " `SignalId` varchar(20) NOT NULL DEFAULT '0'," + - " `CInterFaceId` int(11) NOT NULL DEFAULT '0'," + - " `SignalName` varchar(50) NOT NULL DEFAULT '0'," + - " `Load_curr` float NOT NULL DEFAULT '15'," + - " `disCurrMax` float NOT NULL DEFAULT '0'," + - " `FbsDeviceIp_YM` varchar(50) NOT NULL DEFAULT '255.255.255.0'," + - " `FbsDeviceIp_WG` varchar(50) NOT NULL DEFAULT '127.0.0.1'," + - " `station_phone` varchar(32) DEFAULT ''," + - " `station_install` tinyint(1) NOT NULL DEFAULT '0'," + - " `install_user` varchar(64) DEFAULT ''," + - " `Vol_grade` float DEFAULT '0'," + - " `Manufacturers` varchar(64) DEFAULT ''," + - " `Assetequipment` varchar(64) DEFAULT ''," + - " `Deviceclasspath` varchar(64) DEFAULT ''," + - " `DeviceOperationDepartment` varchar(64) DEFAULT ''," + - " `PropertyRightUnit` varchar(64) DEFAULT ''," + - " `PropertyAttribute` varchar(64) DEFAULT ''," + - " `FactoryNumber` varchar(64) DEFAULT ''," + - " `OperationTeam` varchar(64) DEFAULT ''," + - " `DeviceIdentityCode` varchar(64) DEFAULT ''," + - " `ProjectType` varchar(64) DEFAULT ''," + - " `BatteryApplicationType` varchar(64) DEFAULT ''," + - " `SingleRatedVoltage` float DEFAULT '0'," + - " `RemoteMonitor` varchar(64) DEFAULT ''," + - " `BatttIndependentPlaced` varchar(64) DEFAULT ''," + - " `JunChargeVoltageValue` float DEFAULT '0'," + - " `PublicKeyX` varchar(200) NOT NULL DEFAULT ''," + - " `PublicKeyY` varchar(200) NOT NULL DEFAULT ''," + - " `KeyID` varchar(200) NOT NULL DEFAULT ''," + - " `SerialNumber` varchar(200) NOT NULL DEFAULT ''," + - " `video_url` varchar(200) DEFAULT NULL," + - " PRIMARY KEY (`num`)," + - " UNIQUE KEY `index_battgroup_id` (`BattGroupId`) USING BTREE," + - " KEY `index_station_id` (`StationId`)," + - " KEY `index_station_name` (`StationName`)," + - " KEY `index_battgroup_name` (`BattGroupName`)" + - ") ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;"; + " `num` int(11) NOT NULL AUTO_INCREMENT," + + " `StationId` varchar(20) DEFAULT '0'," + + " `StationId_ex` varchar(20) DEFAULT '0'," + + " `StationName` varchar(100) DEFAULT ' '," + + " `StationName1` varchar(100) DEFAULT ' '," + + " `StationName2` varchar(100) DEFAULT ' '," + + " `StationName3` varchar(100) DEFAULT ' '," + + " `StationName4` varchar(100) DEFAULT ' '," + + " `StationName5` varchar(100) DEFAULT ' '," + + " `StationName6` varchar(100) DEFAULT ' '," + + " `StationName7` varchar(100) DEFAULT ' '," + + " `StationName8` varchar(100) DEFAULT ' '," + + " `StationName9` varchar(100) DEFAULT ' '," + + " `StationIP` varchar(20) DEFAULT '0'," + + " `FBSDeviceId` bigint(11) DEFAULT '0'," + + " `FBSDeviceIp` varchar(50) DEFAULT '192.168.0.88'," + + " `FBSDeviceIp_WG` varchar(64) DEFAULT '192.168.0.1'," + + " `FBSDeviceIp_YM` varchar(64) DEFAULT '255.255.255.0'," + + " `FBSDeviceName` varchar(100) DEFAULT '0'," + + " `GroupIndexInFBSDevice` int(11) DEFAULT '0'," + + " `BattModel` varchar(100) DEFAULT ' '," + + " `BattGroupId` int(11) DEFAULT '0'," + + " `BattGroupNum` int(11) DEFAULT '0'," + + " `BattGroupName` varchar(100) DEFAULT ' '," + + " `BattGroupName1` varchar(100) DEFAULT ' '," + + " `BattGroupName2` varchar(100) DEFAULT ' '," + + " `BattGroupName3` varchar(100) DEFAULT ' '," + + " `BattGroupName4` varchar(100) DEFAULT ' '," + + " `BattGroupName5` varchar(100) DEFAULT ' '," + + " `BattGroupName6` varchar(100) DEFAULT ' '," + + " `FloatVolLevel` float DEFAULT '1.12'," + + " `OfflineVolLevel` float DEFAULT '1.06'," + + " `BattFloatCurrent` float DEFAULT '0'," + + " `DeviceId` varchar(20) DEFAULT '0'," + + " `DeviceName` varchar(100) DEFAULT '0'," + + " `MonCount` int(11) DEFAULT '0'," + + " `MonCapStd` float DEFAULT '0'," + + " `MonVolStd` float DEFAULT '0'," + + " `MonResStd` float DEFAULT '0'," + + " `MonSerStd` float DEFAULT '0'," + + " `MonTmpStd` float DEFAULT '0'," + + " `MonVolLowToAvg` float DEFAULT '0'," + + " `MonNum` int(11) DEFAULT '0'," + + " `BattProducer` varchar(45) DEFAULT '0'," + + " `BattProductDate` date DEFAULT '2006-07-06'," + + " `BattInUseDate` date DEFAULT '2006-07-06'," + + " `BattGuarantDayCount` int(11) DEFAULT '1095'," + + " `SignalId` varchar(20) DEFAULT '0'," + + " `CInterFaceId` int(11) DEFAULT '0'," + + " `SignalName` varchar(50) DEFAULT '0'," + + " `Load_curr` float DEFAULT '15'," + + " `DisCurrMax` float DEFAULT '0'," + + " `station_phone` varchar(32) DEFAULT ''," + + " `station_install` tinyint(1) DEFAULT '0'," + + " `install_user` varchar(64) DEFAULT ''," + + " `charge_curr_max` float DEFAULT '20'," + + " `Vol_grade` float DEFAULT '0'," + + " `Manufacturers` varchar(64) DEFAULT ''," + + " `Assetequipment` varchar(64) DEFAULT ''," + + " `Deviceclasspath` varchar(64) DEFAULT ''," + + " `DeviceOperationDepartment` varchar(64) DEFAULT ''," + + " `PropertyRightUnit` varchar(64) DEFAULT ''," + + " `PropertyAttribute` varchar(64) DEFAULT ''," + + " `FactoryNumber` varchar(64) DEFAULT ''," + + " `OperationTeam` varchar(64) DEFAULT ''," + + " `DeviceIdentityCode` varchar(64) DEFAULT ''," + + " `ProjectType` varchar(64) DEFAULT ''," + + " `BatteryApplicationType` varchar(64) DEFAULT ''," + + " `SingleRatedVoltage` float DEFAULT '0'," + + " `RemoteMonitor` varchar(64) DEFAULT ''," + + " `BatttIndependentPlaced` varchar(64) DEFAULT ''," + + " `JunChargeVoltageValue` float DEFAULT '0'," + + " `PublicKeyX` varchar(200) DEFAULT ''," + + " `PublicKeyY` varchar(200) DEFAULT ''," + + " `KeyID` varchar(200) DEFAULT ''," + + " `SerialNumber` varchar(200) DEFAULT ''," + + " `sort_id` int(3) DEFAULT '0'," + + " `video_url` varchar(200) DEFAULT NULL," + + " `charge_type` int(11) DEFAULT '1' COMMENT '充放电状态:1:限流充电;2;逆变充电'," + + " `buscouple_state` int(11) DEFAULT '0' COMMENT '母联状态:0:无母联;1:有母联'," + + " `tmp_id` int(11) DEFAULT '0'," + + " PRIMARY KEY (`num`)," + + " UNIQUE KEY `index_battgroup_id` (`BattGroupId`) USING BTREE," + + " KEY `index_station_id` (`StationId`)," + + " KEY `index_station_name` (`StationName`)," + + " KEY `index_battgroup_name` (`BattGroupName`)" + + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { @@ -657,7 +661,7 @@ + " AND column_name='Load_curr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `Load_curr` float NOT NULL DEFAULT '15';"); + + " ADD COLUMN `Load_curr` float DEFAULT '15';"); } //添加disCurrMax res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" @@ -666,7 +670,7 @@ + " AND column_name='disCurrMax'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `disCurrMax` float NOT NULL DEFAULT '0';"); + + " ADD COLUMN `disCurrMax` float DEFAULT '0';"); } //添加FbsDeviceIp_YM res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" @@ -675,7 +679,7 @@ + " AND column_name='FbsDeviceIp_YM'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `FbsDeviceIp_YM` varchar(50) NOT NULL DEFAULT '255.255.255.0';"); + + " ADD COLUMN `FbsDeviceIp_YM` varchar(50) DEFAULT '255.255.255.0';"); } //添加FbsDeviceIp_WG res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" @@ -684,7 +688,7 @@ + " AND column_name='FbsDeviceIp_WG'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `FbsDeviceIp_WG` varchar(50) NOT NULL DEFAULT '127.0.0.1';"); + + " ADD COLUMN `FbsDeviceIp_WG` varchar(50) DEFAULT '127.0.0.1';"); } //添加station_phone res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" @@ -702,7 +706,7 @@ + " AND column_name='station_install'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `station_install` tinyint(1) NOT NULL DEFAULT '0';"); + + " ADD COLUMN `station_install` tinyint(1) DEFAULT '0';"); } //添加install_user res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" @@ -864,7 +868,7 @@ + " AND column_name='PublicKeyX'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `PublicKeyX` varchar(200) NOT NULL DEFAULT '';"); + + " ADD COLUMN `PublicKeyX` varchar(200) DEFAULT '';"); } //添加PublicKeyY res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" @@ -873,7 +877,7 @@ + " AND column_name='PublicKeyY'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `PublicKeyY` varchar(200) NOT NULL DEFAULT '';"); + + " ADD COLUMN `PublicKeyY` varchar(200) DEFAULT '';"); } //添加KeyID res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" @@ -882,7 +886,7 @@ + " AND column_name='KeyID'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `KeyID` varchar(200) NOT NULL DEFAULT '';"); + + " ADD COLUMN `KeyID` varchar(200) DEFAULT '';"); } //添加SerialNumber res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" @@ -891,7 +895,7 @@ + " AND column_name='SerialNumber'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `SerialNumber` varchar(200) NOT NULL DEFAULT '';"); + + " ADD COLUMN `SerialNumber` varchar(200) DEFAULT '';"); } //添加SerialNumber res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" @@ -910,7 +914,7 @@ + " AND column_name='charge_type'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `charge_type` int(11) NOT NULL DEFAULT '1' COMMENT '充放电状态:1:限流充电;2;逆变充电';"); + + " ADD COLUMN `charge_type` int(11) DEFAULT '1' COMMENT '充放电状态:1:限流充电;2;逆变充电';"); } //添加buscouple_state @@ -920,7 +924,7 @@ + " AND column_name='buscouple_state'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table - + " ADD COLUMN `buscouple_state` int(11) NOT NULL DEFAULT '0' COMMENT '母联状态:0:无母联;1:有母联';"); + + " ADD COLUMN `buscouple_state` int(11) DEFAULT '0' COMMENT '母联状态:0:无母联;1:有母联';"); } //添加tmp_id @@ -932,6 +936,182 @@ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + " ADD COLUMN `tmp_id` int(11) DEFAULT '0';"); } + + //设置column 去掉默认NOT NULL + { + + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationId` `StationId` varchar(20) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationId_ex` `StationId_ex` varchar(20) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName` `StationName` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName1` `StationName1` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName2` `StationName2` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName3` `StationName3` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName4` `StationName4` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName5` `StationName5` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName6` `StationName6` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName7` `StationName7` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName8` `StationName8` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationName9` `StationName9` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `StationIP` `StationIP` varchar(20) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `FBSDeviceId` `FBSDeviceId` bigint(11) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `FBSDeviceIp` `FBSDeviceIp` varchar(50) DEFAULT '192.168.0.88';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `FBSDeviceIp_WG` `FBSDeviceIp_WG` varchar(64) DEFAULT '192.168.0.1';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `FBSDeviceIp_YM` `FBSDeviceIp_YM` varchar(64) DEFAULT '255.255.255.0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `FBSDeviceName` `FBSDeviceName` varchar(100) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `GroupIndexInFBSDevice` `GroupIndexInFBSDevice` int(11) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattModel` `BattModel` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGroupId` `BattGroupId` int(11) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGroupNum` `BattGroupNum` int(11) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGroupName` `BattGroupName` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGroupName1` `BattGroupName1` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGroupName2` `BattGroupName2` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGroupName3` `BattGroupName3` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGroupName4` `BattGroupName4` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGroupName5` `BattGroupName5` varchar(100) DEFAULT ' ';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGroupName6` `BattGroupName6` varchar(100) DEFAULT ' ';"); + + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `FloatVolLevel` `FloatVolLevel` float DEFAULT '1.12';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `OfflineVolLevel` `OfflineVolLevel` float DEFAULT '1.06';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattFloatCurrent` `BattFloatCurrent` float DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `DeviceId` `DeviceId` varchar(20) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `DeviceName` `DeviceName` varchar(100) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `MonCount` `MonCount` int(11) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `MonCapStd` `MonCapStd` float DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `MonVolStd` `MonVolStd` float DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `MonResStd` `MonResStd` float DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `MonSerStd` `MonSerStd` float DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `MonTmpStd` `MonTmpStd` float DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `MonVolLowToAvg` `MonVolLowToAvg` float DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `MonNum` `MonNum` int(11) DEFAULT '0';"); + + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattProducer` `BattProducer` varchar(45) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattProductDate` `BattProductDate` date DEFAULT '2006-07-06';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattInUseDate` `BattInUseDate` date DEFAULT '2006-07-06';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BattGuarantDayCount` `BattGuarantDayCount` int(11) DEFAULT '1095';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `SignalId` `SignalId` varchar(20) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `CInterFaceId` `CInterFaceId` int(11) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `SignalName` `SignalName` varchar(50) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `Load_curr` `Load_curr` float DEFAULT '15';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `DisCurrMax` `DisCurrMax` float DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `station_phone` `station_phone` varchar(32) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `station_install` `station_install` tinyint(1) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `install_user` `install_user` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `charge_curr_max` `charge_curr_max` float DEFAULT '20';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `Vol_grade` `Vol_grade` float DEFAULT '0';"); + + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `Manufacturers` `Manufacturers` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `Assetequipment` `Assetequipment` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `Deviceclasspath` `Deviceclasspath` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `DeviceOperationDepartment` `DeviceOperationDepartment` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `PropertyRightUnit` `PropertyRightUnit` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `PropertyAttribute` `PropertyAttribute` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `FactoryNumber` `FactoryNumber` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `OperationTeam` `OperationTeam` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `DeviceIdentityCode` `DeviceIdentityCode` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `ProjectType` `ProjectType` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `DeviceIdentityCode` `DeviceIdentityCode` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BatteryApplicationType` `BatteryApplicationType` varchar(64) DEFAULT '';"); + + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `SingleRatedVoltage` `SingleRatedVoltage` float DEFAULT '0';"); + + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `RemoteMonitor` `RemoteMonitor` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `BatttIndependentPlaced` `BatttIndependentPlaced` varchar(64) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `JunChargeVoltageValue` `JunChargeVoltageValue` float DEFAULT '0';"); + + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `PublicKeyX` `PublicKeyX` varchar(200) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `PublicKeyY` `PublicKeyY` varchar(200) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `KeyID` `KeyID` varchar(200) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `SerialNumber` `SerialNumber` varchar(200) DEFAULT '';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `sort_id` `sort_id` int(3) DEFAULT '0';"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `video_url` `video_url` varchar(200) DEFAULT NULL;"); + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `charge_type` `charge_type` int(11) DEFAULT '1' COMMENT '充放电状态:1:限流充电;2;逆变充电';"); + + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `buscouple_state` `buscouple_state` int(11) DEFAULT '0' COMMENT '母联状态:0:无母联;1:有母联';"); + + sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table + + " CHANGE `tmp_id` `tmp_id` int(11) DEFAULT '0';"); + } + } catch (SQLException e) { e.printStackTrace(); } finally { -- Gitblit v1.9.1