|
|
|
@ -235,22 +235,28 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Virtual2DArray searchEmpresas( String pattern ) throws Exception {
|
|
|
|
public Virtual2DArray searchEmpresas( String pattern ) throws Exception {
|
|
|
|
Select select = new Select( "SELECT e.id, e.designacao_social FROM empresas e;" );
|
|
|
|
Select select = new Select( "SELECT e.id, e.designacao_social FROM empresas e ORDER BY lower( e.designacao_social );" );
|
|
|
|
return executer.executeQuery( select );
|
|
|
|
return executer.executeQuery( select );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Virtual2DArray searchEstabelecimentos( String pattern ) throws Exception {
|
|
|
|
public Virtual2DArray searchEstabelecimentos( String pattern ) throws Exception {
|
|
|
|
Select select = new Select( "SELECT e.id, e.nome FROM estabelecimentos e;" );
|
|
|
|
Select select = new Select( "SELECT e.id, e.nome FROM estabelecimentos e WHERE empresa_id = " + SEARCH_EMPRESAS_ID
|
|
|
|
|
|
|
|
+ " ORDER BY lower( e.nome )");
|
|
|
|
return executer.executeQuery( select );
|
|
|
|
return executer.executeQuery( select );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Virtual2DArray searchTrabalhadores( String pattern ) throws Exception {
|
|
|
|
public Virtual2DArray searchTrabalhadores( String pattern ) throws Exception {
|
|
|
|
Select select = new Select( "SELECT t.id, t.nome FROM trabalhadores t;" );
|
|
|
|
Select select =
|
|
|
|
|
|
|
|
new Select( "SELECT t.id, t.nome FROM trabalhadores t, estabelecimentos es "
|
|
|
|
|
|
|
|
+ " WHERE t.estabelecimento_id = es.id "
|
|
|
|
|
|
|
|
+ " AND es.empresa_id = " + SEARCH_EMPRESAS_ID + " ORDE BY lower(t.nome);" );
|
|
|
|
return executer.executeQuery( select );
|
|
|
|
return executer.executeQuery( select );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Virtual2DArray searchExames( String pattern ) throws Exception {
|
|
|
|
public Virtual2DArray searchExames( String pattern ) throws Exception {
|
|
|
|
Select select = new Select( "SELECT e.id, e.data FROM exames e;" );
|
|
|
|
Select select = new Select( "SELECT e.id, e.data FROM exames e "
|
|
|
|
|
|
|
|
+ " WHERE e.trabalhador_id = " + SEARCH_TRABALHADORES_ID
|
|
|
|
|
|
|
|
+ " ORDER BY e.data DESC;" );
|
|
|
|
return executer.executeQuery( select );
|
|
|
|
return executer.executeQuery( select );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|