diff --git a/build.xml b/build.xml
index bb8e9dd..d876708 100644
--- a/build.xml
+++ b/build.xml
@@ -25,8 +25,8 @@ ant -f ../../conf/build.xml -DMODULE=costage -DPFAD=/home/superx/fertige_module
-
+
diff --git a/src-modules/module/costage/conf/costage.xml b/src-modules/module/costage/conf/costage.xml
index 935a536..e122b6e 100644
--- a/src-modules/module/costage/conf/costage.xml
+++ b/src-modules/module/costage/conf/costage.xml
@@ -267,9 +267,9 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" />
-
-
-
+
+
+
@@ -394,13 +394,14 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" />
+
-
+
@@ -436,7 +437,20 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten
$COSTAGE_PFAD/masken
-
+
+ Studierende Zeitreihe
+
+ $COSTAGE_PFAD/masken
+
+
+
+ Studierende Zeitreihe
+
+ $COSTAGE_PFAD/masken
+
+
+
+
@@ -496,14 +510,22 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten
+ displayType="select" visibleFields="studiengangs_bezeichnung" format="%s">
+
+
+
+
+
+
+
+
@@ -535,20 +557,21 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten
+
-
-
-
+
+
+
-
+
@@ -558,14 +581,7 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten
-
+
-
-
+
@@ -603,14 +618,7 @@ gueltig_bis DATE
-
+
-
-
+
diff --git a/src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql b/src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql
index b6c3689..2b3eb35 100644
--- a/src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql
+++ b/src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql
@@ -22,7 +22,7 @@ SA.studienstatustyp,
SA.st_studienstatus_nr,
SA.beginn_datum,
SA.gueltig_ab,
-S.matrikelnummer,
+val(S.matrikelnummer) as matrikelnummer,
S.geschlecht,
S.ca12_staat,
S.second_nationality,
@@ -33,7 +33,7 @@ null::integer as studienfach_sortierung,
null::char(10) as hrst,
null::integer as fachsemester,
null::integer as hssem,
-null::integer as status,
+null::char(10) as statustyp,
0::smallint as primaerflag,
null::integer as studiengang_nr,
null::integer as fach_nr,
@@ -51,11 +51,12 @@ and ST.st_studiengang_nr=SG.st_studiengang_nr
and S.matrikelnummer is not null
--and SM.semester_tid >= 20171
-- and SM.semester_tid <= 20171
- and S.matrikelnummer =7322871
+-- and S.matrikelnummer ='7322871'
and SG.studiengangs_typ_kb in ('ESG','TSG')
and SA.st_studium_nr=ST.st_studium_nr
and SA.st_sem_nr=SM.st_sem_nr
and SA.studienstatustyp not in ('a','o')
+and ${COSTAGE_STUDENT_FILTER}
--group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14
;
-- select * from tmp_studien
@@ -72,6 +73,15 @@ where tmp_studien.st_studstamm_nr = H.st_studstamm_nr
and tmp_studien.st_sem_nr = H.st_sem_nr
;
+
+update tmp_studien
+set fachsemester=F.fachsemester
+from costage_st_fachsemester F
+where F.st_studium_nr=tmp_studien.st_studium_nr
+and F.st_sem_nr=tmp_studien.st_sem_nr
+and F.fachsemestertyp='FS'
+;
+
update tmp_studien
set hssem=F.fachsemester
from costage_st_fachsemester F
@@ -98,11 +108,6 @@ where M.st_studiengang_nr_tsg=tmp_studien.st_studiengang_nr
update tmp_studien set fach_nr=1
where fach_nr is null;
-update tmp_studien
-set status=1
-where studienstatustyp='I' --TODO: andere Ausprägungen gem. Doku
-;
-
@@ -113,7 +118,7 @@ st_studium_nr,
matrikelnummer,
st_studiengang_nr,
st_studienstatus_nr,
- status,
+ statustyp,
hrst,
semester,
fachsemester,
@@ -128,7 +133,7 @@ select st_studium_nr,
matrikelnummer,
st_studiengang_nr,
st_studienstatus_nr,
- status,
+ studienstatustyp,
hrst,
semester,
fachsemester,
diff --git a/src-modules/module/costage/masken/43040_felderinfo.unl b/src-modules/module/costage/masken/43040_felderinfo.unl
new file mode 100644
index 0000000..2b5f8f0
--- /dev/null
+++ b/src-modules/module/costage/masken/43040_felderinfo.unl
@@ -0,0 +1,55 @@
+43040^Köpfe oder Fälle ?^0^0^0^140^150^1^sql^70^0^1^<> select apnr, eintrag from koepfe_oder_faelle order by 2^apnr, eintrag^^
+43041^Seit Semester^3^0^0^140^80^1^integer^30^0^1^<> select tid, eintrag from semester order by tid DESC;^Eintrag^<> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^
+43043^Staatsangehörigkeit^36^0^0^130^150^10^char^30^0^12^<> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^^^
+43044^Status^14^350^-1^140^180^1^sql^30^0^1^<> select apnr,druck from cifx where key=400 order by 2^^<> select apnr,eintrag from sos_status where eintrag='Alle ohne Beurl.';^
+43045^Hörerstatus^33^0^0^140^170^1^sql^30^0^1^<> select apnr, druck from cifx where key=401 order by 2^ ^ ^
+43046^Weitere Tabellen^123^0^0^140^140^10^char^30^0^1^<> \
+--freemarker template\
+select name,string_not_null(caption) || ' - ' || name from sx_tables where name in ('costage_st_studierendenstammdaten')\
+<#if <>!='tabelle_html_datenblatt.xsl'>\
+ and name in (select distinct tablename from stylesheet_field where stylesheet_id in (select tid from sx_stylesheets where filename=<>)) \
+#if>\
+order by 2^^^
+43047^bis Fachsemester^35^350^-1^140^100^1^integer^30^0^0^^^^
+43049^Bis Semester^4^350^-1^140^80^1^integer^30^0^1^<> select tid, eintrag from semester order by tid DESC;^Eintrag^<> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^
+43050^Filter Studierende^119^0^0^140^150^1^sql^20^0^1^<> SELECT id,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SOS_STUD_FILTER' order by 2;^hidden^^
+43051^Geschlecht^37^0^0^140^80^1^integer^30^0^1^<> select apnr,beschreibung from konstanten where tid=1 or tid=2;^^^
+43052^Felder^125^0^0^150^190^10^char^30^0^1^<>\
+--freemarker template\
+ select trim(F.table_name) || '.' || F.name,trim(T.caption) || ':' || trim(F.caption) || ' - ' || trim(F.name) from sx_fields F,\
+ sx_tables T where F.table_name=T.name and F.currentlyused=1\
+ --Pseudonyme eingeschaltet:\
+ and (F.name != 'matrikel_nr' or 0=(select \
+count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\
+and apnr=1)) \
+<#if <>='tabelle_html_datenblatt.xsl'>\
+ and (F.table_name ='costage_st_studien_aggr'\
+ /* or F.table_name in (<>) */) \
+<#else>\
+and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fieldname) from stylesheet_field where stylesheet_id in \
+(select tid from sx_stylesheets where filename=<>))\
+#if>\
+ order by 2;^^^
+43053^Fach^6^0^0^140^150^50^char^30^0^1^<>\
+SELECT \
+ skz_key,\
+ skz_name\
+FROM costage_st_studienkennzahlen\
+/* where unikey='<>' */\
+order by 2\
+;^^^
+43054^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^1^1^<> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^^<> select 1,'Ja' from xdummy^
+43055^tablestylesheet^121^0^0^100^200^1^char^200^1^1^<> select distinct filename,X.caption,ord from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=43040 order by ord^^<> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=43040 and S.ord=1^
+43056^Ausgabeformat^2001^0^0^100^150^1^char^200^1^1^<> select element_value,description from menu_element where element='Ausgabeformat' and nature::smallint<100 order by nature::smallint^^<> select element_value,description from menu_element where element='Ausgabeformat' and description='HTML'^
+43059^Hochschule^5^350^-1^140^80^1^integer^255^0^1^<>select hs_nr,name from kenn_hochschulen\
+where hs_nr::char(10) in (select distinct unikey from costage_st_studienkennzahlen)\
+order by 2;^ ^<> select K.hs_nr,K.name from kenn_hochschulen K, hochschulinfo H\
+where K.hs_nr=H.hs_nr^
+43060^##line##^30^0^0^100^100^1^char^5000^0^8^^^1^
+43061^Abschluss^7^0^0^140^170^5^char^30^0^1^<> SELECT \
+ code,\
+ name\
+FROM costage_st_abschlussziele_lokal\
+order by 2;^^^
+43062^Matrikel-Nr.^20^350^-1^150^180^1^char^200^0^0^^^^
+43063^##line##^40^0^0^100^100^1^char^5000^0^8^^^1^
diff --git a/src-modules/module/costage/masken/43040_maske_system_bez.unl b/src-modules/module/costage/masken/43040_maske_system_bez.unl
new file mode 100644
index 0000000..7f7a415
--- /dev/null
+++ b/src-modules/module/costage/masken/43040_maske_system_bez.unl
@@ -0,0 +1 @@
+43040^7^
diff --git a/src-modules/module/costage/masken/43040_masken_felder_bez.unl b/src-modules/module/costage/masken/43040_masken_felder_bez.unl
new file mode 100644
index 0000000..d06d41a
--- /dev/null
+++ b/src-modules/module/costage/masken/43040_masken_felder_bez.unl
@@ -0,0 +1,20 @@
+43040^43040^
+43040^43041^
+43040^43043^
+43040^43044^
+43040^43045^
+43040^43046^
+43040^43047^
+43040^43049^
+43040^43050^
+43040^43051^
+43040^43052^
+43040^43053^
+43040^43054^
+43040^43055^
+43040^43056^
+43040^43059^
+43040^43060^
+43040^43061^
+43040^43062^
+43040^43063^
diff --git a/src-modules/module/costage/masken/43040_maskeninfo.unl b/src-modules/module/costage/masken/43040_maskeninfo.unl
new file mode 100644
index 0000000..2b902dc
--- /dev/null
+++ b/src-modules/module/costage/masken/43040_maskeninfo.unl
@@ -0,0 +1,174 @@
+43040^Studierende Datenblatt (CO)^--Freemarker Template\
+<#include "SQL_lingua_franca"/>\
+<#include "SuperX_general"/>\
+<#include "SQL_multitable_output"/>\
+\
+--ram excelexport \
+<#include "SQL_lingua_franca"/>\
+<#include "SuperX_general"/>\
+<#include "SQL_multitable_output"/>\
+\
+\
+>,"<>",.vars["Weitere TabellenObject"].allKeys)}\
+ \
+ )\
+ order by 2;]]>\
+\
+>,"<>",.vars["Weitere TabellenObject"].allKeys)} )\
+and foreignkey_tab in ('costage_st_studien_aggr'\
+ ${DatenblattTables(<>,"<>",.vars["Weitere TabellenObject"].allKeys)})\
+;]]>\
+\
+>,"<>",.vars["Weitere TabellenObject"].allKeys)}\
+ )\
+ and currentlyused=1\
+ ${DatenblattFields(<>,"<>",FelderObject.allKeys)}\
+ order by 2,3;]]>\
+\
+>,"<>",.vars["Weitere TabellenObject"].allKeys)}\
+ )\
+ and currentlyused=1\
+ ${DatenblattFields(<>,"<>",FelderObject.allKeys)}\
+ order by 2,3;]]>\
+\
+\
+\
+<@generate_multitable_list />\
+<@generate_field_list_multitable aggregationsfeld="*" aggregatfunktion="count(" />\
+<@generate_foreign_fields_multitable />\
+\
+\
+<#assign filter="\
+/* and hrst in (<>) */\
+/* and semester >= <> */\
+/* and semester <= <> */\
+/* AND fachsemester <= <> */\
+/* and statustyp in(<>) */\
+/* and geschlecht=<> */\
+/* and st_studiengang_nr in (select G.st_studiengang_nr from costage_st_studiengaenge G where G.abschluss in (<>)) */\
+/* and st_studiengang_nr in (select G.st_studiengang_nr from costage_st_studiengaenge G where G.stg in (<>)) */\
+" />\
+\
+\
+<#if "<>"!="">\
+<#assign filter=filter+" and " + basetable + ".matrikel_nr in (<>)"?replace("'","")/>\
+#if>\
+<#if "<>"?index_of("S.gewichtung_id=")!=-1>\
+ <#assign filter=filter+" and "+.vars["Köpfe oder Fälle ?"]?replace('S.','sos_stud_gewichtung.')/>\
+ <#if "<>"?index_of("dim_studiengang_gew")>-1>\
+ <#assign filter=filter+" and (dim_studiengang_gew.gewichtid is null or "+.vars["Köpfe oder Fälle ?"]?replace('S.','dim_studiengang_gew.')?replace("gewichtung_id","gewichtid")+")"/>\
+ #if>\
+<#elseif "<>"!="">\
+<#assign filter=filter+" and "+.vars["Köpfe oder Fälle ?"]/>\
+#if>\
+\
+/* <#assign filter = filter + " and st_studstamm_nr in (select st_studstamm_nr from costage_st_studierendenstammdaten where '' || ca12_staat in "+Staatsangehörigkeit.allNeededKeysList /> ) --<> */\
+\
+\
+ \
+ <@generate_resultset_multitable tabellen=table_list\
+p_show_keys=<>\
+p_field_list_select=field_list_select\
+p_foreign_fields=foreign_fields\
+p_filter=filter\
+p_field_list_groupby=field_list_groupby\
+p_join_clause=join_clause\
+/>^--Freemarker Template \
+\
+>"?index_of("S.gewichtung_id=")==-1>select 'costage_st_studien_aggr' from xdummy<#else>select 'sos_stud_gewichtung' from xdummy#if>]]>\
+\
+<#assign restrict=DatenblattTables(<>,"<>",.vars["Weitere TabellenObject"].allKeys)/>;\
+<#else>\
+<#assign restrict=DatenblattTables(<>,"<>",.vars["Weitere TabellenObject"].allKeys)?replace('costage_st_studien_aggr',basetable)?replace("'dim_studiengang'","'dim_studiengang_gew'")/>;\
+#if>\
+select '${restrict?replace("\\x0027","\\x0027\\x0027")}' from xdummy;]]>\
+\
+\
+${DatenblattFields(<>,"<>",FelderObject.allKeys)}\
+ <#else>\
+${DatenblattFields(<>,"<>"?replace("costage_st_studien_aggr","sos_stud_gewichtung")?replace("dim_studiengang.","dim_studiengang_gew."),\
+FelderObject.allKeys?replace("costage_st_studien_aggr","sos_stud_gewichtung")?replace("dim_studiengang.","dim_studiengang_gew."))}\
+ #if>\
+and table_name !='dim_person_attribute_aggr'\
+--hier personattribute:\
+union SELECT P.attributevalue , -- F.caption,\
+ F.foreignkey_tab,\
+ F.description as strukturStr\
+ from sx_fields F, personattributetype P\
+ where F.table_name in ('${basetable}'\
+ ${restriction}\
+ )\
+ and currentlyused=1\
+ --Pseudonyme eingeschaltet:\
+and (name != 'matrikel_nr' or 0=(select \
+count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\
+and apnr=1))\
+<#if basetable='costage_st_studien_aggr'>\
+ ${DatenblattFields(<>,"<>",FelderObject.allKeys)}\
+ <#else>\
+ ${DatenblattFields(<>,"<>"?replace("costage_st_studien_aggr","sos_stud_gewichtung")?replace("dim_studiengang.","dim_studiengang_gew.")\
+ ,FelderObject.allKeys?replace("costage_st_studien_aggr","sos_stud_gewichtung")?replace("dim_studiengang.","dim_studiengang_gew."))}\
+ #if>\
+and table_name ='dim_person_attribute_aggr'\
+and F.name='attribute' || P.personattributetype_id\
+order by 1;]]>\
+\
+\
+XIL List\
+ sizable_columns horizontal_scrolling\
+ white_space_color=COLOR_WHITE fixed_columns=1\
+ min_heading_height=35\
+<#assign i=1 />\
+<#if get_felder?has_content >\
+<#foreach myfield in get_felder>\
+<#assign i=i+1 />\
+Column CID=${i} heading_text="${myfield.key}" explanation="${myfield.strukturStr}" center_heading\
+ row_selectable col_selectable rightJust heading_platform readonly\
+ width=20\
+<#if myfield.name != '' && <>==1>\
+<#assign i=i+1 />\
+Column CID=${i} heading_text="${myfield.key}\\n(Schlüssel)" explanation="Schlüssel des Feldes ${myfield.key}" center_heading\
+ row_selectable col_selectable rightJust heading_platform readonly\
+ width=20\
+ #if>\
+#foreach>\
+#if>\
+@@@^Altersgruppe^Anzahl^Flexible Ausgabe der Studierendenstatistik, Studiengänge und Lehreinheiten^drop table tmp_tabelle;^^2^700^360^0^1^^
diff --git a/src-modules/module/costage/masken/43040_sachgeb_maske_bez.unl b/src-modules/module/costage/masken/43040_sachgeb_maske_bez.unl
new file mode 100644
index 0000000..0ea71a7
--- /dev/null
+++ b/src-modules/module/costage/masken/43040_sachgeb_maske_bez.unl
@@ -0,0 +1 @@
+16^43040^
diff --git a/src-modules/module/costage/schluesseltabellen/cifx_fuellen.sql b/src-modules/module/costage/schluesseltabellen/cifx_fuellen.sql
new file mode 100644
index 0000000..bedc215
--- /dev/null
+++ b/src-modules/module/costage/schluesseltabellen/cifx_fuellen.sql
@@ -0,0 +1,256 @@
+--Freemarker Template
+
+
+<#assign dimensions = [
+ {"key":"400", "name":"Statustyp (CO)"},
+ {"key":"401", "name":"Hörerstatus (CO)"}
+ ] />
+
+ <#assign dimension_levels_man = [
+ {"key":"400","apnr":"a", "druck":"Studienplatz angenommen", "astat":""},
+ {"key":"400","apnr":"B", "druck":"Neueinschreibung", "astat":"2"},
+ {"key":"400","apnr":"E", "druck":"Ersteinschreibung", "astat":"1"},
+ {"key":"400","apnr":"I", "druck":"gemeldet", "astat":"3"},
+ {"key":"400","apnr":"U", "druck":"beurlaubt", "astat":"4"},
+ {"key":"400","apnr":"R", "druck":"Rücktritt von der Immatrikulation", "astat":""},
+ {"key":"400","apnr":"o", "druck":"Studium offen (noch keine Weitermeldung erfolgt)", "astat":""},
+ {"key":"400","apnr":"V", "druck":"Verzicht auf Studienplatz", "astat":""},
+ {"key":"400","apnr":"X", "druck":"geschlossen (Abschluss und/oder keine Fortsetzung möglich)", "astat":"5"},
+ {"key":"400","apnr":"Z", "druck":"geschlossen", "astat":"5"},
+ {"key":"400","apnr":"z", "druck":"wieder einzuschreiben", "astat":""}
+ ] />
+
+ <#assign dimension_levels_dynamic = [
+ {"key":"401","apnr":"hoererstatus_kb", "druck":"hoererstatus_name", "astat":"", "srctable":"costage_st_hoererstatus"}
+ ] />
+
+ create temp table tmp_cifx
+ (tid serial,
+ key smallint not null ,
+ hs integer not null,
+ apnr varchar(255) ,
+ kurz char(10),
+ druck varchar(200),
+ lang_1 char(255),
+ astat char(10) ,
+ parent varchar(255) ,
+ uniquename VARCHAR(255) ,
+ bund_apnr CHAR(10) ,
+ sort1 integer,
+ sortc1 char(10),
+ d_akt_von date,
+ d_akt_bis date,
+ sourcesystem_id varchar(255),
+ sourcesystem integer,
+lid varchar(255) ,
+parent_lid varchar(255),
+ hiskey_id varchar(255),
+ struktur_c CHAR(50)
+ );
+create temp table tmp_hilf(tid integer);
+insert into tmp_hilf(tid) select max(tid) from cifx;
+
+
+<#foreach dimension in dimensions>
+ <#foreach dimension_level in dimension_levels_man>
+ <#if dimension_level.key==dimension.key >
+
+
+insert into tmp_cifx
+ (
+ key ,
+ hs,
+ apnr ,
+ kurz ,
+ druck,
+ lang_1 ,
+ astat,
+ uniquename ,
+ d_akt_von ,
+ d_akt_bis ,
+ sourcesystem_id ,
+ sourcesystem,
+lid ,
+--parent_lid,
+ hiskey_id ,
+ struktur_c
+ )
+ select
+ ${dimension_level.key} ,
+ 0 as hs,
+ '${dimension_level.apnr}' ,
+ substring('${dimension_level.druck}' from 1 for 10) as kurz ,
+ substring('${dimension_level.druck}' from 1 for 200) as druck,
+ substring('${dimension_level.druck}' from 1 for 255) as lang_1 ,
+ <#if dimension_level.astat=="">
+ NULL::char(10)
+ <#else>
+ '${dimension_level.astat}'
+ #if> as astat,
+ '${dimension_level.apnr}' as uniquename ,
+ date_val('01.01.1900') as d_akt_von ,
+ date_val('01.01.3000')d_akt_bis ,
+ '${dimension_level.apnr}' as sourcesystem_id ,
+ 15 as sourcesystem,
+'${dimension_level.apnr}' as lid ,
+--parent_lid,
+NULL::char(10) as hiskey_id ,
+NULL::char(10) as struktur_c
+ from xdummy
+ ;
+
+ #if>
+ #foreach>
+
+ <#foreach dimension_level in dimension_levels_dynamic>
+ <#if dimension_level.key==dimension.key >
+insert into tmp_cifx
+ (
+ key ,
+ hs,
+ apnr ,
+ kurz ,
+ druck,
+ lang_1 ,
+ astat,
+ uniquename ,
+ d_akt_von ,
+ d_akt_bis ,
+ sourcesystem_id ,
+ sourcesystem,
+lid ,
+--parent_lid,
+ hiskey_id ,
+ struktur_c
+ )
+ select distinct
+ ${dimension_level.key} ,
+ 0 as hs,
+ ${dimension_level.apnr} ,
+ substring(${dimension_level.druck} from 1 for 10) as kurz ,
+ substring(${dimension_level.druck} from 1 for 200) as druck,
+ substring(${dimension_level.druck} from 1 for 255) as lang_1 ,
+ <#if dimension_level.astat=="">
+ NULL::char(10)
+ <#else>
+ ${dimension_level.astat}
+ #if> as astat,
+ ${dimension_level.apnr} as uniquename ,
+ date_val('01.01.1900') as d_akt_von ,
+ date_val('01.01.3000')d_akt_bis ,
+ ${dimension_level.apnr} as sourcesystem_id ,
+ 15 as sourcesystem,
+${dimension_level.apnr} as lid ,
+--parent_lid,
+NULL::char(10) as hiskey_id ,
+NULL::char(10) as struktur_c
+ from ${dimension_level.srctable}
+ ;
+ #if>
+ #foreach>
+
+ #foreach>
+
+--Künstliche Schlüssel aus CO:
+
+
+ --vorh. Datensätze ändern:
+update cifx set hs=T.hs ,
+ apnr=T.apnr ,
+ d_akt_von=T.d_akt_von ,
+ d_akt_bis=T.d_akt_bis ,
+ kurz=T.kurz ,
+ druck=T.druck ,
+ lang_1=T.lang_1 ,
+ parent=T.parent ,
+ astat=T.astat ,
+ hiskey_id=T.hiskey_id ,
+ uniquename=T.uniquename ,
+ sort1=T.sort1 ,
+ sortc1=T.sortc1 ,
+ sourcesystem=T.sourcesystem ,
+ sourcesystem_id=T.sourcesystem_id ,
+ struktur_c=T.struktur_c ,
+ lid=T.lid ,
+ parent_lid=T.parent_lid
+ from tmp_cifx T
+ where T.key=cifx.key
+ and T.apnr=cifx.apnr
+ and T.sourcesystem=cifx.sourcesystem;
+
+delete from tmp_cifx where (key,apnr)
+in (select key,apnr
+from cifx);
+
+
+--neue Datensätze:
+
+
+
+insert into cifx
+(tid ,
+ hs,
+ key,
+ apnr,
+ d_akt_von,
+ d_akt_bis,
+ kurz,
+ druck,
+ lang_1,
+ parent,
+ astat,
+ hiskey_id,
+ uniquename,
+ sort1,
+ sortc1,
+ sourcesystem,
+ sourcesystem_id,
+ struktur_c,
+ lid,
+ parent_lid
+ )
+ select T.tid+H.tid as tid,
+ hs,
+ key,
+ apnr,
+ d_akt_von,
+ d_akt_bis,
+ kurz,
+ druck,
+ lang_1,
+ parent,
+ astat,
+ hiskey_id,
+ uniquename,
+ sort1,
+ sortc1,
+ sourcesystem,
+ sourcesystem_id,
+ struktur_c,
+ lid,
+ parent_lid
+ from tmp_cifx T, tmp_hilf H
+
+ ;
+
+insert into trans_cifx(
+ key,
+ apnr,
+ cifx_tid,
+ sourcesystem,
+ sourcesystem_id,
+ systeminfo_id)
+select
+ T.key,
+ T.apnr,
+ C.tid,
+ T.sourcesystem,
+ T.sourcesystem_id,
+ 310 as systeminfo_id
+FROM tmp_cifx T, cifx C
+where C.key=T.key
+and T.apnr=C.apnr;
+
+
+drop table tmp_cifx;
+drop table tmp_hilf;
diff --git a/src-modules/module/costage/schluesseltabellen/sachgebiete_fuellen.sql b/src-modules/module/costage/schluesseltabellen/sachgebiete_fuellen.sql
index 3d78c91..9ea84b4 100644
--- a/src-modules/module/costage/schluesseltabellen/sachgebiete_fuellen.sql
+++ b/src-modules/module/costage/schluesseltabellen/sachgebiete_fuellen.sql
@@ -2,7 +2,7 @@
delete from sachgebiete where tid in (311);
-insert into sachgebiete(tid,name) values (311,'Laderoutinen Administr.');
+insert into sachgebiete(tid,name) values (311,'CO Basisdaten Administr.');
delete from group_sachgeb_bez where sachgebiete_id in (310,311)
and groupinfo_id in (select G.tid from groupinfo G where G.name='Administratoren' or G.name='superx') ;
diff --git a/src-modules/module/costage/schluesseltabellen/sx_stylesheets_einfuegen.sql b/src-modules/module/costage/schluesseltabellen/sx_stylesheets_einfuegen.sql
new file mode 100644
index 0000000..6eb4328
--- /dev/null
+++ b/src-modules/module/costage/schluesseltabellen/sx_stylesheets_einfuegen.sql
@@ -0,0 +1,149 @@
+--(c) 2011 Andre Knieschewski
+--Freemarker Template
+--Achtung: Macro fügt Inhalte ein
+--Bitte nur Freemarker Variablen füllen
+
+<#assign masken = [
+{"mask":"43040", "filename":"tabelle_html_datenblatt.xsl", "ord":"1"}
+] />
+
+<#assign stylesheet = [
+] />
+
+<#assign stylesheet_field = [
+] />
+
+
+--Hier eventuell notwendige delete's auf die Tabellen sx_mask_style, sx_stylesheets oder stylesheet_field einfügen.
+
+-- die Bewerberstatistiken neu einfuegen
+-- dafür erstmal die Verbindung von Bericht zu Stylesheet loeschen
+
+--Achtung: ab hier nicht ändern, Mutterdatei ist $SUPERX_DIR/db/module/sos/schluesseltabellen/sx_stylesheets_fuellen.sql
+ <@sx_stylesheets_insert
+m_masken=masken
+m_stylesheet=stylesheet
+m_stylesheet_field=stylesheet_field
+/>
+
+
+<#macro sx_stylesheets_insert m_masken m_stylesheet m_stylesheet_field>
+
+--Sicherstellen, dass keine Duplikate vorkommen:
+--####################################################################################################
+<#foreach column in m_masken>
+delete from sx_mask_style where maskeninfo_id=${column.mask} and stylesheet_id=(select tid from sx_stylesheets where filename ='${column.filename}') and ord=${column.ord};
+#foreach>
+
+<#foreach column in m_stylesheet_field>
+delete from stylesheet_field where tablename='${column.tablename}' and stylesheet_id=(select tid from sx_stylesheets where filename ='${column.filename}') and fieldname='${column.fieldname}';
+#foreach>
+
+--delete sx_stylesheets raus genommen #ak 06.03.2013
+
+
+
+-- Stylesheets füllen
+--####################################################################################################
+create temp table tmp_stylesheets (
+tid serial not null,
+filename CHAR(255) ,
+caption CHAR(255) ,
+description CHAR(255) ,
+relation CHAR(10) ,
+useragent CHAR(255) ,
+contenttype CHAR(200)
+);
+
+create temp table tmp_hilf (tid integer);
+insert into tmp_hilf select max(tid) from sx_stylesheets;
+update tmp_hilf set tid=1 where tid is null;
+
+<#assign couter_tid = 1 />
+<#foreach column in m_stylesheet>
+insert into tmp_stylesheets (tid,filename,caption,description,relation,contenttype)
+select max(tid)+${couter_tid},'${column.filename}','${column.caption}', '${column.description}', '${column.relation}','${column.contenttype}' from tmp_hilf;
+<#assign couter_tid = couter_tid + 1 />
+#foreach>
+
+--delete für tml_stylesheets hinzugefügt #ak 06.03.2013
+delete from tmp_stylesheets where filename in (select filename from sx_stylesheets);
+
+
+insert into sx_stylesheets (tid,filename, caption, description, relation, useragent, contenttype)
+SELECT tid, filename, caption, description, relation, useragent, contenttype
+FROM tmp_stylesheets;
+
+drop table tmp_stylesheets;
+
+
+-- Mask Style füllen
+--####################################################################################################
+create temp table tmp_mask_style (
+tid serial not null,
+maskeninfo_id INTEGER ,
+stylesheet_id INTEGER ,
+ord SMALLINT,
+filename char(255)
+);
+
+delete from tmp_hilf;
+insert into tmp_hilf select max(tid) from sx_mask_style;
+update tmp_hilf set tid=1 where tid is null;
+
+<#assign couter_tid = 1 />
+<#foreach column in m_masken>
+insert into tmp_mask_style (tid,maskeninfo_id,ord,filename)
+select max(tid)+${couter_tid},${column.mask},${column.ord},'${column.filename}' from tmp_hilf;
+
+update tmp_mask_style set stylesheet_id=(select max(tid) from sx_stylesheets where filename='${column.filename}')
+where filename='${column.filename}';
+<#assign couter_tid = couter_tid + 1 />
+#foreach>
+
+insert into sx_mask_style ( tid, maskeninfo_id, stylesheet_id, ord)
+SELECT tid, maskeninfo_id, stylesheet_id, ord
+FROM tmp_mask_style;
+
+drop table tmp_mask_style;
+
+
+--Field zu Stylesheet Zuordnungen:
+--####################################################################################################
+CREATE temp TABLE tmp_stylesheet_field
+(
+tid serial NOT NULL,
+stylesheet_id INTEGER,
+tablename char(255),
+fieldname char(255),
+filename char(255)
+);
+
+delete from tmp_hilf;
+insert into tmp_hilf select max(tid) from stylesheet_field;
+update tmp_hilf set tid=1 where tid is null;
+
+<#assign couter_tid = 1 />
+<#foreach column in m_stylesheet_field>
+INSERT INTO tmp_stylesheet_field (tid, filename, tablename, fieldname)
+select max(tid)+${couter_tid}, '${column.filename}', '${column.tablename}', '${column.fieldname}' from tmp_hilf;
+
+update tmp_stylesheet_field set stylesheet_id=(select max(tid) from sx_stylesheets where filename='${column.filename}')
+where filename='${column.filename}';
+<#assign couter_tid = couter_tid + 1 />
+#foreach>
+
+insert into stylesheet_field ( tid, stylesheet_id, tablename, fieldname)
+SELECT tid, stylesheet_id, tablename, fieldname
+FROM tmp_stylesheet_field;
+
+drop table tmp_stylesheet_field;
+drop table tmp_hilf;
+
+<#if SQLdialect='Postgres'>
+select sp_update_sequence('sx_stylesheets');
+select sp_update_sequence('sx_mask_style');
+select sp_update_sequence('stylesheet_field');
+#if>
+
+#macro>