
--生产工单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MFTORDERENTRY' AND KSQL_COL_NAME ='FBDPROJECT') 
 ALTER TABLE T_POM_MFTORDERENTRY ADD (FBDPROJECT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_XMFTORDERENTRY' AND KSQL_COL_NAME ='FBDPROJECT') 
 ALTER TABLE T_POM_XMFTORDERENTRY ADD (FBDPROJECT BIGINT DEFAULT 0 NOT NULL );
--生产组件清单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MFTORDERENTRY_S' AND KSQL_COL_NAME ='FBDPROJECT') 
 ALTER TABLE T_POM_MFTORDERENTRY_S ADD (FBDPROJECT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_XMFTORDERENTRY_S' AND KSQL_COL_NAME ='FBDPROJECT') 
 ALTER TABLE T_POM_XMFTORDERENTRY_S ADD (FBDPROJECT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_XMANUSTOCKENTRY' AND KSQL_COL_NAME ='FBDPROJECT') 
 ALTER TABLE T_POM_XMANUSTOCKENTRY ADD (FBDPROJECT BIGINT DEFAULT 0 NOT NULL );
--检修组件清单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSTOCK' AND KSQL_COL_NAME ='FBDPROJECT') 
 ALTER TABLE T_POM_MROSTOCK ADD (FBDPROJECT BIGINT DEFAULT 0 NOT NULL );
--改制申请
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_RESTRUCTURBILL' AND KSQL_COL_NAME ='FPBBDPROJECT') 
 ALTER TABLE T_POM_RESTRUCTURBILL ADD (FPBBDPROJECT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_RESTRUCTURBILL' AND KSQL_COL_NAME ='FPABDPROJECT') 
 ALTER TABLE T_POM_RESTRUCTURBILL ADD (FPABDPROJECT BIGINT DEFAULT 0 NOT NULL );
--工单合并
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MGSRCENTRY' AND KSQL_COL_NAME ='FBDPROJECT') 
 ALTER TABLE T_POM_MGSRCENTRY ADD (FBDPROJECT BIGINT DEFAULT 0 NOT NULL );
 
--工单汇报单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MFTREPORTSUMMARY' AND KSQL_COL_NAME ='FBDPROJECT') 
 ALTER TABLE T_POM_MFTREPORTSUMMARY ADD (FBDPROJECT BIGINT DEFAULT 0 NOT NULL );

