-- orgcheck组织引用检查性能优化，增加费用承担公司索引
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_RBTE_FECOSTCOMPANYID') CREATE INDEX IDX_ER_RBTE_FECOSTCOMPANYID ON T_ER_REIMBURSETRIPENTRY ( FENTRYCOSTCOMPANYID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_RB_COSTCOMPANYID') CREATE INDEX IDX_ER_RB_COSTCOMPANYID ON T_ER_REQBILL ( FCOSTCOMPANYID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_LOANDETAIL_FECCOMPANYID') CREATE INDEX IDX_ER_LOANDETAIL_FECCOMPANYID ON T_ER_DAILYLOANDETAIL ( FENTRYCOSTCOMPANYID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_RTE_FECOSTCOMPANYID') CREATE INDEX IDX_ER_RTE_FECOSTCOMPANYID ON T_ER_REQTRIPENTRY ( FENTRYCOSTCOMPANYID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_RPB_FCOSTCOMPANYID') CREATE INDEX IDX_ER_RPB_FCOSTCOMPANYID ON T_ER_REPAYMENTBILL ( FCOSTCOMPANYID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_PUBREIM_FCOSTCOMPANYID') CREATE INDEX IDX_ER_PUBREIM_FCOSTCOMPANYID ON T_ER_PUBREIMBILL ( FCOSTCOMPANYID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_DLB_FCOSTCOMPANYID') CREATE INDEX IDX_ER_DLB_FCOSTCOMPANYID ON T_ER_DAILYLOANBILL ( FCOSTCOMPANYID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_DREIM_COSTCOMPY') CREATE INDEX IDX_ER_DREIM_COSTCOMPY ON T_ER_DAILYREIMBURSEBILL ( FCOSTCOMPANYID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_PREIM_EDET_FECCOMPANYID') CREATE INDEX IDX_ER_PREIM_EDET_FECCOMPANYID ON T_ER_PUBREIMEXPDET ( FENTRYCOSTCOMPANYID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_EXPDETAIL_COSTCOMPY') CREATE INDEX IDX_ER_EXPDETAIL_COSTCOMPY ON T_ER_EXPENSEDETAIL ( FENTRYCOSTCOMPANYID );