namespace IceImportDAL.Query.GcmCodeLookup; // The one explicitly-whitelisted generic SQL lookup (see GcmCodeLookupDAL._allowedTables). // MGCM is GB5's generic type-scoped code/define master (GCMTYPEID + GCMCODE/GCMNAME -> GCMID) — // the single genuinely uniform table Ice Import's ValueType 4/5 (Code/Name -> Id) lookups can hit // directly instead of going through the target entity's own GetSelectList endpoint. // Index note: MGCM should have a covering index on (GCMTYPEID, GCMCODE) and (GCMTYPEID, GCMNAME) // including GCMID/STATUS — this DAL is called once per IceMap execution across the whole batch // (chunked at 2000 values/IN-clause), not per row, so it is not a hot per-row path. public static class GcmCodeLookupQB { public const string RESOLVE_CODES_BY_GCMTYPE = @" SELECT GCMCODE AS Value, GCMID AS Id FROM MGCM WHERE GCMTYPEID = @GcmTypeId AND STATUS = 1 AND GCMCODE IN @Values"; public const string RESOLVE_NAMES_BY_GCMTYPE = @" SELECT GCMNAME AS Value, GCMID AS Id FROM MGCM WHERE GCMTYPEID = @GcmTypeId AND STATUS = 1 AND GCMNAME IN @Values"; }