--生产领料
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MREQOUTBILL' AND KSQL_COL_NAME ='FUNITSRCTYPE')
ALTER TABLE T_IM_MDC_MREQOUTBILL ADD (FUNITSRCTYPE VARCHAR(30) DEFAULT 'NULL' NOT NULL );

--生产领料申请
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MFTREQBILLS' AND KSQL_COL_NAME ='FUNITSRCTYPE')
ALTER TABLE T_IM_MDC_MFTREQBILLS ADD (FUNITSRCTYPE VARCHAR(30) DEFAULT 'NULL' NOT NULL );

--完工入库
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_PRODUCTINBILL' AND KSQL_COL_NAME ='FUNITSRCTYPE')
ALTER TABLE T_IM_MDC_PRODUCTINBILL ADD (FUNITSRCTYPE VARCHAR(30) DEFAULT 'NULL' NOT NULL );

--简单委外领料
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDCOM_MREQOUTBILL' AND KSQL_COL_NAME ='FUNITSRCTYPE')
ALTER TABLE T_IM_MDCOM_MREQOUTBILL ADD (FUNITSRCTYPE VARCHAR(30) DEFAULT 'NULL' NOT NULL );

--简单委外入库
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMINBILL' AND KSQL_COL_NAME ='FUNITSRCTYPE')
ALTER TABLE T_IM_MDC_OMINBILL ADD (FUNITSRCTYPE VARCHAR(30) DEFAULT 'NULL' NOT NULL );

--委外领料
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILL' AND KSQL_COL_NAME ='FUNITSRCTYPE')
ALTER TABLE T_IM_MDC_OMOUTBILL ADD (FUNITSRCTYPE VARCHAR(30) DEFAULT 'NULL' NOT NULL );


--委外完工入库
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMCMPLINBILL' AND KSQL_COL_NAME ='FUNITSRCTYPE')
ALTER TABLE T_IM_MDC_OMCMPLINBILL ADD (FUNITSRCTYPE VARCHAR(30) DEFAULT 'NULL' NOT NULL );
