Browse Source

hs_nr in sxc_hochschulen geändert, sxc_hochschulen_standorte geändert, View geändert bzw. eingefügt

master
Marlies Winterstein 6 months ago
parent
commit
7cd6d0ed92
  1. 120
      src-modules/module/sxc/conf/sxc.xml

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

@ -11,20 +11,18 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[SXC]" /> @@ -11,20 +11,18 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[SXC]" />
</sachgebiete>
<table name="sxc_hochschulen">
<columns><column name="name" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="hs_nr" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="hs_nr" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="kapitel" type ="CHAR" size ="5" default ="" notnull ="false" />
<column name="art" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="traegerschaft" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="kurztext" type ="CHAR" size ="100" default ="" notnull ="false" />
<column name="ort" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="bland" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="dat_in_sxc" type ="CHAR" size ="4" default ="" notnull ="false" />
<column name="hrk_laufnummer" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="hrk_art" type ="CHAR" size ="30" default ="" notnull ="false" />
<column name="hrk_traegerschaft" type ="CHAR" size ="30" default ="" notnull ="false" />
<column name="hs_nr_hauptsitz" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="hsk_laufnummer" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="hsk_art" type ="CHAR" size ="30" default ="" notnull ="false" />
<column name="hsk_traegerschaft" type ="CHAR" size ="30" default ="" notnull ="false" />
<column name="updated" type ="CHAR" size ="200" default ="" notnull ="false" />
<column name="hrk_hauptsitz" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="hsk_bundesland" type ="VARCHAR" size ="255" default ="" notnull ="false" />
</columns>
<indexes></indexes>
<primaryKeys><rs>
@ -36,14 +34,17 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[SXC]" /> @@ -36,14 +34,17 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[SXC]" />
<privileges><rs>
</rs></privileges>
</table>
<table name="sxc_standorte">
<columns><column name="name" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="stort_nr" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="kurztext" type ="CHAR" size ="100" default ="" notnull ="false" />
<table name="sxc_hochschulen_standorte">
<columns>
<column name="hsk_laufnummer" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="kurzname" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="name" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="ort" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="bland" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="hrk_laufnummer" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="hauptsitz" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="standort_ort" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="hauptsitz" type ="CHAR" size ="1" default ="" notnull ="false" />
<column name="standort_laufnummer" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="hs_nr" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="hs_nr_hauptsitz" type ="CHAR" size ="10" default ="" notnull ="false" />
</columns>
<indexes></indexes>
<primaryKeys><rs>
@ -232,68 +233,41 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[SXC]" /> @@ -232,68 +233,41 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[SXC]" />
<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'::varchar AS druck,
0 AS apnr,
NULL::integer AS parent,
0::smallint AS ebene
FROM xdummy
UNION
SELECT sxc_hsk_hochschultypen.bezeichnung AS druck,
sxc_hsk_hochschultypen.laufnummer AS apnr,
0 AS parent,
1 AS ebene
FROM sxc_hsk_hochschultypen
UNION
SELECT 'nicht zugeordnet'::varchar AS druck,
99 AS apnr,
0 AS parent,
1 AS ebene
FROM xdummy
UNION
SELECT sxc_hochschulen.name AS druck,
sxc_hochschulen.hs_nr AS apnr,
(( SELECT h.laufnummer
FROM sxc_hsk_hochschultypen h
WHERE h.bezeichnung = sxc_hochschulen.hrk_art))::integer AS parent,
2::smallint AS ebene
FROM sxc_hochschulen
WHERE sxc_hochschulen.hrk_laufnummer IS NOT NULL AND sxc_hochschulen.hs_nr_hauptsitz IS NULL
UNION
SELECT sxc_hochschulen.name AS druck,
sxc_hochschulen.hs_nr * 100 AS apnr,
(( SELECT h.laufnummer
FROM sxc_hsk_hochschultypen h
WHERE h.bezeichnung = sxc_hochschulen.hrk_art))::integer AS parent,
2::smallint AS ebene
FROM sxc_hochschulen
WHERE sxc_hochschulen.hrk_laufnummer IS NOT NULL AND sxc_hochschulen.hs_nr_hauptsitz = 1
UNION
SELECT sxc_hochschulen.name AS druck,
sxc_hochschulen.hs_nr AS apnr,
99 AS parent,
2::smallint AS ebene
FROM sxc_hochschulen
WHERE sxc_hochschulen.hrk_laufnummer IS NULL AND sxc_hochschulen.hrk_hauptsitz IS NULL
UNION
SELECT sxc_hochschulen.name AS druck,
sxc_hochschulen.hs_nr AS apnr,
sxc_hochschulen.hs_nr_hauptsitz * 100 AS parent,
3::smallint AS ebene
FROM sxc_hochschulen
WHERE sxc_hochschulen.hrk_laufnummer IS NULL AND sxc_hochschulen.hs_nr_hauptsitz IS NOT NULL
UNION
SELECT btrim(s.name::text) || ' (Hauptsitz)'::text AS druck,
s.hs_nr AS apnr,
s.hs_nr * 100 AS parent,
3::smallint AS ebene
FROM sxc_hochschulen s
WHERE s.hrk_laufnummer IS NOT NULL AND s.hs_nr_hauptsitz = 1 AND (EXISTS ( SELECT s1.hrk_hauptsitz
FROM sxc_hochschulen s1
WHERE s1.hs_nr = s.hs_nr));
<sql dbsystem=""><![CDATA[
select 'Hochschulen', 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')
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')
--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;
]]></sql>
</view>
<view name="sxc_hochschulen_hsk_bland">
<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', 0::char(10) as hs_nr, null::char(10) as parent, 0::smallint as ebene from xdummy
union select hsk_bundesland, substring(hsk_bundesland, 1,10), '0'::char(10) as parent, 1 as ebene from sxc_hochschulen
--Element kann sich nicht selbst als parent haben!!
--die Einzelhochschulen
union select name, hs_nr::char(10), substring(hsk_bundesland, 1,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')
union select name, 'ST_'||hs_nr::char(10), substring(hsk_bundesland, 1,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')
--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;
]]></sql>
</view>
</views>

Loading…
Cancel
Save