| | |
| | | createFBS9100_InsulatstateTable(pool, recreate);
|
| | |
|
| | | createFBS9100_ChargerstateTable(pool, recreate);
|
| | | |
| | | createTb_Lithium_DataTable(pool, recreate);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 创建 tb_lithium_data 表
|
| | | * @param pool
|
| | | * @param recreate
|
| | | */
|
| | | public static void createTb_Lithium_DataTable(MysqlConnPool pool, boolean recreate) {
|
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_Lithium_DataTable;
|
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_Lithium_DataTable + " (" + |
| | | " `num` bigint(20) NOT NULL AUTO_INCREMENT," + |
| | | " `BattGroupId` int(11) NOT NULL DEFAULT '1000001' COMMENT '电池组ID'," + |
| | | " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '记录时间'," + |
| | | " `envir_tmp` float NOT NULL DEFAULT '0' COMMENT '环境温度'," + |
| | | " `power_tmp` float NOT NULL DEFAULT '0' COMMENT '功率温度'," + |
| | | " `rest_cap` float NOT NULL DEFAULT '0' COMMENT '剩余容量'," + |
| | | " `remote_control_count` int(11) NOT NULL DEFAULT '0' COMMENT '自定义遥控数量'," + |
| | | " `batt_total_cap` float NOT NULL DEFAULT '0' COMMENT '电池总容量'," + |
| | | " `batt_cycles` int(11) NOT NULL DEFAULT '0' COMMENT '电池循环次数'," + |
| | | " `evir_tmp_alm_state` int(11) NOT NULL DEFAULT '0' COMMENT '环境温度告警状态'," + |
| | | " `power_tmp_alm_state` int(11) NOT NULL DEFAULT '0' COMMENT '功率温度告警状态'," + |
| | | " `discharge_curr_alm_state` int(11) NOT NULL DEFAULT '0' COMMENT '充放电电流告警状态'," + |
| | | " `batt_totalvol_alm_state` int(11) NOT NULL DEFAULT '0' COMMENT '电池总电压告警状态'," + |
| | | " `custom_alm_count` int(11) NOT NULL DEFAULT '0' COMMENT '自定义告警量数量'," + |
| | | " `junheng_event_code` int(11) NOT NULL DEFAULT '0' COMMENT '均衡事件代码'," + |
| | | " `vol_event_code` int(11) NOT NULL DEFAULT '0' COMMENT '电压事件代码'," + |
| | | " `tmp_event_code` int(11) NOT NULL DEFAULT '0' COMMENT '温度事件代码'," + |
| | | " `curr_event_code` int(11) NOT NULL DEFAULT '0' COMMENT '电流事件代码'," + |
| | | " `fet_state_code` int(11) NOT NULL DEFAULT '0' COMMENT 'FET状态代码'," + |
| | | " `junheng_state_code` int(11) NOT NULL DEFAULT '0' COMMENT '均衡状态代码'," + |
| | | " `sys_state_code` int(11) NOT NULL DEFAULT '0' COMMENT '系统状态代码'," + |
| | | " `note` varchar(255) NOT NULL DEFAULT '' COMMENT '备用'," + |
| | | " PRIMARY KEY (`num`)" + |
| | | ") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | |
| | | try {
|
| | | if(true == recreate) { |
| | | sql.sqlMysqlExecute(sql_str01);
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02); |
| | | |
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 创建 tb_fbs9100_chargerstate 表
|
| | | * @param pool
|
| | | * @param recreate
|