bugfix na pesquisa de utilizadores.

git-svn-id: https://svn.coded.pt/svn/SIPRP@1558 bb69d46d-e84e-40c8-a05a-06db0d633741
lxbfYeaa
Diogo Neves 15 years ago
parent 017c55192b
commit 4233c1bb36

@ -18,6 +18,7 @@ import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.sql.Expression;
import com.evolute.utils.sql.Field;
import com.evolute.utils.sql.Select2;
import com.evolute.utils.strings.StringPlainer;
import com.sun.rave.web.ui.model.Option;
import db.data.siprp.outer.EstabelecimentosData;
import db.data.siprp.outer.TiposUtilizadoresData;
@ -259,7 +260,7 @@ public class UtilizadoresDataProvider extends GenericDataProvider
List< Utilizador > listUtilizadores = new LinkedList< Utilizador >();
por = por == null ? "" : por;
nome = nome == null ? "" : nome.replaceAll( " ", "%" );
nome = nome == null ? "" : StringPlainer.convertString( nome.replaceAll( " ", "%" ) );
activo = activo == null ? "y" : activo;
dirRH = dirRH == null ? "n" : dirRH;
boolean isDirRH = "y".equals( dirRH );
@ -267,8 +268,10 @@ public class UtilizadoresDataProvider extends GenericDataProvider
Expression whereExpression = new Field( UtilizadoresData.APAGADO_FULL ).isEqual( "n" );
whereExpression = whereExpression.and( new Field( UtilizadoresData.ACTIVO_FULL ).isEqual( activo ) );
whereExpression = whereExpression.and( new Field( UtilizadoresData.TIPO_FULL ).isDifferent( Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP ) );
whereExpression = whereExpression.and( new Field( UtilizadoresData.NUMERO_MECANOGRAFICO_FULL ).isILike( "%" + por + "%" ) );
whereExpression = whereExpression.and( new Field( UtilizadoresData.NOME_FULL ).isILike( "%" + nome + "%" ) );
whereExpression = whereExpression.and( new Field( "plain( " + UtilizadoresData.NUMERO_MECANOGRAFICO_FULL + " )" ).isILike( "%" + por + "%" ) );
whereExpression = whereExpression.and( new Field( "plain( " + UtilizadoresData.NOME_FULL + " )" ).isILike( "%" + nome + "%" ) ).or(
new Field( "plain_utf8( " + UtilizadoresData.NOME_FULL + " )" ).isILike( "%" + nome + "%" )
);
if ( estabelecimentoID != null )
{
whereExpression = whereExpression.and( new Field( UtilizadoresData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );

Loading…
Cancel
Save