IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_MROORDER_N') 
CREATE TABLE T_POM_MROORDER_N (
	FID BIGINT DEFAULT 0 NOT NULL,
	FDUTY NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FFINISHTYPEA CHAR(1) DEFAULT '0' NOT NULL,
	FFINISHTYPEB CHAR(1) DEFAULT '1' NOT NULL,
	FFINISHTYPEC CHAR(1) DEFAULT '0' NOT NULL,
	FFINISHTYPED CHAR(1) DEFAULT '0' NOT NULL,
	FDEFECTAA BIGINT DEFAULT 0 NOT NULL,
	FDEFECTAABEGIN NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTAAEND NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTDD BIGINT DEFAULT 0 NOT NULL,
	FDEFECTBB BIGINT DEFAULT 0 NOT NULL,
	FDEFECTCC BIGINT DEFAULT 0 NOT NULL,
	FDEFECTBBBEGIN NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTBBEND NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTCCBEGIN NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTCCEND NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTCCBEGIN1 NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTCCEND1 NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTDDBEGIN NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTDDBEGIN1 NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTDDEND NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FDEFECTDDEND1 NVARCHAR(255) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_MROORDERENTRY_N') 
CREATE TABLE T_POM_MROORDERENTRY_N (
	FID BIGINT DEFAULT 0 NOT NULL,
	FENTRYID BIGINT DEFAULT 0 NOT NULL,
	FPARENTENTRYID BIGINT DEFAULT 0 NOT NULL,
	FSORDERNO NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FCARDUSER BIGINT DEFAULT 0 NOT NULL,
	FMAJORDEFECT BIGINT DEFAULT 0 NOT NULL,
	FISIMMEDIATELY CHAR(1) DEFAULT '0' NOT NULL,
	FSUPBILLNO NVARCHAR(256) DEFAULT ' ' NOT NULL,
	FFINISHTYPE NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FHANDLEBOOK NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FNRCVERSION NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FNRCREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
	FNRCWORKUSER BIGINT DEFAULT 0 NOT NULL,
	FWORKFINTIME DATETIME , 
	FCHECKUSER BIGINT DEFAULT 0 NOT NULL,
	FCHECKFINTIME DATETIME , 
	FUSERSIGN CHAR(1) DEFAULT '0' NOT NULL,
	FPLANROOM BIGINT DEFAULT 0 NOT NULL,
	FCARDCHECKER BIGINT DEFAULT 0 NOT NULL,
	FDEFECTD BIGINT DEFAULT 0 NOT NULL,
	FDEFECTA BIGINT DEFAULT 0 NOT NULL,
	FDEFECTB BIGINT DEFAULT 0 NOT NULL,
	FDEFECTC BIGINT DEFAULT 0 NOT NULL,
	FCHECKUSER1 BIGINT DEFAULT 0 NOT NULL,
	FCHECKFINTIME1 DATETIME 
);

