CREATE TABLE ops_area_security_user (
    id          BIGINT AUTO_INCREMENT PRIMARY KEY,
    area_id     BIGINT       NOT NULL COMMENT '区域ID，关联 ops_bus_area.id',
    user_id     BIGINT       NOT NULL COMMENT '安保人员用户ID，关联 system_users.id',
    user_name   VARCHAR(64)  DEFAULT '' COMMENT '安保人员姓名（冗余）',
    team_id     BIGINT       DEFAULT NULL COMMENT '所属班组ID',
    enabled     BIT          DEFAULT 1 COMMENT '是否启用',
    sort        INT          DEFAULT 0 COMMENT '排序值',
    creator     VARCHAR(64)  DEFAULT '',
    create_time DATETIME     DEFAULT CURRENT_TIMESTAMP,
    updater     VARCHAR(64)  DEFAULT '',
    update_time DATETIME     DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    deleted     BIT          DEFAULT 0,
    tenant_id   BIGINT       DEFAULT 0,
    UNIQUE KEY uk_area_user (area_id, user_id, deleted)
) COMMENT '区域-安保人员绑定表';
