CREATE TABLE xjr_notice (
    id bigint NOT NULL,
    title varchar(500) NOT NULL COMMENT '标题',
    TYPE bigint NOT NULL COMMENT '类型，枚举id',
    type_name varchar(100) COMMENT '类型字面值',
    publisher bigint COMMENT '发布主体id',
    publisher_type integer COMMENT '发布主体类型，0用户/1组织',
    publisher_name integer COMMENT '发布主体名称',
    CONTENT TEXT COMMENT '发布内容',
    attachs bigint COMMENT '附件组id',
    status integer COMMENT '状态，0草稿/1已发布/2已结束',
    create_user_id bigint NOT NULL,
    create_date timestamp NOT NULL,
    modify_user_id bigint,
    modify_date timestamp,
    delete_mark integer NOT NULL DEFAULT 0,
    enabled_mark integer NOT NULL DEFAULT 1,
    dept_id bigint,
    tenant_id bigint,
    rule_user_id bigint
)COMMENT '通知、手动待办';

ALTER TABLE xjr_notice ADD CONSTRAINT con_incident_dev_xjr_notice_constraint_1 PRIMARY KEY (id);



CREATE TABLE xjr_notice_user (
    id bigint NOT NULL,
    notice_id bigint NOT NULL COMMENT '关联通知id',
    user_id bigint NOT NULL,
    is_read integer NOT NULL DEFAULT 0 COMMENT '是否已读1',
    reply varchar(1000) COMMENT '回复',
    create_user_id bigint NOT NULL,
    create_date timestamp NOT NULL,
    modify_user_id bigint,
    modify_date timestamp,
    delete_mark integer NOT NULL DEFAULT 0,
    enabled_mark integer NOT NULL DEFAULT 1,
    dept_id bigint,
    tenant_id bigint
)COMMENT '通知用户表';

ALTER TABLE xjr_notice_user ADD CONSTRAINT con_incident_dev_xjr_notice_user_constraint_1 PRIMARY KEY (id);

ALTER TABLE xjr_notice ADD COLUMN `RANGE` integer NOT NULL DEFAULT 1 COMMENT '通知范围，0公开/1指定用户';

ALTER TABLE xjr_department ADD COLUMN area_id bigint COMMENT '所在区域id，区域表id';


ALTER TABLE xjr_notice ADD COLUMN  params_json varchar(5000) COMMENT 'json 参数';

ALTER TABLE xjr_notice ADD COLUMN  path varchar(500) COMMENT '路径';