Skip to content

Commit

Permalink
Correção da query de Pesquisa de Lotação
Browse files Browse the repository at this point in the history
Condições add no commit anterior listava lotações de todos os órgãos na tela de cadastro de pessoa e não apenas do órgão selecionado.

Add restrição para pesquisar na sigla apenas se o parâmetro :nome for utilizado
  • Loading branch information
dinarde committed Apr 12, 2021
1 parent 4525a57 commit 3989472
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
@NamedQuery(name = "listarPorIdInicialDpLotacao", query = "select lot from DpLotacao lot where lot.idLotacaoIni = :idLotacaoIni"),
@NamedQuery(name = "consultarPorFiltroDpLotacao", query = "from DpLotacao lot "
+ " where "
+ " (((((upper(lot.siglaLotacao) like upper('%' || :nome || '%') or upper(lot.nomeLotacaoAI) like upper('%' || :nome || '%')) "
+ " and (:idOrgaoUsu = null or :idOrgaoUsu = 0L or lot.orgaoUsuario.idOrgaoUsu = :idOrgaoUsu))))"
+ " or upper(concat(lot.orgaoUsuario.acronimoOrgaoUsu, lot.siglaLotacao)) like upper(:nome || '%')"
+ " or upper(concat(lot.orgaoUsuario.siglaOrgaoUsu, lot.siglaLotacao)) like upper(:nome || '%'))"
+ " ( (upper(lot.siglaLotacao) like upper('%' || :nome || '%') or upper(lot.nomeLotacaoAI) like upper('%' || :nome || '%')) "
+ " and (:idOrgaoUsu = null or :idOrgaoUsu = 0L or lot.orgaoUsuario.idOrgaoUsu = :idOrgaoUsu)"
+ " or ( :nome != null and (upper(concat(lot.orgaoUsuario.acronimoOrgaoUsu, lot.siglaLotacao)) like upper(:nome || '%')"
+ " or upper(concat(lot.orgaoUsuario.siglaOrgaoUsu, lot.siglaLotacao)) like upper(:nome || '%'))))"
+ " and lot.dataFimLotacao = null"
+ " order by lot.nomeLotacao"),
@NamedQuery(name = "consultarQuantidadeDpLotacao", query = "select count(lot) from DpLotacao lot "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ${meta}

<c:set var="collapse_Expanded" scope="request" value="collapsible expanded" />

<c:set var="siga_version" scope="request" value="10.0.6.4" />
<c:set var="siga_version" scope="request" value="10.0.6.5" />

<c:choose>
<c:when test="${siga_cliente == 'GOVSP'}">
Expand Down
2 changes: 1 addition & 1 deletion siga/src/main/webapp/META-INF/VERSION.MF
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Siga-Versao: 10.0.6.4
Siga-Versao: 10.0.6.5

0 comments on commit 3989472

Please sign in to comment.