--生产补料单
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MQBENTRY' AND KSQL_COL_NAME ='FMATERIALREPLACE')
 ALTER TABLE T_IM_MDC_MQBENTRY ADD (FMATERIALREPLACE NVARCHAR(50) DEFAULT ' ' NOT NULL );

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

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

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MQBENTRY' AND KSQL_COL_NAME ='FSTOCKENTRYSEQ')
 ALTER TABLE T_IM_MDC_MQBENTRY ADD (FSTOCKENTRYSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL );
 --委外补料单
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILLENTRY' AND KSQL_COL_NAME ='FMATERIALREPLACE')
 ALTER TABLE T_IM_MDC_OMOUTBILLENTRY ADD (FMATERIALREPLACE NVARCHAR(50) DEFAULT ' ' NOT NULL );

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

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

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

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