mirror of
https://github.com/dyrkin/luxmed-bot.git
synced 2026-01-01 10:37:25 +01:00
DataRepository: Fix forcing clinicId
This commit is contained in:
@@ -45,9 +45,8 @@ class DataRepository(@Autowired em: EntityManager) {
|
||||
.createQuery(
|
||||
s"""select service from ServiceHistory service where service.recordId in
|
||||
| (select max(s.recordId) from ServiceHistory s where s.accountId = :accountId and s.cityId = :cityId
|
||||
| and s.clinicId ${clinicId
|
||||
.map(_ => "= :clinicId")
|
||||
.getOrElse("IS NULL")} group by s.name order by MAX(s.time) desc)
|
||||
| ${clinicId.map(_ => "and s.clinicId = :clinicId").getOrElse("")}
|
||||
| group by s.name order by MAX(s.time) desc)
|
||||
| order by service.time desc""".stripMargin,
|
||||
classOf[ServiceHistory]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user