Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.
HTML
<center><img src="http://confluence.agriness.com/download/attachments/64131649/laco_azul.png" width=50px><font size="5000">CONTROLE DE ERROS ABERTOS</font></center>
Gráfico
bgColor#222222
orientationvertical
dataOrientationhorizontal
borderColor#DDDDDD
height380
colors#3d1606,#273304,#ffe400,#cc50cd,#458ac9
legendfalse
width1200
showShapesfalse
typeline

Excerpt
SQL
dataSourceSIA
   SELECT CAST('Meta' AS VARCHAR(15)) AS "Período",
          0 AS "0",
          15 AS "1",
          30 AS "2",
          45 AS "3",
          60 AS "4",
          75 AS "5",
          90 AS "6",
          105 AS "7",
          120 AS "8",
          135 AS "9",
          150 AS "10",
          165 AS "11",
          180 AS "12",
          195 AS "13"
UNION
   SELECT CAST('1º trimestre' AS VARCHAR(15)) AS "Período",
          0 AS "0",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) = 1 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 1 THEN 1 ELSE 0 END), 0) AS "1",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 2 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 2 THEN 1 ELSE 0 END), 0) AS "2",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 3 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 3 THEN 1 ELSE 0 END), 0) AS "3",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 4 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 4 THEN 1 ELSE 0 END), 0) AS "4",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 5 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 5 THEN 1 ELSE 0 END), 0) AS "5",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 6 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 6 THEN 1 ELSE 0 END), 0) AS "6",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 7 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 7 THEN 1 ELSE 0 END), 0) AS "7",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 8 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 8 THEN 1 ELSE 0 END), 0) AS "8",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 9 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 9 THEN 1 ELSE 0 END), 0) AS "9",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 10 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 10 THEN 1 ELSE 0 END), 0) AS "10",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 11 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 11 THEN 1 ELSE 0 END), 0) AS "11",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 12 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 12 THEN 1 ELSE 0 END), 0) AS "12",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 13 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 13 THEN 1 ELSE 0 END), 0) AS "13"
     FROM esiaprocesso p
LEFT JOIN esiaCategoriaEvento c ON p.cdCategoriaevento = c.cdCategoriaEvento
    WHERE date_part('year', p.dtInicio) = 2018
          AND CAST(EXTRACT(QUARTER FROM P.dtInicio) AS INTEGER) = 1
          AND c.cdCategoriaEvento = 2
          AND p.cdTipoPendencia = 1
          AND p.cdEntidade <> 526
          AND p.cdProduto in (3,10,12,4,8,16,21)
UNION
   SELECT CAST('2º trimestre' AS VARCHAR(15)) AS "Período",
          0 AS "0",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) = 14 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 14 THEN 1 ELSE 0 END), 0) AS "1",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 15 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 15 THEN 1 ELSE 0 END), 0) AS "2",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 16 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 16 THEN 1 ELSE 0 END), 0) AS "3",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 17 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 17 THEN 1 ELSE 0 END), 0) AS "4",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 18 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 18 THEN 1 ELSE 0 END), 0) AS "5",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 19 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 19 THEN 1 ELSE 0 END), 0) AS "6",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 20 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 20 THEN 1 ELSE 0 END), 0) AS "7",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 21 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 21 THEN 1 ELSE 0 END), 0) AS "8",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 22 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 22 THEN 1 ELSE 0 END), 0) AS "9",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 23 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 23 THEN 1 ELSE 0 END), 0) AS "10",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 24 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 24 THEN 1 ELSE 0 END), 0) AS "11",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 25 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 25 THEN 1 ELSE 0 END), 0) AS "12",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 26 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 26 THEN 1 ELSE 0 END), 0) AS "13"
     FROM esiaprocesso p
LEFT JOIN esiaCategoriaEvento c ON p.cdCategoriaevento = c.cdCategoriaEvento
    WHERE date_part('year', p.dtInicio) = 2018
          AND CAST(EXTRACT(QUARTER FROM P.dtInicio) AS INTEGER) = 2
          AND c.cdCategoriaEvento = 2
          AND p.cdTipoPendencia = 1
          AND p.cdEntidade <> 526
          AND p.cdProduto in (3,10,12,4,8,16,21)
UNION
   SELECT CAST('3º trimestre' AS VARCHAR(15)) AS "Período",
          0 AS "0",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) = 27 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 27 THEN 1 ELSE 0 END), 0) AS "1",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 28 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 28 THEN 1 ELSE 0 END), 0) AS "2",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 29 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 29 THEN 1 ELSE 0 END), 0) AS "3",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 30 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 30 THEN 1 ELSE 0 END), 0) AS "4",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 31 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 31 THEN 1 ELSE 0 END), 0) AS "5",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 32 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 32 THEN 1 ELSE 0 END), 0) AS "6",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 33 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 33 THEN 1 ELSE 0 END), 0) AS "7",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 34 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 34 THEN 1 ELSE 0 END), 0) AS "8",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 35 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 35 THEN 1 ELSE 0 END), 0) AS "9",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 36 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 36 THEN 1 ELSE 0 END), 0) AS "10",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 37 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 37 THEN 1 ELSE 0 END), 0) AS "11",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 38 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 38 THEN 1 ELSE 0 END), 0) AS "12",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 39 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 39 THEN 1 ELSE 0 END), 0) AS "13"
     FROM esiaprocesso p
LEFT JOIN esiaCategoriaEvento c ON p.cdCategoriaevento = c.cdCategoriaEvento
    WHERE date_part('year', p.dtInicio) = 2018
          AND CAST(EXTRACT(QUARTER FROM P.dtInicio) AS INTEGER) = 3
          AND c.cdCategoriaEvento = 2
          AND p.cdTipoPendencia = 1
          AND p.cdEntidade <> 526
          AND p.cdProduto in (3,10,12,4,8,16,21)
UNION
   SELECT CAST('4º trimestre' AS VARCHAR(15)) AS "Período",
          0 AS "0",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) = 40 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 40 THEN 1 ELSE 0 END), 0) AS "1",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 41 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 41 THEN 1 ELSE 0 END), 0) AS "2",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 42 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 42 THEN 1 ELSE 0 END), 0) AS "3",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 43 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 43 THEN 1 ELSE 0 END), 0) AS "4",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 44 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 44 THEN 1 ELSE 0 END), 0) AS "5",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 45 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 45 THEN 1 ELSE 0 END), 0) AS "6",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 46 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 46 THEN 1 ELSE 0 END), 0) AS "7",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 47 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 47 THEN 1 ELSE 0 END), 0) AS "8",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 48 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 48 THEN 1 ELSE 0 END), 0) AS "9",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 49 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 49 THEN 1 ELSE 0 END), 0) AS "10",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 50 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 50 THEN 1 ELSE 0 END), 0) AS "11",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 51 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 51 THEN 1 ELSE 0 END), 0) AS "12",
          NULLIF(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM P.dtInicio) AS INTEGER) <= 52 AND CAST(EXTRACT(WEEK FROM CURRENT_DATE) AS INTEGER) >= 52 THEN 1 ELSE 0 END), 0) AS "13"
     FROM esiaprocesso p
LEFT JOIN esiaCategoriaEvento c ON p.cdCategoriaevento = c.cdCategoriaEvento
    WHERE date_part('year', p.dtInicio) = 2018
          AND CAST(EXTRACT(QUARTER FROM P.dtInicio) AS INTEGER) = 4
          AND c.cdCategoriaEvento = 2
          AND p.cdTipoPendencia = 1
          AND p.cdEntidade <> 526
          AND p.cdProduto in (3,10,12,4,8,16,21)
 ORDER BY 1

 

Gráfico
bgColor#222222
orientationvertical
subTitle.
dataOrientationvertical
borderColor#DDDDDD
height350
legendfalse
width1200
typeline

Excerpt
SQL
dataSourceSIA
   SELECT (ARRAY['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez']) [date_part('MONTH', p.dtInicio)],
          SUM(Case when EXTRACT(MONTH FROM p.dtInicio) = EXTRACT(MONTH FROM P.dtInicio) THEN 1 ELSE 0 END) AS "Quantidade"
     FROM esiaprocesso p
LEFT JOIN esiaCategoriaEvento c ON p.cdCategoriaevento = c.cdCategoriaEvento
    WHERE date_part('year', p.dtInicio) = 2018
          AND c.cdCategoriaEvento = 2
          AND p.cdTipoPendencia = 1
          AND p.cdEntidade <> 526
          AND p.cdProduto in (3,10,12,4,8,16,21)
 GROUP BY date_part('MONTH', p.dtInicio)
 ORDER BY date_part('MONTH', p.dtInicio)

SQL
dataSourceSIA
stylebackground-color:black;color:yellow; font-weight:bold;font-size:3.8em;
rowOrientationhorizontal
retainRowStyleOrderfalse
SELECT
COALESCE(SUM(CASE WHEN current_date = P.dtInicio THEN 1 ELSE 0 END), 0) AS "Hoje",
COALESCE(SUM(CASE WHEN CAST(EXTRACT(WEEK FROM current_date) AS integer) = cast(EXTRACT(WEEK FROM P.dtInicio) AS integer) THEN 1 ELSE 0 END), 0) AS "Semana",
COALESCE(SUM(CASE WHEN EXTRACT(MONTH FROM current_date) = EXTRACT(MONTH FROM P.dtInicio) THEN 1 ELSE 0 END), 0) AS "Mês",
COUNT(*) AS "Trimestre"
FROM esiaProcesso p
LEFT JOIN esiaCategoriaEvento c ON p.cdCategoriaevento = c.cdCategoriaEvento
WHERE date_part('year', p.dtInicio) >= 2018
AND EXTRACT(QUARTER FROM p.dtInicio) >= EXTRACT(QUARTER FROM CURRENT_DATE)
AND c.cdCategoriaEvento = 2
AND p.cdTipoPendencia = 1
AND p.cdEntidade <> 526
AND p.cdProduto IN (3,10,12,4,8,16,21)
 

 

SQL
dataSourceSIA
stylebackground-color:#4f7b4b;color:white;font-weight:bold;font-size:3.0em;border-color:#6f9b6b
enableHeadingAttributesfalse
enableHighlightingfalse
enableSortingfalse
border5
outputwiki
heading0
SELECT '{html}<CENTER>ESTAMOS HÁ</CENTER>{html}' AS "Texto"
UNION ALL
SELECT 
'{html}<center><p id="demo" style="font-size: 36px; color:white; background-color:#4f7b4b;"></p>
<script>
var countDownDate = new Date("' || MAX(created) || '").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
    // Get todays date and time
    var now = new Date().getTime();
    
    // Find the distance between now an the count down date
    var distance = now - countDownDate;
    
    // Time calculations for days, hours, minutes and seconds
    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
    var lbl_days;
    var lbl_hours;
    var lbl_minutes;
    var lbl_seconds;
    if (seconds <= 1) {
      lbl_seconds = seconds + " SEGUNDO ";
    } else {
      lbl_seconds = seconds + " SEGUNDOS ";
    };
    if (minutes == 0) {
      lbl_minutes = "";
    } else if (minutes == 1) {
      lbl_minutes = minutes + " MINUTO<BR>";
    } else {
      lbl_minutes = minutes + " MINUTOS<BR>";
    };
    if (hours == 0) {
      lbl_hours = "";
    } else if (hours == 1) {
      lbl_hours = hours + " HORA<BR>";
    } else {
      lbl_hours = hours + " HORAS<BR>";
    };
    
    if (days == 0) {
      lbl_days = "";
    } else if (days == 1) {
      lbl_days = days + " DIA ";
    } else {
      lbl_days = days + " DIAS ";
    };
    document.getElementById("demo").innerHTML = lbl_days + lbl_hours + lbl_minutes + lbl_seconds;
}, 1000);
</script></center>{html}' AS "Texto"
FROM esiaProcesso p
LEFT JOIN esiaCategoriaEvento c ON p.cdCategoriaevento = c.cdCategoriaEvento
WHERE date_part('year', p.dtInicio) = 2018
AND c.cdCategoriaEvento = 2 
AND p.cdTipoPendencia = 1 
AND p.cdEntidade <> 526 
AND p.cdProduto in (3,10,12,4,8,16,21)
UNION ALL
SELECT '{html}<CENTER>SEM ERROS</CENTER>{html}' AS "Texto"