namespace FrameworkBLL.ReportOrchestration { internal static class ReportOrchestrationQB { // Loads MREPORTCONFIG orchestration settings for a given REPORTID. // Returns null when no config row exists; orchestrator uses safe defaults. public const string GET_REPORT_CONFIG = @" SELECT REPORTCONFIGID AS ReportConfigId, REPORTID AS ReportId, DATASOURCETYPE AS DataSourceType, ASYNCMODE AS AsyncMode, ASYNCTHRESHOLDDAYS AS AsyncThresholdDays, QUERYTIMEOUTSECONDS AS QueryTimeoutSeconds, ASYNCQUERYTIMEOUTSECONDS AS AsyncQueryTimeoutSeconds, CACHEDURATIONMINUTES AS CacheDurationMinutes, CACHEKEYPARAMS AS CacheKeyParams, ALLOWEDEXPORTFORMATS AS AllowedExportFormats, PIVOTENGINE AS PivotEngine, REPORTCATEGORY AS ReportCategory, ISNOLOCKALLOWED AS IsNoLockAllowed, RESULTEXPIRYHOURS AS ResultExpiryHours, DEFAULTPRIORITY AS DefaultPriority, ESTIMATIONQUERY AS EstimationQuery FROM MREPORTCONFIG WHERE REPORTID = @ReportId AND STATUS = 1;"; // Loads the MREPORT.REPORTCODE for registry lookup by REPORTID. public const string GET_REPORT_CODE = @" SELECT REPORTCODE FROM MREPORT WHERE REPORTID = @ReportId;"; // Loads auto-routing rules for a report, ordered by priority (lowest = first). public const string GET_DATASOURCE_RULES = @" SELECT RULETYPE AS RuleType, THRESHOLDVALUE AS ThresholdValue, TARGETDATASOURCE AS TargetDataSource, RULEPRIORITY AS RulePriority FROM MREPORTDATASOURCERULE WHERE REPORTID = @ReportId ORDER BY RULEPRIORITY ASC;"; } }