CREATE TABLE "JONHON_MES"."MES_APPROVAL_RECORD" (
                                         "ID" NUMBER(20,0) NOT NULL,
                                         "BIZ_ID" NUMBER(20,0) NOT NULL,
                                         "BIZ_TYPE" NVARCHAR2(255) NOT NULL,
                                         "CONTENT" NVARCHAR2(255) NOT NULL,
                                         "CURRENT_ROLE_ID" NUMBER(20,0) NOT NULL,
                                         "NEXT_ROLE_ID" NUMBER(20,0) NOT NULL,
                                         "OPINION" NVARCHAR2(255),
                                         "CREATE_USER" NUMBER(20,0),
                                         "CREATE_DEPT" NUMBER(20,0),
                                         "CREATE_TIME" DATE,
                                         "UPDATE_USER" NUMBER(20,0),
                                         "UPDATE_TIME" DATE,
                                         "STATUS" NUMBER(1,0) NOT NULL,
                                         "IS_DELETED" NUMBER(11,0) DEFAULT 0,
                                         "CURRENT_ROLE_NAME" NVARCHAR2(255) NOT NULL ENABLE,
                                         "NEXT_ROLE_NAME" NVARCHAR2(255) NOT NULL ENABLE,
                                         CONSTRAINT "SYS_C0023068" PRIMARY KEY ("ID"),
                                         CONSTRAINT "SYS_C0023061" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE,
                                         CONSTRAINT "SYS_C0023062" CHECK ("BIZ_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE,
                                         CONSTRAINT "SYS_C0023063" CHECK ("BIZ_TYPE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE,
                                         CONSTRAINT "SYS_C0023064" CHECK ("CONTENT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE,
                                         CONSTRAINT "SYS_C0023065" CHECK ("CURRENT_ROLE_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE,
                                         CONSTRAINT "SYS_C0023066" CHECK ("NEXT_ROLE_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE,
                                         CONSTRAINT "SYS_C0023067" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE
)
    TABLESPACE "JONHON_MES_DATA"
    LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."ID" IS 'ID';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."BIZ_ID" IS '业务ID';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."BIZ_TYPE" IS '业务类型';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."CONTENT" IS '流程内容';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."CURRENT_ROLE_ID" IS '当前角色ID';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."NEXT_ROLE_ID" IS '下一个流程节点角色ID';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."OPINION" IS '审批意见';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."CREATE_USER" IS '创建人';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."CREATE_DEPT" IS '创建部门';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."CREATE_TIME" IS '创建时间';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."UPDATE_USER" IS '更新人';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."UPDATE_TIME" IS '更新时间';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."STATUS" IS '审核状态 0 待审核 1 审核通过 2 审核失败';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."IS_DELETED" IS '是否已删除';

COMMENT ON TABLE "JONHON_MES"."MES_APPROVAL_RECORD" IS '审批记录表 - 统计所有的审批记录'

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."CURRENT_ROLE_NAME" IS '当前角色名称';

COMMENT ON COLUMN "JONHON_MES"."MES_APPROVAL_RECORD"."NEXT_ROLE_NAME" IS '下一个流程节点角色名称';


CREATE TABLE "JONHON_MES"."MES_NOTIFY_MESSAGE" (
                                         "ID" NUMBER(20,0) NOT NULL,
                                         "CONTENT" NVARCHAR2(255) NOT NULL,
                                         "RECEIVE_USER_ID" NUMBER(20,0),
                                         "CREATE_USER" NUMBER(20,0),
                                         "CREATE_DEPT" NUMBER(20,0),
                                         "CREATE_TIME" DATE,
                                         "UPDATE_USER" NUMBER(20,0),
                                         "UPDATE_TIME" DATE,
                                         "STATUS" NUMBER(1,0) NOT NULL,
                                         "IS_DELETED" NUMBER(11,0) DEFAULT 0,
                                         CONSTRAINT "SYS_C0023072" PRIMARY KEY ("ID"),
                                         CONSTRAINT "SYS_C0023069" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE,
                                         CONSTRAINT "SYS_C0023070" CHECK ("CONTENT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE,
                                         CONSTRAINT "SYS_C0023071" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE
)
    TABLESPACE "JONHON_MES_DATA"
    LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."ID" IS 'ID';

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."CONTENT" IS '流程内容';

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."RECEIVE_USER_ID" IS '接收人ID';

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."CREATE_USER" IS '创建人';

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."CREATE_DEPT" IS '创建部门';

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."CREATE_TIME" IS '创建时间';

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."UPDATE_USER" IS '更新人';

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."UPDATE_TIME" IS '更新时间';

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."STATUS" IS '已读状态 0 未读 1 已读';

COMMENT ON COLUMN "JONHON_MES"."MES_NOTIFY_MESSAGE"."IS_DELETED" IS '是否已删除';

COMMENT ON TABLE "JONHON_MES"."MES_NOTIFY_MESSAGE" IS '通知消息'

ALTER TABLE BLADE_USER
    ADD WORK_NO VARCHAR2(50);

COMMENT ON COLUMN BLADE_USER.WORK_NO IS '工号';
