|
|
|
|
@ -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 ) );
|
|
|
|
|
}
|
|
|
|
|
|