From 09b74e0778576aa8db88d95c780de7cfa9c4cd07 Mon Sep 17 00:00:00 2001 From: Frederico Palma Date: Wed, 5 Apr 2006 19:40:04 +0000 Subject: [PATCH] no message git-svn-id: https://svn.coded.pt/svn/SIPRP@246 bb69d46d-e84e-40c8-a05a-06db0d633741 --- trunk/siprp/FichaDataProvider.java | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/trunk/siprp/FichaDataProvider.java b/trunk/siprp/FichaDataProvider.java index 0b797a73..2bc68d47 100644 --- a/trunk/siprp/FichaDataProvider.java +++ b/trunk/siprp/FichaDataProvider.java @@ -453,6 +453,52 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter { return ids; } + public Object [][]getAvisosTrabalhadorByDate( Date date ) + throws Exception + { + Select select = new Select( new String[]{ "avisos", "empresas", "estabelecimentos", "trabalhadores" }, + new String[]{ "avisos.id", "avisos.data_evento", "avisos.descricao", + "empresas.designacao_social", "estabelecimentos.nome", + "trabalhadores.nome", "data_aviso" }, + new Field( "tipo" ).isEqual( new Integer( AvisoConstants.TIPO_TRABALHADOR ) ).and( + new Field( "data_aviso" ).isLessOrEqual( date ) ).and( + new Field( "avisos.empresa_id" ).isEqual( new Field( "empresas.id" ) ) ).and( + new Field( "avisos.estabelecimento_id" ).isEqual( new Field( "estabelecimentos.id" ) ) ).and( + new Field( "avisos.trabalhador_id" ).isEqual( new Field( "trabalhadores.id" ) ) ), + new String[]{ "data_evento" }, null ); + Virtual2DArray array = executer.executeQuery( select ); + return array.getObjects(); + } + + public Object [][]getAvisosEstabelecimentoByDate( Date date ) + throws Exception + { + Select select = new Select( new String[]{ "avisos", "empresas", "estabelecimentos" }, + new String[]{ "avisos.id", "avisos.data_evento", "avisos.descricao", + "empresas.designacao_social", "estabelecimentos.nome", "data_aviso" }, + new Field( "tipo" ).isEqual( new Integer( AvisoConstants.TIPO_ESTABELECIMENTO ) ).and( + new Field( "data_aviso" ).isLessOrEqual( date ) ).and( + new Field( "avisos.empresa_id" ).isEqual( new Field( "empresas.id" ) ) ).and( + new Field( "avisos.estabelecimento_id" ).isEqual( new Field( "estabelecimentos.id" ) ) ), + new String[]{ "data_evento" }, null ); + Virtual2DArray array = executer.executeQuery( select ); + return array.getObjects(); + } + + public Object [][]getAvisosEmpresaByDate( Date date ) + throws Exception + { + Select select = new Select( new String[]{ "avisos", "empresas" }, + new String[]{ "avisos.id", "avisos.data_evento", "avisos.descricao", + "empresas.designacao_social", "data_aviso" }, + new Field( "tipo" ).isEqual( new Integer( AvisoConstants.TIPO_EMPRESA ) ).and( + new Field( "data_aviso" ).isLessOrEqual( date ) ).and( + new Field( "avisos.empresa_id" ).isEqual( new Field( "empresas.id" ) ) ), + new String[]{ "data_evento" }, null ); + Virtual2DArray array = executer.executeQuery( select ); + return array.getObjects(); + } + public Integer getMarcacaoIDByTrabalhador( Integer trabalhadorID ) throws Exception {