Browse Source

2 Hochschulviews nur für NRW

master
Marlies Winterstein 7 months ago
parent
commit
447ebc47f6
  1. 49
      src-modules/module/sxc/conf/sxc.xml
  2. 17
      src-modules/module/sxc/schluesseltabellen/sichten_fuellen.sql

49
src-modules/module/sxc/conf/sxc.xml

@ -374,6 +374,55 @@ union select trim(name)|| ' Standort '||standort_ort, hs_nr::char(10), 'ST_'||hs @@ -374,6 +374,55 @@ union select trim(name)|| ' Standort '||standort_ort, hs_nr::char(10), 'ST_'||hs
where hs_nr_hauptsitz is not null and hs_nr is not null;
]]></sql>
</view>
<view name="sxc_hochschulen_nrw_art">
<columns><column name="druck" type ="CHAR" size ="2147483647" default ="" notnull ="false" />
<column name="apnr" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="parent" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="ebene" type ="INTEGER" size ="10" default ="" notnull ="false" />
</columns>
<sql dbsystem=""><![CDATA[
select 'Hochschulen in NRW', 0::char(10) as hs_nr, null::char(10) as parent, 0::smallint as ebene from xdummy
union select bezeichnung, laufnummer::char(10), '0'::char(10) as parent, 1 as ebene from sxc_hsk_hochschultypen
--Element kann sich nicht selbst als parent haben!!
--die Einzelhochschulen
union select name, hs_nr::char(10), (select laufnummer from sxc_hsk_hochschultypen H where H.bezeichnung=sxc_hochschulen.hsk_art)::char(10) as parent,
2::smallint as ebene from sxc_hochschulen where
hs_nr is not null and hsk_laufnummer not in (select hsk_laufnummer from sxc_hochschulen_standorte where hauptsitz='1')
and hsk_bundesland='Nordrhein-Westfalen'
union select name, 'ST_'||hs_nr::char(10), (select laufnummer from sxc_hsk_hochschultypen H where H.bezeichnung=sxc_hochschulen.hsk_art)::char(10) as parent, 2::smallint as ebene from sxc_hochschulen where
hs_nr is not null and hsk_laufnummer in (select hsk_laufnummer from sxc_hochschulen_standorte where hauptsitz='1')
and hsk_bundesland='Nordrhein-Westfalen'
--und die Standorte
union select trim(name)|| ' Standort '||standort_ort, hs_nr::char(10), 'ST_'||hs_nr_hauptsitz as parent, 3::smallint as ebene from sxc_hochschulen_standorte
where hs_nr_hauptsitz is not null and hs_nr is not null
and hs_nr_hauptsitz in (select hs_nr from sxc_hochschulen where hsk_bundesland='Nordrhein-Westfalen')
;
]]></sql>
</view>
<view name="sxc_hochschulen_nrw_art">
<columns><column name="druck" type ="CHAR" size ="2147483647" default ="" notnull ="false" />
<column name="apnr" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="parent" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="ebene" type ="INTEGER" size ="10" default ="" notnull ="false" />
</columns>
<sql dbsystem=""><![CDATA[
create view sxc_hochschulen_nrw_liste (druck, apnr, parent, ebene) as
select 'Hochschulen', 0::char(10) as hs_nr, null::char(10) as parent, 0::smallint as ebene from xdummy
union
select name, hs_nr::char(10), '0'::char(10) as parent, 1::smallint as ebene from sxc_hochschulen where
hs_nr is not null and hsk_laufnummer not in (select hsk_laufnummer from sxc_hochschulen_standorte where hauptsitz='1')
and hsk_bundesland='Nordrhein-Westfalen'
union
select name, 'ST_'||hs_nr::char(10), '0'::char(10) as parent, 1::smallint as ebene from sxc_hochschulen where
hs_nr is not null and hsk_laufnummer in (select hsk_laufnummer from sxc_hochschulen_standorte where hauptsitz='1')
and hsk_bundesland='Nordrhein-Westfalen'
--und die Standorte
union select trim(name)|| ' Standort '||standort_ort, hs_nr::char(10), 'ST_'||hs_nr_hauptsitz as parent, 1::smallint as ebene from sxc_hochschulen_standorte
where hs_nr_hauptsitz is not null and hs_nr is not null
and hs_nr_hauptsitz in (select hs_nr from sxc_hochschulen where hsk_bundesland='Nordrhein-Westfalen')
;
]]></sql>
</view>
</views>
<functions>

17
src-modules/module/sxc/schluesseltabellen/sichten_fuellen.sql

@ -5,21 +5,32 @@ select setval('sichten_tid_seq',(select max(tid) from sichten)); @@ -5,21 +5,32 @@ select setval('sichten_tid_seq',(select max(tid) from sichten));
<#assign systeminfoid="360" />
<#assign sichten = [
{"name_intern":"sxc_hochschulen_nrw_art",
"name":"NRW-Hochschulen nach Art",
"quelle":"<<SQL>> select druck ,apnr, parent, ebene from sxc_hochschulen_nrw_art order by 1",
"art":"SXC_Hochschulen-Sicht",
"sortnr":"10"},
{"name_intern":"sxc_hochschulen_nrw_liste",
"name":"NRW-Hochschulen Liste",
"quelle":"<<SQL>> select druck ,apnr, parent, ebene from sxc_hochschulen_nrw_liste order by 1",
"art":"SXC_Hochschulen-Sicht",
"sortnr":"20"},
{"name_intern":"sxc_hochschulen_bland",
"name":"Hochschulen nach Bundesland",
"quelle":"<<SQL>> select druck ,apnr, parent, ebene from sxc_hochschulen_bland order by 1",
"art":"SXC_Hochschulen-Sicht",
"sortnr":"1"},
"sortnr":"30"},
{"name_intern":"sxc_hochschulen_art",
"name":"Hochschulen nach Art",
"quelle":"<<SQL>> select druck ,apnr, parent, ebene from sxc_hochschulen_art order by 1",
"art":"SXC_Hochschulen-Sicht",
"sortnr":"2"},
"sortnr":"40"},
{"name_intern":"sxc_hochschulen_liste",
"name":"Hochschulen Liste",
"quelle":"<<SQL>> select druck ,apnr, parent, ebene from sxc_hochschulen_liste order by 1",
"art":"SXC_Hochschulen-Sicht",
"sortnr":"10"}
"sortnr":"50"}
] />

Loading…
Cancel
Save