feat: expand vehicle data platform capabilities

This commit is contained in:
lingniu
2026-07-27 16:46:15 +08:00
parent e3a1f80f86
commit 3c4bece72c
650 changed files with 62155 additions and 2552 deletions

View File

@@ -0,0 +1,15 @@
CREATE TABLE IF NOT EXISTS platform_user_business_scope (
user_id BIGINT UNSIGNED NOT NULL PRIMARY KEY,
scope_level VARCHAR(24) NOT NULL,
department_ids VARCHAR(1024) NOT NULL DEFAULT '',
responsible_user_id VARCHAR(96) NOT NULL DEFAULT '',
enabled TINYINT(1) NOT NULL DEFAULT 1,
source_system VARCHAR(32) NOT NULL DEFAULT 'oneos',
source_updated_at DATETIME(3) NULL,
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
CONSTRAINT fk_platform_user_business_scope_user FOREIGN KEY (user_id) REFERENCES platform_user(id) ON DELETE CASCADE,
CONSTRAINT chk_platform_user_business_scope_level CHECK (scope_level IN ('department', 'responsible')),
INDEX idx_platform_user_business_scope_level (scope_level, enabled),
INDEX idx_platform_user_business_scope_responsible (responsible_user_id, enabled)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;