|
|
|
|
@ -140,8 +140,17 @@ public class RelatoriosDataProvider extends GenericDataProvider {
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
Valor v = new Valor();
|
|
|
|
|
int valor = rs.getInt("valor");
|
|
|
|
|
v.setValor(new Integer(valor));
|
|
|
|
|
Object oValor = rs.getObject("valor");
|
|
|
|
|
if(oValor == null)
|
|
|
|
|
{
|
|
|
|
|
v.setValor(null);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
v.setValor((Integer) oValor);
|
|
|
|
|
}
|
|
|
|
|
//int valor = rs.getInt("valor");
|
|
|
|
|
//v.setValor(new Integer(valor));
|
|
|
|
|
v.setMedidas(getMedidasByValor(v, r, a));
|
|
|
|
|
valores.add(v);
|
|
|
|
|
}while(rs.next());
|
|
|
|
|
@ -164,7 +173,8 @@ public class RelatoriosDataProvider extends GenericDataProvider {
|
|
|
|
|
sql += "inner join hs_relatorio_posto_risco on (hs_relatorio_posto_risco.posto_id = hs_relatorio_posto.id and hs_relatorio_posto_risco.risco_id = hs_relatorio_risco.id) ";
|
|
|
|
|
sql += "inner join hs_relatorio on hs_relatorio.id = hs_relatorio_risco.relatorio_id ";
|
|
|
|
|
sql += "inner join hs_relatorio_area on hs_relatorio_area.id = area_id ";
|
|
|
|
|
sql += "where hs_relatorio_posto_risco.risco_id = " + r.getId() + " and area_id = " + a.getId() + " and hs_relatorio_posto_medida.is_plano_actuacao = true" + ") subquery ";
|
|
|
|
|
// sql += "where hs_relatorio_posto_risco.risco_id = " + r.getId() + " and area_id = " + a.getId() + " and hs_relatorio_posto_medida.is_plano_actuacao = true" + ") subquery ";
|
|
|
|
|
sql += "where hs_relatorio_posto_risco.risco_id = " + r.getId() + " and area_id = " + a.getId() + ") subquery ";
|
|
|
|
|
sql += "where valor = " + v.getValor() + " ";
|
|
|
|
|
sql += "order by subquery.medida_id, valor";
|
|
|
|
|
System.out.println("MEDIDAS BY VALOR SQL : " + sql);
|
|
|
|
|
|