SHARE
TWEET

Untitled

a guest Jul 18th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Relatorio Registro de Atendimento */
  2. SELECT
  3.     ed.dmda_num_inscr || '/' || ed.dmda_ano AS "Número Demanda",
  4.     bs.sta_titulo AS "Status",
  5.     bp.pes_nome AS "Candidato",
  6.     b.pes_nome AS "Funcionário",
  7.     to_char(a.dmdara_dthra, 'DD/MM/YYYY HH24:MI:SS') AS "Data/Hora",
  8.     a.dmdara_qm_atendeu AS "Contato",
  9.     CASE
  10.         WHEN a.dmdara_vaga_oferecida = '0' THEN 'NÃO'
  11.         WHEN a.dmdara_vaga_oferecida = '1' THEN 'SIM'
  12.         ELSE 'N/D'
  13.         END AS "Vaga Oferecida?",
  14.     a.dmdara_obs AS "Observação"
  15. FROM edu_demanda_reg_atend a
  16.  
  17. INNER JOIN edu_demanda ed
  18.            ON ed.dmda_cod = a.dmdara_dmdacod
  19.  
  20. INNER JOIN edu_demanda_status eds
  21.            ON eds.dmdast_dmdacod = ed.dmda_cod
  22.                AND eds.dmdast_ativo = 1
  23.  
  24. INNER JOIN bas_status bs
  25.            ON bs.sta_numero = eds.dmdast_status
  26.                AND bs.sta_tipo = 'DEMANDA_STATUS'
  27.  
  28. INNER JOIN bas_pessoa b
  29.            ON b.pes_cod = a.dmdara_pescod
  30.  
  31. INNER JOIN bas_pessoa bp
  32.            ON bp.pes_cod = ed.dmda_pescod
  33.  
  34. WHERE
  35.       1 = 1
  36.   AND ed.dmda_num_inscr = :NUMERO_DEMANDA
  37.   AND ed.dmda_ano = :ANO
  38.  
  39. ORDER BY
  40.     a.dmdara_dthra;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top