[Lada-commits] [PATCH 05 of 11] Updated queryconf; Added 'probe.id' as result

Wald Commits scm-commit at wald.intevation.org
Fri Mar 13 16:50:44 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1426261575 -3600
# Node ID c3742f46c8e1b771f69eb729083524113ebbb2ea
# Parent  7c1f9409764a4d211422eb96beee63827d23e1a5
Updated queryconf; Added 'probe.id' as result.

diff -r 7c1f9409764a -r c3742f46c8e1 src/main/java/de/intevation/lada/rest/ProbeService.java
--- a/src/main/java/de/intevation/lada/rest/ProbeService.java	Fri Mar 13 16:45:11 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/ProbeService.java	Fri Mar 13 16:46:15 2015 +0100
@@ -116,6 +116,7 @@
                 filters.add(
                     jsonFilters.getJsonObject(i).getString("dataIndex"));
             }
+            results.add("id");
             for (int i = 0; i < jsonResults.size(); i++) {
                 results.add(
                     jsonResults.getJsonObject(i).getString("dataIndex"));
diff -r 7c1f9409764a -r c3742f46c8e1 src/main/resources/queryconf.json
--- a/src/main/resources/queryconf.json	Fri Mar 13 16:45:11 2015 +0100
+++ b/src/main/resources/queryconf.json	Fri Mar 13 16:46:15 2015 +0100
@@ -2,7 +2,7 @@
 {   "id": "1",
     "name": "Kein Filter",
     "description": "Abfrage der Proben ohne Filter",
-    "sql": "select pt.probe_id_alt, mst_id, umw_id from probe join probe_translation pt on probe.id = pt.probe_id",
+    "sql": "select p.id, pt.probe_id_alt, p.mst_id, p.umw_id from probe p join probe_translation pt on p.id = pt.probe_id",
     "result": [
         {"dataIndex": "probeId", "header": "ProbeId", "width": 100},
         {"dataIndex": "mstId", "header": "MST", "width": 100},
@@ -14,7 +14,7 @@
 {   "id": "2",
     "name": "MST und UMW",
     "description": "Abfrage der Proben gefiltert nach Messtellen ID und ID des Umweltbereichs",
-    "sql": "select pt.probe_id_alt, p.mst_id, p.umw_id from probe p join probe_translation pt on p.id = pt.probe_id where (p.mst_id = :mst_id OR '' = :mst_id) and (p.umw_id = :umw_id OR '' = :umw_id)",
+    "sql": "select p.id, pt.probe_id_alt, p.mst_id, p.umw_id from probe p join probe_translation pt on p.id = pt.probe_id where (p.mst_id = :mst_id OR '' = :mst_id) and (p.umw_id = :umw_id OR '' = :umw_id)",
     "result": [
         {"dataIndex": "probeId", "header": "ProbeId", "width": 100},
         {"dataIndex": "mstId", "header": "MST", "width": 100},


More information about the Lada-commits mailing list