Interface ShiftRepository
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Shift,Long>,org.springframework.data.jpa.repository.JpaRepository<Shift,Long>,org.springframework.data.repository.PagingAndSortingRepository<Shift,Long>,org.springframework.data.repository.query.QueryByExampleExecutor<Shift>,org.springframework.data.repository.Repository<Shift,Long>
@Repository public interface ShiftRepository extends org.springframework.data.jpa.repository.JpaRepository<Shift,Long>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteForTenant(Integer tenantId)List<Shift>filterWithEmployees(Integer tenantId, Set<Employee> employeeSet, OffsetDateTime startDateTime, OffsetDateTime endDateTime)List<Shift>filterWithSpots(Integer tenantId, Set<Spot> spotSet, OffsetDateTime startDateTime, OffsetDateTime endDateTime)List<Shift>findAllByTenantId(Integer tenantId)List<Shift>findAllByTenantIdBetweenDates(Integer tenantId, OffsetDateTime startDateTime, OffsetDateTime endDateTime)-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush
-
-
-
-
Method Detail
-
findAllByTenantId
@Query("select distinct sa from Shift sa left join fetch sa.spot s left join fetch sa.rotationEmployee re left join fetch sa.originalEmployee oe left join fetch sa.employee e where sa.tenantId = :tenantId order by sa.startDateTime, s.name, e.name") List<Shift> findAllByTenantId(@Param("tenantId") Integer tenantId)
-
findAllByTenantIdBetweenDates
@Query("select distinct sa from Shift sa left join fetch sa.spot s left join fetch sa.rotationEmployee re left join fetch sa.originalEmployee oe left join fetch sa.employee e where sa.tenantId = :tenantId and sa.endDateTime >= :startDateTime and sa.startDateTime < :endDateTime order by sa.startDateTime, s.name, e.name") List<Shift> findAllByTenantIdBetweenDates(@Param("tenantId") Integer tenantId, @Param("startDateTime") OffsetDateTime startDateTime, @Param("endDateTime") OffsetDateTime endDateTime)
-
deleteForTenant
@Modifying(flushAutomatically=true, clearAutomatically=true) @Query("delete from Shift s where s.tenantId = :tenantId") void deleteForTenant(@Param("tenantId") Integer tenantId)
-
filterWithSpots
@Query("select distinct sa from Shift sa left join fetch sa.spot s left join fetch sa.rotationEmployee re left join fetch sa.originalEmployee oe left join fetch sa.employee e where sa.tenantId = :tenantId and sa.spot IN :spotSet and sa.endDateTime >= :startDateTime and sa.startDateTime < :endDateTime order by sa.startDateTime, s.name, e.name") List<Shift> filterWithSpots(@Param("tenantId") Integer tenantId, @Param("spotSet") Set<Spot> spotSet, @Param("startDateTime") OffsetDateTime startDateTime, @Param("endDateTime") OffsetDateTime endDateTime)
-
filterWithEmployees
@Query("select distinct sa from Shift sa left join fetch sa.spot s left join fetch sa.rotationEmployee re left join fetch sa.originalEmployee oe left join fetch sa.employee e where sa.tenantId = :tenantId and sa.employee IN :employeeSet and sa.endDateTime >= :startDateTime and sa.startDateTime < :endDateTime order by sa.startDateTime, s.name, e.name") List<Shift> filterWithEmployees(@Param("tenantId") Integer tenantId, @Param("employeeSet") Set<Employee> employeeSet, @Param("startDateTime") OffsetDateTime startDateTime, @Param("endDateTime") OffsetDateTime endDateTime)
-
-