diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/UtilizadoresDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/UtilizadoresDataProvider.java index 19686596..d864ae3c 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/UtilizadoresDataProvider.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/UtilizadoresDataProvider.java @@ -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 ) );