From 521eaa583d34416c6f580bc37053ade415e4c84e Mon Sep 17 00:00:00 2001 From: Jottyfan Date: Sat, 10 Dec 2022 20:54:12 +0100 Subject: [PATCH] reorder dashboard bookings by its date --- build.gradle | 2 +- .../jottyfan/camporganizer/module/common/IndexGateway.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 223dbc2..ba3c58e 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'war' apply plugin: 'application' group = 'de.jottyfan.camporganizer' -version = '0.1.6' +version = '0.1.7' sourceCompatibility = 17 mainClassName = "de.jottyfan.camporganizer.Main" diff --git a/src/main/java/de/jottyfan/camporganizer/module/common/IndexGateway.java b/src/main/java/de/jottyfan/camporganizer/module/common/IndexGateway.java index f35052c..046e056 100644 --- a/src/main/java/de/jottyfan/camporganizer/module/common/IndexGateway.java +++ b/src/main/java/de/jottyfan/camporganizer/module/common/IndexGateway.java @@ -14,8 +14,8 @@ import org.apache.logging.log4j.Logger; import org.jooq.Condition; import org.jooq.DSLContext; import org.jooq.Record; -import org.jooq.SelectConditionStep; import org.jooq.SelectSeekStep1; +import org.jooq.SelectSeekStep2; import org.jooq.UpdateConditionStep; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; @@ -46,7 +46,7 @@ public class IndexGateway { public List getAllBookings(String username) { TProfile REGISTRATOR = TProfile.T_PROFILE.as("registrator"); - SelectConditionStep sql = jooq + SelectSeekStep2 sql = jooq // @formatter:off .select(T_PERSON.PK, T_PERSON.FORENAME, @@ -81,7 +81,8 @@ public class IndexGateway { .leftJoin(REGISTRATOR).on(REGISTRATOR.PK.eq(T_PERSON.FK_REGISTRATOR)) .leftJoin(V_CAMP).on(V_CAMP.PK.eq(T_PERSON.FK_CAMP)) .where(T_PROFILE.USERNAME.eq(username)) - .and(T_PERSON.PK.isNotNull()); + .and(T_PERSON.PK.isNotNull()) + .orderBy(V_CAMP.ARRIVE, T_PERSON.CREATED); // @formatter:on LOGGER.debug(sql.toString()); List list = new ArrayList<>();