--资源检查工具，增加相关索引
 EXEC P_ALTERPK 'PK_MSPLAN_CHECKRESOURCE', 'T_MSPLAN_CHECKRESOURCE', 'FID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_CHECKRESOURCE_L', 'T_MSPLAN_CHECKRESOURCE_L', 'FPKID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_CHECKFILTERENTRY', 'T_MSPLAN_CHECKFILTERENTRY', 'FENTRYID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_CHECKMATCHENTRY', 'T_MSPLAN_CHECKMATCHENTRY', 'FENTRYID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_CHECKLOGICENTRY', 'T_MSPLAN_CHECKLOGICENTRY', 'FENTRYID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_RESULTFIELDENTRY', 'T_MSPLAN_RESULTFIELDENTRY', 'FENTRYID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_CHECKGROUPENTRY', 'T_MSPLAN_CHECKGROUPENTRY', 'FENTRYID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_CHECKRESULT', 'T_MSPLAN_CHECKRESULT', 'FID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_CHECKRESULTENTRY', 'T_MSPLAN_CHECKRESULTENTRY', 'FENTRYID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_RESULTSUMENTRY', 'T_MSPLAN_RESULTSUMENTRY', 'FENTRYID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_SQLPARAM', 'T_MSPLAN_SQLPARAM', 'FID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_SQLPARAM_L', 'T_MSPLAN_SQLPARAM_L', 'FPKID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_RCPARAMSET', 'T_MSPLAN_RCPARAMSET', 'FID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_RCPARAMSET_L', 'T_MSPLAN_RCPARAMSET_L', 'FPKID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_BIZBILLRESULT', 'T_MSPLAN_BIZBILLRESULT', 'FID', '1';
 EXEC P_ALTERPK 'PK_MSPLAN_BIZBILLCHKENTRY', 'T_MSPLAN_BIZBILLCHKENTRY', 'FENTRYID', '1';
  

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_BIZBILLRESULT_BIZID')   
CREATE INDEX IDX_MSPLAN_BIZBILLRESULT_BIZID ON T_MSPLAN_BIZBILLRESULT  (FBIZBILLID,FBIZENTITY);

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_BIZBILLRESULT_TAGID')   
CREATE INDEX IDX_MSPLAN_BIZBILLRESULT_TAGID ON T_MSPLAN_BIZBILLRESULT  (FTAGID);

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


IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHECKRESOURCE_NUM')   
CREATE INDEX IDX_MSPLAN_CHECKRESOURCE_NUM ON T_MSPLAN_CHECKRESOURCE  (FNUMBER);

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

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

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

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

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

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHECKRESULT_TAGID')   
CREATE INDEX IDX_MSPLAN_CHECKRESULT_TAGID ON T_MSPLAN_CHECKRESULT  (FTAGID);

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHECKRESULTENTRY_BID')   
CREATE INDEX IDX_MSPLAN_CHECKRESULTENTRY_BID ON T_MSPLAN_CHECKRESULTENTRY  (FBILLID);

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHECKRESULTENTRY_BEID')   
CREATE INDEX IDX_MSPLAN_CHECKRESULTENTRY_BEID ON T_MSPLAN_CHECKRESULTENTRY  (FBILLENTRYID);

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_SQLPARAM_NUM')   
CREATE INDEX IDX_MSPLAN_SQLPARAM_NUM ON T_MSPLAN_SQLPARAM  (FNUMBER);

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


IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_RCPARAMSET_NUM')   
CREATE INDEX IDX_MSPLAN_RCPARAMSET_NUM ON T_MSPLAN_RCPARAMSET  (FNUMBER);

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


