namespace CMSDAL.Query.DesignSystem; public static class DesignSystemQB { public const string GET_LIST = @" SELECT DESIGNSYSTEMID AS DesignSystemId, SYSTEMCODE AS SystemCode, SYSTEMNAME AS SystemName, VERSION AS Version, STATUS AS Status FROM DBO.MDESIGNSYSTEM WHERE TENANTID = @TenantId AND STATUS = 1 ORDER BY SYSTEMNAME"; // Includes CONFIGJSON — the theme-token payload — unlike GET_LIST/GET_SELECT_LIST, which // are deliberately lightweight pick-list projections. Added for gb5-site-renderer (Site/Page // platform Phase 8): the renderer needs a Site's actual design tokens, not just its name. // TENANTID = -1 (system-wide, DF_MDESIGNSYS_TENANTID's own default) is included alongside // the caller's own tenant — a Site may reference either a tenant-authored design system or // one of the shared system-wide ones. public const string GET_BY_ID = @" SELECT DESIGNSYSTEMID AS DesignSystemId, SYSTEMCODE AS SystemCode, SYSTEMNAME AS SystemName, VERSION AS Version, CONFIGJSON AS ConfigJson, STATUS AS Status FROM DBO.MDESIGNSYSTEM WHERE DESIGNSYSTEMID = @DesignSystemId AND (TENANTID = @TenantId OR TENANTID = -1)"; public const string GET_SELECT_LIST = @" SELECT DESIGNSYSTEMID AS DesignSystemId, SYSTEMCODE AS SystemCode, SYSTEMNAME AS SystemName, VERSION AS Version FROM DBO.MDESIGNSYSTEM WHERE TENANTID = @TenantId AND STATUS = 1 ORDER BY SYSTEMNAME"; public const string INSERT = @" INSERT INTO DBO.MDESIGNSYSTEM (SYSTEMCODE, SYSTEMNAME, VERSION, CONFIGJSON, STATUS, TENANTID, CREATEDBYID, MODIFIEDBYID) VALUES (@SystemCode, @SystemName, @Version, @ConfigJson, @Status, @TenantId, @CreatedById, @ModifiedById)"; public const string UPDATE = @" UPDATE DBO.MDESIGNSYSTEM SET SYSTEMNAME=@SystemName, VERSION=@Version, CONFIGJSON=@ConfigJson, STATUS=@Status, MODIFIEDBYID=@ModifiedById, MODIFIEDON=GETDATE() WHERE DESIGNSYSTEMID=@DesignSystemId AND TENANTID=@TenantId"; }