Skip to content

Commit

Permalink
Update query
Browse files Browse the repository at this point in the history
  • Loading branch information
AudunSorheim committed Oct 24, 2023
1 parent e057c23 commit 99c38b2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/kotlin/no/nav/syfo/persistence/AktivitetskravDAO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ class AktivitetskravDAO(val namedParameterJdbcTemplate: NamedParameterJdbcTempla

fun getAktivitetsplikt(fnr: String): Aktivitetsplikt? {
val query = """
SELECT vurdering.status, vurdering.arsaker, vurdering.sist_vurdert, vurdering.frist, varsel.journalpost_id
SELECT vurdering.status, vurdering.arsaker, vurdering.sist_vurdert, vurdering.frist, varsel.journalpost_id
FROM aktivitetskrav_vurdering vurdering
LEFT JOIN aktivitetskrav_varsel varsel ON vurdering.person_ident = varsel.person_ident
WHERE varsel.person_ident = :person_ident
AND varsel.aktivitetskrav_uuid = vurdering.vurdering_uuid
LEFT JOIN aktivitetskrav_varsel varsel ON vurdering.siste_vurdering_uuid = varsel.vurdering_uuid
WHERE vurdering.person_ident = :person_ident
ORDER BY vurdering.created_at desc, vurdering.sist_vurdert desc NULLS LAST
LIMIT 1;
""".trimIndent()
Expand Down

0 comments on commit 99c38b2

Please sign in to comment.