
 EXEC P_ALTERPK 'PK_T_ER_APPLYPAYBILL_L', 'T_ER_APPLYPAYBILL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ALYPAY_L_ID') CREATE INDEX IDX_ALYPAY_L_ID ON T_ER_APPLYPAYBILL_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_ER_APPLYPAYBILL_LK', 'T_ER_APPLYPAYBILL_LK', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAY_LK_FID') CREATE INDEX IDX_ER_ALYPAY_LK_FID ON T_ER_APPLYPAYBILL_LK ( FID );


 EXEC P_ALTERPK 'PK_T_ER_APPLYPAYBILL_TC', 'T_ER_APPLYPAYBILL_TC', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAY_TC_FBILLID') CREATE INDEX IDX_ER_ALYPAY_TC_FBILLID ON T_ER_APPLYPAYBILL_TC ( FTBILLID );


 EXEC P_ALTERPK 'PK_T_ER_APPLYPAYBILL_WB', 'T_ER_APPLYPAYBILL_WB', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAY_WB_FID') CREATE INDEX IDX_ER_ALYPAY_WB_FID ON T_ER_APPLYPAYBILL_WB ( FID );


 EXEC P_ALTERPK 'PK_T_ER_APPLYPAYBILLPAYENTRY', 'T_ER_APPLYPAYBILLPAYENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAYENT_TARGETBILLID') CREATE INDEX IDX_ER_ALYPAYENT_TARGETBILLID ON T_ER_APPLYPAYBILLPAYENTRY ( FTARGETBILLID ,FTARGETBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAYENT_FEQ') CREATE INDEX IDX_ER_ALYPAYENT_FEQ ON T_ER_APPLYPAYBILLPAYENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_ER_APPLYPAYBILL', 'T_ER_APPLYPAYBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAY_FBILLNO') CREATE INDEX IDX_ER_ALYPAY_FBILLNO ON T_ER_APPLYPAYBILL ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAY_FAPPLYERID') CREATE INDEX IDX_ER_ALYPAY_FAPPLYERID ON T_ER_APPLYPAYBILL ( FAPPLIERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAY_FCREATORID') CREATE INDEX IDX_ER_ALYPAY_FCREATORID ON T_ER_APPLYPAYBILL ( FCREATORID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAY_FCOMPANYID') CREATE INDEX IDX_ER_ALYPAY_FCOMPANYID ON T_ER_APPLYPAYBILL ( FCOMPANYID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAY_FSTATUS') CREATE INDEX IDX_ER_ALYPAY_FSTATUS ON T_ER_APPLYPAYBILL ( FBILLSTATUS );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAY_FDATE_NO') CREATE INDEX IDX_ER_ALYPAY_FDATE_NO ON T_ER_APPLYPAYBILL ( FBIZDATE ,FBILLNO );


 EXEC P_ALTERPK 'PK_T_ER_APPLYPAYBILLENTRY', 'T_ER_APPLYPAYBILLENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAYENT_FSEQ') CREATE INDEX IDX_ER_ALYPAYENT_FSEQ ON T_ER_APPLYPAYBILLENTRY ( FID ,FSEQ );

 EXEC P_ALTERPK 'PK_T_ER_APPLYPAYBILLRECENTRY', 'T_ER_APPLYPAYBILLRECENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ALYPAYRECENT_FSEQ') CREATE INDEX IDX_ER_ALYPAYRECENT_FSEQ ON T_ER_APPLYPAYBILLRECENTRY ( FID ,FSEQ );

 EXEC P_ALTERPK 'PK_ER_APPLYPAYBILLRECENTRY_LK', 'T_ER_APPLYPAYBILLRECENTRY_LK', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_APPLYPAY_LK_FENTRYID') CREATE INDEX IDX_ER_APPLYPAY_LK_FENTRYID ON T_ER_APPLYPAYBILLRECENTRY_LK ( FENTRYID );
