/**Begin D:\PDM_UPGRADE\PDM1\TSRBD_table.sql 推荐悬赏规则**/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_REWARDRULE')
CREATE TABLE T_TSRBD_REWARDRULE (
                                    FID BIGINT DEFAULT 0 NOT NULL,
                                    FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
                                    FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
                                    FSTATUS VARCHAR(10) DEFAULT 'C' NOT NULL,
                                    FCREATORID BIGINT DEFAULT 0 NOT NULL,
                                    FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
                                    FENABLE VARCHAR(10) DEFAULT '2' NOT NULL,
                                    FCREATETIME DATETIME,
                                    FMODIFYTIME DATETIME,
                                    FMASTERID BIGINT DEFAULT 0 NOT NULL,
                                    FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
                                    FORGID BIGINT DEFAULT 0 NOT NULL,
                                    FUSEORGID BIGINT DEFAULT 0 NOT NULL,
                                    FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
                                    FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
                                    FBITINDEX INT DEFAULT 0 NOT NULL,
                                    FSOURCEBITINDEX INT DEFAULT 0 NOT NULL,
                                    FINDEX INT DEFAULT 0 NOT NULL,
                                    FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
                                    FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
                                    FISSYSPRESET VARCHAR(1) DEFAULT '0' NOT NULL,
                                    FDISABLERID BIGINT DEFAULT 0 NOT NULL,
                                    FDISABLEDATE DATETIME,
                                    FRECOMMENDTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
                                    FRECRUTYPID BIGINT DEFAULT 0 NOT NULL,
                                    FRECRUSCENEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_REWARDONBOARD')
CREATE TABLE T_TSRBD_REWARDONBOARD (
                                       FENTRYID BIGINT DEFAULT 0 NOT NULL,
                                       FSEQ INT DEFAULT 0 NOT NULL,
                                       FRECRUSTGNEW BIGINT DEFAULT 0 NOT NULL,
                                       FRECRUSTGTYP BIGINT DEFAULT 0 NOT NULL,
                                       FRECRUSTATNEW BIGINT DEFAULT 0 NOT NULL,
                                       FREWARDITEM VARCHAR(10) DEFAULT ' ' NOT NULL,
                                       FCURRENCY BIGINT DEFAULT 0 NOT NULL,
                                       FREWARDVAL DECIMAL(10,2) DEFAULT 0 NOT NULL,
                                       FJOBSCMHRSWITCH VARCHAR(1) DEFAULT ' ' NOT NULL,
                                       FJOBSCMHRID BIGINT DEFAULT 0 NOT NULL,
                                       FJOBFAMILYHRID BIGINT DEFAULT 0 NOT NULL,
                                       FLOWJOBGRADE BIGINT DEFAULT 0 NOT NULL,
                                       FHIGHJOBGRADE BIGINT DEFAULT 0 NOT NULL,
                                       FCLASSLEVELLOW BIGINT DEFAULT 0 NOT NULL,
                                       FCLASSLEVELHIGH BIGINT DEFAULT 0 NOT NULL,
                                       FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_REWARDPROCESS')
CREATE TABLE T_TSRBD_REWARDPROCESS(
                                       FENTRYID BIGINT DEFAULT 0 NOT NULL,
                                       FSEQ INT DEFAULT 0 NOT NULL,
                                       FRECRUSTGNEWID BIGINT DEFAULT 0 NOT NULL,
                                       FRECRUSTGTYPID BIGINT DEFAULT 0 NOT NULL,
                                       FREWARDITEM VARCHAR(10) DEFAULT ' ' NOT NULL,
                                       FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
                                       FREWARDVAL DECIMAL(10,2) DEFAULT 0 NOT NULL,
                                       FRECRUSTATNEWID BIGINT DEFAULT 0 NOT NULL,
                                       FJOBSCMHRSWITCH VARCHAR(1) DEFAULT ' ' NOT NULL,
                                       FJOBSCMHRID BIGINT DEFAULT 0 NOT NULL,
                                       FJOBFAMILYHRID BIGINT DEFAULT 0 NOT NULL,
                                       FLOWJOBGRADE BIGINT DEFAULT 0 NOT NULL,
                                       FHIGHJOBGRADE BIGINT DEFAULT 0 NOT NULL,
                                       FCLASSLEVELLOW BIGINT DEFAULT 0 NOT NULL,
                                       FCLASSLEVELHIGH BIGINT DEFAULT 0 NOT NULL,
                                       FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_REWARDRESULT')
CREATE TABLE T_TSRBD_REWARDRESULT (
                                      FENTRYID BIGINT DEFAULT 0 NOT NULL,
                                      FSEQ INT DEFAULT 0 NOT NULL,
                                      FRQMTPROCID BIGINT DEFAULT 0 NOT NULL,
                                      FPOINTMAX VARCHAR(50) DEFAULT ' ' NOT NULL,
                                      FREMARK VARCHAR(500) DEFAULT ' ' NOT NULL,
                                      FADVERTPROPOSAL VARCHAR(500) DEFAULT ' ' NOT NULL,
                                      FREWARDMAX VARCHAR(50) DEFAULT ' ' NOT NULL,
                                      FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
                                      FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_REWARDRULE_L')
CREATE TABLE T_TSRBD_REWARDRULE_L (
                                      FID BIGINT DEFAULT 0 NOT NULL,
                                      FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
                                      FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
                                      FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
                                      FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
                                      FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\TSRBD_table.sql **/
