|
|
|
|
@ -428,21 +428,6 @@ public class PlanoActuacaoDataProvider
|
|
|
|
|
{
|
|
|
|
|
return (HsRiscoData) ENTITY_PROVIDER.load( HsRiscoData.class, id );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//FIXME : a query esta errada !!! :s
|
|
|
|
|
/*
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM hs_relatorio_posto_medida
|
|
|
|
|
INNER JOIN hs_relatorio_medida ON ( hs_relatorio_posto_medida.medida_id = hs_relatorio_medida.id )
|
|
|
|
|
INNER JOIN hs_relatorio_risco ON ( hs_relatorio_medida.risco_id = hs_relatorio_risco.id )
|
|
|
|
|
INNER JOIN hs_relatorio_posto_risco ON ( hs_relatorio_risco.id = hs_relatorio_posto_risco.risco_id )
|
|
|
|
|
WHERE
|
|
|
|
|
hs_relatorio_posto_medida.posto_id = 6515
|
|
|
|
|
AND hs_relatorio_medida.deleted_date IS NULL
|
|
|
|
|
AND hs_relatorio_risco.deleted_date IS NULL
|
|
|
|
|
ORDER BY hs_relatorio_risco.description, hs_relatorio_medida.description, hs_relatorio_medida.requesitos_legais
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public List<EvoJoinObject> getRelatorioMedidasForPosto( HsRelatorioPostoData posto ) throws Exception
|
|
|
|
|
{
|
|
|
|
|
@ -453,12 +438,45 @@ public class PlanoActuacaoDataProvider
|
|
|
|
|
fks.add( new ForeignKey( HsRelatorioRiscoData.class, HsRelatorioRiscoData.ID_FULL, HsRelatorioPostoRiscoData.class, HsRelatorioPostoRiscoData.RISCO_ID_FULL ) );
|
|
|
|
|
|
|
|
|
|
Expression where = new Field( HsRelatorioPostoMedidaData.POSTO_ID_FULL ).isEqual( posto.getId() ).and(
|
|
|
|
|
new Field( HsRelatorioMedidaData.DELETED_DATE_FULL ).isEqual( null ).and(
|
|
|
|
|
new Field( HsRelatorioRiscoData.DELETED_DATE_FULL ).isEqual( null )
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
new Field( HsRelatorioMedidaData.DELETED_DATE_FULL ).isEqual( null ).and(
|
|
|
|
|
new Field( HsRelatorioRiscoData.DELETED_DATE_FULL ).isEqual( null )
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
result = ((EvoDataProvider)ENTITY_PROVIDER).listLoad( fks, where, HsRelatorioRiscoData.DESCRIPTION_FULL, HsRelatorioMedida.DESCRIPTION_FULL, HsRelatorioMedida.REQUESITOS_LEGAIS_FULL );
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HsRelatorioRiscoData loadRelatorioRiscoByRiscoID( Integer hsRiscoID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
return ((EvoDataProvider)ENTITY_PROVIDER).load( HsRelatorioRiscoData.class,
|
|
|
|
|
new Object[] { null, hsRiscoID }, new String[] { HsRelatorioRiscoData.DELETED_DATE, HsRelatorioRiscoData.HS_RISCO_ID },
|
|
|
|
|
null );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HsRelatorioPostoRiscoData loadRelatorioPostoRisco( Integer postoID, Integer riscoID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
return ((EvoDataProvider)ENTITY_PROVIDER).load( HsRelatorioPostoRiscoData.class,
|
|
|
|
|
new Object[] { postoID, riscoID }, new String[] { HsRelatorioPostoRiscoData.POSTO_ID, HsRelatorioPostoRiscoData.RISCO_ID },
|
|
|
|
|
null );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HsRelatorioMedidaData loadRelatorioMedidaByMedidaID( Integer hsMedidaID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
return ((EvoDataProvider)ENTITY_PROVIDER).load( HsRelatorioMedidaData.class,
|
|
|
|
|
new Object[] { null, hsMedidaID }, new String[] { HsRelatorioMedidaData.DELETED_DATE, HsRelatorioMedidaData.HS_MEDIDA_ID },
|
|
|
|
|
null );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HsRelatorioPostoMedidaData loadRelatorioPostoMedida( Integer postoID, Integer medidaID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
return ((EvoDataProvider)ENTITY_PROVIDER).load( HsRelatorioPostoMedidaData.class,
|
|
|
|
|
new Object[] { postoID, medidaID }, new String[] { HsRelatorioPostoMedidaData.POSTO_ID, HsRelatorioPostoMedidaData.MEDIDA_ID },
|
|
|
|
|
null );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|