/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PRINTRESOURCE') 
 CREATE TABLE T_SVC_PRINTRESOURCE (
FID BIGINT DEFAULT 0 NOT NULL,
FILENAME NVARCHAR(120) DEFAULT ' ' NOT NULL,
FILETYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FILESIZE BIGINT DEFAULT 0 NOT NULL,
FPRINTTPLID VARCHAR(36) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL,
FURL VARCHAR(300) DEFAULT ' ' NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FPOWERSCOPE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PRINTTPL') 
 CREATE TABLE T_SVC_PRINTTPL (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FMASTERID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(256) DEFAULT ' ' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FPICTURE VARCHAR(256) DEFAULT ' ' NOT NULL,
FPIC_WIDTH BIGINT DEFAULT 0 NOT NULL,
FPIC_HEIGH BIGINT DEFAULT 0 NOT NULL,
FDIRECTION CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FVERSION VARCHAR(30) DEFAULT ' ' NOT NULL,
FDATA NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PRINTTPL_GROUP') 
 CREATE TABLE T_SVC_PRINTTPL_GROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCREATORID VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PRINTTPL_GROUP_L') 
 CREATE TABLE T_SVC_PRINTTPL_GROUP_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PRINTMETA') 
 CREATE TABLE T_SVC_PRINTMETA (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FMASTERID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(256) DEFAULT ' ' NOT NULL,
FSTPLID VARCHAR(36) DEFAULT ' ' NOT NULL,
FBILLFORMID VARCHAR(50) DEFAULT ' ' NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FBIZAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FVERSION VARCHAR(30) DEFAULT ' ' NOT NULL,
FDATA NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PRINTMETA_L') 
 CREATE TABLE T_SVC_PRINTMETA_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(256) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PRINTTPL_L') 
 CREATE TABLE T_SVC_PRINTTPL_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(256) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/
