--生产月度在制查询

EXEC P_ALTERPK 'PK_POM_PRODWIPBILL', 'T_POM_PRODWIPBILL', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PRODLL_FBILLNO') CREATE INDEX IDX_POM_PRODLL_FBILLNO ON T_POM_PRODWIPBILL ( FBILLNO );
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PRODLL_FCREATETIME') CREATE INDEX IDX_POM_PRODLL_FCREATETIME ON T_POM_PRODWIPBILL ( FCREATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PRODWIPBILL_FORGID_AUDITDATE') CREATE INDEX IDX_POM_PRODWIPBILL_FORGID_AUDITDATE ON T_POM_PRODWIPBILL ( FORGID, FAUDITDATE );

--生产月度在制查询_在制信息

EXEC P_ALTERPK 'PK_POM_PRODWIPBILLENTRY', 'T_POM_PRODWIPBILLENTRY', 'FENTRYID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PRODRY_FID') CREATE INDEX IDX_POM_PRODRY_FID ON T_POM_PRODWIPBILLENTRY ( FID );
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PRODRY_FSEQ') CREATE INDEX IDX_POM_PRODRY_FSEQ ON T_POM_PRODWIPBILLENTRY ( FSEQ );
