WHERE (@CategoryId IS NULL OR CategoryId = @CategoryId)类似于WhereIf(!string.IsNullOrEmpty(a), A = a);
WHERE (@CategoryId IS NULL OR CategoryId = @CategoryId)