ALTER TABLE mes_yield_order_craft
	ADD process_code NVARCHAR2(255) NULL;
COMMENT ON COLUMN mes_yield_order_craft.process_code IS '工序编码- 工序冗余字段';
ALTER TABLE mes_yield_order_craft
	ADD process_name NVARCHAR2(255) NULL;
COMMENT ON COLUMN mes_yield_order_craft.process_name IS '工序名称- 工序冗余字段';
COMMENT ON COLUMN mes_yield_order_craft.process_no IS '工序排序序号- 工序冗余字段';

DROP TABLE "MES_PLATE_GOODS_APPLY_DETAIL";
CREATE TABLE "MES_PLATE_GOODS_APPLY_DETAIL"
(
	"ID"          NUMBER(20, 0) NOT NULL,
	"TENANT_ID"   NVARCHAR2(12),
	"CREATE_USER" NUMBER(20, 0),
	"CREATE_TIME" DATE,
	"CREATE_DEPT" NUMBER(20, 0),
	"UPDATE_USER" NUMBER(20, 0),
	"UPDATE_TIME" DATE,
	"STATUS"      NUMBER(11, 0) NOT NULL,
	"IS_DELETED"  NUMBER(11, 0),
	"PGA_ID"      NUMBER(20, 0),
	"PGR_ID"      NUMBER(20, 0)
) LOGGING NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE
(
	BUFFER_POOL DEFAULT
) PARALLEL 1 NOCACHE DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."ID" IS '主键';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."CREATE_USER" IS '创建人';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."CREATE_DEPT" IS '创建部门';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."UPDATE_USER" IS '更新人';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."STATUS" IS '状态';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."IS_DELETED" IS '删除标记';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."PGA_ID" IS '添加量申报ID';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY_DETAIL"."PGR_ID" IS '镀层物料需求ID';
COMMENT ON TABLE "MES_PLATE_GOODS_APPLY_DETAIL" IS '烧结模具计划-申报';

-- ----------------------------
-- Checks structure for table MES_PLATE_GOODS_APPLY_DETAIL
-- ----------------------------
ALTER TABLE "MES_PLATE_GOODS_APPLY_DETAIL"
	ADD CONSTRAINT "SYS_C0021890" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "MES_PLATE_GOODS_APPLY_DETAIL"
	ADD CONSTRAINT "SYS_C0021891" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

DROP TABLE "MES_PLATE_GOODS_APPLY";
CREATE TABLE "MES_PLATE_GOODS_APPLY"
(
	"ID"                   NUMBER(20, 0)            NOT NULL,
	"TENANT_ID"            NVARCHAR2(12),
	"CREATE_USER"          NUMBER(20, 0),
	"CREATE_TIME"          DATE,
	"CREATE_DEPT"          NUMBER(20, 0),
	"UPDATE_USER"          NUMBER(20, 0),
	"UPDATE_TIME"          DATE,
	"STATUS"               NUMBER(11, 0)            NOT NULL,
	"IS_DELETED"           NUMBER(11, 0)  DEFAULT 0,
	"APPROVAL_MAN"         NUMBER(20, 0),
	"APPROVAL_TIME"        DATE,
	"APPROVAL_STATUS"      NUMBER(20, 0),
	"APPROVAL_MEMO"        NVARCHAR2(255),
	"WC_ID"                NUMBER(20, 0)            NOT NULL,
	"GOODS_CODE"           NVARCHAR2(255)           NOT NULL,
	"GOODS_DEMAND"         NUMBER(20, 10) DEFAULT 0 NOT NULL,
	"GOODS_NAME"           VARCHAR2(100 BYTE),
	"GOODS_ADD_TOTAL"      NUMBER(20, 10),
	"GOODS_DEMAND_TOTAL"   NUMBER(20, 10),
	"DECLARED_QUOTA_TOTAL" NUMBER(20, 10),
	"APPLY_CODE"           VARCHAR2(100 BYTE)
) LOGGING NOCOMPRESS PCTFREE 10 INITRANS 1 STORAGE
(
	INITIAL 65536
	NEXT 1048576
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	BUFFER_POOL DEFAULT
) PARALLEL 1 NOCACHE DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."ID" IS '主键';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."TENANT_ID" IS '租户ID';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."CREATE_USER" IS '创建人';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."CREATE_DEPT" IS '创建部门';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."UPDATE_USER" IS '修改人';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."UPDATE_TIME" IS '修改时间';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."STATUS" IS '状态';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."IS_DELETED" IS '是否已删除';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."APPROVAL_MAN" IS '审批人';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."APPROVAL_TIME" IS '审批时间';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."APPROVAL_STATUS" IS '审批状态';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."APPROVAL_MEMO" IS '审批结果';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."WC_ID" IS '作业中心';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."GOODS_CODE" IS '镀层物料';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."GOODS_DEMAND" IS '物料需求定额';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."GOODS_NAME" IS '镀层物料名称';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."GOODS_ADD_TOTAL" IS '本次申报添加量';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."GOODS_DEMAND_TOTAL" IS '本次申报物料需求单总物料需求剩余量';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."DECLARED_QUOTA_TOTAL" IS '本次申报物料需求单已申报定额总量';
COMMENT ON COLUMN "MES_PLATE_GOODS_APPLY"."APPLY_CODE" IS '申报单号';
COMMENT ON TABLE "MES_PLATE_GOODS_APPLY" IS '镀层物料申报添加量';

-- ----------------------------
-- Primary Key structure for table MES_PLATE_GOODS_APPLY
-- ----------------------------
ALTER TABLE "MES_PLATE_GOODS_APPLY"
	ADD CONSTRAINT "SYS_C0021902" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table MES_PLATE_GOODS_APPLY
-- ----------------------------
ALTER TABLE "MES_PLATE_GOODS_APPLY"
	ADD CONSTRAINT "SYS_C0021892" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "MES_PLATE_GOODS_APPLY"
	ADD CONSTRAINT "SYS_C0021893" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "MES_PLATE_GOODS_APPLY"
	ADD CONSTRAINT "SYS_C0021894" CHECK ("WC_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "MES_PLATE_GOODS_APPLY"
	ADD CONSTRAINT "SYS_C0021895" CHECK ("GOODS_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "MES_PLATE_GOODS_APPLY"
	ADD CONSTRAINT "SYS_C0021896" CHECK ("GOODS_DEMAND" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
