Árvore de páginas

Versões comparadas

Chave

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

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

Image Added

Gráfico
bgColor#222222
orientationvertical
subTitle.
dataOrientationvertical
borderColor#DDDDDD
height400350
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) thenTHEN 1 elseELSE 0 endEND) 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)

HTML
<center><font size="30">Número de erros que entraram:</font></center>

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 thenTHEN 1 elseELSE 0 endEND), as0) AS "Hoje",
COALESCE(SUM(CaseCASE whenWHEN castCAST(EXTRACT(WEEK FROM current_date) asAS integer) = cast(EXTRACT(WEEK FROM P.dtInicio) asAS integer) thenTHEN 1 elseELSE 0 endEND), as0) AS "Semana ",
COALESCE(SUM(CaseCASE whenWHEN EXTRACT(MONTH FROM current_date) = EXTRACT(MONTH FROM P.dtInicio) thenTHEN 1 elseELSE 0 endEND), as0) AS "Mês   ",
COUNT(*) asAS "Trimestre"
FROM esiaProcesso p
LEFT JOIN esiaCategoriaEvento c ON p.cdCategoriaevento = c.cdCategoriaEvento
WHERE date_part('year', p.dtInicio) >= 2018
andAND date_part('MONTH', EXTRACT(QUARTER FROM p.dtInicio) >= 7EXTRACT(QUARTER and FROM CURRENT_DATE)
AND c.cdCategoriaEvento = 2
andAND p.cdTipoPendencia = 1
andAND p.cdEntidade <> 526
andAND p.cdProduto inIN (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) (SELECT CAST(e.dtEvento || ' ' || e.hrEvento AS TIMESTAMP) FROM esiaEvento e WHERE e.cdEvento = (SELECT MIN(ee.cdEvento) FROM esiaEvento ee WHERE cdProcesso = p.cdProcesso))) || '").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 MINUTO<BR>";
    } else {
      lbl_minutes = minutes + " MINUTOS MINUTOS<BR>";
    };
    if (hours == 0) {
      lbl_hours = "";
    } else if (hours == 1) {
      lbl_hours = hours + " HORA HORA<BR>";
    } else {
      lbl_hours = hours + " HORAS 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"