Убрал добавление groupBy по полям сортировки

This commit is contained in:
Struchkov Mark 2023-05-23 16:02:12 +03:00
parent 117b575d58
commit 44e8dc5253
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6

View File

@ -14,7 +14,6 @@ import org.jooq.DSLContext;
import org.jooq.Query;
import org.jooq.conf.ParamType;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
@ -30,7 +29,7 @@ public class QuarkusFilter<ID> {
private final PgPool pgPool;
private final CriteriaJooqFilter jooqFilter;
private PageableOffset offset;
private final List<String> sortFieldNames = new ArrayList<>();
// private final List<String> sortFieldNames = new ArrayList<>();
private QuarkusFilter(PgPool pgPool, String table, DSLContext dslContext) {
dslContext.settings().withParamType(ParamType.NAMED_OR_INLINED);
@ -83,7 +82,7 @@ public class QuarkusFilter<ID> {
public QuarkusFilter<ID> sort(SortContainer container) {
if (container != null && container.getFieldName() != null) {
jooqFilter.sort(container);
sortFieldNames.add(container.getFieldName());
// sortFieldNames.add(container.getFieldName());
}
return this;
}
@ -91,7 +90,7 @@ public class QuarkusFilter<ID> {
public QuarkusFilter<ID> sort(String field, SortType sortType) {
if (field != null) {
jooqFilter.sort(field, sortType);
sortFieldNames.add(field);
// sortFieldNames.add(field);
}
return this;
}
@ -99,7 +98,7 @@ public class QuarkusFilter<ID> {
public QuarkusFilter<ID> sort(String field) {
if (field != null) {
jooqFilter.sort(field);
sortFieldNames.add(field);
// sortFieldNames.add(field);
}
return this;
}
@ -136,7 +135,7 @@ public class QuarkusFilter<ID> {
public Uni<FilterResult<ID>> filterResult(Class<ID> idType, String idField) {
jooqFilter.groupBy(tableName + "." + idField);
jooqFilter.groupBy(sortFieldNames);
// jooqFilter.groupBy(sortFieldNames);
distinctCount = true;
final Uni<Long> count = count();
final Uni<List<ID>> content = build(idType, idField);