Skip to content

Instantly share code, notes, and snippets.

@jonathanalves
Created May 22, 2020 18:36
Show Gist options
  • Save jonathanalves/982244f136dceb292346e7aa4dcbc1a0 to your computer and use it in GitHub Desktop.
Save jonathanalves/982244f136dceb292346e7aa4dcbc1a0 to your computer and use it in GitHub Desktop.
create table migracao.atos_utilizados (
cartorio varchar,
protocolo_pedido varchar,
pessoa_ato varchar,
data_utilizacao varchar,
retornado varchar,
tipo_ato varchar,
nome_serventuario varchar,
inutilizado varchar,
justificativa_inutilizacao varchar,
codigo_selo varchar,
codigo_ato varchar,
emolumento numeric,
fundesp numeric,
taxa_judiciaria numeric,
id_ato_isentado varchar,
protocolo_protesto varchar,
protocolo_imovel varchar,
ip varchar
)
@jonathanalves
Copy link
Author

jonathanalves commented May 22, 2020

SELECT
cast(p.codigo as text) protocolo, p.cadastro, s.utilizacao, tipo_ato, a.codigo_ato selo, a.emolumento tj_emolumento, s.emolumentos
FROM migracao.atos_utilizados a
join selo s on s.codigo = a.codigo_ato
join protocolo p on p.id = s.protocolo_id
where s.emolumentos != a.emolumento
order by p.codigo asc

@jonathanalves
Copy link
Author

SELECT
cast(p.codigo as text) protocolo, p.cadastro, s.utilizacao, tipo_ato, a.codigo_ato selo, a.emolumento tj_emolumento, s.emolumentos
FROM selo_retorno_tj_go a
join selo s on s.codigo = a.codigo_ato
join protocolo p on p.id = s.protocolo_id
where s.envio between '2020-06-21 00:00:00' and '2020-06-30 23:59:59'
and s.emolumentos != a.emolumento
order by p.codigo asc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment