Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RONALDO RODRIGUES DE OLIVEIRA
/
simec-scripts-banco
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a4243ceb
authored
Apr 22, 2025
by
RONALDO RODRIGUES DE OLIVEIRA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Function verifica ciência/notificacao gestor
parent
1e5224e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
declaracao_omissao/2.1-function-par-get_gestor_ciencia_par.sql
declaracao_omissao/2.1-function-par-get_gestor_ciencia_par.sql
0 → 100644
View file @
a4243ceb
-- DROP FUNCTION IF EXISTS par.get_gestor_ciencia_par(VARCHAR, VARCHAR, INT, INT)
CREATE
OR
REPLACE
FUNCTION
par
.
get_gestor_ciencia_par
(
i_responsavel_cpf
VARCHAR
,
i_processo
VARCHAR
,
i_dopid
INT
,
i_prp_id
INT
)
RETURNS
TABLE
(
usucpf
VARCHAR
)
AS
$$
BEGIN
RETURN
QUERY
SELECT
np
.
npresptermocpf
AS
usucpf
FROM
par
.
notificacao_postal
np
WHERE
np
.
npstatus
=
'A'
AND
np
.
npcienc_dt_receb
IS
NOT
NULL
AND
np
.
npresptermocpf
=
i_responsavel_cpf
AND
np
.
processo
=
i_processo
union
all
select
usu
.
usucpf
from
par
.
exgestor
eg
inner
join
par
.
notificacaoexgestor
neg
on
neg
.
egid
=
eg
.
egid
inner
join
seguranca
.
usuario
usu
on
usu
.
usucpf
=
eg
.
usucpf
where
eg
.
dopid
=
i_dopid
and
neg
.
negdtaceiterealizado
is
not
null
and
eg
.
egstatus
=
'A'
and
neg
.
negstatus
=
'A'
UNION
ALL
SELECT
opc
.
opccpfciencia
AS
usucpf
FROM
par
.
omissaopcente
opc
WHERE
opc
.
opcciencia
=
'true'
AND
opc
.
opcstatus
=
'A'
AND
opc
.
opccpfciencia
=
i_responsavel_cpf
AND
opc
.
prpid
=
i_prp_id
;
END
;
$$
LANGUAGE
plpgsql
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment