added booking_start comparison
This commit is contained in:
parent
1ff307b9ed
commit
66f50a6fe9
@ -22,7 +22,7 @@ apply plugin: 'java'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
group = 'de.jottyfan'
|
||||
version = '2024.03.16b'
|
||||
version = '2024.03.16c'
|
||||
|
||||
description = """COJooq"""
|
||||
|
||||
|
@ -148,6 +148,11 @@ public class VCamp extends TableImpl<VCampRecord> {
|
||||
*/
|
||||
public final TableField<VCampRecord, LocalDateTime> START_BOOKING = createField(DSL.name("start_booking"), SQLDataType.LOCALDATETIME(6), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.v_camp.booking_has_started</code>.
|
||||
*/
|
||||
public final TableField<VCampRecord, Boolean> BOOKING_HAS_STARTED = createField(DSL.name("booking_has_started"), SQLDataType.BOOLEAN, this, "");
|
||||
|
||||
private VCamp(Name alias, Table<VCampRecord> aliased) {
|
||||
this(alias, aliased, (Field<?>[]) null, null);
|
||||
}
|
||||
@ -186,7 +191,8 @@ public class VCamp extends TableImpl<VCampRecord> {
|
||||
c.blocked_beds_male,
|
||||
COALESCE(male.used, (0)::bigint) AS used_beds_male,
|
||||
COALESCE(female.used, (0)::bigint) AS used_beds_female,
|
||||
c.start_booking
|
||||
c.start_booking,
|
||||
(c.start_booking < now()) AS booking_has_started
|
||||
FROM (((t_camp c
|
||||
LEFT JOIN t_location l ON ((c.fk_location = l.pk)))
|
||||
LEFT JOIN male ON ((male.fk_camp = c.pk)))
|
||||
|
@ -36,6 +36,7 @@ public class VCamp implements Serializable {
|
||||
private final Long usedBedsMale;
|
||||
private final Long usedBedsFemale;
|
||||
private final LocalDateTime startBooking;
|
||||
private final Boolean bookingHasStarted;
|
||||
|
||||
public VCamp(VCamp value) {
|
||||
this.pk = value.pk;
|
||||
@ -58,6 +59,7 @@ public class VCamp implements Serializable {
|
||||
this.usedBedsMale = value.usedBedsMale;
|
||||
this.usedBedsFemale = value.usedBedsFemale;
|
||||
this.startBooking = value.startBooking;
|
||||
this.bookingHasStarted = value.bookingHasStarted;
|
||||
}
|
||||
|
||||
public VCamp(
|
||||
@ -80,7 +82,8 @@ public class VCamp implements Serializable {
|
||||
Integer blockedBedsMale,
|
||||
Long usedBedsMale,
|
||||
Long usedBedsFemale,
|
||||
LocalDateTime startBooking
|
||||
LocalDateTime startBooking,
|
||||
Boolean bookingHasStarted
|
||||
) {
|
||||
this.pk = pk;
|
||||
this.isOver = isOver;
|
||||
@ -102,6 +105,7 @@ public class VCamp implements Serializable {
|
||||
this.usedBedsMale = usedBedsMale;
|
||||
this.usedBedsFemale = usedBedsFemale;
|
||||
this.startBooking = startBooking;
|
||||
this.bookingHasStarted = bookingHasStarted;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -244,6 +248,13 @@ public class VCamp implements Serializable {
|
||||
return this.startBooking;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.v_camp.booking_has_started</code>.
|
||||
*/
|
||||
public Boolean getBookingHasStarted() {
|
||||
return this.bookingHasStarted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
@ -373,6 +384,12 @@ public class VCamp implements Serializable {
|
||||
}
|
||||
else if (!this.startBooking.equals(other.startBooking))
|
||||
return false;
|
||||
if (this.bookingHasStarted == null) {
|
||||
if (other.bookingHasStarted != null)
|
||||
return false;
|
||||
}
|
||||
else if (!this.bookingHasStarted.equals(other.bookingHasStarted))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -400,6 +417,7 @@ public class VCamp implements Serializable {
|
||||
result = prime * result + ((this.usedBedsMale == null) ? 0 : this.usedBedsMale.hashCode());
|
||||
result = prime * result + ((this.usedBedsFemale == null) ? 0 : this.usedBedsFemale.hashCode());
|
||||
result = prime * result + ((this.startBooking == null) ? 0 : this.startBooking.hashCode());
|
||||
result = prime * result + ((this.bookingHasStarted == null) ? 0 : this.bookingHasStarted.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -427,6 +445,7 @@ public class VCamp implements Serializable {
|
||||
sb.append(", ").append(usedBedsMale);
|
||||
sb.append(", ").append(usedBedsFemale);
|
||||
sb.append(", ").append(startBooking);
|
||||
sb.append(", ").append(bookingHasStarted);
|
||||
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
|
@ -319,6 +319,21 @@ public class VCampRecord extends TableRecordImpl<VCampRecord> {
|
||||
return (LocalDateTime) get(19);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.v_camp.booking_has_started</code>.
|
||||
*/
|
||||
public VCampRecord setBookingHasStarted(Boolean value) {
|
||||
set(20, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.v_camp.booking_has_started</code>.
|
||||
*/
|
||||
public Boolean getBookingHasStarted() {
|
||||
return (Boolean) get(20);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -------------------------------------------------------------------------
|
||||
@ -333,7 +348,7 @@ public class VCampRecord extends TableRecordImpl<VCampRecord> {
|
||||
/**
|
||||
* Create a detached, initialised VCampRecord
|
||||
*/
|
||||
public VCampRecord(Integer pk, Boolean isOver, String name, LocalDateTime arrive, LocalDateTime depart, Double year, String locationName, Integer minAge, Integer maxAge, String url, String price, String countries, Integer fkDocument, Integer bedsFemale, Integer bedsMale, Integer blockedBedsFemale, Integer blockedBedsMale, Long usedBedsMale, Long usedBedsFemale, LocalDateTime startBooking) {
|
||||
public VCampRecord(Integer pk, Boolean isOver, String name, LocalDateTime arrive, LocalDateTime depart, Double year, String locationName, Integer minAge, Integer maxAge, String url, String price, String countries, Integer fkDocument, Integer bedsFemale, Integer bedsMale, Integer blockedBedsFemale, Integer blockedBedsMale, Long usedBedsMale, Long usedBedsFemale, LocalDateTime startBooking, Boolean bookingHasStarted) {
|
||||
super(VCamp.V_CAMP);
|
||||
|
||||
setPk(pk);
|
||||
@ -356,6 +371,7 @@ public class VCampRecord extends TableRecordImpl<VCampRecord> {
|
||||
setUsedBedsMale(usedBedsMale);
|
||||
setUsedBedsFemale(usedBedsFemale);
|
||||
setStartBooking(startBooking);
|
||||
setBookingHasStarted(bookingHasStarted);
|
||||
resetChangedOnNotNull();
|
||||
}
|
||||
|
||||
@ -386,6 +402,7 @@ public class VCampRecord extends TableRecordImpl<VCampRecord> {
|
||||
setUsedBedsMale(value.getUsedBedsMale());
|
||||
setUsedBedsFemale(value.getUsedBedsFemale());
|
||||
setStartBooking(value.getStartBooking());
|
||||
setBookingHasStarted(value.getBookingHasStarted());
|
||||
resetChangedOnNotNull();
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,8 @@ with female(used, fk_camp) as (
|
||||
c.blocked_beds_male,
|
||||
coalesce(male.used, 0) as used_beds_male,
|
||||
coalesce(female.used, 0) as used_beds_female,
|
||||
c.start_booking
|
||||
c.start_booking,
|
||||
(c.start_booking < now()) as booking_has_started
|
||||
from public.t_camp c
|
||||
left join public.t_location l on c.fk_location = l.pk
|
||||
left join male on male.fk_camp = c.pk
|
||||
|
Loading…
x
Reference in New Issue
Block a user