| | |
| | | |
| | | //创建东峰BMS实时数据表 |
| | | createTb_Dfxt_Bms_State_Table(pool, recreate); |
| | | |
| | | createTb_Dfxt_DeviceList_Table(pool, recreate); |
| | | |
| | | createTb_Qgn_618_NBstate_Table(pool, recreate); |
| | | |
| | | System.out.println(" Db_Ram_Db init end at " + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)); |
| | | } |
| | |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | /** |
| | | * 创建 tb_lithium_data 表 |
| | | * @param pool |
| | | * @param recreate |
| | | */ |
| | | public static void createTb_Dfxt_DeviceList_Table(MysqlConnPool pool, boolean recreate) { |
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Dfxt_DeviceList_Table; |
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Dfxt_DeviceList_Table+ " (" + |
| | | " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键'," + |
| | | " `objectid` varchar(255) NOT NULL DEFAULT '' COMMENT '设备号'," + |
| | | " `macid` varchar(255) NOT NULL DEFAULT '' COMMENT '设备号'," + |
| | | " `platenumber` varchar(255) NOT NULL DEFAULT '' COMMENT '车牌号'," + |
| | | " `fullname` varchar(255) NOT NULL DEFAULT '' COMMENT '设备名称'," + |
| | | " `block_date` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '设备到期时间'," + |
| | | " `offline` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否在线'," + |
| | | " `gsm` float NOT NULL DEFAULT '0' COMMENT '网络信号值'," + |
| | | " `gpsCount` int(11) NOT NULL DEFAULT '0' COMMENT 'gps星数'," + |
| | | " `speed` float NOT NULL DEFAULT '0' COMMENT '速度'," + |
| | | " `updtime` bigint(20) NOT NULL DEFAULT '0' COMMENT '最后更新时间'," + |
| | | " `defence_status` int(11) NOT NULL DEFAULT '0' COMMENT '设防状态'," + |
| | | " `gpstime` bigint(20) NOT NULL DEFAULT '0' COMMENT '定位时间'," + |
| | | " `mac_name` varchar(255) NOT NULL DEFAULT '' COMMENT '设备型号'," + |
| | | " `server_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '当前时间'," + |
| | | " `sim` varchar(255) NOT NULL DEFAULT '' COMMENT 'SIM卡号码'," + |
| | | " PRIMARY KEY (`num`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='东峰系统所有设备列表';"; |
| | | 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_lithium_data 表 |
| | | * @param pool |
| | | * @param recreate |
| | | */ |
| | | public static void createTb_Qgn_618_NBstate_Table(MysqlConnPool pool, boolean recreate) { |
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Qgn_618_NBstate_Table; |
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Qgn_618_NBstate_Table+ " (" + |
| | | " `num` bigint(20) NOT NULL AUTO_INCREMENT,\n" + |
| | | " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT '设备ID',\n" + |
| | | " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '记录时间',\n" + |
| | | " `model_num` int(11) NOT NULL DEFAULT '0' COMMENT '模块编号[0-模块1 1-模块2 .. 5-模块6]',\n" + |
| | | " `dk11_st` int(11) NOT NULL DEFAULT '0' COMMENT 'DK11状态【1-闭合 0-断开】',\n" + |
| | | " `dk12_st` int(11) NOT NULL DEFAULT '0' COMMENT 'DK12状态【1-闭合 0-断开】',\n" + |
| | | " `dk13_st` int(11) NOT NULL DEFAULT '0' COMMENT 'DK13状态【1-闭合 0-断开】',\n" + |
| | | " `dk21_st` int(11) NOT NULL DEFAULT '0' COMMENT 'DK21状态【1-闭合 0-断开】',\n" + |
| | | " `dk22_st` int(11) NOT NULL DEFAULT '0' COMMENT 'DK22状态【1-闭合 0-断开】',\n" + |
| | | " `dk23_st` int(11) NOT NULL DEFAULT '0' COMMENT 'DK23状态【1-闭合 0-断开】',\n" + |
| | | " `dk31_st` int(11) NOT NULL DEFAULT '0' COMMENT 'DK31状态【1-闭合 0-断开】',\n" + |
| | | " `jk1_st` int(11) NOT NULL DEFAULT '0' COMMENT 'JK1状态【1-闭合 0-断开】',\n" + |
| | | " `emergen_stop` int(11) NOT NULL DEFAULT '0' COMMENT '急停状态',\n" + |
| | | " `remote_lock` int(11) NOT NULL DEFAULT '0' COMMENT '远程闭锁状态',\n" + |
| | | " `ac_vola` float NOT NULL DEFAULT '0' COMMENT '交流A相电压',\n" + |
| | | " `ac_volb` float NOT NULL DEFAULT '0' COMMENT '交流B相电压',\n" + |
| | | " `ac_volc` float NOT NULL DEFAULT '0' COMMENT '交流C相电压',\n" + |
| | | " `ac_curra` float NOT NULL DEFAULT '0' COMMENT '交流A相电流',\n" + |
| | | " `ac_currb` float NOT NULL DEFAULT '0' COMMENT '交流B相电流',\n" + |
| | | " `ac_currc` float NOT NULL DEFAULT '0' COMMENT '交流C相电流',\n" + |
| | | " `dc_vol` float NOT NULL DEFAULT '0' COMMENT '直流侧电压',\n" + |
| | | " `dc_curr` float NOT NULL DEFAULT '0' COMMENT '直流侧电流',\n" + |
| | | " `interver_temp` float NOT NULL DEFAULT '0' COMMENT '温度',\n" + |
| | | " `interver_alm1` int(11) NOT NULL DEFAULT '0' COMMENT '告警1[bit0-输出大短路 bit4-模块休眠 bit5-模块放电异常 bit8-模块DC侧处于关机状态 bit9-模块故障告警 bit10-模块保护告警 bit11-风扇故障告警 bit12-过温告警 bit13-输出过压告警 bit14-WALK-IN使能 bit15-模块通信中断告警 bit16-模块处于限功率状态 bit17-模块ID重复 bit18-模块严重不均流 bit19-三相输入缺相告警 bit20-三相输入不平衡告警 bit21-输入欠压告警 bit22-输入过压告警 bit23-模块PFC侧处于关机状态]\\r\\n\\r\\n\\r\\n',\n" + |
| | | " `interver_alm2` int(11) NOT NULL DEFAULT '0' COMMENT '告警2[bit0-(1-逆变模式;0-整流模式) bit4-(1-AC故障) bit5-(1-锁相错误)]',\n" + |
| | | " PRIMARY KEY (`num`)\n" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='全功能逆变假负载开关以及逆变模块实时状态表';"; |
| | | 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(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建组端信息告警记录表 |