Skip to content

Commit

Permalink
Retter SQL-syntaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
stiangre committed Dec 1, 2023
1 parent fd680f9 commit 83333a7
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ abstract class LøpendeDurationTransientFeltutleder(
)
WHERE ov.oppgave_id = o.id
AND $minstEtDurationFeltSql
)
), INTERVAL '0 days')
+
COALESCE((
Expand All @@ -58,18 +57,17 @@ abstract class LøpendeDurationTransientFeltutleder(
WHERE ov.oppgave_id = o.id
AND ov.verdi = 'true'
AND $løpendetidfelterSql
)
)
), INTERVAL '0 days')
)
""".trimIndent()

return SqlMedParams(query, mutableMapOf("now" to now))
return SqlMedParams(query, mapOf("now" to now))
}

private fun sqlVelgFelt(felter: List<OmrådeOgKode>): String {
return "(" + felter.map {
"fo.ekstern_id = ${it.område} AND fd.ekstern_id = ${it.kode}"
"fo.ekstern_id = '${it.område}' AND fd.ekstern_id = '${it.kode}'"
}.reduce { ok1, ok2 ->
"$ok1 OR $ok2"
} + ")"
Expand All @@ -92,7 +90,6 @@ abstract class LøpendeDurationTransientFeltutleder(
} catch (e: Exception) { null }

val params = mapOf("inputVerdi" to inputVerdi)

return SqlMedParams(query, (sumLøpendeDuration.queryParams + params))
}

Expand Down

0 comments on commit 83333a7

Please sign in to comment.