git-svn-id: https://svn.coded.pt/svn/SIPRP@2053 bb69d46d-e84e-40c8-a05a-06db0d633741

lxbfYeaa
Frederico Palma 11 years ago
parent 13cc8bc7e9
commit b7664ab4ae

@ -206,7 +206,11 @@ public class AnalisesDataProvider extends GenericDataProvider
throws Exception
{
Expression where = new Field( AnalisesAcidentesData.APAGADA_FULL ).isEqual( "n" );
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
if( estabelecimentoID != null && estabelecimentoID > 0 )
{
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
}
// where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
if( fromYear != null )
{
where = where.and(
@ -300,7 +304,11 @@ public class AnalisesDataProvider extends GenericDataProvider
throws Exception
{
Expression where = new Field( AnalisesAcidentesData.APAGADA_FULL ).isEqual( "n" );
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
if( estabelecimentoID != null && estabelecimentoID > 0 )
{
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
}
// where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
if( fromYear != null )
{
@ -392,6 +400,10 @@ public class AnalisesDataProvider extends GenericDataProvider
where = where.and(
new Field( "EXTRACT( year FROM " + AnalisesAcidentesData.DATA_ACIDENTE_FULL + " )" ).isEqual( fromYear ) );
}
if( estabelecimentoID != null && estabelecimentoID > 0 )
{
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
}
if( empresa_id != null )
{
@ -485,7 +497,7 @@ public class AnalisesDataProvider extends GenericDataProvider
{
String tables[] = new String[]{ AnalisesAcidentesData.TABLENAME };
Expression where = new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimento_id )
.or( new Field( AnalisesAcidentesData.APAGADA_FULL ).isEqual( "n" ) );
.and( new Field( AnalisesAcidentesData.APAGADA_FULL ).isEqual( "n" ) );
String[] order = new String[]{ AnalisesAcidentesData.ANALISE_NR_FULL };
if( responsavel_loja.matches( "y" ) )
@ -585,6 +597,10 @@ public class AnalisesDataProvider extends GenericDataProvider
where = where.and(
new Field( "EXTRACT( year FROM " + AnalisesAcidentesData.DATA_ACIDENTE_FULL + " )" ).isEqual( fromYear ) );
}
if( estabelecimentoID != null && estabelecimentoID > 0 )
{
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
}
where = where.and(
new Field( AnalisesAcidentesData.ESTADO_FULL ).isLess( Global.ESTADO_HS )
.or( new Field( AnalisesAcidentesData.ESTADO_FULL ).isGreater( Global.ESTADO_HS )
@ -676,7 +692,10 @@ public class AnalisesDataProvider extends GenericDataProvider
throws Exception
{
Expression where = new Field( AnalisesAcidentesData.APAGADA_FULL ).isEqual( "n" );
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
if( estabelecimentoID != null && estabelecimentoID > 0 )
{
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
}
if( fromYear != null )
{
where = where.and(
@ -768,8 +787,10 @@ public class AnalisesDataProvider extends GenericDataProvider
throws Exception
{
Expression where = new Field( AnalisesAcidentesData.APAGADA_FULL ).isEqual( "n" );
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
if( estabelecimentoID != null && estabelecimentoID > 0 )
{
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
}
if( fromYear != null )
{
where = where.and(
@ -937,7 +958,7 @@ public class AnalisesDataProvider extends GenericDataProvider
{
Expression where = new Field( AnalisesAcidentesData.APAGADA_FULL ).isEqual( "n" );
where = where.and( new Field( AnalisesAcidentesData.ESTADO_FULL ).isLess( Global.ESTADO_CONCLUIDO ) );
if( estabelecimentoID != null )
if( estabelecimentoID != null && estabelecimentoID > 0 )
{
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
}
@ -979,7 +1000,7 @@ public class AnalisesDataProvider extends GenericDataProvider
{
Expression where = new Field( AnalisesAcidentesData.ESTADO_FULL ).isEqual( Global.ESTADO_CONCLUIDO );
where = where.and( new Field( AnalisesAcidentesData.APAGADA_FULL ).isEqual( "n" ) );
if( estabelecimentoID != null )
if( estabelecimentoID != null && estabelecimentoID > 0 )
{
where = where.and( new Field( AnalisesAcidentesData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) );
}

Loading…
Cancel
Save