--检查逻辑分录中，增加字段过滤类型
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_CHECKLOGICENTRY' AND KSQL_COL_NAME ='FENTRYFILTERTYPE') 
ALTER TABLE T_MSPLAN_CHECKLOGICENTRY ADD (FENTRYFILTERTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL);
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_CHECKLOGICENTRY' AND KSQL_COL_NAME ='FENTRYFILTERRULE') 
ALTER TABLE T_MSPLAN_CHECKLOGICENTRY ADD (FENTRYFILTERRULE NVARCHAR(2000) DEFAULT ' ' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_CHECKLOGICENTRY' AND KSQL_COL_NAME ='FENTRYFILTERVALUE') 
ALTER TABLE T_MSPLAN_CHECKLOGICENTRY ADD (FENTRYFILTERVALUE NVARCHAR(255) DEFAULT ' ' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_CHECKLOGICENTRY' AND KSQL_COL_NAME ='FENTRYFILTERVALUE_TAG') 
ALTER TABLE T_MSPLAN_CHECKLOGICENTRY ADD (FENTRYFILTERVALUE_TAG NCLOB);



IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_CHECKRESOURCE' AND KSQL_COL_NAME ='FBIZRESULTFIELDNAME') 
ALTER TABLE T_MSPLAN_CHECKRESOURCE ADD (FBIZRESULTFIELDNAME NVARCHAR(255) DEFAULT ' ' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_CHECKRESOURCE' AND KSQL_COL_NAME ='FBIZRESULTFIELDNUMBER') 
ALTER TABLE T_MSPLAN_CHECKRESOURCE ADD (FBIZRESULTFIELDNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_CHECKRESOURCE' AND KSQL_COL_NAME ='FONETYPE') 
ALTER TABLE T_MSPLAN_CHECKRESOURCE ADD (FONETYPE CHAR(1) DEFAULT '0' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_BIZBILLRESULT' AND KSQL_COL_NAME ='FSRCRESOURCECHECKID') 
ALTER TABLE T_MSPLAN_BIZBILLRESULT ADD (FSRCRESOURCECHECKID BIGINT DEFAULT 0 NOT NULL);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_CHECKRESOURCE' AND KSQL_COL_NAME ='FFIELDAPPID') 
ALTER TABLE T_MSPLAN_CHECKRESOURCE ADD (FFIELDAPPID NVARCHAR(50) DEFAULT ' ' NOT NULL);

