 /** 付款申请 **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AP_APPLYPAYBILL' AND KSQL_COL_NAME ='fcoopstatus')
 ALTER TABLE T_AP_APPLYPAYBILL ADD (fcoopstatus VARCHAR(30) DEFAULT 'A' NOT NULL );

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

  /** 月末清理 **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_ap_liquidation' AND KSQL_COL_NAME ='fcoopstatus')
 ALTER TABLE t_ap_liquidation ADD (fcoopstatus VARCHAR(30) DEFAULT 'A' NOT NULL  );

  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AP_APPLYPAYBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO')
 ALTER TABLE T_AP_APPLYPAYBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AP_APPLYPAYBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID')
 ALTER TABLE T_AP_APPLYPAYBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AP_APPLYPAYBILLENTRY' AND KSQL_COL_NAME ='FGROUPNUMBER')
 ALTER TABLE T_AP_APPLYPAYBILLENTRY ADD (FGROUPNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AP_APPLYPAYBILLENTRY' AND KSQL_COL_NAME ='FGROUPSEQ')
 ALTER TABLE T_AP_APPLYPAYBILLENTRY ADD (FGROUPSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL );


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AP_LIQUIDATIONENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO')
 ALTER TABLE T_AP_LIQUIDATIONENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AP_LIQUIDATIONENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID')
 ALTER TABLE T_AP_LIQUIDATIONENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AP_LIQUIDATIONENTRY' AND KSQL_COL_NAME ='FGROUPNUMBER')
 ALTER TABLE T_AP_LIQUIDATIONENTRY ADD (FGROUPNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AP_LIQUIDATIONENTRY' AND KSQL_COL_NAME ='FGROUPSEQ')
 ALTER TABLE T_AP_LIQUIDATIONENTRY ADD (FGROUPSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL );
