Skip to content

Commit

Permalink
Fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
tu55eladd committed Dec 20, 2024
1 parent 01dca38 commit 325214b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ private static SkalSendes mapRow(ResultSet rs, int rowNum) {
}

public List<SkalSendes> hentVarselSomSkalSendes(int maxAntall) {
List<String> oppgavetyper = VarselType.varslerForBrukernotifikasjonstype(BrukernotifikasjonsType.OPPGAVE).stream().map(VarselType::name).toList();

SqlParameterSource parameterSource = new MapSqlParameterSource()
.addValue("oppgavetyper", oppgavetyper)
.addValue("limit", maxAntall);

return jdbcTemplate
Expand All @@ -67,10 +69,10 @@ and not exists(
inner join AKTIVITET_BRUKERNOTIFIKASJON AB on A.AKTIVITET_ID = AB.AKTIVITET_ID
where AB.BRUKERNOTIFIKASJON_ID = B.ID
and A.GJELDENDE = 1
and B.TYPE = 'OPPGAVE'
and TYPE in ('STILLING_FRA_NAV', 'FORHAANDSORENTERING')
and (A.HISTORISK_DATO is not null or A.LIVSLOPSTATUS_KODE in('FULLFORT', 'AVBRUTT'))
)
fetch first :limit rows only
limit :limit
""",
parameterSource, rowMapper);
}
Expand Down

0 comments on commit 325214b

Please sign in to comment.