package no.dusken.barweb.plugin.vaktplugin.service; import no.dusken.barweb.model.BarPerson; import no.dusken.barweb.plugin.vaktplugin.model.Vakt; import no.dusken.common.model.Person; import no.dusken.common.service.GenericService; import org.springframework.data.domain.Sort; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import java.util.Date; import java.util.List; /** * @author Marvin B. Lillehaug <lillehau@underdusken.no> */ public interface VaktService extends GenericService<Vakt> { public List<Vakt> getByAttendandAndTimeAfterOrderByTimeAsc(Person p, Date date); public List<Vakt> getByTimeBetween(Date from, Date to, Sort sort); @Query("select v from Vakt v where v.attendand is null or v.secondAttendand is null and v.time > :time order by v.time ASC") public List<Vakt> getByAttendandIsNullOrSecondAttendandIsNullAndTimeAfter(@Param("time") Date time); }