Commit 3597c7dea9b380e17a522793c58be35bdbec6068
1 parent
3963c340
Exists in
master
and in
1 other branch
Correção na query que conta os processos.
Showing
1 changed file
with
1 additions
and
3 deletions
Show diff stats
src/main/java/br/gov/ans/integracao/sei/dao/ProcessoDAO.java
... | ... | @@ -84,7 +84,7 @@ public class ProcessoDAO { |
84 | 84 | public Long countProcessos(String interessado, String unidade, String tipoProcesso){ |
85 | 85 | HashMap<String, Object> parametros = new HashMap<String, Object>(); |
86 | 86 | |
87 | - StringBuilder builder = new StringBuilder("SELECT count(*) "); | |
87 | + StringBuilder builder = new StringBuilder("SELECT count(DISTINCT pr.protocolo_formatado_pesquisa) "); | |
88 | 88 | builder.append("FROM protocolo pr, tipo_procedimento tp, participante p "); |
89 | 89 | |
90 | 90 | if(StringUtils.isNotBlank(interessado)){ |
... | ... | @@ -112,8 +112,6 @@ public class ProcessoDAO { |
112 | 112 | parametros.put("unidade", unidade); |
113 | 113 | } |
114 | 114 | |
115 | - builder.append("group by pr.protocolo_formatado_pesquisa "); | |
116 | - | |
117 | 115 | Query query = em.createNativeQuery(builder.toString()); |
118 | 116 | |
119 | 117 | setQueryParameters(query, parametros); | ... | ... |