# HG changeset patch # User "Tom Gottfried " # Date 1408706342 -7200 # Node ID b57f4bcd0f6f1bf07cb8c850276784c5cea692eb # Parent a9a6414b3563a46521e8ed4183ad728cb973c292 Remove code duplications in sedimentload datacage. diff -r a9a6414b3563 -r b57f4bcd0f6f artifacts/doc/conf/meta-data.xml --- a/artifacts/doc/conf/meta-data.xml Fri Aug 22 08:04:43 2014 +0200 +++ b/artifacts/doc/conf/meta-data.xml Fri Aug 22 13:19:02 2014 +0200 @@ -1354,7 +1354,7 @@ d.lower AS depth_lower, d.upper AS depth_upper, p.description || '<BR>' || - 'Tiefe: ' || d.lower || ' - ' || d.upper + 'Tiefe: ' || d.lower || ' - ' || d.upper || ' cm <BR>' || 'Zeitraum: ' AS info, t.start_time AS syear, @@ -1409,42 +1409,20 @@ - - - - - - - - - + + ids="{$syid};{$fraction};{$timespan}" /> - - - + - - - - - - + ids="{$syid};{$timespan}" /> @@ -1453,13 +1431,37 @@ - + + + + + + + + + + + + + + + + + + + + + + This is the macro for static datacage "Sedimentloads". @@ -1468,108 +1470,58 @@ - - - - SELECT DISTINCT - sy.id AS syid, - sy.description AS description, - ti.start_time AS year, - gf.name AS fraction - FROM sediment_load sy - JOIN sediment_load_values syv - ON sy.id = syv.sediment_load_id - JOIN measurement_station ms - ON ms.id = syv.measurement_station_id - JOIN rivers r ON ms.river_id = r.id - JOIN time_intervals ti ON sy.time_interval_id = ti.id - JOIN grain_fraction gf ON gf.id = sy.grain_fraction_id - WHERE r.id = ${river_id} - AND ti.stop_time IS NULL - AND ms.station BETWEEN ${fromkm} AND ${tokm} - ORDER BY fraction, year DESC - + + + SELECT DISTINCT + sy.id AS syid, + sy.description AS description, + ti.start_time AS startyear, + ti.stop_time AS endyear, + gf.name AS fraction + FROM sediment_load sy + JOIN sediment_load_values syv + ON sy.id = syv.sediment_load_id + JOIN measurement_station ms + ON ms.id = syv.measurement_station_id + JOIN rivers r ON ms.river_id = r.id + JOIN time_intervals ti ON sy.time_interval_id = ti.id + JOIN grain_fraction gf ON gf.id = sy.grain_fraction_id + WHERE r.id = ${river_id} + AND ms.station BETWEEN ${fromkm} AND ${tokm} + ORDER BY fraction, startyear DESC, endyear DESC + + - + - - - - - - SELECT DISTINCT - sy.id AS syid, - sy.description AS description, - ti.start_time AS startyear, - ti.stop_time AS endyear, - gf.name AS fraction - FROM sediment_load sy - JOIN sediment_load_values syv - ON sy.id = syv.sediment_load_id - JOIN measurement_station ms - ON ms.id = syv.measurement_station_id - JOIN rivers r ON ms.river_id = r.id - JOIN time_intervals ti ON sy.time_interval_id = ti.id - JOIN grain_fraction gf ON gf.id = sy.grain_fraction_id - WHERE r.id = ${river_id} - AND ti.stop_time IS NOT NULL - AND ms.station BETWEEN ${fromkm} AND ${tokm} - ORDER BY fraction, startyear DESC, endyear DESC - - - - - - + + - - - - SELECT DISTINCT - sy.id AS syid, - sy.description AS description, - ti.start_time AS year, - gf.name AS fraction - FROM sediment_load_ls sy - JOIN rivers r ON sy.river_id = r.id - JOIN sediment_load_ls_values syv ON sy.id = syv.sediment_load_ls_id - JOIN time_intervals ti ON sy.time_interval_id = ti.id - JOIN grain_fraction gf ON gf.id = sy.grain_fraction_id - WHERE r.id = ${river_id} - AND ti.stop_time IS NULL - AND syv.station BETWEEN ${fromkm} AND ${tokm} - ORDER BY fraction, year DESC - + + + SELECT DISTINCT + sy.id AS syid, + sy.description AS description, + ti.start_time AS startyear, + ti.stop_time AS endyear, + gf.name AS fraction + FROM sediment_load_ls sy + JOIN rivers r ON sy.river_id = r.id + JOIN sediment_load_ls_values syv + ON sy.id = syv.sediment_load_ls_id + JOIN time_intervals ti ON sy.time_interval_id = ti.id + JOIN grain_fraction gf ON gf.id = sy.grain_fraction_id + WHERE r.id = ${river_id} + AND syv.station BETWEEN ${fromkm} AND ${tokm} + ORDER BY fraction, startyear DESC, endyear DESC + + - + - - - - - - SELECT DISTINCT - sy.id AS syid, - sy.description AS description, - ti.start_time AS startyear, - ti.stop_time AS endyear, - gf.name AS fraction - FROM sediment_load_ls sy - JOIN rivers r ON sy.river_id = r.id - JOIN sediment_load_ls_values syv ON sy.id = syv.sediment_load_ls_id - JOIN time_intervals ti ON sy.time_interval_id = ti.id - JOIN grain_fraction gf ON gf.id = sy.grain_fraction_id - WHERE r.id = ${river_id} - AND ti.stop_time IS NOT NULL - AND syv.station BETWEEN ${fromkm} AND ${tokm} - ORDER BY fraction, startyear DESC, endyear DESC - - - - - - + +