Reorder room image sequences after delete
All checks were successful
build-and-deploy / build-deploy (push) Successful in 30s

This commit is contained in:
androidlover5842
2026-01-27 17:15:48 +05:30
parent 2b01ed3859
commit c369996132
2 changed files with 51 additions and 0 deletions

View File

@@ -16,6 +16,26 @@ interface RoomImageRepo : JpaRepository<RoomImage, UUID> {
"""
)
fun findByRoomIdOrdered(@Param("roomId") roomId: UUID): List<RoomImage>
@Query(
"""
select ri
from RoomImage ri
where ri.room.id = :roomId
order by ri.roomSortOrder asc, ri.createdAt desc
"""
)
fun findByRoomIdForReorder(@Param("roomId") roomId: UUID): List<RoomImage>
@Query(
"""
select ri
from RoomImage ri
where ri.roomTypeCode = :roomTypeCode
order by ri.roomTypeSortOrder asc, ri.createdAt desc
"""
)
fun findByRoomTypeCodeForReorder(@Param("roomTypeCode") roomTypeCode: String): List<RoomImage>
fun findByIdAndRoomIdAndPropertyId(id: UUID, roomId: UUID, propertyId: UUID): RoomImage?
fun existsByRoomIdAndContentHash(roomId: UUID, contentHash: String): Boolean