--
-- Table structure for table `sync_tables_info`
--
DROP TABLE IF EXISTS sync_tables_info;
CREATE TABLE sync_tables_info (
  client_id int(10) unsigned NOT NULL,
  `table_name` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  `sql` varchar(2048) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  devid_field_name varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  outer_devid_fname varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  field_name varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  field_type tinyint(4) NOT NULL DEFAULT '1' COMMENT '1: 整数 2: 字符串 3: 日期 4: 浮点数',
  update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (client_id,`table_name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `sync_fields_info`
--
DROP TABLE IF EXISTS sync_fields_info;
CREATE TABLE sync_fields_info (
  id int(10) unsigned NOT NULL AUTO_INCREMENT,
  client_id int(10) unsigned NOT NULL,
  `table_name` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  field_name varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  field_type tinyint(3) unsigned NOT NULL DEFAULT '0',
  dest_field_name varchar(128) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  sensorindex int(11) NOT NULL,
  PRIMARY KEY (id) USING BTREE,
  KEY `fields` (client_id,`table_name`,field_name) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `sync_records`
--
DROP TABLE IF EXISTS sync_records;
CREATE TABLE sync_records (
  client_id int(10) unsigned NOT NULL,
  `table_name` varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  devid_val varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  field_val1 bigint(20) unsigned DEFAULT '0',
  field_val2 datetime DEFAULT '2000-01-01 01:00:00',
  update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (client_id,`table_name`,devid_val) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- ----------------------------
-- Records of sync_tables_info
-- ----------------------------
INSERT INTO sync_tables_info VALUES (10,'data_eaif_h','','eqmid','sensorid','capturetime',3,'2023-12-25 09:13:25');
INSERT INTO sync_tables_info VALUES (10,'data_eia_h','','eqmid','sensorid','d_time',3,'2023-12-25 09:13:25');
INSERT INTO sync_tables_info VALUES (10,'data_epa_h','','eqmid','sensorid','d_time',3,'2023-12-25 09:13:25');
INSERT INTO sync_tables_info VALUES (10,'data_microclimate_h','','eqmid','sensorid','d_time',3,'2023-12-25 09:13:25');
INSERT INTO sync_tables_info VALUES (10,'data_pd_h','','eqmid','sensorid','d_time',3,'2023-12-25 09:13:25');
INSERT INTO sync_tables_info VALUES (10,'data_scur_h','','eqmid','sensorid','d_time',3,'2023-12-25 09:13:25');
INSERT INTO sync_tables_info VALUES (10,'data_sf6_h','','eqmid','sensorid','d_time',3,'2023-12-25 09:13:25');

-- ----------------------------
-- Records of sync_fields_info
-- ----------------------------
INSERT INTO sync_fields_info VALUES (1,10,'data_eaif_h','maxtemp',4,'MaxTemp',1);
INSERT INTO sync_fields_info VALUES (2,10,'data_eaif_h','mintemp',4,'MinTemp',1);
INSERT INTO sync_fields_info VALUES (3,10,'data_eaif_h','avgtemp',4,'avgtemp',1);
INSERT INTO sync_fields_info VALUES (4,10,'data_eaif_h','phase',2,'Phase',1);
INSERT INTO sync_fields_info VALUES (8,10,'data_eia_h','phase',2,'Phase',1);
INSERT INTO sync_fields_info VALUES (9,10,'data_eia_h','d_ct_1',4,'TotalCoreCurrent',1);
INSERT INTO sync_fields_info VALUES (13,10,'data_epa_h','h2ppm',0,'H2',1);
INSERT INTO sync_fields_info VALUES (14,10,'data_epa_h','ch4ppm',0,'CH4',1);
INSERT INTO sync_fields_info VALUES (15,10,'data_epa_h','c2h6ppm',0,'C2H6',1);
INSERT INTO sync_fields_info VALUES (16,10,'data_epa_h','c2h4ppm',0,'C2H4',1);
INSERT INTO sync_fields_info VALUES (17,10,'data_epa_h','c2h2ppm',0,'C2H2',1);
INSERT INTO sync_fields_info VALUES (18,10,'data_epa_h','coppm',0,'CO',1);
INSERT INTO sync_fields_info VALUES (19,10,'data_epa_h','co2ppm',0,'CO2',1);
INSERT INTO sync_fields_info VALUES (20,10,'data_epa_h','o2ppm',0,'O2',1);
INSERT INTO sync_fields_info VALUES (21,10,'data_epa_h','n2ppm',0,'N2',1);
INSERT INTO sync_fields_info VALUES (22,10,'data_epa_h','totalhydrocarbon',0,'TotalHydrocarbon',1);
INSERT INTO sync_fields_info VALUES (23,10,'data_epa_h','gaspress',0,'GasPress',1);
INSERT INTO sync_fields_info VALUES (24,10,'data_epa_h','h2oppm',0,'H2O',1);
INSERT INTO sync_fields_info VALUES (28,10,'data_microclimate_h','envtmp',0,'AirTemperature',1);
INSERT INTO sync_fields_info VALUES (29,10,'data_microclimate_h','envpres',0,'AirPressure',1);
INSERT INTO sync_fields_info VALUES (30,10,'data_microclimate_h','envhum',0,'Humidity',1);
INSERT INTO sync_fields_info VALUES (31,10,'data_microclimate_h','rnfll',0,'Precipitation',1);
INSERT INTO sync_fields_info VALUES (35,10,'data_pd_h','waveform',0,'DischargeCapacity',1);
INSERT INTO sync_fields_info VALUES (36,10,'data_pd_h','apppadsch',0,'DischargePosition',1);
INSERT INTO sync_fields_info VALUES (37,10,'data_pd_h','plsnum',0,'PulseCount',1);
INSERT INTO sync_fields_info VALUES (38,10,'data_pd_h','waveform',0,'DischargeCapacity',1);
INSERT INTO sync_fields_info VALUES (39,10,'data_pd_h','apppadsch',0,'MaxDsch',1);
INSERT INTO sync_fields_info VALUES (40,10,'data_pd_h','plsnum',0,'PulseCount',1);
INSERT INTO sync_fields_info VALUES (41,10,'data_pd_h','padschalm',0,'SupDevRun',1);
INSERT INTO sync_fields_info VALUES (42,10,'data_pd_h','padschtype',0,'DschType',1);
INSERT INTO sync_fields_info VALUES (43,10,'data_pd_h','nqs',0,'AvDsch',1);
INSERT INTO sync_fields_info VALUES (50,10,'data_scur_h','current_val',0,'CoreCurrent',1);
INSERT INTO sync_fields_info VALUES (61,10,'data_sf6_h','ddt1',0,'Dewpoint',1);
INSERT INTO sync_fields_info VALUES (62,10,'data_sf6_h','md1',0,'Density',1);
INSERT INTO sync_fields_info VALUES (63,10,'data_sf6_h','pm1',0,'Moisture',1);
INSERT INTO sync_fields_info VALUES (64,10,'data_sf6_h','pressure1',0,'Pressure20C',1);
INSERT INTO sync_fields_info VALUES (65,10,'data_sf6_h','temp1',0,'Temperature',1);
INSERT INTO sync_fields_info VALUES (66,10,'data_sf6_h','ddt2',0,'Dewpoint',2);
INSERT INTO sync_fields_info VALUES (67,10,'data_sf6_h','md2',0,'Density',2);
INSERT INTO sync_fields_info VALUES (68,10,'data_sf6_h','pm2',0,'Moisture',2);
INSERT INTO sync_fields_info VALUES (69,10,'data_sf6_h','pressure2',0,'Pressure20C',2);
INSERT INTO sync_fields_info VALUES (70,10,'data_sf6_h','temp2',0,'Temperature',2);
INSERT INTO sync_fields_info VALUES (71,10,'data_sf6_h','ddt3',0,'Dewpoint',3);
INSERT INTO sync_fields_info VALUES (72,10,'data_sf6_h','md3',0,'Density',3);
INSERT INTO sync_fields_info VALUES (73,10,'data_sf6_h','pm3',0,'Moisture',3);
INSERT INTO sync_fields_info VALUES (74,10,'data_sf6_h','pressure3',0,'Pressure20C',3);
INSERT INTO sync_fields_info VALUES (75,10,'data_sf6_h','temp3',0,'Temperature',3);
