more codes
This commit is contained in:
@@ -14,4 +14,17 @@ interface RoomStayRepo : JpaRepository<RoomStay, UUID> {
|
||||
and rs.toAt is null
|
||||
""")
|
||||
fun findOccupiedRoomIds(@Param("propertyId") propertyId: UUID): List<UUID>
|
||||
|
||||
@Query("""
|
||||
select distinct rs.room.id
|
||||
from RoomStay rs
|
||||
where rs.property.id = :propertyId
|
||||
and rs.fromAt < :toAt
|
||||
and (rs.toAt is null or rs.toAt > :fromAt)
|
||||
""")
|
||||
fun findOccupiedRoomIdsBetween(
|
||||
@Param("propertyId") propertyId: UUID,
|
||||
@Param("fromAt") fromAt: java.time.OffsetDateTime,
|
||||
@Param("toAt") toAt: java.time.OffsetDateTime
|
||||
): List<UUID>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user