gasWellWatch/src/main/resources/sql/CREATE_SCSS.sql

91 lines
9.8 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

CREATE TABLE `$TableName$`
(
`id` bigint NOT NULL COMMENT '主键',
`device_id` int NOT NULL COMMENT '设备标识',
`created_time` datetime NOT NULL COMMENT '数据落库时间',
`collection_time` datetime NOT NULL COMMENT '采集指令下发时间',
`receive_time` datetime NOT NULL COMMENT '接收到数据时间',
`cas_pressure` decimal(10, 2) NULL DEFAULT NULL COMMENT '套压',
`oil_pressure` decimal(10, 2) NULL DEFAULT NULL COMMENT '油压',
`first_solenoid_status` int NULL DEFAULT NULL COMMENT '当前第一个电磁阀状态',
`battery_voltage` decimal(10, 1) NULL DEFAULT NULL COMMENT '电池电压',
`solar_voltage` decimal(10, 1) NULL DEFAULT NULL COMMENT '太阳能电压',
`remaining_time_action` int NULL DEFAULT NULL COMMENT '动作剩余时间',
`second_solenoid_status` int NULL DEFAULT NULL COMMENT '第二个电磁阀状态',
`pre_pressure` int NULL DEFAULT NULL COMMENT '输压',
`internet_traffic` int NULL DEFAULT NULL COMMENT '流量',
`load_factor` int NULL DEFAULT NULL COMMENT '载荷因子',
`data_time` datetime NULL DEFAULT NULL COMMENT '日期时间',
`show_delay` int NULL DEFAULT NULL COMMENT '显示延时',
`open_well_sampling_interval` int NULL DEFAULT NULL COMMENT '开井采样间隔',
`close_well_sampling_interval` int NULL DEFAULT NULL COMMENT '关井采样间隔',
`ctl_model` int NULL DEFAULT NULL COMMENT '控制模式',
`min_pressure` decimal(10, 2) NULL DEFAULT NULL COMMENT '套压最小值',
`max_pressure` decimal(10, 2) NULL DEFAULT NULL COMMENT '套压最大值',
`pressure_min_voltage` decimal(10, 2) NULL DEFAULT NULL COMMENT '套压最小电压',
`pressure_max_voltage` decimal(10, 2) NULL DEFAULT NULL COMMENT '套压最大电压',
`oil_min` decimal(10, 2) NULL DEFAULT NULL COMMENT '油压最小值',
`oil_max` decimal(10, 2) NULL DEFAULT NULL COMMENT '油压最大值',
`oil_min_voltage` decimal(10, 2) NULL DEFAULT NULL COMMENT '油压最小电压',
`oil_max_voltage` decimal(10, 2) NULL DEFAULT NULL COMMENT '油压最大电压',
`input_pressure_min_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '输压最小值',
`input_pressure_max_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '输压最大值',
`input_voltage_min_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '输压最小电压',
`input_voltage_max_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '输压最大电压',
`flow_rate_min_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '流量最小值',
`flow_rate_max_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '流量最大值',
`flow_voltage_min_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '流量最小电压',
`flow_voltage_max_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '流量最大电压',
`continuous_sampling_interval_duration` int NULL DEFAULT NULL COMMENT '连续采样间隔',
`sensor_signal_effective_level` int NULL DEFAULT NULL COMMENT '到达传感器有效电平',
`pressure_compensation_polarity_flag` int NULL DEFAULT NULL COMMENT '套压补偿极性',
`pressure_compensation_value_setting` int NULL DEFAULT NULL COMMENT '套压补偿值',
`oil_pressure_compensation_polarity_flag` int NULL DEFAULT NULL COMMENT '油压补偿极性',
`oil_pressure_compensation_value_setting` int NULL DEFAULT NULL COMMENT '油压补偿值',
`input_pressure_compensation_polarity_flag` int NULL DEFAULT NULL COMMENT '输压补偿极性',
`input_pressure_compensation_value_setting` int NULL DEFAULT NULL COMMENT '输压补偿值',
`flow_compensation_polarity_flag` int NULL DEFAULT NULL COMMENT '流量补偿极性',
`flow_compensation_value_setting` int NULL DEFAULT NULL COMMENT '流量补偿值',
`well_open_time_timestamp` varchar(10) NULL DEFAULT NULL COMMENT '开井时间',
`well_open_pressure_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '开井套压',
`well_open_oil_pressure_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '开井油压',
`well_open_load_factor_presets` decimal(10, 2) NULL DEFAULT NULL COMMENT '开井载荷因子预设值',
`well_close_time_timestamp` varchar(10) NULL DEFAULT NULL COMMENT '关井时间时间戳',
`well_close_pressure_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '关井压力值',
`well_close_oil_pressure_value` decimal(10, 2) NULL DEFAULT NULL COMMENT '关井油压值',
`well_close_flow_value` int NULL DEFAULT NULL COMMENT '关井流量值',
`min_well_open_time_duration` varchar(10) NULL DEFAULT NULL COMMENT '最小开井时间持续时长',
`max_well_open_time_duration` varchar(10) NULL DEFAULT NULL COMMENT '最大开井时间持续时长',
`min_well_close_time_duration` varchar(10) NULL DEFAULT NULL COMMENT '最小关井时间持续时长',
`max_well_close_time_duration` varchar(10) NULL DEFAULT NULL COMMENT '最大关井时间持续时长',
`pressure_stabilization_duration` varchar(10) NULL DEFAULT NULL COMMENT '压力稳定持续时长',
`flow_stabilization_duration` varchar(10) NULL DEFAULT NULL COMMENT '流量稳定持续时长',
`load_factor_stabilization_duration` varchar(10) NULL DEFAULT NULL COMMENT '载荷因子稳定持续时长',
`plunger_delay_duration` varchar(10) NULL DEFAULT NULL COMMENT '柱塞延迟时长',
`plunger_rise_duration` varchar(10) NULL DEFAULT NULL COMMENT '柱塞上升时长',
`continuos_flow_duration` varchar(10) NULL DEFAULT NULL COMMENT '连续流量持续时长',
`well_close_time_duration` varchar(10) NULL DEFAULT NULL COMMENT '关井时间持续时长',
`well_close_time_not_reached_duration` varchar(10) NULL DEFAULT NULL COMMENT '关井时间未达到持续时长',
`well_close_not_reached_count_value` int NULL DEFAULT NULL COMMENT '关井未达到次数值',
`plunger_delay_duration_repeat` int NULL DEFAULT NULL COMMENT '柱塞延迟时长重复次数',
`target_time_timestamp` int NULL DEFAULT NULL COMMENT '目标时间时间戳',
`target_time_range_value` int NULL DEFAULT NULL COMMENT '目标时间范围值',
`continuos_flow_increase_duration` varchar(10) NULL DEFAULT NULL COMMENT '连续流量增加持续时长',
`continuos_flow_decrease_duration` varchar(10) NULL DEFAULT NULL COMMENT '连续流量减少持续时长',
`well_close_increase_duration` varchar(10) NULL DEFAULT NULL COMMENT '关井增加持续时长',
`well_close_decrease_duration` varchar(10) NULL DEFAULT NULL COMMENT '关井减少持续时长',
`min_well_close_time_duration2` varchar(10) NULL DEFAULT NULL COMMENT '最小关井时间持续时长',
`max_well_close_time_duration2` varchar(10) NULL DEFAULT NULL COMMENT '最大关井时间持续时长',
`min_continous_flow_time_duration` varchar(10) NULL DEFAULT NULL COMMENT '最小连续流量时间持续时长',
`max_continous_flow_time_duration` varchar(10) NULL DEFAULT NULL COMMENT '最大连续流量时间持续时长',
`min_well_open_time_duration2` varchar(10) NULL DEFAULT NULL COMMENT '最小开井时间持续时长',
`max_well_open_time_duration2` varchar(10) NULL DEFAULT NULL COMMENT '最大开井时间持续时长',
`well_open_pressure_value_at_open` int NULL DEFAULT NULL COMMENT '开井时压力值(开井瞬间)',
`well_open_oil_pressure_value_at_open` int NULL DEFAULT NULL COMMENT '开井时油压值(开井瞬间)',
`well_open_load_factor_presets_at_open` int NULL DEFAULT NULL COMMENT '开井时载荷因子预设值(开井瞬间)',
`well_close_pressure_value_at_close` int NULL DEFAULT NULL COMMENT '关井时压力值(关井瞬间)',
`well_close_oil_ppressure_value_at_close` int NULL DEFAULT NULL COMMENT '关井时油压值(关井瞬间)',
`well_close_flow_value_at_close` int NULL DEFAULT NULL COMMENT '关井时流量值(关井瞬间)',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `udx_device_create_time` (`device_id` ASC, `collection_time` ASC) USING BTREE COMMENT '设备采集数据唯一键'
) ENGINE = InnoDB COMMENT = '设备ID$DeviceId$的采集数据'