Mercurial > dive4elements > river
comparison flys-aft/src/main/resources/sql/flys-common.properties @ 4775:d9f1202cef78
Do the pairing of FLYS and AFT discharge tables by the field 'ABFLUSSTAFEL.BFG_ID' in
AFT and 'discharge_table.bfg_id' in FLYS.
TODO: Create new column in discharge_tabel.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sat, 05 Jan 2013 14:52:55 +0100 |
parents | a310aceb2e51 |
children | 46e984a3d576 |
comparison
equal
deleted
inserted
replaced
4774:9dcc32fc5167 | 4775:d9f1202cef78 |
---|---|
12 VALUES(:id, :name, :river_id, :station, :aeo, :official_number, :datum) | 12 VALUES(:id, :name, :river_id, :station, :aeo, :official_number, :datum) |
13 select.timeintervals = SELECT id, start_time, stop_time FROM time_intervals | 13 select.timeintervals = SELECT id, start_time, stop_time FROM time_intervals |
14 next.timeinterval.id = SELECT NEXTVAL('TIME_INTERVALS_ID_SEQ') AS time_interval_id | 14 next.timeinterval.id = SELECT NEXTVAL('TIME_INTERVALS_ID_SEQ') AS time_interval_id |
15 insert.timeinterval = INSERT INTO time_intervals (id, start_time, stop_time) VALUES (:id, :start_time, :stop_time) | 15 insert.timeinterval = INSERT INTO time_intervals (id, start_time, stop_time) VALUES (:id, :start_time, :stop_time) |
16 next.discharge.id = SELECT NEXTVAL('DISCHARGE_TABLES_ID_SEQ') AS discharge_table_id | 16 next.discharge.id = SELECT NEXTVAL('DISCHARGE_TABLES_ID_SEQ') AS discharge_table_id |
17 insert.dischargetable = INSERT INTO discharge_tables (id, gauge_id, description, kind, time_interval_id) \ | 17 insert.dischargetable = \ |
18 VALUES (:id, :gauge_id, :description, 1, :time_interval_id) | 18 INSERT INTO discharge_tables \ |
19 (id, gauge_id, description, bfg_id, kind, time_interval_id) \ | |
20 VALUES (:id, :gauge_id, :description, :bfg_id, 1, :time_interval_id) | |
19 select.discharge.table.values = SELECT id, w, q FROM discharge_table_values WHERE table_id = :table_id | 21 select.discharge.table.values = SELECT id, w, q FROM discharge_table_values WHERE table_id = :table_id |
20 next.discharge.table.values.id = SELECT NEXTVAL('DISCHARGE_TABLE_VALUES_ID_SEQ') AS discharge_table_values_id | 22 next.discharge.table.values.id = SELECT NEXTVAL('DISCHARGE_TABLE_VALUES_ID_SEQ') AS discharge_table_values_id |
21 insert.discharge.table.value = INSERT INTO discharge_table_values (id, table_id, w, q) VALUES (:id, :table_id, :w, :q) | 23 insert.discharge.table.value = INSERT INTO discharge_table_values (id, table_id, w, q) VALUES (:id, :table_id, :w, :q) |
22 delete.discharge.table.value = DELETE FROM discharge_table_values WHERE id = :id | 24 delete.discharge.table.value = DELETE FROM discharge_table_values WHERE id = :id |
23 select.gauge.discharge.tables = SELECT dt.id AS id, dt.description AS description, ti.start_time AS start_time, ti.stop_time AS stop_time \ | 25 select.gauge.discharge.tables = \ |
24 FROM discharge_tables dt LEFT OUTER JOIN time_intervals ti ON dt.time_interval_id = ti.id \ | 26 SELECT \ |
25 WHERE gauge_id = :gauge_id | 27 dt.id AS id, \ |
28 dt.description AS description, \ | |
29 ti.start_time AS start_time, \ | |
30 ti.stop_time AS stop_time, \ | |
31 dt.bfg_id AS bfg_id \ | |
32 FROM discharge_tables dt \ | |
33 LEFT OUTER JOIN time_intervals ti ON dt.time_interval_id = ti.id \ | |
34 WHERE gauge_id = :gauge_id |