|
|
|
|
@ -352,4 +352,60 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter {
|
|
|
|
|
}
|
|
|
|
|
return exames;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IDObject []getAllEstabelecimentosForEmpresa( Integer empresaID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Select select = new Select( new String[]{ T_ESTABELECIMENTOS },
|
|
|
|
|
new String[]{ ID, NOME },
|
|
|
|
|
new Field( EMPRESA_ID ).isEqual( empresaID ),
|
|
|
|
|
new String[]{ "lower(" + NOME + ")" }, null );
|
|
|
|
|
Virtual2DArray array = executer.executeQuery( select );
|
|
|
|
|
IDObject objects[] = new IDObject[ array.columnLength() ];
|
|
|
|
|
for( int n = 0; n < objects.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
Integer id = new Integer( ((Number)array.get( n, 0 )).intValue() );
|
|
|
|
|
String desc = (String)array.get( n, 1 );
|
|
|
|
|
objects[ n ] = new MappableObject( id, desc );
|
|
|
|
|
}
|
|
|
|
|
return objects;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IDObject []getAllTrabalhadoresForEmpresa( Integer empresaID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Select select = new Select( new String[]{ T_TRABALHADORES, T_ESTABELECIMENTOS },
|
|
|
|
|
new String[]{ T_TRABALHADORES + "." + ID,
|
|
|
|
|
T_TRABALHADORES + "." + NOME },
|
|
|
|
|
new Field( T_ESTABELECIMENTOS + "." + EMPRESA_ID ).isEqual( empresaID ).and(
|
|
|
|
|
new Field( T_TRABALHADORES + "." + ESTABELECIMENTO_ID ).isEqual( new Field( T_ESTABELECIMENTOS + "." + ID ) ) ),
|
|
|
|
|
new String[]{ "lower(" + T_TRABALHADORES + "." + NOME + ")" }, null );
|
|
|
|
|
Virtual2DArray array = executer.executeQuery( select );
|
|
|
|
|
IDObject objects[] = new IDObject[ array.columnLength() ];
|
|
|
|
|
for( int n = 0; n < objects.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
Integer id = new Integer( ((Number)array.get( n, 0 )).intValue() );
|
|
|
|
|
String desc = (String)array.get( n, 1 );
|
|
|
|
|
objects[ n ] = new MappableObject( id, desc );
|
|
|
|
|
}
|
|
|
|
|
return objects;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IDObject []getAllTrabalhadoresForEstabelecimento( Integer estabelecimentoID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Select select = new Select( new String[]{ T_TRABALHADORES },
|
|
|
|
|
new String[]{ ID, NOME },
|
|
|
|
|
new Field( ESTABELECIMENTO_ID ).isEqual( estabelecimentoID ),
|
|
|
|
|
new String[]{ "lower(" + NOME + ")" }, null );
|
|
|
|
|
Virtual2DArray array = executer.executeQuery( select );
|
|
|
|
|
IDObject objects[] = new IDObject[ array.columnLength() ];
|
|
|
|
|
for( int n = 0; n < objects.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
Integer id = new Integer( ((Number)array.get( n, 0 )).intValue() );
|
|
|
|
|
String desc = (String)array.get( n, 1 );
|
|
|
|
|
objects[ n ] = new MappableObject( id, desc );
|
|
|
|
|
}
|
|
|
|
|
return objects;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|