Files
aiot-platform-cloud/sql/mysql/ops_area_security_user.sql
lzh d53d1c4584 feat(ops): 新增安保模块数据模型与 Mapper
新增安保区域人员绑定表 ops_area_security_user 和安保工单扩展表
ops_order_security_ext,以及对应的 DO 和 Mapper 接口。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:32:56 +08:00

17 lines
956 B
SQL
Raw Permalink 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 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 '区域-安保人员绑定表';