- 删除旧事件:BillApprovedEvent, BillCreatedEvent, DeductionCompletedEvent, DetailAuditedEvent, DetailCreatedEvent, RecordMatchedEvent - 新增事件:BillAuditPassedEvent, DetailAuditPassedEvent - 保留事件:RecordImportedEvent - 更新监听器:AccountEventListener, BillEventListener, DetailEventListener - 清理代码中的旧事件引用和注释 优化原则:前端简单,后端健壮 事件流程:导入→匹配→生成明细→审核→扣款→生成账单→结算
283 lines
20 KiB
SQL
283 lines
20 KiB
SQL
-- ==========================================
|
||
-- 能源账单模块建表 SQL(331 一期,9 张表)
|
||
-- ==========================================
|
||
|
||
-- ----------------------------
|
||
-- 1. energy_hydrogen_record — 加氢原始记录
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `energy_hydrogen_record`;
|
||
CREATE TABLE `energy_hydrogen_record` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||
`station_id` bigint NOT NULL COMMENT '加氢站 ID(关联 asset 模块)',
|
||
`plate_number` varchar(20) NOT NULL COMMENT '车牌号',
|
||
`hydrogen_date` date NOT NULL COMMENT '加氢日期',
|
||
`hydrogen_quantity` decimal(10,2) NOT NULL COMMENT '加氢量(KG)',
|
||
`unit_price` decimal(10,2) NOT NULL COMMENT '单价(元/KG)',
|
||
`amount` decimal(12,2) NOT NULL COMMENT '金额(以数据源原始值为准,不重新计算)',
|
||
`mileage` decimal(12,2) DEFAULT NULL COMMENT '里程数',
|
||
`source_type` tinyint NOT NULL COMMENT '数据来源(1=Excel 2=Web 3=API 4=OCR)',
|
||
`match_status` tinyint NOT NULL DEFAULT 0 COMMENT '匹配状态(0=未匹配 1=已匹配 2=无法匹配)',
|
||
`vehicle_id` bigint DEFAULT NULL COMMENT '匹配到的车辆 ID(匹配后填充)',
|
||
`customer_id` bigint DEFAULT NULL COMMENT '匹配到的客户 ID(匹配后填充)',
|
||
`upload_batch_no` varchar(64) DEFAULT NULL COMMENT '导入批次号(幂等去重)',
|
||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_station_id` (`station_id`),
|
||
KEY `idx_plate_number` (`plate_number`),
|
||
KEY `idx_hydrogen_date` (`hydrogen_date`),
|
||
KEY `idx_match_status` (`match_status`),
|
||
KEY `idx_upload_batch_no` (`upload_batch_no`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='加氢原始记录';
|
||
|
||
-- ----------------------------
|
||
-- 2. energy_hydrogen_detail — 加氢明细
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `energy_hydrogen_detail`;
|
||
CREATE TABLE `energy_hydrogen_detail` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||
`record_id` bigint NOT NULL COMMENT '关联原始记录 ID',
|
||
`station_id` bigint NOT NULL COMMENT '加氢站 ID',
|
||
`vehicle_id` bigint NOT NULL COMMENT '车辆 ID',
|
||
`plate_number` varchar(20) NOT NULL COMMENT '车牌号(冗余)',
|
||
`hydrogen_date` date NOT NULL COMMENT '加氢日期',
|
||
`hydrogen_quantity` decimal(10,2) NOT NULL COMMENT '加氢量(KG)',
|
||
`cost_price` decimal(10,2) NOT NULL COMMENT '成本单价(元/KG)',
|
||
`cost_amount` decimal(12,2) NOT NULL COMMENT '成本金额',
|
||
`customer_price` decimal(10,2) NOT NULL COMMENT '对客单价(元/KG)',
|
||
`customer_amount` decimal(12,2) NOT NULL COMMENT '对客金额',
|
||
`contract_id` bigint NOT NULL COMMENT '合同 ID',
|
||
`customer_id` bigint NOT NULL COMMENT '客户 ID',
|
||
`project_name` varchar(100) DEFAULT NULL COMMENT '项目名称(冗余)',
|
||
`cost_bearer` tinyint NOT NULL COMMENT '费用承担方(1=客户承担 2=羚牛承担 3=自行结算)',
|
||
`pay_method` tinyint NOT NULL COMMENT '支付方式(1=预充值 2=月结算)',
|
||
`audit_status` tinyint NOT NULL DEFAULT 0 COMMENT '审核状态(0=待审核 1=已审核 2=已驳回)',
|
||
`audit_remark` varchar(500) DEFAULT NULL COMMENT '审核备注',
|
||
`deduction_status` tinyint NOT NULL DEFAULT 0 COMMENT '扣款状态(0=未扣款 1=已扣款)',
|
||
`settlement_status` tinyint NOT NULL DEFAULT 0 COMMENT '结算状态(0=未结算 1=已结算)',
|
||
`bill_id` bigint DEFAULT NULL COMMENT '关联账单 ID',
|
||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_record_id` (`record_id`),
|
||
KEY `idx_station_id` (`station_id`),
|
||
KEY `idx_vehicle_id` (`vehicle_id`),
|
||
KEY `idx_customer_id` (`customer_id`),
|
||
KEY `idx_contract_id` (`contract_id`),
|
||
KEY `idx_bill_id` (`bill_id`),
|
||
KEY `idx_audit_status` (`audit_status`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='加氢明细';
|
||
|
||
-- ----------------------------
|
||
-- 3. energy_bill — 能源账单
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `energy_bill`;
|
||
CREATE TABLE `energy_bill` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||
`bill_code` varchar(32) NOT NULL COMMENT '账单编号(唯一)',
|
||
`energy_type` tinyint NOT NULL COMMENT '能源类型(1=氢 2=电 3=ETC)',
|
||
`customer_id` bigint NOT NULL COMMENT '客户 ID',
|
||
`customer_name` varchar(100) DEFAULT NULL COMMENT '客户名称(冗余)',
|
||
`contract_id` bigint NOT NULL COMMENT '合同 ID',
|
||
`station_id` bigint DEFAULT NULL COMMENT '加氢站 ID',
|
||
`station_name` varchar(100) DEFAULT NULL COMMENT '站点名称(冗余)',
|
||
`bill_period_start` date NOT NULL COMMENT '账单周期开始日期',
|
||
`bill_period_end` date NOT NULL COMMENT '账单周期结束日期',
|
||
`receivable_amount` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '应收总额',
|
||
`actual_amount` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '实收总额(receivable_amount + adjustment_amount)',
|
||
`adjustment_amount` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '调整总额(可正可负)',
|
||
`paid_amount` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '已收金额',
|
||
`total_quantity` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '总加氢量/总度数',
|
||
`detail_count` int NOT NULL DEFAULT 0 COMMENT '明细条数',
|
||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '账单状态(0=草稿 1=已生成 2=已作废)',
|
||
`audit_status` tinyint NOT NULL DEFAULT 0 COMMENT '审核状态(0=待审核 1=已审核 2=已驳回)',
|
||
`submit_status` tinyint NOT NULL DEFAULT 0 COMMENT '提交状态(0=未提交 1=已提交 2=已驳回)',
|
||
`payment_status` tinyint NOT NULL DEFAULT 0 COMMENT '支付状态(0=未支付 1=部分支付 2=已结清)',
|
||
`auditor_id` bigint DEFAULT NULL COMMENT '审核人 ID',
|
||
`audit_time` datetime DEFAULT NULL COMMENT '审核时间',
|
||
`audit_remark` varchar(500) DEFAULT NULL COMMENT '审核备注',
|
||
`submit_time` datetime DEFAULT NULL COMMENT '提交时间',
|
||
`generate_time` datetime DEFAULT NULL COMMENT '账单生成时间',
|
||
`yos_bill_code` varchar(64) DEFAULT NULL COMMENT 'YOS 账单编号',
|
||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_bill_code` (`bill_code`),
|
||
KEY `idx_customer_id` (`customer_id`),
|
||
KEY `idx_contract_id` (`contract_id`),
|
||
KEY `idx_station_id` (`station_id`),
|
||
KEY `idx_bill_period` (`bill_period_start`, `bill_period_end`),
|
||
KEY `idx_status` (`status`),
|
||
KEY `idx_audit_status` (`audit_status`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='能源账单';
|
||
|
||
-- ----------------------------
|
||
-- 4. energy_bill_adjustment — 账单调整记录
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `energy_bill_adjustment`;
|
||
CREATE TABLE `energy_bill_adjustment` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||
`bill_id` bigint NOT NULL COMMENT '关联账单 ID',
|
||
`detail_id` bigint DEFAULT NULL COMMENT '关联明细 ID(可选)',
|
||
`adjustment_type` tinyint NOT NULL COMMENT '调整类型(1=增加 2=减少)',
|
||
`amount` decimal(12,2) NOT NULL COMMENT '调整金额(正数)',
|
||
`reason` varchar(500) DEFAULT NULL COMMENT '调整原因',
|
||
`attachment_urls` varchar(1000) DEFAULT NULL COMMENT '附件 URL(JSON 数组)',
|
||
`operator_id` bigint DEFAULT NULL COMMENT '操作人 ID',
|
||
`operate_time` datetime DEFAULT NULL COMMENT '操作时间',
|
||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_bill_id` (`bill_id`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='账单调整记录';
|
||
|
||
-- ----------------------------
|
||
-- 5. energy_account — 客户能源总账户
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `energy_account`;
|
||
CREATE TABLE `energy_account` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||
`customer_id` bigint NOT NULL COMMENT '客户 ID(唯一)',
|
||
`balance` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '当前余额(可为负数)',
|
||
`init_balance` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '初始余额',
|
||
`accumulated_recharge` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '累计充值',
|
||
`accumulated_hydrogen` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '累计氢费',
|
||
`accumulated_electric` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '累计电费',
|
||
`accumulated_consume` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '累计消费(所有能源类型合计)',
|
||
`reminder_threshold` decimal(14,2) DEFAULT NULL COMMENT '提醒阈值(低于此值触发预警)',
|
||
`account_status` tinyint NOT NULL DEFAULT 0 COMMENT '账户状态(0=正常 1=预警 2=欠费)',
|
||
`last_recharge_date` date DEFAULT NULL COMMENT '最后充值日期',
|
||
`version` int NOT NULL DEFAULT 0 COMMENT '乐观锁版本号',
|
||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_customer_id` (`customer_id`),
|
||
KEY `idx_account_status` (`account_status`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='客户能源总账户';
|
||
|
||
-- ----------------------------
|
||
-- 6. energy_project_account — 项目账户
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `energy_project_account`;
|
||
CREATE TABLE `energy_project_account` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||
`account_id` bigint NOT NULL COMMENT '关联总账户 ID',
|
||
`contract_id` bigint NOT NULL COMMENT '合同 ID(唯一)',
|
||
`project_name` varchar(100) DEFAULT NULL COMMENT '项目名称',
|
||
`project_balance` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '项目余额',
|
||
`project_remit_amount` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '累计划账金额',
|
||
`project_hydrogen_amount` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '累计氢费',
|
||
`project_electric_amount` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '累计电费',
|
||
`project_consume_amount` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '累计消费',
|
||
`reminder_threshold` decimal(14,2) DEFAULT NULL COMMENT '提醒阈值',
|
||
`account_status` tinyint NOT NULL DEFAULT 0 COMMENT '账户状态(0=正常 1=预警 2=欠费)',
|
||
`version` int NOT NULL DEFAULT 0 COMMENT '乐观锁版本号',
|
||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_contract_id` (`contract_id`),
|
||
KEY `idx_account_id` (`account_id`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='项目账户';
|
||
|
||
-- ----------------------------
|
||
-- 7. energy_account_flow — 统一余额变更流水
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `energy_account_flow`;
|
||
CREATE TABLE `energy_account_flow` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||
`account_id` bigint NOT NULL COMMENT '关联总账户 ID',
|
||
`project_account_id` bigint DEFAULT NULL COMMENT '关联项目账户 ID(可选)',
|
||
`flow_type` tinyint NOT NULL COMMENT '流水类型(1=充值 2=扣款 3=冲正 4=划账 5=退款)',
|
||
`amount` decimal(14,2) NOT NULL COMMENT '变动金额',
|
||
`balance_before` decimal(14,2) NOT NULL COMMENT '变动前余额(总账户级别)',
|
||
`balance_after` decimal(14,2) NOT NULL COMMENT '变动后余额(总账户级别)',
|
||
`project_balance_before` decimal(14,2) DEFAULT NULL COMMENT '变动前项目余额(仅项目账户操作时填写)',
|
||
`project_balance_after` decimal(14,2) DEFAULT NULL COMMENT '变动后项目余额(仅项目账户操作时填写)',
|
||
`biz_type` tinyint NOT NULL COMMENT '业务类型(1=加氢扣款 2=账单结算 3=手动调整 ...)',
|
||
`biz_id` bigint DEFAULT NULL COMMENT '关联单据 ID',
|
||
`biz_code` varchar(64) DEFAULT NULL COMMENT '关联单据编号',
|
||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||
`operator_id` bigint DEFAULT NULL COMMENT '操作人 ID',
|
||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_account_id` (`account_id`),
|
||
KEY `idx_project_account_id` (`project_account_id`),
|
||
KEY `idx_biz_type_biz_id` (`biz_type`, `biz_id`),
|
||
KEY `idx_create_time` (`create_time`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='统一余额变更流水';
|
||
|
||
-- ----------------------------
|
||
-- 8. energy_station_price — 加氢站客户价格
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `energy_station_price`;
|
||
CREATE TABLE `energy_station_price` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||
`station_id` bigint NOT NULL COMMENT '加氢站 ID',
|
||
`customer_id` bigint NOT NULL COMMENT '客户 ID',
|
||
`cost_price` decimal(10,2) NOT NULL COMMENT '成本价(元/KG)',
|
||
`customer_price` decimal(10,2) NOT NULL COMMENT '对客价(元/KG)',
|
||
`effective_date` date NOT NULL COMMENT '生效日期',
|
||
`expiry_date` date DEFAULT NULL COMMENT '失效日期(可空,空=永久生效)',
|
||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0=生效中 1=已失效)',
|
||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_station_customer_date` (`station_id`, `customer_id`, `effective_date`),
|
||
KEY `idx_station_id` (`station_id`),
|
||
KEY `idx_customer_id` (`customer_id`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='加氢站客户价格';
|
||
|
||
-- ----------------------------
|
||
-- 9. energy_station_config — 加氢站扣款配置
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `energy_station_config`;
|
||
CREATE TABLE `energy_station_config` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||
`station_id` bigint NOT NULL COMMENT '加氢站 ID(唯一,每站一条记录)',
|
||
`auto_deduct` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否自动扣款(1=是 0=否)',
|
||
`cooperation_type` tinyint NOT NULL DEFAULT 0 COMMENT '合作类型(0=合作 1=非合作)',
|
||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_station_id` (`station_id`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='加氢站扣款配置';
|