Skip to content

Commit

Permalink
add regras resolucao 3777/2024
Browse files Browse the repository at this point in the history
  • Loading branch information
akaBotelho committed Nov 5, 2024
1 parent adc8d47 commit 969c003
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions queries/models/dashboard_subsidio_sppo/viagens_remuneradas.sql
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,23 @@ WITH
SELECT
v.* EXCEPT(rn, datetime_partida, viagens_planejadas, viagens_planejadas_ida_volta, km_planejada, tipo_dia, consorcio, faixa_horaria_inicio, faixa_horaria_fim),
CASE
WHEN v.data >= DATE("{{ var("DATA_SUBSIDIO_V10_INICIO") }}")
AND v.tipo_dia = "Dia Útil"
AND viagens_planejadas > 5
AND pof > 110
AND rn > viagens_planejadas_ida_volta*1.1
THEN FALSE
WHEN v.data >= DATE("{{ var("DATA_SUBSIDIO_V10_INICIO") }}")
AND v.tipo_dia = "Dia Útil"
AND viagens_planejadas <= 5
AND pof > 200
AND rn > viagens_planejadas_ida_volta*2
THEN FALSE
WHEN v.data >= DATE("{{ var("DATA_SUBSIDIO_V10_INICIO") }}")
AND v.tipo_dia != "Dia Útil"
AND pof > 120
AND rn > viagens_planejadas_ida_volta*1.2
THEN FALSE
WHEN v.data >= DATE("{{ var("DATA_SUBSIDIO_V3A_INICIO") }}")
AND v.tipo_dia = "Dia Útil"
AND viagens_planejadas > 10
Expand Down

0 comments on commit 969c003

Please sign in to comment.