Skip to content

Commit

Permalink
Mofidica filtro de empenhos federais par regras de 2021 e 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersonrpn committed Aug 22, 2022
1 parent 775679b commit d234bcb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions feed/scripts/create/create_itens_historico_federais.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ CREATE TABLE IF NOT EXISTS "itens_historico_raw_federais" (
data_emissao TEXT,
quantidade NUMERIC,
valor_unitario NUMERIC,
valor_total NUMERIC,
FOREIGN KEY (id_empenho) REFERENCES empenhos_raw_federais(id)
valor_total NUMERIC
);
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ adapta_info_compras_federal <- function(empenho_df, empenhos_licitacao_df, filtr
TRUE ~ 'O'
)) %>%
left_join(empenhos_licitacao_df, by = c("codigo" = "codigo_contrato")) %>%
filter(especie %in% c("ORIGINAL", "REFORÇO")) %>%
mutate(especie1 = if_else(ano_contrato %in% c(2021, 2022), "ORIGINAL", especie)) %>%
filter(especie1 %in% c("ORIGINAL", "REFORÇO")) %>%
select(
codigo_contrato = codigo,
nr_contrato = codigo_resumido,
Expand Down
2 changes: 1 addition & 1 deletion transformer/utils/read/read_empenhos_federais.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ read_empenhos_federais_covid <- function(host, user, database, port, password) {
str_glue(
"SELECT * FROM empenhos_raw_federais ",
"WHERE codigo_acao IN ",
"('00S4', '00S5', '00S7', '00S8', '00S9', '00SF', '00SH', '21C0', '21C1', '21C2', '00SI', '21C0')",
"('00S4', '00S5', '00S7', '00S8', '00S9', '00SF', '00SH', '21C0', '21C1', '21C2', '00SI', '21C0', '8585', '00EE')",
"AND codigo_modalidade_aplicacao IN ('90')"
)
)
Expand Down

0 comments on commit d234bcb

Please sign in to comment.