Last change
on this file was e5fefbd, checked in by Anita Terziska <63020646+Nit4e@…>, 2 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1007 bytes
|
Line | |
---|
1 | package com.example.medweb.repository;
|
---|
2 |
|
---|
3 | import com.example.medweb.model.Termin;
|
---|
4 | import com.example.medweb.model.TerminId;
|
---|
5 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
6 | import org.springframework.data.jpa.repository.Query;
|
---|
7 | import org.springframework.stereotype.Component;
|
---|
8 | import org.springframework.stereotype.Repository;
|
---|
9 |
|
---|
10 | import java.time.ZonedDateTime;
|
---|
11 | import java.util.List;
|
---|
12 | import java.util.Optional;
|
---|
13 |
|
---|
14 |
|
---|
15 | @Repository
|
---|
16 | @Component("main")
|
---|
17 | public interface TerminRepository extends JpaRepository<Termin, TerminId>, TerminRepositoryCustom {
|
---|
18 |
|
---|
19 | @Query("select t from Termin t left join Rezervacija r on t.termin_id = r.termin.termin_id where t.vreme > :now and r.termin is null")
|
---|
20 | List<Termin> findFutureAndFree (ZonedDateTime now);
|
---|
21 |
|
---|
22 | @Query("select t from Termin t left join Rezervacija r on t.termin_id = r.termin.termin_id where t.vreme > :now and t.doktor_id = :doktor_id and r.termin is null")
|
---|
23 | List<Termin> findFutureAndFreeAndByDoktor (ZonedDateTime now, Integer doktor_id);
|
---|
24 |
|
---|
25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.