Mercurial > dive4elements > river
comparison etl/src/main/resources/sql/flys-common.properties @ 7730:e1b831fe435a slt-simplify-cross-sections
Merged default into slt-simplify-cross-sections branch and updated package and class names.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 20 Jan 2014 14:04:20 +0100 |
parents | e5675e85ac38 |
children |
comparison
equal
deleted
inserted
replaced
5084:ca45dd039b54 | 7730:e1b831fe435a |
---|---|
1 select.rivers = \ | |
2 SELECT r.id AS id, r.name AS name, min(wcv.position) AS min_km, max(wcv.position) AS max_km \ | |
3 FROM rivers r \ | |
4 JOIN wsts w ON r.id = w.river_id \ | |
5 JOIN wst_columns wc ON w.id = wc.wst_id \ | |
6 JOIN wst_column_values wcv ON wcv.wst_column_id = wc.id \ | |
7 WHERE w.kind = 0 \ | |
8 GROUP BY r.id, r.name | |
9 select.gauges = \ | |
10 SELECT id, name, official_number, station \ | |
11 FROM gauges \ | |
12 WHERE river_id = :river_id | |
13 next.gauge.id = \ | |
14 SELECT NEXTVAL('GAUGES_ID_SEQ') AS gauge_id | |
15 insert.gauge = \ | |
16 INSERT INTO gauges (id, name, river_id, station, aeo, official_number, datum) \ | |
17 VALUES(:id, :name, :river_id, :station, :aeo, :official_number, :datum) | |
18 select.timeintervals = \ | |
19 SELECT id, start_time, stop_time FROM time_intervals | |
20 next.timeinterval.id = \ | |
21 SELECT NEXTVAL('TIME_INTERVALS_ID_SEQ') AS time_interval_id | |
22 insert.timeinterval = \ | |
23 INSERT INTO time_intervals (id, start_time, stop_time) \ | |
24 VALUES (:id, :start_time, :stop_time) | |
25 next.discharge.id = \ | |
26 SELECT NEXTVAL('DISCHARGE_TABLES_ID_SEQ') AS discharge_table_id | |
27 insert.dischargetable = \ | |
28 INSERT INTO discharge_tables \ | |
29 (id, gauge_id, description, bfg_id, kind, time_interval_id) \ | |
30 VALUES (:id, :gauge_id, :description, :bfg_id, 1, :time_interval_id) | |
31 select.discharge.table.values = \ | |
32 SELECT id, w, q FROM discharge_table_values WHERE table_id = :table_id | |
33 next.discharge.table.values.id = \ | |
34 SELECT NEXTVAL('DISCHARGE_TABLE_VALUES_ID_SEQ') AS discharge_table_values_id | |
35 insert.discharge.table.value = \ | |
36 INSERT INTO discharge_table_values (id, table_id, w, q) \ | |
37 VALUES (:id, :table_id, :w, :q) | |
38 delete.discharge.table.value = \ | |
39 DELETE FROM discharge_table_values WHERE id = :id | |
40 select.gauge.discharge.tables = \ | |
41 SELECT \ | |
42 dt.id AS id, \ | |
43 dt.description AS description, \ | |
44 ti.start_time AS start_time, \ | |
45 ti.stop_time AS stop_time, \ | |
46 dt.bfg_id AS bfg_id \ | |
47 FROM discharge_tables dt \ | |
48 LEFT OUTER JOIN time_intervals ti ON dt.time_interval_id = ti.id \ | |
49 WHERE dt.gauge_id = :gauge_id AND dt.kind = 1 | |
50 select.gauge.master.discharge.table = \ | |
51 SELECT \ | |
52 dt.id AS id, \ | |
53 dt.bfg_id AS bfg_id \ | |
54 FROM discharge_tables dt JOIN gauges g ON dt.gauge_id = g.id \ | |
55 WHERE g.id = :gauge_id AND dt.kind = 0 | |
56 update.bfg.id.discharge.table = \ | |
57 UPDATE discharge_tables SET bfg_id = :bfg_id WHERE id = :id | |
58 delete.discharge.table.values = \ | |
59 DELETE from discharge_table_values where table_id = :id | |
60 delete.discharge.table = \ | |
61 DELETE from discharge_tables where id = :id and kind = 1 |