diff --git a/trunk/PlanosActuacao/.classpath b/trunk/PlanosActuacao/.classpath
index 1e95162f..2f37df0a 100644
--- a/trunk/PlanosActuacao/.classpath
+++ b/trunk/PlanosActuacao/.classpath
@@ -3,15 +3,17 @@
-
+
-
+
-
+
+
+
diff --git a/trunk/PlanosActuacao/.settings/org.eclipse.wst.common.project.facet.core.xml b/trunk/PlanosActuacao/.settings/org.eclipse.wst.common.project.facet.core.xml
index a51df16b..bac98091 100644
--- a/trunk/PlanosActuacao/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ b/trunk/PlanosActuacao/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/trunk/PlanosActuacao/lib/el-api.jar b/trunk/PlanosActuacao/lib/el-api.jar
new file mode 100644
index 00000000..ac49fc84
Binary files /dev/null and b/trunk/PlanosActuacao/lib/el-api.jar differ
diff --git a/trunk/PlanosActuacao/lib/servlet-api.jar b/trunk/PlanosActuacao/lib/servlet-api.jar
new file mode 100644
index 00000000..38cf06c0
Binary files /dev/null and b/trunk/PlanosActuacao/lib/servlet-api.jar differ
diff --git a/trunk/PlanosActuacao/properties/0-Importer/app.properties b/trunk/PlanosActuacao/properties/0-Importer/app.properties
index a5446a3a..e8504467 100644
--- a/trunk/PlanosActuacao/properties/0-Importer/app.properties
+++ b/trunk/PlanosActuacao/properties/0-Importer/app.properties
@@ -19,8 +19,14 @@ database.siprp = siprp
username.siprp = siprp
password.siprp = -rg2hpgsql
-server.siprp_local = vps-siprp.evo.pt
-port.siprp_local = 5432
-database.siprp_local = siprp_local_3
+#server.siprp_local = vps-siprp.evo.pt
+#port.siprp_local = 5432
+#database.siprp_local = siprp_local_3
+#username.siprp_local = siprp
+#password.siprp_local = -rg2hpgsql
+
+server.siprp_local = localhost
+port.siprp_local = 5444
+database.siprp_local = siprp_local
username.siprp_local = siprp
-password.siprp_local = -rg2hpgsql
+password.siprp_local = rg2h-opksiprp
diff --git a/trunk/PlanosActuacao/src/importer/PlanosActuacaoImporterProvider.java b/trunk/PlanosActuacao/src/importer/PlanosActuacaoImporterProvider.java
index 91337fb6..e4132ca5 100644
--- a/trunk/PlanosActuacao/src/importer/PlanosActuacaoImporterProvider.java
+++ b/trunk/PlanosActuacao/src/importer/PlanosActuacaoImporterProvider.java
@@ -305,7 +305,7 @@ public class PlanosActuacaoImporterProvider extends GenericDataProvider
Select innerSelect = new Select2(
new String[] { HsRelatorioPostoData.TABLENAME, HsRelatorioPostoMedidaData.TABLENAME,
HsRelatorioMedidaData.TABLENAME, HsRelatorioRiscoData.TABLENAME, HsRelatorioPostoRiscoData.TABLENAME,
- HsRelatorioData.TABLENAME, HsRelatorioAreaData.TABLENAME, HsRelatorioRiscoValorQualitativoData.TABLENAME },
+ HsRelatorioData.TABLENAME, HsRelatorioAreaData.TABLENAME },
new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER, Select2.JOIN_INNER, Select2.JOIN_INNER,
Select2.JOIN_INNER, Select2.JOIN_INNER },
new Expression[]{
@@ -319,7 +319,7 @@ public class PlanosActuacaoImporterProvider extends GenericDataProvider
},
new String[]{ "DISTINCT " + HsRelatorioPostoMedidaData.MEDIDA_ID_FULL,
HsRelatorioPostoRiscoData.RISCO_ID_FULL,
- HsRelatorioMedidaData.DESCRIPTION_FULL,
+ HsRelatorioMedidaData.DESCRIPTION_FULL + " AS descricao",
"CASE WHEN " +
new Field( HsRelatorioPostoRiscoData.VALOR_QUALITATIVO_ID_FULL ).isEqual( null )
.and( new Field( HsRelatorioPostoRiscoData.PROBABILIDADE_FULL ).isEqual( null ) )
@@ -379,7 +379,7 @@ public class PlanosActuacaoImporterProvider extends GenericDataProvider
new Field( HsRelatorioAreaData.ID_FULL ).isEqual( new Field( HsRelatorioPostoData.AREA_ID_FULL ) )
},
new String[]{ HsRelatorioPostoMedidaData.POSTO_ID_FULL,
- HsRelatorioPostoData.DESCRIPTION_FULL,
+ HsRelatorioPostoData.DESCRIPTION_FULL + " AS descricao",
"CASE WHEN " +
new Field( HsRelatorioPostoRiscoData.VALOR_QUALITATIVO_ID_FULL ).isEqual( null )
.and( new Field( HsRelatorioPostoRiscoData.PROBABILIDADE_FULL ).isEqual( null ) )
@@ -389,11 +389,11 @@ public class PlanosActuacaoImporterProvider extends GenericDataProvider
" THEN " + HsRelatorioPostoRiscoData.PROBABILIDADE_FULL + "*" + HsRelatorioPostoRiscoData.SEVERIDADE_FULL +
" ELSE " + HsRelatorioPostoRiscoData.VALOR_QUALITATIVO_ID_FULL +
" END AS valor ",
- "coalesce( " + HsRelatorioPostoData.IS_PRINCIPAL_FULL + ", false )" },
+ "coalesce( " + HsRelatorioPostoData.IS_PRINCIPAL_FULL + ", false ) AS is_principal" },
new Field( HsRelatorioPostoMedidaData.MEDIDA_ID ).isEqual( m.getId() )
.and( new Field( HsRelatorioPostoRiscoData.RISCO_ID_FULL ).isEqual( r.getId() ) )
.and( new Field( HsRelatorioPostoData.AREA_ID_FULL ).isEqual( a.getId() ) ),
- new String[]{ HsRelatorioRiscoData.ID_FULL }, null, null, null
+ new String[]{ HsRelatorioPostoMedidaData.POSTO_ID_FULL }, null, null, null
);
Select select = new Select( MessageFormat.format( "SELECT subquery.posto_id, valor, descricao, is_principal FROM ( {0} ) subquery ", innerSelect.toString() ) );
@@ -470,7 +470,7 @@ public class PlanosActuacaoImporterProvider extends GenericDataProvider
},
new String[]{ "DISTINCT " + HsRelatorioPostoMedidaData.MEDIDA_ID_FULL,
HsRelatorioPostoRiscoData.RISCO_ID_FULL,
- HsRelatorioMedidaData.DESCRIPTION_FULL,
+ HsRelatorioMedidaData.DESCRIPTION_FULL + " AS descricao",
"CASE WHEN " +
new Field( HsRelatorioPostoRiscoData.VALOR_QUALITATIVO_ID_FULL ).isEqual( null )
.and( new Field( HsRelatorioPostoRiscoData.PROBABILIDADE_FULL ).isEqual( null ) )