|
|
|
|
@ -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
|
|
|
|
|
{
|
|
|
|
|
|