Skip to content

Commit

Permalink
Ikke bruk coalesce men sorter på fra dato i oppfolgingsperiode spørring
Browse files Browse the repository at this point in the history
  • Loading branch information
tu55eladd committed Dec 20, 2024
1 parent 7b0b225 commit c348291
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package no.nav.veilarbaktivitet.oppfolging.periode

import no.nav.veilarbaktivitet.veilarbdbutil.VeilarbAktivitetSqlParameterSource
import no.nav.veilarbaktivitet.person.Person.AktorId
import no.nav.veilarbaktivitet.veilarbdbutil.VeilarbAktivitetSqlParameterSource
import org.slf4j.LoggerFactory
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
Expand Down Expand Up @@ -40,7 +40,7 @@ open class OppfolgingsperiodeDAO(val jdbc: NamedParameterJdbcTemplate) {
val params = MapSqlParameterSource()
.addValue("aktorId", aktorId.get(), Types.VARCHAR)
val sql = """
SELECT * FROM oppfolgingsperiode WHERE aktorId = :aktorId ORDER BY coalesce(til, TO_DATE('9999-12-31', 'YYYY-MM-DD')) DESC
SELECT * FROM oppfolgingsperiode WHERE aktorId = :aktorId ORDER BY fra DESC
""".trimIndent()
return jdbc.query(sql, params) {row, _ ->
Oppfolgingsperiode(
Expand Down

0 comments on commit c348291

Please sign in to comment.