From 4d32a9903a11f33cf0e14da25f1e7286b50258f6 Mon Sep 17 00:00:00 2001
From: Administrator <1525436766@qq.com>
Date: 星期二, 27 七月 2021 16:08:31 +0800
Subject: [PATCH] V1.63 edit at date 2021-07-27 	1.表'db_ram_db.tb_fbs9100_setparam'新增恒流参数字段

---
 BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java |  224 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 223 insertions(+), 1 deletions(-)

diff --git a/BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java b/BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java
index 19da0cc..54e28b6 100644
--- a/BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java
+++ b/BattMonitor_DB_Builder/src/com/dev/fbs9100/FBS9100_Task_Thread_SQL.java
@@ -316,7 +316,27 @@
 					+ "`DCVolHighLimit` FLOAT NOT NULL DEFAULT 0, "
 					+ "`ChargeCurrSet` FLOAT NOT NULL DEFAULT 0, "
 					+ "`MonomerTmp_High` FLOAT NOT NULL DEFAULT 0, "
-					+ "`AutoTestStartVol`  float NOT NULL DEFAULT 0, "			//起始电压
+					+ "`AutoTestStartVol`  float NOT NULL DEFAULT 0, "				//起始电压
+					+ "`MonCount` int(11) NOT NULL DEFAULT '0' COMMENT '每组单体数'," 
+					+ "`MonVol` float(11,0) NOT NULL DEFAULT '0' COMMENT '单体电压'," 
+					+ "`DisPower` float(11,0) NOT NULL DEFAULT '0' COMMENT '预放功率(0.1kw)'," 
+					+ "`DisPreRes` float(11,0) NOT NULL DEFAULT '0' COMMENT '放电阻值(mΩ)   '," 
+					+ "`CharCap` int(11) NOT NULL DEFAULT '0' COMMENT '充电容量(AH)'," 
+					+ "`CharTimeLong` int(11) NOT NULL DEFAULT '0' COMMENT '充电时长(min)'," 
+					+ "`FloatCharTimeLong` int(11) NOT NULL DEFAULT '0' COMMENT '浮充时长'," 
+					+ "`CharSotpCurr` float(11,0) NOT NULL DEFAULT '0' COMMENT '截止电流(0.1A)    ',"  
+					+ "`MonVolHightLimit` float(11,0) NOT NULL DEFAULT '0' COMMENT '单体上限(0.01V)',"  
+					+ "`MonVolHightLimitCount` int(11) NOT NULL DEFAULT '0' COMMENT '单体上限数量',"  
+					+ "`CharHighTmp` int(11) NOT NULL DEFAULT '0' COMMENT '充电过温'," 
+					+ "`DisWaitTime` int(11) NOT NULL DEFAULT '0' COMMENT '放完静置(0-500分钟)',"  
+					+ "`CharWaitTime` int(11) NOT NULL DEFAULT '0' COMMENT '充完静置(0-500分钟)',"
+					+ "`FlowOver_Count` int(11) NOT NULL DEFAULT '1' COMMENT '恒流总阶段数[1-3]',"  
+					+ "`FlowOver_CharCurr_1` float(11,0) NOT NULL DEFAULT '0' COMMENT '恒流1阶段充电电流',"  
+					+ "`FlowOver_CharCurr_2` float(11,0) NOT NULL DEFAULT '0' COMMENT '恒流2阶段充电电流',"  
+					+ "`FlowOver_CharCurr_3` float(11,0) NOT NULL DEFAULT '0' COMMENT '恒流3阶段充电电流',"  
+					+ "`FlowOver_CharTime_1` int(11) NOT NULL DEFAULT '0' COMMENT '恒流1阶段充电时长'," 
+					+ "`FlowOver_CharTime_2` int(11) NOT NULL DEFAULT '0' COMMENT '恒流2阶段充电时长',"  
+					+ "`FlowOver_CharTime_3` int(11) NOT NULL DEFAULT '0' COMMENT '恒流3阶段充电时长',"			
 					+ " UNIQUE INDEX index_dev_id_uniq (`dev_id`), "
 					+ " PRIMARY KEY (`num`) ) "
 					+ " ENGINE=MEMORY DEFAULT CHARSET=utf8";
@@ -430,6 +450,208 @@
 								+ " ADD COLUMN `OffLineYHOnceCycle` int(11) NOT NULL DEFAULT '1';");
 			}
 			
+			/* 	2021-07-19 edit by lijun 
+			 *  FGCD_A059设备新增参数
+			 */
+			//添加指定的MonCount列(每组单体数)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='MonCount'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `MonCount` int(11) NOT NULL DEFAULT '0' COMMENT '每组单体数';");
+			}
+			
+			//添加指定的MonVol列(单体电压)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='MonVol'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `MonVol` float(11,0) NOT NULL DEFAULT '0' COMMENT '单体电压';");
+			}
+			
+			//添加指定的DisPower列(预放功率(0.1kw))
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='DisPower'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `DisPower` float(11,0) NOT NULL DEFAULT '0' COMMENT '预放功率(0.1kw)';");
+			}
+			
+			//添加指定的DisPreRes列(放电阻值(mΩ))
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='DisPreRes'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `DisPreRes` float(11,0) NOT NULL DEFAULT '0' COMMENT '放电阻值(mΩ)';");
+			}
+			
+			//添加指定的CharCap列(充电容量(AH))
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='CharCap'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `CharCap` int(11) NOT NULL DEFAULT '0' COMMENT '充电容量(AH)';");
+			}
+			
+			//添加指定的CharTimeLong列(充电时长(min))
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='CharTimeLong'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `CharTimeLong` int(11) NOT NULL DEFAULT '0' COMMENT '充电时长(min)';");
+			}
+			
+			//添加指定的FloatCharTimeLong列(浮充时长)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='FloatCharTimeLong'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `FloatCharTimeLong` int(11) NOT NULL DEFAULT '0' COMMENT '浮充时长';");
+			}
+			
+			//添加指定的CharSotpCurr列(截止电流(0.1A))
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='CharSotpCurr'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `CharSotpCurr` float(11,0) NOT NULL DEFAULT '0' COMMENT '截止电流(0.1A)';");
+			}
+			
+			//添加指定的MonVolHightLimit列(单体上限(0.01V))
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='MonVolHightLimit'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `MonVolHightLimit` float(11,0) NOT NULL DEFAULT '0' COMMENT '单体上限(0.01V)';");
+			}
+			
+			//添加指定的MonVolHightLimitCount列(单体上限数量)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='MonVolHightLimitCount'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `MonVolHightLimitCount` int(11) NOT NULL DEFAULT '0' COMMENT '单体上限数量';");
+			}
+			
+			//添加指定的CharHighTmp列(充电过温)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='CharHighTmp'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `CharHighTmp` int(11) NOT NULL DEFAULT '0' COMMENT '充电过温';");
+			}
+			
+			//添加指定的DisWaitTime列(放完静置(0-500分钟))
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='DisWaitTime'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `DisWaitTime` int(11) NOT NULL DEFAULT '0' COMMENT '放完静置(0-500分钟)';");
+			}
+			
+			//添加指定的CharWaitTime列(充完静置(0-500分钟))
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='CharWaitTime'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `CharWaitTime` int(11) NOT NULL DEFAULT '0' COMMENT '充完静置(0-500分钟)';");
+			}
+			
+			//添加指定的FlowOver_Count列(恒流总阶段数[1-3])
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='FlowOver_Count'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `FlowOver_Count` int(11) NOT NULL DEFAULT '1' COMMENT '恒流总阶段数[1-3]';");
+			}
+			
+			//添加指定的FlowOver_CharCurr_1列(恒流1阶段充电电流)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='FlowOver_CharCurr_1'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `FlowOver_CharCurr_1` float(11,0) NOT NULL DEFAULT '0' COMMENT '恒流1阶段充电电流';");
+			}
+			
+			//添加指定的FlowOver_CharCurr_2列(恒流2阶段充电电流)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='FlowOver_CharCurr_2'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `FlowOver_CharCurr_2` float(11,0) NOT NULL DEFAULT '0' COMMENT '恒流2阶段充电电流';");
+			}
+			
+			//添加指定的FlowOver_CharCurr_3列(恒流3阶段充电电流)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='FlowOver_CharCurr_3'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `FlowOver_CharCurr_3` float(11,0) NOT NULL DEFAULT '0' COMMENT '恒流3阶段充电电流';");
+			}
+			
+			//添加指定的FlowOver_CharTime_1列(恒流1阶段充电时长)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='FlowOver_CharTime_1'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `FlowOver_CharTime_1` int(11) NOT NULL DEFAULT '0' COMMENT '恒流1阶段充电时长';");
+			}
+			
+			//添加指定的FlowOver_CharTime_2列(恒流2阶段充电时长)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='FlowOver_CharTime_2'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `FlowOver_CharTime_2` int(11) NOT NULL DEFAULT '0' COMMENT '恒流2阶段充电时长';");
+			}
+			
+			//添加指定的FlowOver_CharTime_3列(恒流3阶段充电时长)
+			res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
+					+ " WHERE table_schema='db_ram_db'"
+					+ " AND table_name='tb_fbs9100_setparam'"
+					+ " AND column_name='FlowOver_CharTime_3'");
+			if(false == res.next()) {
+				sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table 
+								+ " ADD COLUMN `FlowOver_CharTime_3` int(11) NOT NULL DEFAULT '0' COMMENT '恒流3阶段充电时长';");
+			}
 		} catch (SQLException e) {
 			e.printStackTrace();
 		} finally {

--
Gitblit v1.9.1