Compare commits
No commits in common. 'master' and 'rpta_0.1_Release' have entirely different histories.
master
...
rpta_0.1_R
57 changed files with 522 additions and 5150 deletions
@ -1,18 +0,0 @@
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<classpath> |
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
||||
<classpathentry kind="src" path="src"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/freemarker-2.3.25.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/postgresql-42.2.19.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/superx5.0.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/saxon-he-10.5.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib_ext/servlet-api.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jersey-core-1.11.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/fop-2.2.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-jdbc-3.0.3.RELEASE.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/kettle-core-6.0.0.0-353.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-core-2.16.0.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-1.2-api-2.16.0.jar"/> |
||||
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-api-2.16.0.jar"/> |
||||
<classpathentry kind="output" path="superx/WEB-INF/classes"/> |
||||
</classpath> |
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>rpta</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
</natures> |
||||
</projectDescription> |
@ -1,2 +0,0 @@
@@ -1,2 +0,0 @@
|
||||
--rücksichern der eigenen Styles: |
||||
\! cp $WEBAPP/WEB-INF/reports/simple_table_myorg.jrtx $WEBAPP/WEB-INF/reports/simple_table.jrtx |
@ -1,63 +0,0 @@
@@ -1,63 +0,0 @@
|
||||
--freemarker Template |
||||
|
||||
<sqlvars> |
||||
<sqlvar name="lm_exam_unit_exists"> |
||||
select sp_table_exists('lm_exam_unit') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="sos_lab_pord_exists"> |
||||
select sp_table_exists('sos_lab_pord') from xdummy; |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if lm_exam_unit_exists=1 && sos_lab_pord_exists=1> |
||||
|
||||
insert into rpta_exam_unit |
||||
SELECT |
||||
matrikel_nr, |
||||
labnr, |
||||
sourcesystem, |
||||
tid_stg, |
||||
sem_der_pruefung, |
||||
note, |
||||
fach_sem_zahl, |
||||
pstatus, |
||||
prueck, |
||||
pvermerk, |
||||
bonus, |
||||
pordnr, |
||||
part, |
||||
ppflicht, |
||||
modulart, |
||||
pktxt, |
||||
pdtxt, |
||||
pversuch, |
||||
elementnr, |
||||
summe |
||||
FROM lm_exam_unit |
||||
|
||||
UNION SELECT |
||||
matrikel_nr, |
||||
labnr, |
||||
sourcesystem, |
||||
tid_stg, |
||||
sem_der_pruefung, |
||||
note, |
||||
fach_sem_zahl, |
||||
pstatus, |
||||
prueck, |
||||
pvermerk, |
||||
bonus, |
||||
pordnr, |
||||
part, |
||||
ppflicht, |
||||
modulart, |
||||
pktxt, |
||||
pdtxt, |
||||
pversuch, |
||||
pnr::varchar(255) as elementnr, |
||||
summe |
||||
FROM sos_lab_pord |
||||
WHERE sourcesystem = 5 |
||||
; |
||||
|
||||
</#if> |
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
44630^Bis Semester^4^350^-1^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^Eintrag^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||
44631^Studiengang^6^0^0^140^150^50^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht', 'SOS-Studiengang-Sicht') order by 3,2;^^^ |
||||
44632^Jahr^110^0^0^140^80^1^integer^30^0^13^ ^ ^ ^ |
||||
44645^tablestylesheet^150^0^0^100^100^1^char^255^1^1^<<SQL>> select filename,caption from sx_stylesheets S, sx_mask_style M where S.tid=M.stylesheet_id and M.maskeninfo_id=44190 order by ord^ ^<<SQL>> select filename,caption from sx_stylesheets S, sx_mask_style M where S.tid=M.stylesheet_id and M.maskeninfo_id=44190 order by ord limit 1^ |
||||
44647^Grafik^1000^300^-1^170^150^1^integer^30^0^1^<<SQL>> select tid, caption from viz_chart order by 2;^hidden^ ^ |
||||
44649^Spaltenanzahl^5^350^-1^140^80^1^integer^255^0^1^<<SQL>> SELECT 0,'Dynamisch' from xdummy \ |
||||
union SELECT 1,'1-spaltig' from xdummy \ |
||||
union SELECT 2,'2-spaltig' from xdummy \ |
||||
union SELECT 3,'3-spaltig' from xdummy \ |
||||
union SELECT 4,'4-spaltig' from xdummy \ |
||||
order by 1;^ ^<<SQL>> SELECT 2,'2-spaltig' from xdummy;^ |
||||
44650^Kachelbreite^30^0^0^100^100^1^integer^5000^0^0^^^800^ |
||||
44653^Kachelhöhe^40^0^0^100^100^1^integer^5000^0^0^^^600^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
44630^320^ |
@ -1,8 +0,0 @@
@@ -1,8 +0,0 @@
|
||||
44630^44630^ |
||||
44630^44631^ |
||||
44630^44632^ |
||||
44630^44645^ |
||||
44630^44647^ |
||||
44630^44649^ |
||||
44630^44650^ |
||||
44630^44653^ |
@ -1,106 +0,0 @@
@@ -1,106 +0,0 @@
|
||||
44630^Dashboard Kopfzeile^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<#assign jahr_filter="1=1" />\ |
||||
--Akad. Jahr 2022: WS + SS - Beispiel: WS 22/23 + SS 2023\ |
||||
<#if "<<Jahr>>" !="">\ |
||||
<#assign jahr_filter="(" />\ |
||||
<#assign jahr_filter=jahr_filter + "(substring('' || sem_rueck_beur_ein from 5 for 1)='2' and val(substring('' || sem_rueck_beur_ein from 1 for 4))=<<Jahr>>)" />\ |
||||
<#assign jahr_filter=jahr_filter + " or "/>\ |
||||
<#assign jahr_filter=jahr_filter + "(substring('' || sem_rueck_beur_ein from 5 for 1)='1' and (val(substring('' || sem_rueck_beur_ein from 1 for 4))-1)=<<Jahr>>)" />\ |
||||
<#assign jahr_filter=jahr_filter + ")" />\ |
||||
</#if>\ |
||||
\ |
||||
<#assign filter="1=1\ |
||||
/* and sem_rueck_beur_ein = <<Bis Semester>> */\ |
||||
" />\ |
||||
\ |
||||
<#assign filter= filter + " and " + jahr_filter />\ |
||||
\ |
||||
<#assign stg_filter = " and 's_' || tid_stg in "+Studiengang.allNeededKeysList /> \ |
||||
\ |
||||
create temp table tmp_erg(\ |
||||
ord integer,\ |
||||
kennz varchar(255),\ |
||||
wert integer,\ |
||||
link_maskeninfo_id integer\ |
||||
);\ |
||||
\ |
||||
insert into tmp_erg(ord,kennz,wert)\ |
||||
select 1,'Bewerbungen',sum(summe)\ |
||||
from zul_antr_aggr A\ |
||||
where A.bewsem=<<Bis Semester>>\ |
||||
and A.stg in (select L.stg from lehr_stg_ab L where 's_' || L.tid in <@printkeys Studiengang.allNeededKeysList/>)\ |
||||
and A.abschl in (select L.abschluss from lehr_stg_ab L where 's_' || L.tid in <@printkeys Studiengang.allNeededKeysList/>)\ |
||||
group by 1,2;\ |
||||
\ |
||||
\ |
||||
insert into tmp_erg(ord,kennz,wert)\ |
||||
select 10,'Studienanfänger*innen im 1. HS',sum(summe)\ |
||||
from sos_stg_aggr S, sos_stichtag I\ |
||||
where ${filter}\ |
||||
and S.studiengang_nr=1\ |
||||
and S.fach_nr=1\ |
||||
and S.stichtag=I.tid\ |
||||
and I.appl_key='0'\ |
||||
and 's_' || S.tid_stg in <@printkeys Studiengang.allNeededKeysList/>\ |
||||
and S.hssem=1\ |
||||
group by 1,2;\ |
||||
\ |
||||
\ |
||||
insert into tmp_erg(ord,kennz,wert)\ |
||||
select 20,'Studierende gesamt',sum(summe)\ |
||||
from sos_stg_aggr S, sos_stichtag I\ |
||||
where ${filter}\ |
||||
and S.studiengang_nr=1\ |
||||
and S.fach_nr=1\ |
||||
and S.stichtag=I.tid\ |
||||
and I.appl_key='0'\ |
||||
and 's_' || S.tid_stg in <@printkeys Studiengang.allNeededKeysList/>\ |
||||
group by 1,2;\ |
||||
\ |
||||
\ |
||||
insert into tmp_erg(ord,kennz,wert)\ |
||||
select 30,'Studierende im Lehramt',sum(summe)\ |
||||
from sos_stg_aggr S, sos_stichtag I, dim_studiengang D\ |
||||
where ${filter}\ |
||||
and S.studiengang_nr=1\ |
||||
and S.fach_nr=1\ |
||||
and S.stichtag=I.tid\ |
||||
and D.tid=S.tid_stg\ |
||||
and D.ist_lehramt=1\ |
||||
and I.appl_key='0'\ |
||||
and 's_' || S.tid_stg in <@printkeys Studiengang.allNeededKeysList/>\ |
||||
group by 1,2;\ |
||||
\ |
||||
insert into tmp_erg(ord,kennz,wert)\ |
||||
select 30,'Absolvent*innen',sum(summe)\ |
||||
from sos_lab_aggr S, sos_stichtag I, dim_studiengang D\ |
||||
where S.sem_der_pruefung=<<Bis Semester>>\ |
||||
and S.studiengang_nr=1\ |
||||
and S.fach_nr=1\ |
||||
and S.stichtag=I.tid\ |
||||
and D.tid=S.tid_stg\ |
||||
and I.appl_key='2'\ |
||||
and 's_' || S.tid_stg in <@printkeys Studiengang.allNeededKeysList/>\ |
||||
group by 1,2;\ |
||||
\ |
||||
select kennz,wert,link_maskeninfo_id\ |
||||
from tmp_erg\ |
||||
order by ord;^XIL List\ |
||||
sizable_columns horizontal_scrolling\ |
||||
white_space_color=COLOR_WHITE fixed_columns=1\ |
||||
drop_and_delete movable_columns\ |
||||
min_heading_height=55\ |
||||
Column CID=0 heading_text="Kennzahl" explanation="" center_heading\ |
||||
row_selectable heading_platform readonly\ |
||||
width=10\ |
||||
Column CID=0 heading_text="Wert" explanation="" center_heading\ |
||||
row_selectable heading_platform readonly\ |
||||
width=30\ |
||||
Column CID=0 heading_text="Maske" explanation="" center_heading\ |
||||
row_selectable heading_platform readonly\ |
||||
width=30\ |
||||
@@@^ ^ ^Dashboard Inistialisierung^drop table tmp_erg;^^3^700^360^0^1^^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
320^44630^ |
@ -1,29 +0,0 @@
@@ -1,29 +0,0 @@
|
||||
48000^Spaltenlayout^3000^350^-1^140^180^1^char^30^1^1^<<SQL>>SELECT uniquename,\ |
||||
caption\ |
||||
FROM rpta_column_layout \ |
||||
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename='sos_stud_astat'\ |
||||
and R.systeminfo_id=7)\ |
||||
order by sortnr, caption\ |
||||
;^^<<SQL>>SELECT uniquename,\ |
||||
caption\ |
||||
FROM rpta_column_layout \ |
||||
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename='sos_stud_astat'\ |
||||
and R.systeminfo_id=7) and uniquename='sos_stud_astat_rsz';^ |
||||
48001^Seit Semester^10^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||
48002^Fächer^30^0^0^130^200^6^integer^1000^0^12^<<SQL>> select tid,name,sortnr from sichten where art='Fächer-Sicht' order by 3,2;^ ^ ^ |
||||
48003^Abschluss^40^0^0^100^200^3^char^1500^0^1^<<SQL>> select apnr, druck from cifx where key=35 order by 2;^ ^ ^ |
||||
48004^bis Fachsemester^1000^300^-1^200^100^1^integer^30^0^0^^ ^ ^ |
||||
48005^Semestertyp^22^350^-1^140^80^1^integer^255^0^1^<<SQL>> select 1,'nur Sommersemester' from xdummy union select 2,'nur Wintersemester' from xdummy^ ^<<SQL>> select 2,'nur Wintersemester' from xdummy^ |
||||
48006^Hochschulzugangsberechtigung^120^300^-1^200^200^1^sql^30^0^1^hs_zugangsber^ ^ ^ |
||||
48007^Bis Semester^20^350^-1^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||
48008^Staatsangehörigkeit^150^0^0^140^150^10^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^ ^ ^ |
||||
48009^Studiengang^25^0^0^140^150^50^char^1000^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht', 'SOS-Studiengang-Sicht') order by 3,2;^ ^ ^ |
||||
48010^Semester^100^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^hidden^ ^ |
||||
48011^Stichtag^23^330^-1^130^100^1^sql^30^1^1^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende';^ ^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende' and appl_key='0';^ |
||||
48012^Hörerstatus^200^330^-1^140^150^1^sql^30^0^1^<<SQL>> select apnr, eintrag from hoererstatus order by 2^ ^<<SQL>> select apnr, eintrag from hoererstatus where eintrag='alle';^ |
||||
48013^Jahr^110^0^0^140^80^1^integer^30^0^13^ ^ ^ ^ |
||||
48018^Köpfe oder Fälle ?^0^0^0^140^150^1^sql^70^0^1^<<SQL>> select apnr, eintrag from koepfe_oder_faelle order by 2^ ^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag = 'Fälle';^ |
||||
48022^Geschlecht^110^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM cif where key = 9003 and apnr between 1 and 4 order by 1;^ ^ ^ |
||||
48023^Spalten^3001^0^0^150^190^10^char^30^0^1^<<SQL>>\ |
||||
select C.uniquename, C.caption ,L.layout_id from rpta_column C, rpta_column2layout L where C.tid=L.column_id and layout_id in\ |
||||
(select tid from rpta_column_layout where uniquename=<<Spaltenlayout>>) order by 2;^^^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48000^7^ |
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
48000^48000^ |
||||
48000^48001^ |
||||
48000^48002^ |
||||
48000^48003^ |
||||
48000^48004^ |
||||
48000^48005^ |
||||
48000^48006^ |
||||
48000^48007^ |
||||
48000^48008^ |
||||
48000^48009^ |
||||
48000^48010^ |
||||
48000^48011^ |
||||
48000^48012^ |
||||
48000^48013^ |
||||
48000^48018^ |
||||
48000^48022^ |
||||
48000^48023^ |
@ -1,229 +0,0 @@
@@ -1,229 +0,0 @@
|
||||
48000^Tabellenausgabe Studierende (amtlich und intern)^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<sqlvars>\ |
||||
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||
<#assign my_base_rs='sos_stud_astat' />\ |
||||
SELECT distinct name,\ |
||||
0::smallint as is_virtual,\ |
||||
name as runtime_tablename\ |
||||
from sx_tables\ |
||||
where name in ('${my_base_rs}')\ |
||||
and 0=(select count(*) from rpta_resultset R where R.uniquename='${my_base_rs}')\ |
||||
union\ |
||||
select R.uniquename,\ |
||||
1::smallint as is_virtual,\ |
||||
'tmp_' || R.uniquename as runtime_tablename\ |
||||
from rpta_resultset R where R.uniquename='${my_base_rs}'\ |
||||
;\ |
||||
]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="rpta_resultset" type="hash"><![CDATA[\ |
||||
select caption,\ |
||||
uniquename,\ |
||||
fieldclause,\ |
||||
joinclause,\ |
||||
whereclause,\ |
||||
systeminfo_id\ |
||||
from rpta_resultset\ |
||||
where uniquename='${basetable.name}';\ |
||||
\ |
||||
]]></sqlvar>\ |
||||
<sqlvar name="rpta_column_layout" type="hash"><![CDATA[\ |
||||
select L.uniquename,\ |
||||
L.caption,\ |
||||
L.whereclause\ |
||||
from rpta_resultset R, rpta_column_layout L\ |
||||
where L.resultset_id=R.tid\ |
||||
and R.uniquename='${basetable.name}'\ |
||||
and L.uniquename=<<Spaltenlayout>>;\ |
||||
\ |
||||
]]></sqlvar>\ |
||||
<sqlvar name="columns" type="hashsequence"><![CDATA[\ |
||||
SELECT C.srcfieldname,\ |
||||
(case when string_not_null(C.targetfieldname)='' then C.srcfieldname else C.targetfieldname end) as targetfieldname,\ |
||||
T.uniquename as coltype,\ |
||||
C.is_aggregate,\ |
||||
(case when string_not_null(CL.caption)='' then C.caption else CL.caption end) as caption,\ |
||||
CL.is_visible,\ |
||||
CL.visible_size as visible_width,\ |
||||
(select F.sql_code from rpta_format_code F where F.tid=CL.format_code_id) as format_sql,\ |
||||
C.col_function as colfunction,\ |
||||
(case when string_not_null(CL.description)='' then C.description else CL.description end) as description\ |
||||
FROM rpta_column_layout L, rpta_column2layout CL, rpta_column C, rpta_column_type T\ |
||||
where L.tid=CL.layout_id\ |
||||
and C.tid=CL.column_id\ |
||||
and T.tid=C.column_type\ |
||||
and L.uniquename=<<Spaltenlayout>>\ |
||||
/* and C.uniquename in (<<Spalten>>) */\ |
||||
order by CL.sortnr\ |
||||
;\ |
||||
]]></sqlvar>\ |
||||
</sqlvars>\ |
||||
\ |
||||
<#assign jahr_param="" />\ |
||||
<#assign jahr_filter="1=1" />\ |
||||
/* <#assign jahr_param="<<Jahr>>" /> */\ |
||||
--Akad. Jahr 2022: WS + SS - Beispiel: WS 22/23 + SS 2023\ |
||||
<#if jahr_param !="">\ |
||||
<#assign jahr_filter="(" />\ |
||||
<#assign jahr_filter=jahr_filter + "(substring('' || sem_rueck_beur_ein from 5 for 1)='2' and val(substring('' || sem_rueck_beur_ein from 1 for 4))="+jahr_param+")" />\ |
||||
<#assign jahr_filter=jahr_filter + " or "/>\ |
||||
<#assign jahr_filter=jahr_filter + "(substring('' || sem_rueck_beur_ein from 5 for 1)='1' and (val(substring('' || sem_rueck_beur_ein from 1 for 4))-1)="+jahr_param+")" />\ |
||||
<#assign jahr_filter=jahr_filter + ")" />\ |
||||
</#if>\ |
||||
\ |
||||
<#assign filter="<<Köpfe oder Fälle ?>>\ |
||||
/* and sem_rueck_beur_ein >= <<Seit Semester>> */\ |
||||
/* and sem_rueck_beur_ein <= <<Bis Semester>> */\ |
||||
/* and sem_rueck_beur_ein = <<Semester>> */\ |
||||
/* and stichtag = <<Stichtag>> */\ |
||||
/* and <<Hochschulzugangsberechtigung>> */\ |
||||
/* and <<Hörerstatus>>*/\ |
||||
/* and abschluss in (<<Abschluss>>) */\ |
||||
/* and geschlecht = <<Geschlecht>> */\ |
||||
/* and fach_sem_zahl <= <<bis Fachsemester>> */\ |
||||
/* and substring('' || sem_rueck_beur_ein from 5 for 1)='<<Semestertyp>>' */\ |
||||
" />\ |
||||
\ |
||||
<#assign filter= filter + " and " + jahr_filter />\ |
||||
\ |
||||
<#assign filter = filter + " and 's_' || tid_stg in "+Studiengang.allNeededKeysList /> \ |
||||
/* <#assign filter = filter + " and '' || ca12_staat in "+Staatsangehörigkeit.allNeededKeysList /> --<<Staatsangehörigkeit>> */\ |
||||
/* <#assign filter = filter + " and stg in "+Fächer.allNeededKeysList /> --<<Fächer>> */\ |
||||
\ |
||||
<#if columns?has_content>\ |
||||
\ |
||||
<#if basetable.is_virtual==1>\ |
||||
\ |
||||
create temp table ${basetable.runtime_tablename} as\ |
||||
select ${rpta_resultset.fieldclause} \ |
||||
from ${rpta_resultset.joinclause} \ |
||||
where 1=1\ |
||||
<#if rpta_resultset.whereclause != ""> \ |
||||
${rpta_resultset.whereclause} </#if>\ |
||||
and ${filter}\ |
||||
;\ |
||||
</#if>\ |
||||
\ |
||||
\ |
||||
\ |
||||
select \ |
||||
--zuerst die Basisdaten:\ |
||||
<#foreach column in columns>\ |
||||
<#if column.coltype="physicalColumn">\ |
||||
${column.srcfieldname},\ |
||||
<#elseif column.coltype="logicalColumn">\ |
||||
${column.colfunction} as ${column.targetfieldname},\ |
||||
<#elseif column.coltype="lookupColumn">\ |
||||
(${column.colfunction}) as ${column.targetfieldname},\ |
||||
<#elseif column.coltype="computedColumn">\ |
||||
null::decimal(19,6) as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_stud\ |
||||
from ${basetable.runtime_tablename}\ |
||||
<#if rpta_column_layout.whereclause !="">\ |
||||
where ${rpta_column_layout.whereclause}\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
\ |
||||
--ergebnistabelle:\ |
||||
select \ |
||||
--zuerst die nicht-Aggregate:\ |
||||
<#assign groupby=0 />\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_aggregate==0>\ |
||||
<#assign groupby=groupby+1 />\ |
||||
${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
--dann die Aggregate:\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_aggregate==1 && column.coltype!="computedColumn">\ |
||||
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_stud2\ |
||||
from tmp_stud\ |
||||
where 1=1\ |
||||
/* ${<<Zusatzfilter>>} */\ |
||||
group by\ |
||||
<#list 1..groupby as i>${i}\ |
||||
<#if i != groupby>\ |
||||
,\ |
||||
</#if>\ |
||||
</#list>\ |
||||
;\ |
||||
--für Prozentwerte alle Aggregate summieren:\ |
||||
select <#foreach column in columns>\ |
||||
<#if column.is_aggregate==1 && column.coltype!="computedColumn">\ |
||||
sum(${column.targetfieldname})::float as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_gesamt\ |
||||
from tmp_stud2\ |
||||
where 1=1\ |
||||
;\ |
||||
\ |
||||
<#assign number_of_visible_colums=0 />\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_visible!=0>\ |
||||
<#assign number_of_visible_colums=number_of_visible_colums+1 />\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
<#assign colnr=0 />\ |
||||
select \ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_visible!=0>\ |
||||
<#assign colnr=colnr+1 />\ |
||||
<#assign format_sql="" />\ |
||||
<#if column.format_sql?string != "">\ |
||||
<#assign format_sql=column.format_sql />\ |
||||
</#if>\ |
||||
\ |
||||
<#if column.coltype=="computedColumn">\ |
||||
(${column.colfunction})${format_sql} as ${column.targetfieldname}\ |
||||
<#else>\ |
||||
${column.targetfieldname}${format_sql} as ${column.targetfieldname}\ |
||||
</#if>\ |
||||
\ |
||||
<#if colnr < number_of_visible_colums>,</#if>\ |
||||
</#if> --wenn sichtbar\ |
||||
</#foreach>\ |
||||
from tmp_stud2\ |
||||
order by <#list 1..number_of_visible_colums as i>${i}\ |
||||
<#if i != number_of_visible_colums>\ |
||||
,\ |
||||
</#if>\ |
||||
</#list>\ |
||||
;\ |
||||
<#if basetable.is_virtual==1>\ |
||||
drop table if exists ${basetable.runtime_tablename};\ |
||||
</#if>\ |
||||
\ |
||||
\ |
||||
drop table if exists tmp_stud;\ |
||||
drop table if exists tmp_gesamt;\ |
||||
\ |
||||
\ |
||||
</#if> --wenn columns?has_content^--Freemarker Template\ |
||||
XIL List\ |
||||
sizable_columns horizontal_scrolling\ |
||||
drop_and_delete movable_columns \ |
||||
white_space_color=COLOR_WHITE fixed_columns=1\ |
||||
min_heading_height=55\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_visible!=0>\ |
||||
Column CID=0 heading_text="${column.caption}" center_heading explanation="${column.description}"\ |
||||
row_selectable heading_platform readonly\ |
||||
width=${column.visible_width} text_size=60\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
@@@^Studienfach^Anzahl bzw. Anteil^Datenblatt Studierendenstatistik^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^2^850^540^^1^<<SQL>>SELECT description FROM rpta_column_layout where tid=<<Spaltenlayout>>;^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
16^48000^ |
@ -1,8 +0,0 @@
@@ -1,8 +0,0 @@
|
||||
48040^Benutzer/in^50^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^hidden^^ |
||||
48041^Spaltenlayout^10^0^0^150^80^1^integer^200^0^1^<<SQL>> select tid,caption from rpta_column_layout where 1=1 /* and resultset_id=<<Virtuelle Tabelle>> */ order by 2;^^^ |
||||
48042^Spaltenlayouts verwalten^110^0^0^140^80^1^char^255^0^18^ ^ ^<<SQL>> select '../edit/rpta/rpta_column_layout_list.jsp' from xdummy;^ |
||||
48043^Stichwort^20^0^0^150^150^1^sql^50^0^0^^^^ |
||||
48044^Komponente^1^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,name from systeminfo order by 2;^ ^^ |
||||
48045^Virtuelle Tabellen bearbeiten^100^0^0^140^80^1^char^255^0^18^ ^ ^<<SQL>> select '../edit/rpta/rpta_resultset_list.jsp' from xdummy;^ |
||||
48046^Virtuelle Tabelle^5^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,caption from rpta_resultset where 1=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^ |
||||
48047^Spaltentyp^200^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,caption from rpta_column_type order by 2;^^ ^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48040^330^ |
@ -1,8 +0,0 @@
@@ -1,8 +0,0 @@
|
||||
48040^48040^ |
||||
48040^48041^ |
||||
48040^48042^ |
||||
48040^48043^ |
||||
48040^48044^ |
||||
48040^48045^ |
||||
48040^48046^ |
||||
48040^48047^ |
@ -1,121 +0,0 @@
@@ -1,121 +0,0 @@
|
||||
48040^Spalten und Spaltenlayouts verwalten^--Autor: D. Quathamer\ |
||||
--Datum: 15.3.2024\ |
||||
--freemarker template\ |
||||
create temp table tmp_rpta_column (\ |
||||
ord smallint,\ |
||||
tid INTEGER , \ |
||||
uniquename varchar(255),\ |
||||
caption varchar(255),\ |
||||
srcfieldname varchar(255),\ |
||||
column_type integer,\ |
||||
column_type_str varchar(255),\ |
||||
col_function text,\ |
||||
is_aggregate smallint,\ |
||||
resultset_id integer,\ |
||||
resultset_str varchar(255),\ |
||||
systeminfo_str varchar(255),\ |
||||
custom integer ,\ |
||||
description text,\ |
||||
targetfieldname varchar(255),\ |
||||
nextedit varchar(255)\ |
||||
);\ |
||||
insert into tmp_rpta_column (ord,\ |
||||
tid,\ |
||||
uniquename,\ |
||||
caption,\ |
||||
srcfieldname,\ |
||||
column_type_str,\ |
||||
col_function,\ |
||||
is_aggregate,\ |
||||
resultset_id,\ |
||||
custom,\ |
||||
description,\ |
||||
targetfieldname,\ |
||||
nextedit) \ |
||||
select 1 as ord,\ |
||||
C.tid,\ |
||||
C.uniquename,\ |
||||
C.caption,\ |
||||
C.srcfieldname,\ |
||||
T.caption as column_type,\ |
||||
C.col_function,\ |
||||
C.is_aggregate,\ |
||||
C.resultset_id,\ |
||||
C.custom,\ |
||||
C.description,\ |
||||
C.targetfieldname,\ |
||||
('../edit/rpta/rpta_column_edit.jsp|tid=' || C.tid)::varchar(255)\ |
||||
FROM rpta_column C, rpta_column_type T\ |
||||
where T.tid=C.column_type\ |
||||
/* and C.resultset_id=<<Virtuelle Tabelle>> */\ |
||||
/* and C.caption like '%<<Stichwort>>%' */\ |
||||
/* and C.tid in (select P.column_id from rpta_column2layout P where P.layout_id=<<Spaltenlayout>> )*/\ |
||||
/* and C.resultset_id in (select R.tid from rpta_resultset R where R.systeminfo_id=<<Komponente>> )*/\ |
||||
/* and C.column_type=<<Spaltentyp>> */\ |
||||
;\ |
||||
\ |
||||
\ |
||||
\ |
||||
update tmp_rpta_column set resultset_str=R.caption\ |
||||
from rpta_resultset R\ |
||||
where R.tid=tmp_rpta_column.resultset_id;\ |
||||
\ |
||||
\ |
||||
\ |
||||
insert into tmp_rpta_column (ord,\ |
||||
caption, \ |
||||
nextedit) \ |
||||
select 10, --ord\ |
||||
'Neuer Eintrag',\ |
||||
nvl(('../edit/qa/rpta_column_edit.jsp|tid=' || max(tid)+1)::varchar(255),'../edit/qa/rpta_column_edit.jsp'::varchar(255))\ |
||||
from rpta_column\ |
||||
;\ |
||||
\ |
||||
\ |
||||
\ |
||||
\ |
||||
\ |
||||
select \ |
||||
caption,\ |
||||
uniquename,\ |
||||
resultset_str,\ |
||||
srcfieldname,\ |
||||
column_type_str,\ |
||||
-- col_function,\ |
||||
is_aggregate,\ |
||||
custom,\ |
||||
-- description,\ |
||||
-- targetfieldname\ |
||||
nextedit \ |
||||
\ |
||||
from tmp_rpta_column\ |
||||
order by ord,caption ,uniquename\ |
||||
;^XIL List\ |
||||
drop_and_delete movable_columns sizable_columns horizontal_scrolling\ |
||||
white_space_color=COLOR_WHITE fixed_columns=2\ |
||||
min_heading_height=35\ |
||||
Column CID=0 heading_text="Name" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=50 text_size=100\ |
||||
Column CID=0 heading_text="Schlüssel" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=50 text_size=100\ |
||||
Column CID=1 heading_text="Virtuelle Tabelle" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=150 text_size=200\ |
||||
Column CID=1 heading_text="Quellfeld" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=10 text_size=200\ |
||||
Column CID=1 heading_text="Spaltentyp" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=5 text_size=200\ |
||||
Column CID=1 heading_text="Ist Aggregat?" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=5 text_size=200\ |
||||
Column CID=1 heading_text="Individuelle Spalte" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=5 text_size=200\ |
||||
Column CID=1 heading_text="Bearbeiten" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=5 text_size=200\ |
||||
@@@^^^Spaltendefinitionen und deren Zuordnung zu Berichten verwalten.^drop table tmp_rpta_column;^^1^440^360^0^1^^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
331^48040^ |
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
48080^Institution (Stelle)^1^0^0^150^150^0^char^30^0^12^<<SQL>>select tid,type,name,sortnr from sichten where art in ('SVA-Kostenstellen-Sicht','SVA-spez-Besch./Kostenstellen-Sicht','SVA-spez-Kostenstellen-Sicht') and aktiv=1 order by sortnr,type,name;^^^ |
||||
48081^Datum^0^350^-1^150^80^1^date^10^1^0^^^<<SQL>> select today() from xdummy^ |
||||
48082^Stellenkategorie^2^0^0^150^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA Kategorie' and aktiv=1 order by type,name;^hidden^^ |
||||
48083^Spalten^3001^0^0^150^190^10^char^30^0^1^<<SQL>>\ |
||||
select C.uniquename, C.caption ,L.layout_id from rpta_column C, rpta_column2layout L where C.tid=L.column_id and layout_id in\ |
||||
(select tid from rpta_column_layout where tid=<<Spaltenlayout>>) order by 2;^^^ |
||||
48084^Lehreinheit (Stelle)^4^0^0^150^150^1^char^4^0^12^<<SQL>> select tid,type,name from sichten where art ='SVA-Lehreinheiten-Sicht' and aktiv=1 order by type,name;^hidden^^ |
||||
48085^Stellen-Nr.^50^350^-1^150^80^1^integer^10^0^0^^^^ |
||||
48086^Amtsbezeichnung^55^0^0^150^160^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA Amtsdienstbez.' and aktiv=1 order by type,name;^hidden^^ |
||||
48087^Beschäftigungsstelle (Person)^65^0^0^150^150^1^char^30^0^12^<<SQL>>select tid,type,name,sortnr from sichten where art in ('SVA-Kostenstellen-Sicht','SVA-spez-Besch./Kostenstellen-Sicht') and aktiv=1 order by sortnr,type,name;^hidden^^ |
||||
48088^Kostenstelle (Person)^70^350^-1^150^150^1^char^30^0^12^<<SQL>> select tid,type,name,sortnr from sichten where art in ('SVA-Kostenstellen-Sicht','SVA-spez-Kostenstellen-Sicht','SVA-Kst-spezial') and aktiv=1 order by sortnr,type,name;^hidden^^ |
||||
48089^Haushaltsvermerk^60^350^-1^150^200^3^char^4^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA HHV' and aktiv=1 order by type,name;^hidden^^ |
||||
48090^Spaltenlayout^3000^350^-1^140^180^1^integer^50^1^1^<<SQL>>SELECT tid,\ |
||||
caption\ |
||||
FROM rpta_column_layout \ |
||||
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename='sva_pbe_aggr_sgd'\ |
||||
and R.systeminfo_id=6)\ |
||||
order by sortnr, caption\ |
||||
;^^<<SQL>>SELECT tid,\ |
||||
caption\ |
||||
FROM rpta_column_layout \ |
||||
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename='sva_pbe_aggr_sgd'\ |
||||
and R.systeminfo_id=6)\ |
||||
order by sortnr, caption\ |
||||
limit 1 \ |
||||
;^ |
||||
48091^Filter Stellen^120^350^-1^150^150^1^sql^20^0^1^<<SQL>> select id,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SVA_STELL_FILTER' order by 2;^hidden^^ |
||||
48092^Dienstart^3^350^-1^150^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA Dienstart' and aktiv=1 order by type,name;^hidden^^ |
||||
48093^BVL-Gruppe (Stelle)^74^0^0^150^120^10^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA BVL-Gruppen' and aktiv=1 order by type,name;^hidden^^ |
||||
48094^BVL-Gruppe (Person)^80^350^-1^150^120^10^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA BVL-Gruppen' and aktiv=1 order by type,name;^hidden^^ |
||||
48095^Filter Besetzung^130^0^0^150^150^1^sql^20^0^1^<<SQL>> select id,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SVA_BESETZ_FILTER' order by 2;^hidden^^ |
||||
48096^Finanzierungsquelle^302^0^0^100^200^3^char^30^0^1^<<SQL>> select id,caption from sx_repository where art='SVA_FINANZIERUNGSQUELLE' and aktiv=1 and gueltig_seit<=date_val(<<Datum>>) and gueltig_bis>=date_val(<<Datum>>) order by sort1^hidden^^ |
||||
48097^Personalkategorie^310^0^0^100^200^3^char^30^0^1^<<SQL>> select id,caption from sx_repository where art='SVA_PERSONALKATEGORIE' and aktiv=1 and gueltig_seit<=date_val(<<Datum>>) and gueltig_bis>=date_val(<<Datum>>) order by sort1^hidden^^ |
||||
48098^Stellenanzeige^1000^0^0^100^200^1^char^20^0^1^<<SQL>> select 'besetzt','nur besetzte' from xdummy union select 'frei','nur freie' from xdummy^hidden^^ |
||||
48099^Stellen-Nr. im HHPlan^52^350^-1^150^80^1^char^25^0^0^^^^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48080^6^ |
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
48080^48080^ |
||||
48080^48081^ |
||||
48080^48082^ |
||||
48080^48083^ |
||||
48080^48084^ |
||||
48080^48085^ |
||||
48080^48086^ |
||||
48080^48087^ |
||||
48080^48088^ |
||||
48080^48089^ |
||||
48080^48090^ |
||||
48080^48091^ |
||||
48080^48092^ |
||||
48080^48093^ |
||||
48080^48094^ |
||||
48080^48095^ |
||||
48080^48096^ |
||||
48080^48097^ |
||||
48080^48098^ |
||||
48080^48099^ |
@ -1,210 +0,0 @@
@@ -1,210 +0,0 @@
|
||||
48080^Stellenbesetzung und Beschäftigung (Liste)^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<sqlvars>\ |
||||
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||
<#assign my_base_rs='sva_pbe_aggr_sgd' />\ |
||||
SELECT distinct name,\ |
||||
0::smallint as is_virtual,\ |
||||
name as runtime_tablename\ |
||||
from sx_tables\ |
||||
where name in ('${my_base_rs}')\ |
||||
and 0=(select count(*) from rpta_resultset R where R.uniquename='${my_base_rs}')\ |
||||
union\ |
||||
select R.uniquename,\ |
||||
1::smallint as is_virtual,\ |
||||
'tmp_' || R.uniquename as runtime_tablename\ |
||||
from rpta_resultset R where R.uniquename='${my_base_rs}'\ |
||||
;\ |
||||
]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="rpta_resultset" type="hash"><![CDATA[\ |
||||
select caption,\ |
||||
uniquename,\ |
||||
fieldclause,\ |
||||
joinclause,\ |
||||
whereclause,\ |
||||
systeminfo_id\ |
||||
from rpta_resultset\ |
||||
where uniquename='${basetable.name}';\ |
||||
\ |
||||
]]></sqlvar>\ |
||||
<sqlvar name="rpta_column_layout" type="hash"><![CDATA[\ |
||||
select L.uniquename,\ |
||||
L.caption,\ |
||||
L.whereclause\ |
||||
from rpta_resultset R, rpta_column_layout L\ |
||||
where L.resultset_id=R.tid\ |
||||
and R.uniquename='${basetable.name}'\ |
||||
and L.tid=<<Spaltenlayout>>;\ |
||||
\ |
||||
]]></sqlvar>\ |
||||
<sqlvar name="columns" type="hashsequence"><![CDATA[\ |
||||
SELECT C.srcfieldname,\ |
||||
(case when string_not_null(C.targetfieldname)='' then C.srcfieldname else C.targetfieldname end) as targetfieldname,\ |
||||
T.uniquename as coltype,\ |
||||
C.is_aggregate,\ |
||||
(case when string_not_null(CL.caption)='' then C.caption else CL.caption end) as caption,\ |
||||
CL.is_visible,\ |
||||
CL.visible_size as visible_width,\ |
||||
(select F.sql_code from rpta_format_code F where F.tid=CL.format_code_id) as format_sql,\ |
||||
C.col_function as colfunction,\ |
||||
(case when string_not_null(CL.description)='' then C.description else CL.description end) as description\ |
||||
FROM rpta_column_layout L, rpta_column2layout CL, rpta_column C, rpta_column_type T\ |
||||
where L.tid=CL.layout_id\ |
||||
and C.tid=CL.column_id\ |
||||
and T.tid=C.column_type\ |
||||
and L.tid=<<Spaltenlayout>>\ |
||||
/* and C.uniquename in (<<Spalten>>) */\ |
||||
order by CL.sortnr\ |
||||
;\ |
||||
]]></sqlvar>\ |
||||
</sqlvars>\ |
||||
\ |
||||
<#assign filter="sva_sgd_aggr.d_gueltig_anfang <= date_val(<<Datum>>) \ |
||||
and sva_sgd_aggr.d_gueltig_ende >= date_val(<<Datum>>)\ |
||||
\ |
||||
/* and sva_sgd_aggr.ca115_haushverm in <@printkeys .vars["Haushaltsvermerk"].allNeededKeys /> -- <<Haushaltsvermerk>> */\ |
||||
/* and sva_sgd_aggr.ca107_dienstart in <@printkeys .vars["Dienstart"].allNeededKeys /> --<<Dienstart>>= */\ |
||||
/* and sva_sgd_aggr.ca259_kategorie in <@printkeys .vars["Stellenkategorie"].allNeededKeys /> -- <<Stellenkategorie>> */\ |
||||
/* and sva_sgd_aggr.ca108_amtsbez in <@printkeys .vars["Amtsbezeichnung"].allNeededKeys /> -- <<Amtsbezeichnung>> */\ |
||||
/* and sva_sgd_aggr.lehreinheit in <@printkeys .vars["Lehreinheit (Stelle)"].allNeededKeys /> -- <<Lehreinheit (Stelle)>> */\ |
||||
/* and sva_sgd_aggr.ca109_key_bvl in <@printkeys .vars["BVL-Gruppe (Stelle)"].allNeededKeys /> --<<BVL-Gruppe (Stelle)>>*/\ |
||||
/* and sva_sgd_aggr.stellen_nr=<<Stellen-Nr.>> */\ |
||||
/* and ${<<Filter Stellen>>} */\ |
||||
" />\ |
||||
\ |
||||
<#if "<<Stellen-Nr. im HHPlan>>"!="">\ |
||||
<#assign hn="<<Stellen-Nr. im HHPlan>>"?replace("'","")/>\ |
||||
<#assign filter = filter + "and sva_sgd_aggr.haushalt_nr like '"+hn+"%'" />\ |
||||
</#if>\ |
||||
\ |
||||
\ |
||||
\ |
||||
<#assign filter = filter + " and sva_sgd_aggr.ch110_besch_st in "+.vars["Institution (Stelle)"].allNeededKeysList /> \ |
||||
\ |
||||
<#if columns?has_content>\ |
||||
\ |
||||
<#if basetable.is_virtual==1>\ |
||||
\ |
||||
create temp table ${basetable.runtime_tablename} as\ |
||||
select ${rpta_resultset.fieldclause} \ |
||||
from ${rpta_resultset.joinclause} \ |
||||
where 1=1\ |
||||
<#if rpta_resultset.whereclause != ""> \ |
||||
${rpta_resultset.whereclause} </#if>\ |
||||
and ${filter}\ |
||||
;\ |
||||
</#if>\ |
||||
\ |
||||
--Daten außerhalb des Berichtszeitraums entfernen:\ |
||||
delete from ${basetable.runtime_tablename}\ |
||||
where sva_pbe_aggr_d_besetz_anfang > date_val(<<Datum>>)\ |
||||
or sva_pbe_aggr_d_besetz_ende < date_val(<<Datum>>);\ |
||||
\ |
||||
select \ |
||||
--zuerst die Basisdaten:\ |
||||
<#foreach column in columns>\ |
||||
<#if column.coltype="physicalColumn">\ |
||||
${column.srcfieldname},\ |
||||
<#elseif column.coltype="logicalColumn">\ |
||||
${column.colfunction} as ${column.targetfieldname},\ |
||||
<#elseif column.coltype="lookupColumn">\ |
||||
(${column.colfunction}) as ${column.targetfieldname},\ |
||||
<#elseif column.coltype="computedColumn">\ |
||||
null::decimal(19,6) as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_stud\ |
||||
from ${basetable.runtime_tablename}\ |
||||
<#if rpta_column_layout.whereclause !="">\ |
||||
where ${rpta_column_layout.whereclause}\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
\ |
||||
--ergebnistabelle:\ |
||||
select \ |
||||
--zuerst die nicht-Aggregate:\ |
||||
<#assign groupby=0 />\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_aggregate==0>\ |
||||
<#assign groupby=groupby+1 />\ |
||||
${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
--dann die Aggregate:\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_aggregate==1 && column.coltype!="computedColumn">\ |
||||
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_stud2\ |
||||
from tmp_stud\ |
||||
where 1=1\ |
||||
/* ${<<Zusatzfilter>>} */\ |
||||
group by\ |
||||
<#list 1..groupby as i>${i}\ |
||||
<#if i != groupby>\ |
||||
,\ |
||||
</#if>\ |
||||
</#list>\ |
||||
;\ |
||||
\ |
||||
<#assign number_of_visible_colums=0 />\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_visible!=0>\ |
||||
<#assign number_of_visible_colums=number_of_visible_colums+1 />\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
<#assign colnr=0 />\ |
||||
select \ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_visible!=0>\ |
||||
<#assign colnr=colnr+1 />\ |
||||
<#assign format_sql="" />\ |
||||
<#if column.format_sql?string != "">\ |
||||
<#assign format_sql=column.format_sql />\ |
||||
</#if>\ |
||||
\ |
||||
<#if column.coltype=="computedColumn">\ |
||||
(${column.colfunction})${format_sql} as ${column.targetfieldname}\ |
||||
<#else>\ |
||||
${column.targetfieldname}${format_sql} as ${column.targetfieldname}\ |
||||
</#if>\ |
||||
\ |
||||
<#if colnr < number_of_visible_colums>,</#if>\ |
||||
</#if> --wenn sichtbar\ |
||||
</#foreach>\ |
||||
from tmp_stud2\ |
||||
order by <#list 1..number_of_visible_colums as i>${i}\ |
||||
<#if i != number_of_visible_colums>\ |
||||
,\ |
||||
</#if>\ |
||||
</#list>\ |
||||
;\ |
||||
<#if basetable.is_virtual==1>\ |
||||
drop table if exists ${basetable.runtime_tablename};\ |
||||
</#if>\ |
||||
\ |
||||
\ |
||||
drop table if exists tmp_stud;\ |
||||
\ |
||||
</#if> --wenn columns?has_content^--Freemarker Template\ |
||||
XIL List\ |
||||
sizable_columns horizontal_scrolling\ |
||||
drop_and_delete movable_columns \ |
||||
white_space_color=COLOR_WHITE fixed_columns=1\ |
||||
min_heading_height=55\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_visible!=0>\ |
||||
Column CID=0 heading_text="${column.caption}" center_heading explanation="${column.description}"\ |
||||
row_selectable heading_platform readonly\ |
||||
width=${column.visible_width} text_size=60\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
@@@^^^Informationen über Stellen und deren Besetzung zu einem bel. Zeitpunkt^drop table tmp_stud2;^^2^700^500^^1^<<SQL>> select 'Achtung: Das Datum des Buttons Institution bzw OrgEinheit (Stelle) unterscheidet sich vom ausgewählten Datum im Maskenfeld.' from xdummy where <<Institution (Stelle)-Stand>> != date_val(<<Datum>>)^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
100^48080^ |
@ -1,27 +0,0 @@
@@ -1,27 +0,0 @@
|
||||
48110^Spaltenlayout^3000^350^-1^140^180^1^char^30^1^1^<<SQL>>SELECT uniquename,\ |
||||
caption\ |
||||
FROM rpta_column_layout \ |
||||
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename='rpta_exam_unit_dim_studiengang'\ |
||||
)\ |
||||
order by sortnr, caption\ |
||||
;^ ^<<SQL>>SELECT uniquename,\ |
||||
caption\ |
||||
FROM rpta_column_layout \ |
||||
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename='rpta_exam_unit_dim_studiengang'\ |
||||
) and uniquename='rpta_exam_unit_dim_studiengang_note';^ |
||||
48111^Seit Semester^10^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||
48112^Fächer^30^0^0^130^200^6^char^1000^0^12^<<SQL>> select tid,name,sortnr from sichten where art='Fächer-Sicht' order by 3,2;^ ^ ^ |
||||
48113^Abschluss^40^0^0^100^200^3^char^1500^0^1^<<SQL>> select apnr, druck from cifx where key=35 order by 2;^ ^ ^ |
||||
48114^bis Fachsemester^1000^300^-1^200^100^1^integer^30^0^0^^ ^ ^ |
||||
48115^Semestertyp^22^350^-1^140^80^1^integer^255^0^1^<<SQL>> select 1,'nur Sommersemester' from xdummy union select 2,'nur Wintersemester' from xdummy^Eintrag^<<SQL>> select 2,'nur Wintersemester' from xdummy^ |
||||
48116^Hochschulzugangsberechtigung^120^300^-1^200^200^1^sql^30^0^1^hs_zugangsber^apnr, eintrag^ ^ |
||||
48117^Bis Semester^20^350^-1^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||
48118^Staatsangehörigkeit^150^0^0^140^150^10^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^ ^ ^ |
||||
48119^Studiengang^25^0^0^140^150^50^char^1000^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht', 'SOS-Studiengang-Sicht') order by 3,2;^ ^ ^ |
||||
48121^Stichtag^23^330^-1^130^100^1^sql^30^1^1^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende';^ ^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende' and appl_key='0';^ |
||||
48122^Hörerstatus^200^330^-1^140^150^1^sql^30^0^1^<<SQL>> select apnr, eintrag from hoererstatus order by 2^apnr, eintrag^<<SQL>> select apnr, eintrag from hoererstatus where eintrag='alle';^ |
||||
48128^Köpfe oder Fälle ?^0^0^0^140^150^1^sql^70^0^1^<<SQL>> select apnr, eintrag from koepfe_oder_faelle order by 2^apnr, eintrag^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag = 'Fälle';^ |
||||
48132^Geschlecht^110^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM cif where key = 9003 and apnr between 1 and 4 order by 1;^ ^ ^ |
||||
48133^Spalten^3001^0^0^150^190^10^char^30^0^1^<<SQL>>\ |
||||
select C.uniquename, C.caption ,L.layout_id from rpta_column C, rpta_column2layout L where C.tid=L.column_id and layout_id in\ |
||||
(select tid from rpta_column_layout where uniquename=<<Spaltenlayout>>) order by 2;^ ^ ^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48110^7^ |
@ -1,15 +0,0 @@
@@ -1,15 +0,0 @@
|
||||
48110^48110^ |
||||
48110^48111^ |
||||
48110^48112^ |
||||
48110^48113^ |
||||
48110^48114^ |
||||
48110^48115^ |
||||
48110^48116^ |
||||
48110^48117^ |
||||
48110^48118^ |
||||
48110^48119^ |
||||
48110^48121^ |
||||
48110^48122^ |
||||
48110^48128^ |
||||
48110^48132^ |
||||
48110^48133^ |
@ -1,214 +0,0 @@
@@ -1,214 +0,0 @@
|
||||
48110^Leistungen und Studiengänge^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<sqlvars>\ |
||||
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||
<#assign my_base_rs='rpta_exam_unit_dim_studiengang' />\ |
||||
SELECT distinct name,\ |
||||
0::smallint as is_virtual,\ |
||||
name as runtime_tablename\ |
||||
from sx_tables\ |
||||
where name in ('${my_base_rs}')\ |
||||
and 0=(select count(*) from rpta_resultset R where R.uniquename='${my_base_rs}')\ |
||||
union\ |
||||
select R.uniquename,\ |
||||
1::smallint as is_virtual,\ |
||||
'tmp_' || R.uniquename as runtime_tablename\ |
||||
from rpta_resultset R where R.uniquename='${my_base_rs}'\ |
||||
;\ |
||||
]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="rpta_resultset" type="hash"><![CDATA[\ |
||||
select caption,\ |
||||
uniquename,\ |
||||
fieldclause,\ |
||||
joinclause,\ |
||||
whereclause,\ |
||||
systeminfo_id\ |
||||
from rpta_resultset\ |
||||
where uniquename='${basetable.name}';\ |
||||
\ |
||||
]]></sqlvar>\ |
||||
<sqlvar name="rpta_column_layout" type="hash"><![CDATA[\ |
||||
select L.uniquename,\ |
||||
L.caption,\ |
||||
L.whereclause\ |
||||
from rpta_resultset R, rpta_column_layout L\ |
||||
where L.resultset_id=R.tid\ |
||||
and R.uniquename='${basetable.name}'\ |
||||
and L.uniquename=<<Spaltenlayout>>;\ |
||||
\ |
||||
]]></sqlvar>\ |
||||
<sqlvar name="columns" type="hashsequence"><![CDATA[\ |
||||
SELECT C.srcfieldname,\ |
||||
(case when string_not_null(C.targetfieldname)='' then C.srcfieldname else C.targetfieldname end) as targetfieldname,\ |
||||
T.uniquename as coltype,\ |
||||
C.is_aggregate,\ |
||||
(case when string_not_null(CL.caption)='' then C.caption else CL.caption end) as caption,\ |
||||
CL.is_visible,\ |
||||
CL.visible_size as visible_width,\ |
||||
(select F.sql_code from rpta_format_code F where F.tid=CL.format_code_id) as format_sql,\ |
||||
C.col_function as colfunction,\ |
||||
(case when string_not_null(CL.description)='' then C.description else CL.description end) as description\ |
||||
FROM rpta_column_layout L, rpta_column2layout CL, rpta_column C, rpta_column_type T\ |
||||
where L.tid=CL.layout_id\ |
||||
and C.tid=CL.column_id\ |
||||
and T.tid=C.column_type\ |
||||
and L.uniquename=<<Spaltenlayout>>\ |
||||
/* and C.uniquename in (<<Spalten>>) */\ |
||||
order by CL.sortnr\ |
||||
;\ |
||||
]]></sqlvar>\ |
||||
</sqlvars>\ |
||||
\ |
||||
<#assign filter="1=1\ |
||||
/* and sem_der_pruefung >= <<Seit Semester>> */\ |
||||
/* and sem_der_pruefung <= <<Bis Semester>> */\ |
||||
/* and sem_der_pruefung = <<Semester>> */\ |
||||
/* and substring('' || sem_der_pruefung from 5 for 1)='<<Semestertyp>>' */\ |
||||
" />\ |
||||
\ |
||||
<#assign filter = filter + " and 's_' || tid_stg in "+Studiengang.allNeededKeysList /> \ |
||||
\ |
||||
<#if columns?has_content>\ |
||||
\ |
||||
<#if basetable.is_virtual==1>\ |
||||
\ |
||||
create temp table ${basetable.runtime_tablename} as\ |
||||
select ${rpta_resultset.fieldclause} \ |
||||
from ${rpta_resultset.joinclause} \ |
||||
where 1=1\ |
||||
<#if rpta_resultset.whereclause != ""> \ |
||||
${rpta_resultset.whereclause} </#if>\ |
||||
and ${filter}\ |
||||
;\ |
||||
</#if>\ |
||||
\ |
||||
\ |
||||
\ |
||||
select \ |
||||
--zuerst die Basisdaten:\ |
||||
<#foreach column in columns>\ |
||||
<#if column.coltype="physicalColumn">\ |
||||
${column.srcfieldname} as ${column.srcfieldname},\ |
||||
<#elseif column.coltype="logicalColumn">\ |
||||
${column.colfunction} as ${column.targetfieldname},\ |
||||
<#elseif column.coltype="lookupColumn">\ |
||||
(${column.colfunction}) as ${column.targetfieldname},\ |
||||
<#elseif column.coltype="computedColumn" || column.coltype=="processingColumn">\ |
||||
null::decimal(19,6) as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_stud\ |
||||
from ${basetable.runtime_tablename}\ |
||||
<#if rpta_column_layout.whereclause !="">\ |
||||
where ${rpta_column_layout.whereclause}\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
--ergebnistabelle:\ |
||||
select \ |
||||
--zuerst die nicht-Aggregate:\ |
||||
<#assign groupby=0 />\ |
||||
<#foreach column in columns>\ |
||||
-- logicalColumns ausgeschlossen, da sie von processingColumns aggregiert werden\ |
||||
-- computedColumns immer mitnehmen, da später verarbeitet\ |
||||
<#if column.is_aggregate==0 && column.coltype!="logicalColumn" && column.coltype!="processingColumn" || column.coltype="computedColumn"> \ |
||||
<#assign groupby=groupby+1 />\ |
||||
${column.targetfieldname},\ |
||||
<#elseif column.is_aggregate==0 && column.coltype="processingColumn"> \ |
||||
<#assign groupby=groupby+1 />\ |
||||
${column.srcfieldname} as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
--dann die Aggregate:\ |
||||
<#foreach column in columns>\ |
||||
-- logicalColumns ausgeschlossen, da sie von processingColumns aggregiert werden\ |
||||
-- computedColumns ausgeschlossen, da später im finalen select verarbeitet\ |
||||
<#if column.is_aggregate==1 && column.coltype!="computedColumn" && column.coltype!="logicalColumn"> \ |
||||
${column.colfunction}(${column.srcfieldname}) as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_stud2\ |
||||
from tmp_stud\ |
||||
where 1=1\ |
||||
/* ${<<Zusatzfilter>>} */\ |
||||
group by\ |
||||
<#list 1..groupby as i>${i}\ |
||||
<#if i != groupby>\ |
||||
,\ |
||||
</#if>\ |
||||
</#list>\ |
||||
;\ |
||||
--für Prozentwerte alle Aggregate summieren:\ |
||||
select <#foreach column in columns>\ |
||||
<#if column.is_aggregate==1 && column.coltype!="computedColumn" && column.coltype!="processingColumn">\ |
||||
sum(${column.targetfieldname})::float as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_gesamt\ |
||||
from tmp_stud2\ |
||||
where 1=1\ |
||||
;\ |
||||
\ |
||||
<#assign number_of_visible_colums=0 />\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_visible!=0>\ |
||||
<#assign number_of_visible_colums=number_of_visible_colums+1 />\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
<#assign colnr=0 />\ |
||||
select \ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_visible!=0>\ |
||||
<#assign colnr=colnr+1 />\ |
||||
<#assign format_sql="" />\ |
||||
<#if column.format_sql?string != "">\ |
||||
<#assign format_sql=column.format_sql />\ |
||||
</#if>\ |
||||
\ |
||||
<#if column.coltype=="computedColumn">\ |
||||
(${column.colfunction})${format_sql} as ${column.targetfieldname}\ |
||||
<#else>\ |
||||
${column.targetfieldname}${format_sql} as ${column.targetfieldname}\ |
||||
</#if>\ |
||||
\ |
||||
<#if colnr < number_of_visible_colums>,</#if>\ |
||||
</#if> --wenn sichtbar\ |
||||
</#foreach>\ |
||||
from tmp_stud2\ |
||||
order by <#list 1..number_of_visible_colums as i>${i}\ |
||||
<#if i != number_of_visible_colums>\ |
||||
,\ |
||||
</#if>\ |
||||
</#list>\ |
||||
;\ |
||||
<#if basetable.is_virtual==1>\ |
||||
drop table if exists ${basetable.runtime_tablename};\ |
||||
</#if>\ |
||||
\ |
||||
\ |
||||
drop table if exists tmp_stud;\ |
||||
drop table if exists tmp_stud2;\ |
||||
drop table if exists tmp_gesamt;\ |
||||
\ |
||||
\ |
||||
</#if> --wenn columns?has_content^--Freemarker Template\ |
||||
XIL List\ |
||||
sizable_columns horizontal_scrolling\ |
||||
drop_and_delete movable_columns \ |
||||
white_space_color=COLOR_WHITE fixed_columns=1\ |
||||
min_heading_height=55\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_visible!=0>\ |
||||
Column CID=0 heading_text="${column.caption}" center_heading explanation="${column.description}"\ |
||||
row_selectable heading_platform readonly\ |
||||
width=${column.visible_width} text_size=60\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
@@@^Studienfach^Anzahl bzw. Anteil^Leistungen und Studiengänge^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^2^850^540^^1^<<SQL>>SELECT description FROM rpta_column_layout where tid=<<Spaltenlayout>>;^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
16^48110^ |
@ -1,65 +0,0 @@
@@ -1,65 +0,0 @@
|
||||
#!/bin/bash |
||||
|
||||
#Arbeitsverzeichnis fuer crontab |
||||
PFAD=$2 |
||||
if [ "$PFAD" != "" ] |
||||
then |
||||
|
||||
cd $PFAD |
||||
|
||||
fi |
||||
#Umgebung einlesen: |
||||
if [ "$RPTA_PFAD" = "" ] |
||||
then |
||||
echo "ACHTUNG: Die Umgebungsvariable RPTA_PFAD ist nicht gesetzt. Bitte prüfen Sie $SUPERX_DIR/db/bin/SQL_ENV" |
||||
|
||||
exit 1 |
||||
|
||||
fi |
||||
if [ "$RPTA_ERRORMAIL" != "" ] |
||||
then |
||||
ERRORMAIL=$RPTA_ERRORMAIL |
||||
export ERRORMAIL |
||||
fi |
||||
if [ "$RPTA_LOGMAIL" != "" ] |
||||
then |
||||
LOGMAIL=$RPTA_LOGMAIL |
||||
export LOGMAIL |
||||
fi |
||||
if [ "$RPTA_BACKUP" != "" ] |
||||
then |
||||
MODULE_BACKUP=$RPTA_BACKUP |
||||
export MODULE_BACKUP |
||||
fi |
||||
|
||||
#hier geht es los |
||||
#runAndCheck.x path command (EXIT_ON_ERROR|CONT_ON_ERROR) (SEND_ERRORMAIL|NO_ERRORMAIL) (SEND_LOGMAIL|NO_LOGMAIL) [description] " |
||||
echo "rpta-Update startet" >$RPTA_ERRORDAT |
||||
#Tagesdatum für Systeminfo |
||||
date +'%d.%m.%Y' > $RPTA_LOAD_PFAD/superx.datum |
||||
|
||||
runAndCheck.x $RPTA_PFAD "module_etl.x rpta $RPTA_PFAD $RPTA_LOAD_PFAD" EXIT_ON_ERROR SEND_ERRORMAIL SEND_LOGMAIL "RPTA update$MANDANTID" |
||||
cat $RPTA_PFAD/L_RPTA_update$MANDANTID.log >>$RPTA_ERRORDAT |
||||
|
||||
|
||||
fgrep -s "not found" $RPTA_ERRORDAT |
||||
FLAG1=$? |
||||
fgrep -i -s "error" $RPTA_ERRORDAT |
||||
FLAG2=$? |
||||
fgrep -i -s "nicht gefunden" $RPTA_ERRORDAT |
||||
FLAG3=$? |
||||
if [ $FLAG1 -eq 0 -o $FLAG2 -eq 0 -o $FLAG3 -eq 0 ] |
||||
then |
||||
echo "Fehler beim RPTA-Update " |
||||
echo "---------------------------------------" |
||||
echo "Fehlerprotokoll in $RPTA_ERRORDAT" |
||||
echo "---------------------------------------" |
||||
cp $RPTA_LOAD_PFAD/superx.datum.alt $RPTA_LOAD_PFAD/superx.datum |
||||
else |
||||
echo "RPTA-Update erfolgreich" |
||||
fi |
||||
|
||||
echo "---------------------------Beginn Prüfroutine-----------------------------------" >>$RPTA_ERRORDAT |
||||
#cat $RPTA_PFAD/L_rpta_Test$MANDANTID.log >>$RPTA_ERRORDAT |
||||
pruefmail.x $RPTA_PFAD/L_rpta_Test$MANDANTID.log $ERRORMAIL |
||||
|
@ -1,223 +0,0 @@
@@ -1,223 +0,0 @@
|
||||
84^RPTA-Makros^<#macro rpta_column_layout_fuellen>\ |
||||
CREATE temp TABLE tmp_rpta_column\ |
||||
(\ |
||||
uniquename varchar(255) NOT NULL,\ |
||||
caption varchar(255),\ |
||||
srcfieldname varchar(255),\ |
||||
targetfieldname varchar(255),\ |
||||
column_type integer,\ |
||||
col_function text,\ |
||||
is_visible smallint,\ |
||||
visible_size smallint,\ |
||||
is_aggregate smallint,\ |
||||
resultset_id integer,\ |
||||
sortnr integer,\ |
||||
description TEXT,\ |
||||
format_code_uniquename varchar(255),\ |
||||
format_code_id integer\ |
||||
);\ |
||||
\ |
||||
CREATE temp TABLE tmp_rpta_column_layout\ |
||||
(\ |
||||
uniquename varchar(255) NOT NULL,\ |
||||
caption varchar(255),\ |
||||
resultset_id integer,\ |
||||
whereclause text,\ |
||||
description text\ |
||||
);\ |
||||
\ |
||||
insert into tmp_rpta_column_layout(\ |
||||
resultset_id,\ |
||||
uniquename,\ |
||||
caption,\ |
||||
whereclause,\ |
||||
description\ |
||||
)\ |
||||
select tid,\ |
||||
'${rpta_column_layout.uniquename}',\ |
||||
'${rpta_column_layout.caption}',\ |
||||
'${rpta_column_layout.whereclause}',\ |
||||
'${rpta_column_layout.description}'\ |
||||
FROM rpta_resultset\ |
||||
where uniquename='${rpta_column_layout.rpta_resultset}';\ |
||||
\ |
||||
<#assign sortnr=0 />\ |
||||
<#foreach column in rpta_columns>\ |
||||
<#assign sortnr=sortnr +1 />\ |
||||
\ |
||||
INSERT INTO tmp_rpta_column\ |
||||
(resultset_id,\ |
||||
uniquename,\ |
||||
caption,\ |
||||
srcfieldname,\ |
||||
targetfieldname,\ |
||||
column_type,\ |
||||
col_function,\ |
||||
is_visible,\ |
||||
visible_size,\ |
||||
is_aggregate,\ |
||||
sortnr,\ |
||||
description,\ |
||||
format_code_uniquename\ |
||||
)\ |
||||
select R.tid,\ |
||||
'${column.uniquename}',\ |
||||
'${column.caption}',\ |
||||
'${column.srcfieldname}',\ |
||||
<#if !column.targetfieldname?exists || column.targetfieldname=="">null::varchar <#else>'${column.targetfieldname}' </#if>,\ |
||||
T.tid as column_type,\ |
||||
<#if column.col_function?exists>'${column.col_function}'<#else>null::varchar </#if>,\ |
||||
${column.is_visible},\ |
||||
${column.visible_size},\ |
||||
${column.is_aggregate},\ |
||||
${sortnr*10},\ |
||||
<#if column.description?exists>'${column.description}'<#else>null::varchar </#if>,\ |
||||
<#if column.format_code?exists>'${column.format_code}'<#else>null::varchar </#if>\ |
||||
FROM rpta_resultset R, rpta_column_type T\ |
||||
where R.uniquename='${rpta_column_layout.rpta_resultset}'\ |
||||
and T.uniquename='${column.column_type}';\ |
||||
\ |
||||
</#foreach>\ |
||||
\ |
||||
update tmp_rpta_column set format_code_id=C.tid\ |
||||
from rpta_format_code C\ |
||||
where C.uniquename=tmp_rpta_column.format_code_uniquename\ |
||||
and format_code_uniquename is not null;\ |
||||
\ |
||||
\ |
||||
select * into temp tmp_rpta_column2layout\ |
||||
from rpta_column2layout\ |
||||
where layout_id in (select L.tid\ |
||||
from rpta_column_layout L,rpta_resultset R\ |
||||
where R.tid=L.resultset_id \ |
||||
and R.uniquename='${rpta_column_layout.rpta_resultset}'\ |
||||
and L.uniquename='${rpta_column_layout.uniquename}'\ |
||||
)\ |
||||
; \ |
||||
\ |
||||
select uniquename into temp tmp_rpta_column_layout_target\ |
||||
from rpta_column_layout\ |
||||
where resultset_id in (select tid\ |
||||
FROM rpta_resultset\ |
||||
where uniquename='${rpta_column_layout.rpta_resultset}')\ |
||||
and uniquename in (select uniquename from tmp_rpta_column_layout)\ |
||||
;\ |
||||
--falls neu\ |
||||
insert into rpta_column_layout\ |
||||
(uniquename,\ |
||||
caption,\ |
||||
resultset_id,\ |
||||
whereclause,\ |
||||
description)\ |
||||
select uniquename,\ |
||||
caption,\ |
||||
resultset_id,\ |
||||
whereclause,\ |
||||
description\ |
||||
FROM tmp_rpta_column_layout T\ |
||||
where not exists (select uniquename from tmp_rpta_column_layout_target);\ |
||||
\ |
||||
--falls geändert, uniquename muss bleiben\ |
||||
update rpta_column_layout\ |
||||
set (caption, resultset_id, whereclause, description)\ |
||||
= ( select caption, resultset_id,\ |
||||
whereclause,\ |
||||
description\ |
||||
FROM tmp_rpta_column_layout T\ |
||||
where T.uniquename=rpta_column_layout.uniquename)\ |
||||
where rpta_column_layout.uniquename=(select uniquename from tmp_rpta_column_layout);\ |
||||
\ |
||||
drop table tmp_rpta_column_layout_target;\ |
||||
\ |
||||
delete from rpta_column2layout\ |
||||
where layout_id in (select L.tid\ |
||||
from rpta_column_layout L,rpta_resultset R\ |
||||
where R.tid=L.resultset_id \ |
||||
and R.uniquename='${rpta_column_layout.rpta_resultset}'\ |
||||
and L.uniquename='${rpta_column_layout.uniquename}'\ |
||||
)\ |
||||
; \ |
||||
\ |
||||
select * into temp tmp_rpta_column2 \ |
||||
from tmp_rpta_column T \ |
||||
where (resultset_id,uniquename) not in\ |
||||
(select resultset_id,uniquename from rpta_column);\ |
||||
\ |
||||
INSERT INTO rpta_column\ |
||||
(resultset_id,\ |
||||
uniquename,\ |
||||
caption,\ |
||||
srcfieldname,\ |
||||
targetfieldname,\ |
||||
column_type,\ |
||||
col_function,\ |
||||
is_aggregate,\ |
||||
description,\ |
||||
custom\ |
||||
)\ |
||||
select \ |
||||
resultset_id,\ |
||||
uniquename,\ |
||||
caption,\ |
||||
srcfieldname,\ |
||||
targetfieldname,\ |
||||
column_type,\ |
||||
col_function,\ |
||||
is_aggregate,\ |
||||
description,\ |
||||
0 as custom\ |
||||
from tmp_rpta_column2; \ |
||||
\ |
||||
--evtl. neuen Satz einfügen, dann alle updaten\ |
||||
\ |
||||
update rpta_column set ( caption,\ |
||||
srcfieldname,\ |
||||
targetfieldname,\ |
||||
column_type,\ |
||||
col_function,\ |
||||
is_aggregate,\ |
||||
description)\ |
||||
= (select caption,\ |
||||
srcfieldname,\ |
||||
targetfieldname,\ |
||||
column_type,\ |
||||
col_function,\ |
||||
is_aggregate,\ |
||||
description\ |
||||
from tmp_rpta_column T\ |
||||
where T.resultset_id=rpta_column.resultset_id\ |
||||
and T.uniquename=rpta_column.uniquename)\ |
||||
where custom=0\ |
||||
and (resultset_id,uniquename) in\ |
||||
(select T.resultset_id,T.uniquename\ |
||||
from tmp_rpta_column T)\ |
||||
;\ |
||||
\ |
||||
drop table tmp_rpta_column2;\ |
||||
\ |
||||
insert into rpta_column2layout(column_id,\ |
||||
layout_id,\ |
||||
sortnr,\ |
||||
is_visible,\ |
||||
visible_size,\ |
||||
caption,\ |
||||
description,\ |
||||
format_code_id)\ |
||||
select C.tid as column_id,\ |
||||
L.tid as layout_id,\ |
||||
T.sortnr,\ |
||||
T.is_visible,\ |
||||
T.visible_size,\ |
||||
T.caption,\ |
||||
T.description,\ |
||||
T.format_code_id\ |
||||
FROM rpta_column C, rpta_column_layout L, tmp_rpta_column T\ |
||||
where C.uniquename=T.uniquename\ |
||||
and C.resultset_id=T.resultset_id\ |
||||
and L.uniquename='${rpta_column_layout.uniquename}'\ |
||||
and L.resultset_id=T.resultset_id\ |
||||
;\ |
||||
drop table tmp_rpta_column;\ |
||||
drop TABLE tmp_rpta_column_layout;\ |
||||
drop TABLE tmp_rpta_column2layout;\ |
||||
</#macro>^Makros zum Umgang mit Spaltenlayouts^^1^ |
@ -1,15 +0,0 @@
@@ -1,15 +0,0 @@
|
||||
|
||||
delete from fm_templates where id in (select id from tmp_templates); |
||||
|
||||
insert into fm_templates(id, |
||||
content, |
||||
description, |
||||
comment, |
||||
version) select id, |
||||
content, |
||||
description, |
||||
comment, |
||||
version from tmp_templates; |
||||
|
||||
drop table tmp_templates; |
||||
|
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash |
||||
#löscht alle nicht-kern-templates und entlädt die Tabelle sortiert ins Rohdaten Verzeichnis (für git-diff). |
||||
|
||||
|
||||
|
||||
|
||||
SX_CLIENT=jdbc |
||||
export SX_CLIENT |
||||
#man_catalogue |
||||
DOQUERY "select * from fm_templates where id in ('RPTA-Makros')" false $DBDELIMITER ./fm_templates.unl txt |
||||
|
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash |
||||
|
||||
DOQUERY "create table tmp_templates(tid integer, |
||||
id char(200) not null, |
||||
content text not null, |
||||
description char(200) , |
||||
comment char(200) , |
||||
version integer default 1 |
||||
|
||||
) |
||||
;" |
||||
|
||||
sx_auto_upload_table.x tmp_templates ./fm_templates.unl |
||||
|
||||
DOSQL fm_templates_fuellen.sql |
||||
|
||||
|
@ -1,429 +0,0 @@
@@ -1,429 +0,0 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="sos_lab_pord_exists"> |
||||
select sp_table_exists('sos_lab_pord') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source" type="hash"> |
||||
select name |
||||
from sx_tables where name ='sos_lab_pord' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"><![CDATA[ |
||||
select 1::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'dim_studiengang.tid=sos_lab_pord.tid_stg and sos_lab_pord.sem_der_pruefung >= semester_von and sos_lab_pord.sem_der_pruefung <= semester_bis' as joinclause |
||||
from sx_tables where name in ('dim_studiengang') |
||||
union select 10::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sos_lab_pord.labnr=sos_lab.labnr and sos_lab_pord.sourcesystem=sos_lab.sourcesystem' as joinclause |
||||
from sx_tables where name in ('sos_lab') |
||||
union select 20::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'cif.apnr=sos_lab_pord.pversion and sos_lab_pord.sourcesystem=5 and cif.key=632' as joinclause |
||||
from sx_tables where name in ('cif') |
||||
|
||||
]]></sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source.name}' |
||||
--and currentlyused=1 |
||||
and name in ('matrikel_nr', |
||||
'sem_der_pruefung', |
||||
'hrst', |
||||
'fach_sem_zahl', |
||||
'kz_rueck_beur_ein', |
||||
'part', |
||||
'pnr', |
||||
'pversuch', |
||||
'prueck', |
||||
'pversion', |
||||
'pstatus', |
||||
'd_abg_pruefung', |
||||
'note', |
||||
'pvermerk', |
||||
'pform', |
||||
'studiengang_nr', |
||||
'fach_nr', |
||||
'is_modul', |
||||
'tid_stg', |
||||
'pdtxt', |
||||
'sourcesystem', |
||||
'labnr' |
||||
) |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'dim_studiengang_' || name as targetname |
||||
from sx_fields where table_name ='dim_studiengang' |
||||
and currentlyused=1 |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sos_lab_' || name as targetname |
||||
from sx_fields where table_name ='sos_lab' |
||||
and name in ('ppruef1','ppruef2','panerk') |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'pversion_ktxt' as targetname |
||||
from sx_fields where table_name ='cif' |
||||
and name in ('lang_3') |
||||
|
||||
|
||||
order by 1 |
||||
|
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if sos_lab_pord_exists==1> |
||||
|
||||
<#assign fact_table_target = {"name":"sos_lab_pord_ppruef", "caption":"Modulprüfungen und Prüfer_innen"} |
||||
/> |
||||
|
||||
drop index if exists ix_sos_lab_pord_is_modul; |
||||
|
||||
create index ix_sos_lab_pord_is_modul on sos_lab_pord (is_modul ); |
||||
|
||||
CREATE temp table tmp_tables( |
||||
name CHAR(255) , |
||||
caption CHAR(255) , |
||||
description CHAR(255) , |
||||
table_type CHAR(255) , |
||||
systeminfo_id INTEGER , |
||||
systeminfo_orig INTEGER , |
||||
thema CHAR(255) , |
||||
sachgebiete_id CHAR(255) |
||||
); |
||||
CREATE temp TABLE tmp_fields( |
||||
tid serial NOT NULL, |
||||
table_name VARCHAR(255) not null, |
||||
name VARCHAR(255) not null, |
||||
caption VARCHAR(255) , |
||||
description VARCHAR(255) , |
||||
field_type VARCHAR(255) not null, |
||||
field_size VARCHAR(255) , |
||||
field_not_null smallint, |
||||
currentlyused SMALLINT , |
||||
is_primarykey SMALLINT default 0 , |
||||
foreignkey_tab VARCHAR(255) , |
||||
foreignkey_col VARCHAR(255) , |
||||
foreignkey_int VARCHAR(255) , |
||||
foreignkey_cap VARCHAR(255) , |
||||
foreignkey_cond VARCHAR(255) , |
||||
foreignkey_func VARCHAR(255) , |
||||
check_integrity SMALLINT, |
||||
is_sum SMALLINT default 1, |
||||
foreignkey_uniquename VARCHAR(255) |
||||
|
||||
); |
||||
|
||||
|
||||
|
||||
update sx_fields set |
||||
is_sum=0 |
||||
where table_name='sos_lab_pord' |
||||
and name!='summe'; |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='sos_lab_pord' |
||||
and name='summe'; |
||||
|
||||
|
||||
insert into tmp_tables ( |
||||
name, |
||||
caption, |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
) |
||||
select |
||||
'${fact_table_target.name}', |
||||
'${fact_table_target.caption}', |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
from sx_tables where name='${fact_table_source.name}' |
||||
; |
||||
|
||||
|
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${fact_table_source.name}' |
||||
and currentlyused=1; |
||||
<#foreach added_table in added_tables> |
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
'${added_table.prefix}' || name, |
||||
'${added_table.caption}: ' || caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${added_table.name}' |
||||
and currentlyused=1; |
||||
</#foreach> |
||||
|
||||
CREATE temp TABLE tmp_rpta_resultset |
||||
( |
||||
caption varchar(255), |
||||
uniquename varchar(255), |
||||
fieldclause text, |
||||
joinclause text, |
||||
whereclause text, |
||||
systeminfo_id integer |
||||
); |
||||
|
||||
insert into tmp_rpta_resultset(caption, |
||||
uniquename, |
||||
systeminfo_id) |
||||
select '${fact_table_target.caption}', |
||||
'${fact_table_target.name}', |
||||
7 |
||||
; |
||||
|
||||
|
||||
update tmp_rpta_resultset set fieldclause=' |
||||
<#foreach field_target in fields_target> |
||||
${field_target.table_name}.${field_target.name} as ${field_target.targetname}, |
||||
</#foreach> |
||||
null::varchar as dummy', |
||||
joinclause='${fact_table_source.name} |
||||
<#foreach added_table in added_tables> |
||||
left outer join ${added_table.name} on (${added_table.joinclause}) |
||||
</#foreach>'; |
||||
|
||||
select * into temp tmp_rs1 |
||||
from rpta_resultset |
||||
; |
||||
|
||||
update rpta_resultset set caption=T.caption, |
||||
fieldclause=T.fieldclause, |
||||
joinclause=T.joinclause, |
||||
whereclause=T.whereclause |
||||
from tmp_rpta_resultset T |
||||
where T.systeminfo_id=rpta_resultset.systeminfo_id |
||||
and T.uniquename=rpta_resultset.uniquename |
||||
; |
||||
|
||||
insert into rpta_resultset(caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id) |
||||
select caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id |
||||
from tmp_rpta_resultset |
||||
where 0=(select count(*) |
||||
from tmp_rs1 T |
||||
where T.systeminfo_id=tmp_rpta_resultset.systeminfo_id |
||||
and T.uniquename=tmp_rpta_resultset.uniquename) |
||||
; |
||||
drop table tmp_rpta_resultset; |
||||
drop table tmp_rs1; |
||||
|
||||
delete from sx_tables where name |
||||
in (select T.name from tmp_tables T); |
||||
|
||||
insert into sx_tables (name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id) |
||||
select name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id |
||||
from tmp_tables; |
||||
|
||||
|
||||
delete from sx_fields where table_name |
||||
in (select T.table_name from tmp_fields T); |
||||
|
||||
insert into sx_fields (table_name,name,caption,description,field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyUsed, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_cap, |
||||
foreignkey_int, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
) |
||||
select |
||||
F.table_name,F.name,F.caption,F.description,F.field_type, |
||||
F.field_size, |
||||
F.field_not_null, |
||||
F.currentlyUsed, |
||||
F.foreignkey_tab, |
||||
F.foreignkey_col, |
||||
F.foreignkey_cap, |
||||
F.foreignkey_int, |
||||
F.foreignkey_cond, |
||||
F.foreignkey_func, |
||||
F.check_integrity, |
||||
F.is_sum, |
||||
F.foreignkey_uniquename |
||||
|
||||
from tmp_fields F; |
||||
|
||||
|
||||
drop table tmp_fields; |
||||
drop table tmp_tables; |
||||
|
||||
|
||||
--rpta_column füllen: |
||||
select * into temp tmp_rc1 |
||||
from rpta_column; |
||||
|
||||
|
||||
create temp table tmp_rpta_column( |
||||
uniquename varchar(255) NOT NULL, |
||||
caption varchar(255), |
||||
srcfieldname varchar(255), |
||||
column_type integer, |
||||
col_function text, |
||||
is_aggregate smallint, |
||||
resultset_id integer, |
||||
description text, |
||||
custom integer default 0 |
||||
); |
||||
|
||||
insert into tmp_rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description) |
||||
select F.name as uniquename, |
||||
coalesce(T.caption,T.name) || ' - ' || F.caption, |
||||
F.name as srcfieldname, |
||||
1 as column_type, |
||||
(case when F.is_sum=1 then 'sum' else null::varchar end) as col_function, |
||||
(case when F.is_sum=1 then 1 else 0 end) as is_aggregate, |
||||
R.tid as resultset_id, |
||||
F.description |
||||
from rpta_resultset R, sx_fields F left outer join sx_tables T on (T.name=F.table_name) |
||||
where F.table_name='${fact_table_target.name}' |
||||
and R.uniquename='${fact_table_target.name}' |
||||
and F.currentlyused=1 |
||||
; |
||||
|
||||
update rpta_column set |
||||
caption=T.caption, |
||||
srcfieldname=T.srcfieldname, |
||||
column_type=T.column_type, |
||||
col_function=T.col_function, |
||||
is_aggregate=T.is_aggregate, |
||||
resultset_id=R.tid, |
||||
description=T.description, |
||||
custom=T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where T.uniquename=rpta_column.uniquename |
||||
and rpta_column.resultset_id=R.tid |
||||
and R.uniquename='${fact_table_target.name}' |
||||
; |
||||
insert into rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description, |
||||
custom) |
||||
select T.uniquename, |
||||
T.caption, |
||||
T.srcfieldname, |
||||
T.column_type, |
||||
T.col_function, |
||||
T.is_aggregate, |
||||
R.tid as resultset_id, |
||||
T.description, |
||||
T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where R.uniquename='${fact_table_target.name}' |
||||
and 0=(select count(*) from tmp_rc1 C |
||||
where C.uniquename=T.uniquename |
||||
and C.resultset_id=R.tid) |
||||
; |
||||
|
||||
drop table tmp_rpta_column; |
||||
drop table tmp_rc1; |
||||
|
||||
</#if> --wenn sos_lab_pord_exists=1 |
@ -1,373 +0,0 @@
@@ -1,373 +0,0 @@
|
||||
--freemarker template |
||||
<#include "RPTA-Makros"/> |
||||
<sqlvars> |
||||
<sqlvar name="rpta_exam_unit_dim_studiengang_exists"> |
||||
select count(*) from rpta_resultset where uniquename='rpta_exam_unit_dim_studiengang'; |
||||
</sqlvar> |
||||
<sqlvar name="rpta_resultset"> |
||||
select uniquename from rpta_resultset where uniquename='rpta_exam_unit_dim_studiengang'; |
||||
</sqlvar> |
||||
</sqlvars> |
||||
<#assign rpta_column_layouts = [{"uniquename":"rpta_exam_unit_dim_studiengang_note", |
||||
"caption":"Prüfungsergebnisse", |
||||
"rpta_resultset":"rpta_exam_unit_dim_studiengang", |
||||
"whereclause":"modulart=''P''", |
||||
"description":"Prüfung und Noten" |
||||
}] |
||||
/> |
||||
|
||||
<#assign rpta_columns = [ |
||||
|
||||
{"uniquename":"elementnr", |
||||
"srcfieldname":"elementnr", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"pnr", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pdtxt", |
||||
"srcfieldname":"pdtxt", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"summe", |
||||
"srcfieldname":"summe", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"sum", |
||||
"format_code":"", |
||||
"caption":"Teilnehmer", |
||||
"is_visible":"1", |
||||
"is_aggregate":1, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"note_schnitt", |
||||
"srcfieldname":"note", |
||||
"targetfieldname":"note_schnitt", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"avg", |
||||
"format_code":"", |
||||
"caption":"Durchschnittsnote *", |
||||
"is_visible":"0", |
||||
"is_aggregate":1, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"note_schnitt_case", |
||||
"srcfieldname":"note_schnitt", |
||||
"targetfieldname":"note_schnitt_case", |
||||
"column_type":"computedColumn", |
||||
"col_function":"case when summe < 5 then null else note_schnitt end", |
||||
"format_code":"", |
||||
"caption":"Durchschnittsnote *", |
||||
"is_visible":"1", |
||||
"is_aggregate":1, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pstatus_nb", |
||||
"srcfieldname":"pstatus", |
||||
"targetfieldname":"pstatus_nb", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"(case when pstatus in (''NB'',''EN'') then 1 else 0 end)", |
||||
"format_code":"", |
||||
"caption":"Durchfallquote in % *", |
||||
"is_visible":"0", |
||||
"is_aggregate":0, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pstatus_nb_sum", |
||||
"srcfieldname":"pstatus_nb", |
||||
"targetfieldname":"pstatus_nb_sum", |
||||
"column_type":"processingColumn", |
||||
"col_function":"sum", |
||||
"format_code":"", |
||||
"caption":"Durchfallquote in % *", |
||||
"is_visible":"0", |
||||
"is_aggregate":1, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pstatus_nb_quote", |
||||
"srcfieldname":"pstatus_nb_sum", |
||||
"targetfieldname":"pstatus_nb_quote", |
||||
"column_type":"computedColumn", |
||||
"col_function":"case when summe < 5 then null else pstatus_nb_sum/summe::decimal(18,2)*100 end", |
||||
"format_code":"DEC_2", |
||||
"caption":"Durchfallquote in % *", |
||||
"is_visible":"1", |
||||
"is_aggregate":1, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pvermerk_ne", |
||||
"srcfieldname":"pvermerk", |
||||
"targetfieldname":"pvermerk_ne", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"(case when pvermerk in (''NE'',''N'') then 1 else 0 end)", |
||||
"format_code":"", |
||||
"caption":"Nicht erschienen", |
||||
"is_visible":"0", |
||||
"is_aggregate":0, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pvermerk_ne_sum", |
||||
"srcfieldname":"pvermerk_ne", |
||||
"targetfieldname":"pvermerk_ne_sum", |
||||
"column_type":"processingColumn", |
||||
"col_function":"sum", |
||||
"format_code":"INTEGER", |
||||
"caption":"Nicht erschienen", |
||||
"is_visible":"1", |
||||
"is_aggregate":1, |
||||
"visible_size":5, |
||||
"description":""} |
||||
|
||||
|
||||
] /> |
||||
|
||||
|
||||
---ab hier nicht mehr ändern: |
||||
|
||||
CREATE temp TABLE tmp_rpta_column |
||||
( |
||||
uniquename varchar(255) NOT NULL, |
||||
caption varchar(255), |
||||
srcfieldname varchar(255), |
||||
targetfieldname varchar(255), |
||||
column_type integer, |
||||
col_function text, |
||||
is_visible smallint, |
||||
visible_size smallint, |
||||
is_aggregate smallint, |
||||
resultset_id integer, |
||||
sortnr integer, |
||||
description TEXT, |
||||
format_code_uniquename varchar(255), |
||||
format_code_id integer |
||||
); |
||||
|
||||
CREATE temp TABLE tmp_rpta_column_layout |
||||
( |
||||
uniquename varchar(255) NOT NULL, |
||||
caption varchar(255), |
||||
resultset_id integer, |
||||
whereclause text, |
||||
description text |
||||
); |
||||
|
||||
|
||||
<#foreach rpta_column_layout in rpta_column_layouts> |
||||
|
||||
insert into tmp_rpta_column_layout( |
||||
resultset_id, |
||||
uniquename, |
||||
caption, |
||||
whereclause, |
||||
description |
||||
) |
||||
select tid, |
||||
'${rpta_column_layout.uniquename}', |
||||
'${rpta_column_layout.caption}', |
||||
'${rpta_column_layout.whereclause}', |
||||
'${rpta_column_layout.description}' |
||||
FROM rpta_resultset |
||||
where uniquename='${rpta_column_layout.rpta_resultset}'; |
||||
|
||||
</#foreach > |
||||
|
||||
<#assign sortnr=0 /> |
||||
<#foreach column in rpta_columns> |
||||
<#assign sortnr=sortnr +1 /> |
||||
|
||||
INSERT INTO tmp_rpta_column |
||||
(resultset_id, |
||||
uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_visible, |
||||
visible_size, |
||||
is_aggregate, |
||||
sortnr, |
||||
description, |
||||
format_code_uniquename |
||||
) |
||||
select R.tid, |
||||
'${column.uniquename}', |
||||
'${column.caption}', |
||||
'${column.srcfieldname}', |
||||
<#if !column.targetfieldname?exists || column.targetfieldname=="">null::varchar <#else>'${column.targetfieldname}' </#if>, |
||||
T.tid as column_type, |
||||
<#if column.col_function?exists>'${column.col_function}'<#else>null::varchar </#if>, |
||||
${column.is_visible}, |
||||
${column.visible_size}, |
||||
${column.is_aggregate}, |
||||
${sortnr*10}, |
||||
<#if column.description?exists>'${column.description}'<#else>null::varchar </#if>, |
||||
<#if column.format_code?exists>'${column.format_code}'<#else>null::varchar </#if> |
||||
FROM rpta_resultset R, rpta_column_type T |
||||
where R.uniquename='${rpta_resultset}' |
||||
and T.uniquename='${column.column_type}'; |
||||
|
||||
</#foreach> |
||||
|
||||
update tmp_rpta_column set format_code_id=C.tid |
||||
from rpta_format_code C |
||||
where C.uniquename=tmp_rpta_column.format_code_uniquename |
||||
and format_code_uniquename is not null; |
||||
|
||||
|
||||
select * into temp tmp_rpta_column2layout |
||||
from rpta_column2layout |
||||
where layout_id in (select L.tid |
||||
from rpta_column_layout L,rpta_resultset R |
||||
where R.tid=L.resultset_id |
||||
and R.uniquename='${rpta_resultset}' |
||||
and L.uniquename in ( |
||||
<#foreach rpta_column_layout in rpta_column_layouts> |
||||
'${rpta_column_layout.uniquename}', |
||||
</#foreach>'xy') |
||||
) |
||||
; |
||||
|
||||
select * into temp tmp_rpta_column_layout_target |
||||
from rpta_column_layout |
||||
where resultset_id in (select tid |
||||
FROM rpta_resultset |
||||
where uniquename='${rpta_resultset}') |
||||
and uniquename in (select uniquename from tmp_rpta_column_layout) |
||||
; |
||||
|
||||
insert into rpta_column_layout |
||||
(uniquename, |
||||
caption, |
||||
resultset_id, |
||||
whereclause, |
||||
description) |
||||
select uniquename, |
||||
caption, |
||||
resultset_id, |
||||
whereclause, |
||||
description |
||||
FROM tmp_rpta_column_layout T |
||||
where 0=(select count(*) from tmp_rpta_column_layout_target T2 |
||||
where T.uniquename=T2.uniquename); |
||||
|
||||
drop table tmp_rpta_column_layout_target; |
||||
|
||||
delete from rpta_column2layout |
||||
where layout_id in (select L.tid |
||||
from rpta_column_layout L,rpta_resultset R |
||||
where R.tid=L.resultset_id |
||||
and R.uniquename='${rpta_resultset}' |
||||
and L.uniquename in ( |
||||
<#foreach rpta_column_layout in rpta_column_layouts> |
||||
'${rpta_column_layout.uniquename}', |
||||
</#foreach>'xy') |
||||
) |
||||
; |
||||
|
||||
select * into temp tmp_rpta_column2 |
||||
from tmp_rpta_column T |
||||
where (resultset_id,uniquename) not in |
||||
(select resultset_id,uniquename from rpta_column); |
||||
|
||||
INSERT INTO rpta_column |
||||
(resultset_id, |
||||
uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
description, |
||||
custom |
||||
) |
||||
select |
||||
resultset_id, |
||||
uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
description, |
||||
0 as custom |
||||
from tmp_rpta_column2; |
||||
|
||||
--evtl. neuen Satz einfügen, dann alle updaten |
||||
|
||||
update rpta_column set ( caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
description) |
||||
= (select caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
description |
||||
from tmp_rpta_column T |
||||
where T.resultset_id=rpta_column.resultset_id |
||||
and T.uniquename=rpta_column.uniquename) |
||||
where custom=0 |
||||
and (resultset_id,uniquename) in |
||||
(select T.resultset_id,T.uniquename |
||||
from tmp_rpta_column T) |
||||
; |
||||
|
||||
drop table tmp_rpta_column2; |
||||
|
||||
insert into rpta_column2layout(column_id, |
||||
layout_id, |
||||
sortnr, |
||||
is_visible, |
||||
visible_size, |
||||
caption, |
||||
description, |
||||
format_code_id) |
||||
select C.tid as column_id, |
||||
L.tid as layout_id, |
||||
T.sortnr, |
||||
T.is_visible, |
||||
T.visible_size, |
||||
T.caption, |
||||
T.description, |
||||
T.format_code_id |
||||
FROM rpta_column C, rpta_column_layout L, tmp_rpta_column T |
||||
where C.uniquename=T.uniquename |
||||
and C.resultset_id=T.resultset_id |
||||
and L.uniquename in ( |
||||
<#foreach rpta_column_layout in rpta_column_layouts> |
||||
'${rpta_column_layout.uniquename}', |
||||
</#foreach>'xy') |
||||
and L.resultset_id=T.resultset_id |
||||
; |
||||
drop table tmp_rpta_column; |
||||
drop table if exists tmp_rpta_column2; |
||||
drop TABLE tmp_rpta_column_layout; |
||||
|
||||
|
||||
|
||||
|
@ -1,79 +0,0 @@
@@ -1,79 +0,0 @@
|
||||
--freemarker template |
||||
<#include "RPTA-Makros"/> |
||||
<#assign rpta_column_layout = {"uniquename":"sos_stud_astat_rsz", |
||||
"caption":"MKW-Abfrage_Studierende_RSZ", |
||||
"rpta_resultset":"sos_stud_astat", |
||||
"whereclause":"fach_sem_zahl <= dim_studiengang_regel", |
||||
"description":"MKW-Abfrage_Studierende_RSZ" |
||||
} |
||||
/> |
||||
|
||||
<#assign rpta_columns = [ |
||||
{"uniquename":"sos_k_stort_astat", |
||||
"caption":"Hochschulnummer Statistik", |
||||
"srcfieldname":"sos_k_stort_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0" |
||||
}, |
||||
{"uniquename":"dim_studiengang_stg_astat", |
||||
"caption":"HSF-Schlüssel", |
||||
"srcfieldname":"dim_studiengang_stg_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0" |
||||
}, |
||||
{"uniquename":"sos_k_stufrm_astat", |
||||
"caption":"Art des Studiums", |
||||
"srcfieldname":"sos_k_stufrm_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0" |
||||
}, |
||||
{"uniquename":"dim_studiengang_abschluss_astat", |
||||
"caption":"Abschlussschlüssel Statistik NRW", |
||||
"srcfieldname":"dim_studiengang_abschluss_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0" |
||||
}, |
||||
{"uniquename":"sos_k_stutyp_astat", |
||||
"caption":"Vollzeit / Teilzeit / ausbildungsintegriert / praxisintegriert / berufsintegriert", |
||||
"srcfieldname":"sos_k_stutyp_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0" |
||||
}, |
||||
{"uniquename":"dim_studiengang_regel", |
||||
"caption":"Angabe der Regelstudienzeit", |
||||
"srcfieldname":"dim_studiengang_regel", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0" |
||||
}, |
||||
{"uniquename":"summe", |
||||
"caption":"Anzahl der Studierenden in der Regelstudienzeit", |
||||
"srcfieldname":"summe", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"sum", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1" |
||||
} |
||||
] |
||||
/> |
||||
|
||||
|
||||
<@rpta_column_layout_fuellen /> |
@ -1,182 +0,0 @@
@@ -1,182 +0,0 @@
|
||||
--freemarker template |
||||
<#include "RPTA-Makros"/> |
||||
<sqlvars> |
||||
<sqlvar name="rpta_installed"> |
||||
select count(*) from systeminfo where tid=330; |
||||
</sqlvar> |
||||
</sqlvars> |
||||
<#assign rpta_column_layout = {"uniquename":"sgd_pbe_pbv", |
||||
"caption":"Stellen, Besetzungen und Beschäftigungsverhältnisse", |
||||
"rpta_resultset":"sva_pbe_aggr_sgd", |
||||
"whereclause":"", |
||||
"description":"Stellendaten, Besetzungen und Personaldaten" |
||||
} |
||||
/> |
||||
|
||||
<#assign rpta_columns = [ |
||||
{"uniquename":"ch110_besch_st", |
||||
"caption":"Beschäftigungsstelle (Schlüssel)", |
||||
"srcfieldname":"ch110_besch_st", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Beschäftigungsstelle (Schlüssel)" |
||||
}, |
||||
{"uniquename":"ch110_besch_st_str", |
||||
"caption":"Beschäftigungsstelle", |
||||
"srcfieldname":"ch110_besch_st_str", |
||||
"column_type":"lookupColumn", |
||||
"col_function":"select C.druck from cifx C where C.key=110 and C.apnr=ch110_besch_st", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Beschäftigungsstelle (Name)" |
||||
}, |
||||
{"uniquename":"stellen_nr", |
||||
"caption":"Stellen-Nr.", |
||||
"srcfieldname":"stellen_nr", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Stellen-Nr." |
||||
}, |
||||
{"uniquename":"haushalt_nr", |
||||
"caption":"Stellen-Nr. im HH-Plan", |
||||
"srcfieldname":"haushalt_nr", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Stellen-Nr. im HH-Plan" |
||||
}, |
||||
{"uniquename":"widmung", |
||||
"caption":"Widmung", |
||||
"srcfieldname":"sva_sgd_widmung", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Widmung" |
||||
}, |
||||
{"uniquename":"sva_sgd_von", |
||||
"caption":"Stellengültigkeit (von)", |
||||
"srcfieldname":"d_finanz_anfang", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Stellengültigkeit (von)" |
||||
}, |
||||
{"uniquename":"sva_sgd_bis", |
||||
"caption":"Stellengültigkeit (bis)", |
||||
"srcfieldname":"d_finanz_ende", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Stellengültigkeit (bis)" |
||||
}, |
||||
{"uniquename":"sgd_ansatz", |
||||
"caption":"Stellen-Ansatz", |
||||
"srcfieldname":"kont_proz_soll", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Stellen-Ansatz" |
||||
}, |
||||
{"uniquename":"personal_nr", |
||||
"caption":"Personal-Nr.", |
||||
"srcfieldname":"sva_pbe_aggr_personal_nr", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"" |
||||
}, |
||||
{"uniquename":"besch_verh_nr", |
||||
"caption":"Besch.-Verh Nr.", |
||||
"srcfieldname":"sva_pbe_aggr_besch_verh_nr", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"" |
||||
}, |
||||
{"uniquename":"name", |
||||
"caption":"Person Name", |
||||
"srcfieldname":"sva_pbe_aggr_name", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"" |
||||
}, |
||||
{"uniquename":"d_besetz_anfang", |
||||
"caption":"Besetzung gültig (von)", |
||||
"srcfieldname":"sva_pbe_aggr_d_besetz_anfang", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"0", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"" |
||||
} , |
||||
{"uniquename":"d_besetz_ende", |
||||
"caption":"Besetzung gültig (bis)", |
||||
"srcfieldname":"sva_pbe_aggr_d_besetz_ende", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"0", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"" |
||||
}, |
||||
{"uniquename":"pbe_von", |
||||
"caption":"Besetzungsdatum (von)", |
||||
"srcfieldname":"sva_pbe_aggr_pbe_von", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"0", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"" |
||||
} , |
||||
{"uniquename":"pbe_bis", |
||||
"caption":"Besetzungsdatum (bis)", |
||||
"srcfieldname":"sva_pbe_aggr_pbe_bis", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"0", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"" |
||||
}, |
||||
{"uniquename":"vzae", |
||||
"caption":"VZÄ (Besetzung)", |
||||
"srcfieldname":"sva_pbe_aggr_vzae", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"sum", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"" |
||||
} |
||||
] |
||||
/> |
||||
|
||||
<#if rpta_installed==1> |
||||
<@rpta_column_layout_fuellen /> |
||||
</#if> |
@ -1,91 +0,0 @@
@@ -1,91 +0,0 @@
|
||||
--freemarker template |
||||
<#include "RPTA-Makros"/> |
||||
<sqlvars> |
||||
<sqlvar name="sos_stud_astat_exists"> |
||||
select count(*) from rpta_resultset where uniquename='sos_stud_astat'; |
||||
</sqlvar> |
||||
</sqlvars> |
||||
<#assign rpta_column_layout = {"uniquename":"sos_stud_astat_rsz", |
||||
"caption":"MKW-Abfrage_Studierende_RSZ", |
||||
"rpta_resultset":"sos_stud_astat", |
||||
"whereclause":"fach_sem_zahl <= dim_studiengang_regel and dim_studiengang_regel between 1 and 20 and studiengang_nr <=2 and fach_nr <=4", |
||||
"description":"Fachbelegungen: 1. & 2. Studiengang; 1.-4. Fach; nur Studiengänge mit Angabe einer Regelstudienzeit" |
||||
} |
||||
/> |
||||
|
||||
<#assign rpta_columns = [ |
||||
{"uniquename":"sos_k_stort_astat", |
||||
"caption":"Hochschulnummer Statistik", |
||||
"srcfieldname":"sos_k_stort_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtliche Standortnummer" |
||||
}, |
||||
{"uniquename":"dim_studiengang_stg_astat", |
||||
"caption":"HSF-Schlüssel", |
||||
"srcfieldname":"dim_studiengang_stg_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtliches Fach" |
||||
}, |
||||
{"uniquename":"sos_k_stufrm_astat", |
||||
"caption":"Art des Studiums", |
||||
"srcfieldname":"sos_k_stufrm_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtliche Studienform" |
||||
}, |
||||
{"uniquename":"dim_studiengang_abschluss_astat", |
||||
"caption":"Abschlussschlüssel Statistik NRW", |
||||
"srcfieldname":"dim_studiengang_abschluss_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtlicher Abschluss" |
||||
}, |
||||
{"uniquename":"sos_k_stutyp_astat", |
||||
"caption":"Vollzeit / Teilzeit / ausbildungsintegriert / praxisintegriert / berufsintegriert", |
||||
"srcfieldname":"sos_k_stutyp_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtlicher Studiumstyp" |
||||
}, |
||||
{"uniquename":"dim_studiengang_regel", |
||||
"caption":"Angabe der Regelstudienzeit", |
||||
"srcfieldname":"dim_studiengang_regel", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Regelstudienzeit in Semestern" |
||||
}, |
||||
{"uniquename":"summe", |
||||
"caption":"Anzahl der Studierenden in der Regelstudienzeit", |
||||
"srcfieldname":"summe", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"sum", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Summe der Studierenden mit Fachsemester kleiner oder gleich der Regelstudienzeit" |
||||
} |
||||
] |
||||
/> |
||||
|
||||
|
||||
<@rpta_column_layout_fuellen /> |
@ -1,90 +0,0 @@
@@ -1,90 +0,0 @@
|
||||
--freemarker template |
||||
<#include "RPTA-Makros"/> |
||||
<sqlvars> |
||||
<sqlvar name="sos_stud_astat_exists"> |
||||
select count(*) from rpta_resultset where uniquename='sos_stud_astat'; |
||||
</sqlvar> |
||||
</sqlvars> |
||||
<#assign rpta_column_layout = {"uniquename":"sos_stud_astat_rsz", |
||||
"caption":"MKW-Abfrage_Studierende_RSZ", |
||||
"rpta_resultset":"sos_stud_astat", |
||||
"whereclause":"fach_sem_zahl <= dim_studiengang_regel and dim_studiengang_regel between 1 and 20 and studiengang_nr <=2 and fach_nr <=4", |
||||
"description":"Fachbelegungen: 1. & 2. Studiengang; 1.-4. Fach; nur Studiengänge mit Angabe einer Regelstudienzeit" |
||||
} |
||||
/> |
||||
|
||||
<#assign rpta_columns = [ |
||||
{"uniquename":"sos_k_stort_astat", |
||||
"caption":"Hochschulnummer Statistik", |
||||
"srcfieldname":"sos_k_stort_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtliche Standortnummer" |
||||
}, |
||||
{"uniquename":"dim_studiengang_stg_astat", |
||||
"caption":"HSF-Schlüssel", |
||||
"srcfieldname":"dim_studiengang_stg_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtliches Fach" |
||||
}, |
||||
{"uniquename":"sos_k_stufrm_astat", |
||||
"caption":"Art des Studiums", |
||||
"srcfieldname":"sos_k_stufrm_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtliche Studienform" |
||||
}, |
||||
{"uniquename":"dim_studiengang_abschluss_astat", |
||||
"caption":"Abschlussschlüssel Statistik NRW", |
||||
"srcfieldname":"dim_studiengang_abschluss_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtlicher Abschluss" |
||||
}, |
||||
{"uniquename":"sos_k_stutyp_astat", |
||||
"caption":"Vollzeit / Teilzeit / ausbildungsintegriert / praxisintegriert / berufsintegriert", |
||||
"srcfieldname":"sos_k_stutyp_astat", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Amtlicher Studiumstyp" |
||||
}, |
||||
{"uniquename":"dim_studiengang_regel", |
||||
"caption":"Angabe der Regelstudienzeit", |
||||
"srcfieldname":"dim_studiengang_regel", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"visible_size":"10", |
||||
"is_aggregate":"0", |
||||
"description":"Regelstudienzeit in Semestern" |
||||
}, |
||||
{"uniquename":"summe", |
||||
"caption":"Anzahl der Studierenden in der Regelstudienzeit", |
||||
"srcfieldname":"summe", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"sum", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Summe der Studierenden mit Fachsemester kleiner oder gleich der Regelstudienzeit" |
||||
} |
||||
] |
||||
/> |
||||
|
||||
<@rpta_column_layout_fuellen /> |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
1^physicalColumn^Physische Spalte^ |
||||
2^logicalColumn^Logische Spalte^ |
||||
3^lookupColumn^Lookup-Spalte^ |
||||
4^computedColumn^Berechnete Spalte^ |
||||
5^processingColumn^Weiterverarbeitende Spalte^ |
@ -1,384 +0,0 @@
@@ -1,384 +0,0 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="rpta_exam_unit_exists"> |
||||
select sp_table_exists('rpta_exam_unit') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source" type="hash"> |
||||
select name |
||||
from sx_tables where name ='rpta_exam_unit' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"><![CDATA[ |
||||
select 1::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'dim_studiengang.tid=rpta_exam_unit.tid_stg and rpta_exam_unit.sem_der_pruefung >= semester_von and rpta_exam_unit.sem_der_pruefung <= semester_bis' as joinclause |
||||
from sx_tables where name in ('dim_studiengang') |
||||
|
||||
]]></sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source.name}' |
||||
and currentlyused=1 |
||||
|
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'dim_studiengang_' || name as targetname |
||||
from sx_fields where table_name ='dim_studiengang' |
||||
and currentlyused=1 |
||||
|
||||
|
||||
order by 1 |
||||
|
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if rpta_exam_unit_exists==1> |
||||
|
||||
<#assign fact_table_target = {"name":"rpta_exam_unit_dim_studiengang", "caption":"Einzelprüfungen und Studiengänge"} |
||||
/> |
||||
|
||||
drop index if exists ix_rpta_exam_unit_is_modul; |
||||
|
||||
|
||||
CREATE temp table tmp_tables( |
||||
name CHAR(255) , |
||||
caption CHAR(255) , |
||||
description CHAR(255) , |
||||
table_type CHAR(255) , |
||||
systeminfo_id INTEGER , |
||||
systeminfo_orig INTEGER , |
||||
thema CHAR(255) , |
||||
sachgebiete_id CHAR(255) |
||||
); |
||||
CREATE temp TABLE tmp_fields( |
||||
tid serial NOT NULL, |
||||
table_name VARCHAR(255) not null, |
||||
name VARCHAR(255) not null, |
||||
caption VARCHAR(255) , |
||||
description VARCHAR(255) , |
||||
field_type VARCHAR(255) not null, |
||||
field_size VARCHAR(255) , |
||||
field_not_null smallint, |
||||
currentlyused SMALLINT , |
||||
is_primarykey SMALLINT default 0 , |
||||
foreignkey_tab VARCHAR(255) , |
||||
foreignkey_col VARCHAR(255) , |
||||
foreignkey_int VARCHAR(255) , |
||||
foreignkey_cap VARCHAR(255) , |
||||
foreignkey_cond VARCHAR(255) , |
||||
foreignkey_func VARCHAR(255) , |
||||
check_integrity SMALLINT, |
||||
is_sum SMALLINT default 1, |
||||
foreignkey_uniquename VARCHAR(255) |
||||
|
||||
); |
||||
|
||||
|
||||
|
||||
update sx_fields set |
||||
is_sum=0 |
||||
where table_name='rpta_exam_unit' |
||||
and name!='summe'; |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='rpta_exam_unit' |
||||
and name='summe'; |
||||
|
||||
|
||||
insert into tmp_tables ( |
||||
name, |
||||
caption, |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
) |
||||
select |
||||
'${fact_table_target.name}', |
||||
'${fact_table_target.caption}', |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
from sx_tables where name='${fact_table_source.name}' |
||||
; |
||||
|
||||
|
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${fact_table_source.name}' |
||||
and currentlyused=1; |
||||
<#foreach added_table in added_tables> |
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
'${added_table.prefix}' || name, |
||||
'${added_table.caption}: ' || caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${added_table.name}' |
||||
and currentlyused=1; |
||||
</#foreach> |
||||
|
||||
CREATE temp TABLE tmp_rpta_resultset |
||||
( |
||||
caption varchar(255), |
||||
uniquename varchar(255), |
||||
fieldclause text, |
||||
joinclause text, |
||||
whereclause text, |
||||
systeminfo_id integer |
||||
); |
||||
|
||||
insert into tmp_rpta_resultset(caption, |
||||
uniquename, |
||||
systeminfo_id) |
||||
select '${fact_table_target.caption}', |
||||
'${fact_table_target.name}', |
||||
7 |
||||
; |
||||
|
||||
|
||||
update tmp_rpta_resultset set fieldclause=' |
||||
<#foreach field_target in fields_target> |
||||
${field_target.table_name}.${field_target.name} as ${field_target.targetname}, |
||||
</#foreach> |
||||
null::varchar as dummy', |
||||
joinclause='${fact_table_source.name} |
||||
<#foreach added_table in added_tables> |
||||
left outer join ${added_table.name} on (${added_table.joinclause}) |
||||
</#foreach>'; |
||||
|
||||
select * into temp tmp_rs1 |
||||
from rpta_resultset |
||||
; |
||||
|
||||
update rpta_resultset set caption=T.caption, |
||||
fieldclause=T.fieldclause, |
||||
joinclause=T.joinclause, |
||||
whereclause=T.whereclause |
||||
from tmp_rpta_resultset T |
||||
where T.systeminfo_id=rpta_resultset.systeminfo_id |
||||
and T.uniquename=rpta_resultset.uniquename |
||||
; |
||||
|
||||
insert into rpta_resultset(caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id) |
||||
select caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id |
||||
from tmp_rpta_resultset |
||||
where 0=(select count(*) |
||||
from tmp_rs1 T |
||||
where T.systeminfo_id=tmp_rpta_resultset.systeminfo_id |
||||
and T.uniquename=tmp_rpta_resultset.uniquename) |
||||
; |
||||
drop table tmp_rpta_resultset; |
||||
drop table tmp_rs1; |
||||
|
||||
delete from sx_tables where name |
||||
in (select T.name from tmp_tables T); |
||||
|
||||
insert into sx_tables (name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id) |
||||
select name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id |
||||
from tmp_tables; |
||||
|
||||
|
||||
delete from sx_fields where table_name |
||||
in (select T.table_name from tmp_fields T); |
||||
|
||||
insert into sx_fields (table_name,name,caption,description,field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyUsed, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_cap, |
||||
foreignkey_int, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
) |
||||
select |
||||
F.table_name,F.name,F.caption,F.description,F.field_type, |
||||
F.field_size, |
||||
F.field_not_null, |
||||
F.currentlyUsed, |
||||
F.foreignkey_tab, |
||||
F.foreignkey_col, |
||||
F.foreignkey_cap, |
||||
F.foreignkey_int, |
||||
F.foreignkey_cond, |
||||
F.foreignkey_func, |
||||
F.check_integrity, |
||||
F.is_sum, |
||||
F.foreignkey_uniquename |
||||
|
||||
from tmp_fields F; |
||||
|
||||
|
||||
drop table tmp_fields; |
||||
drop table tmp_tables; |
||||
|
||||
|
||||
--rpta_column füllen: |
||||
select * into temp tmp_rc1 |
||||
from rpta_column; |
||||
|
||||
|
||||
create temp table tmp_rpta_column( |
||||
uniquename varchar(255) NOT NULL, |
||||
caption varchar(255), |
||||
srcfieldname varchar(255), |
||||
column_type integer, |
||||
col_function text, |
||||
is_aggregate smallint, |
||||
resultset_id integer, |
||||
description text, |
||||
custom integer default 0 |
||||
); |
||||
|
||||
insert into tmp_rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description) |
||||
select F.name as uniquename, |
||||
coalesce(T.caption,T.name) || ' - ' || F.caption, |
||||
F.name as srcfieldname, |
||||
1 as column_type, |
||||
(case when F.is_sum=1 then 'sum' else null::varchar end) as col_function, |
||||
(case when F.is_sum=1 then 1 else 0 end) as is_aggregate, |
||||
R.tid as resultset_id, |
||||
F.description |
||||
from rpta_resultset R, sx_fields F left outer join sx_tables T on (T.name=F.table_name) |
||||
where F.table_name='${fact_table_target.name}' |
||||
and R.uniquename='${fact_table_target.name}' |
||||
and F.currentlyused=1 |
||||
; |
||||
|
||||
update rpta_column set |
||||
caption=T.caption, |
||||
srcfieldname=T.srcfieldname, |
||||
column_type=T.column_type, |
||||
col_function=T.col_function, |
||||
is_aggregate=T.is_aggregate, |
||||
resultset_id=R.tid, |
||||
description=T.description, |
||||
custom=T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where T.uniquename=rpta_column.uniquename |
||||
and rpta_column.resultset_id=R.tid |
||||
and R.uniquename='${fact_table_target.name}' |
||||
; |
||||
insert into rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description, |
||||
custom) |
||||
select T.uniquename, |
||||
T.caption, |
||||
T.srcfieldname, |
||||
T.column_type, |
||||
T.col_function, |
||||
T.is_aggregate, |
||||
R.tid as resultset_id, |
||||
T.description, |
||||
T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where R.uniquename='${fact_table_target.name}' |
||||
and 0=(select count(*) from tmp_rc1 C |
||||
where C.uniquename=T.uniquename |
||||
and C.resultset_id=R.tid) |
||||
; |
||||
|
||||
drop table tmp_rpta_column; |
||||
drop table tmp_rc1; |
||||
|
||||
</#if> --wenn rpta_exam_unit_exists=1 |
@ -1,4 +0,0 @@
@@ -1,4 +0,0 @@
|
||||
1^INTEGER^Ganzzahlig^::integer^ |
||||
2^INT_NO_SEP^Ganzzahlig ohne 1000er Trenner^::varchar^ |
||||
3^INT_PERCENT^Ganzzahlig %^::integer || ' %'^ |
||||
4^DEC_2^Dezimal mit 2 Nachkommastellen^::decimal(18,2)^ |
@ -1,14 +0,0 @@
@@ -1,14 +0,0 @@
|
||||
--Das Sachgebiet 331 (RPTA Administr.) wird installiert |
||||
|
||||
|
||||
delete from sachgebiete where tid in (331); |
||||
insert into sachgebiete(tid,name) values (331,'Qualitätssicherung Administr.'); |
||||
|
||||
delete from group_sachgeb_bez where sachgebiete_id in (330,331) |
||||
and groupinfo_id in (select G.tid from groupinfo G where G.name='Administratoren' or G.name='superx') ; |
||||
|
||||
insert into group_sachgeb_bez |
||||
select G.tid,330 from groupinfo G where G.name='Administratoren' or G.name='superx'; |
||||
insert into group_sachgeb_bez |
||||
select G.tid,331 from groupinfo G where G.name='Administratoren' or G.name='superx'; |
||||
|
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
delete from sachgebiete where tid in (330,331); |
||||
delete from group_sachgeb_bez where sachgebiete_id in (330,331); |
||||
delete from user_sachgeb_bez where sachgebiete_id in (330,331); |
@ -1,393 +0,0 @@
@@ -1,393 +0,0 @@
|
||||
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="sva_sgd_aggr_exists"> |
||||
select sp_table_exists('sva_sgd_aggr') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source" type="hash"> |
||||
select name |
||||
from sx_tables where name ='sva_sgd_aggr' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"><![CDATA[ |
||||
select 1::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_sgd.sgd_join_id=sva_sgd_aggr.stellen_nr' as joinclause |
||||
from sx_tables where name in ('sva_sgd') |
||||
union |
||||
select 2::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_sgd_aggr.stellen_nr=sva_pbe_aggr.stellen_nr and (sva_sgd_aggr.sbst_nr=sva_pbe_aggr.soe_serial or sva_pbe_aggr.soe_serial is null )' as joinclause |
||||
from sx_tables where name in ('sva_pbe_aggr') |
||||
]]></sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source.name}' |
||||
and currentlyused=1 |
||||
|
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sva_sgd_' || name as targetname |
||||
from sx_fields where table_name ='sva_sgd' |
||||
and currentlyused=1 |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sva_pbe_aggr_' || name as targetname |
||||
from sx_fields where table_name ='sva_pbe_aggr' |
||||
and currentlyused=1 |
||||
|
||||
order by 1 |
||||
|
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if sva_sgd_aggr_exists==1> |
||||
|
||||
<#assign fact_table_target = {"name":"sva_pbe_aggr_sgd", "caption":"Stellen, Besetzungen, Personen"} |
||||
/> |
||||
|
||||
|
||||
CREATE temp table tmp_tables( |
||||
name CHAR(255) , |
||||
caption CHAR(255) , |
||||
description CHAR(255) , |
||||
table_type CHAR(255) , |
||||
systeminfo_id INTEGER , |
||||
systeminfo_orig INTEGER , |
||||
thema CHAR(255) , |
||||
sachgebiete_id CHAR(255) |
||||
); |
||||
CREATE temp TABLE tmp_fields( |
||||
tid serial NOT NULL, |
||||
table_name VARCHAR(255) not null, |
||||
name VARCHAR(255) not null, |
||||
caption VARCHAR(255) , |
||||
description VARCHAR(255) , |
||||
field_type VARCHAR(255) not null, |
||||
field_size VARCHAR(255) , |
||||
field_not_null smallint, |
||||
currentlyused SMALLINT , |
||||
is_primarykey SMALLINT default 0 , |
||||
foreignkey_tab VARCHAR(255) , |
||||
foreignkey_col VARCHAR(255) , |
||||
foreignkey_int VARCHAR(255) , |
||||
foreignkey_cap VARCHAR(255) , |
||||
foreignkey_cond VARCHAR(255) , |
||||
foreignkey_func VARCHAR(255) , |
||||
check_integrity SMALLINT, |
||||
is_sum SMALLINT default 1, |
||||
foreignkey_uniquename VARCHAR(255) |
||||
|
||||
); |
||||
|
||||
|
||||
|
||||
update sx_fields set |
||||
is_sum=0 |
||||
where table_name='sva_sgd_aggr' |
||||
and name!='vzae'; |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='sva_sgd_aggr' |
||||
and name='vzae'; |
||||
|
||||
|
||||
insert into tmp_tables ( |
||||
name, |
||||
caption, |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
) |
||||
select |
||||
'${fact_table_target.name}', |
||||
'${fact_table_target.caption}', |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
from sx_tables where name='${fact_table_source.name}' |
||||
; |
||||
|
||||
|
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${fact_table_source.name}' |
||||
and currentlyused=1; |
||||
<#foreach added_table in added_tables> |
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
'${added_table.prefix}' || name, |
||||
'${added_table.caption}: ' || caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${added_table.name}' |
||||
and currentlyused=1; |
||||
</#foreach> |
||||
|
||||
CREATE temp TABLE tmp_rpta_resultset |
||||
( |
||||
caption varchar(255), |
||||
uniquename varchar(255), |
||||
fieldclause text, |
||||
joinclause text, |
||||
whereclause text, |
||||
systeminfo_id integer |
||||
); |
||||
|
||||
insert into tmp_rpta_resultset(caption, |
||||
uniquename, |
||||
systeminfo_id) |
||||
select '${fact_table_target.caption}', |
||||
'${fact_table_target.name}', |
||||
6 |
||||
; |
||||
|
||||
|
||||
update tmp_rpta_resultset set fieldclause=' |
||||
<#foreach field_target in fields_target> |
||||
${field_target.table_name}.${field_target.name} as ${field_target.targetname}, |
||||
</#foreach> |
||||
null::varchar as dummy', |
||||
joinclause='${fact_table_source.name} |
||||
<#foreach added_table in added_tables> |
||||
left outer join ${added_table.name} on (${added_table.joinclause}) |
||||
</#foreach>'; |
||||
|
||||
select * into temp tmp_rs1 |
||||
from rpta_resultset |
||||
; |
||||
|
||||
update rpta_resultset set caption=T.caption, |
||||
fieldclause=T.fieldclause, |
||||
joinclause=T.joinclause, |
||||
whereclause=T.whereclause |
||||
from tmp_rpta_resultset T |
||||
where T.systeminfo_id=rpta_resultset.systeminfo_id |
||||
and T.uniquename=rpta_resultset.uniquename |
||||
; |
||||
|
||||
insert into rpta_resultset(caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id) |
||||
select caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id |
||||
from tmp_rpta_resultset |
||||
where 0=(select count(*) |
||||
from tmp_rs1 T |
||||
where T.systeminfo_id=tmp_rpta_resultset.systeminfo_id |
||||
and T.uniquename=tmp_rpta_resultset.uniquename) |
||||
; |
||||
drop table tmp_rpta_resultset; |
||||
drop table tmp_rs1; |
||||
|
||||
delete from sx_tables where name |
||||
in (select T.name from tmp_tables T); |
||||
|
||||
insert into sx_tables (name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id) |
||||
select name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id |
||||
from tmp_tables; |
||||
|
||||
|
||||
delete from sx_fields where table_name |
||||
in (select T.table_name from tmp_fields T); |
||||
|
||||
insert into sx_fields (table_name,name,caption,description,field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyUsed, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_cap, |
||||
foreignkey_int, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
) |
||||
select |
||||
F.table_name,F.name,F.caption,F.description,F.field_type, |
||||
F.field_size, |
||||
F.field_not_null, |
||||
F.currentlyUsed, |
||||
F.foreignkey_tab, |
||||
F.foreignkey_col, |
||||
F.foreignkey_cap, |
||||
F.foreignkey_int, |
||||
F.foreignkey_cond, |
||||
F.foreignkey_func, |
||||
F.check_integrity, |
||||
F.is_sum, |
||||
F.foreignkey_uniquename |
||||
|
||||
from tmp_fields F; |
||||
|
||||
|
||||
drop table tmp_fields; |
||||
drop table tmp_tables; |
||||
|
||||
|
||||
--rpta_column füllen: |
||||
select * into temp tmp_rc1 |
||||
from rpta_column; |
||||
|
||||
|
||||
create temp table tmp_rpta_column( |
||||
uniquename varchar(255) NOT NULL, |
||||
caption varchar(255), |
||||
srcfieldname varchar(255), |
||||
column_type integer, |
||||
col_function text, |
||||
is_aggregate smallint, |
||||
resultset_id integer, |
||||
description text, |
||||
custom integer default 0 |
||||
); |
||||
|
||||
insert into tmp_rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description) |
||||
select F.name as uniquename, |
||||
coalesce(T.caption,T.name) || ' - ' || F.caption, |
||||
F.name as srcfieldname, |
||||
1 as column_type, |
||||
(case when F.is_sum=1 then 'sum' else null::varchar end) as col_function, |
||||
(case when F.is_sum=1 then 1 else 0 end) as is_aggregate, |
||||
R.tid as resultset_id, |
||||
F.description |
||||
from rpta_resultset R, sx_fields F left outer join sx_tables T on (T.name=F.table_name) |
||||
where F.table_name='${fact_table_target.name}' |
||||
and R.uniquename='${fact_table_target.name}' |
||||
and F.currentlyused=1 |
||||
; |
||||
|
||||
update rpta_column set |
||||
caption=T.caption, |
||||
srcfieldname=T.srcfieldname, |
||||
column_type=T.column_type, |
||||
col_function=T.col_function, |
||||
is_aggregate=T.is_aggregate, |
||||
resultset_id=R.tid, |
||||
description=T.description, |
||||
custom=T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where T.uniquename=rpta_column.uniquename |
||||
and rpta_column.resultset_id=R.tid |
||||
and R.uniquename='${fact_table_target.name}' |
||||
; |
||||
insert into rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description, |
||||
custom) |
||||
select T.uniquename, |
||||
T.caption, |
||||
T.srcfieldname, |
||||
T.column_type, |
||||
T.col_function, |
||||
T.is_aggregate, |
||||
R.tid as resultset_id, |
||||
T.description, |
||||
T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where R.uniquename='${fact_table_target.name}' |
||||
and 0=(select count(*) from tmp_rc1 C |
||||
where C.uniquename=T.uniquename |
||||
and C.resultset_id=R.tid) |
||||
; |
||||
|
||||
drop table tmp_rpta_column; |
||||
drop table tmp_rc1; |
||||
|
||||
</#if> --wenn sva_sgd_aggr_exists=1 |
@ -1,449 +0,0 @@
@@ -1,449 +0,0 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="sos_stg_aggr_exists"> |
||||
select sp_table_exists('sos_stg_aggr') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source" type="hash"> |
||||
select name |
||||
from sx_tables where name ='sos_stg_aggr' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"> |
||||
select 1::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'dim_studiengang.tid=sos_stg_aggr.tid_stg' as joinclause |
||||
from sx_tables where name in ('dim_studiengang') |
||||
union |
||||
select 10::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'dim_studiengang.stort=sos_k_stort.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_stort') |
||||
union |
||||
select 20::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sos_stg_aggr.stutyp=sos_k_stutyp.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_stutyp') |
||||
union |
||||
select 30::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sos_stg_aggr.stuart=sos_k_stuart.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_stuart') |
||||
union |
||||
select 40::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sos_stg_aggr.stufrm=sos_k_stufrm.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_stufrm') |
||||
union |
||||
select 50::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sos_stg_aggr.hrst=sos_k_hrst.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_hrst') |
||||
order by 1 |
||||
</sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source.name}' |
||||
and currentlyused=1 |
||||
<#foreach added_table in added_tables> |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'${added_table.prefix}' || name as targetname |
||||
from sx_fields where table_name ='${added_table.name}' |
||||
and currentlyused=1 |
||||
|
||||
</#foreach> |
||||
order by 1 |
||||
|
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if sos_stg_aggr_exists==1> |
||||
|
||||
<#assign fact_table_target = {"name":"sos_stud_astat", "caption":"Studierende (intern und amtlich)"} |
||||
/> |
||||
|
||||
|
||||
CREATE temp table tmp_tables( |
||||
name CHAR(255) , |
||||
caption CHAR(255) , |
||||
description CHAR(255) , |
||||
table_type CHAR(255) , |
||||
systeminfo_id INTEGER , |
||||
systeminfo_orig INTEGER , |
||||
thema CHAR(255) , |
||||
sachgebiete_id CHAR(255) |
||||
); |
||||
CREATE temp TABLE tmp_fields( |
||||
tid serial NOT NULL, |
||||
table_name VARCHAR(255) not null, |
||||
name VARCHAR(255) not null, |
||||
caption VARCHAR(255) , |
||||
description VARCHAR(255) , |
||||
field_type VARCHAR(255) not null, |
||||
field_size VARCHAR(255) , |
||||
field_not_null smallint, |
||||
currentlyused SMALLINT , |
||||
is_primarykey SMALLINT default 0 , |
||||
foreignkey_tab VARCHAR(255) , |
||||
foreignkey_col VARCHAR(255) , |
||||
foreignkey_int VARCHAR(255) , |
||||
foreignkey_cap VARCHAR(255) , |
||||
foreignkey_cond VARCHAR(255) , |
||||
foreignkey_func VARCHAR(255) , |
||||
check_integrity SMALLINT, |
||||
is_sum SMALLINT default 1, |
||||
foreignkey_uniquename VARCHAR(255) |
||||
|
||||
); |
||||
|
||||
|
||||
--Vorbereitung: |
||||
UPDATE sx_tables |
||||
SET caption = 'Standorte' |
||||
WHERE name='sos_k_stort'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Studienart' |
||||
WHERE name = 'sos_k_stuart'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Studiumstyp' |
||||
WHERE name = 'sos_k_stutyp'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Studienform' |
||||
WHERE name = 'sos_k_stufrm'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Hörerstatus' |
||||
WHERE name = 'sos_k_hrst'; |
||||
|
||||
|
||||
|
||||
--drop view if exists sos_stud_astat; |
||||
|
||||
|
||||
drop VIEW sos_k_stutyp; |
||||
|
||||
CREATE VIEW sos_k_stutyp |
||||
( |
||||
apnr, |
||||
druck, |
||||
astat |
||||
) |
||||
AS |
||||
SELECT cifx.apnr, |
||||
cifx.druck, |
||||
astat |
||||
FROM cifx |
||||
WHERE cifx.key = 40; |
||||
|
||||
|
||||
update sx_fields set |
||||
is_sum=0 |
||||
where table_name='sos_stg_aggr' |
||||
and name!='summe'; |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='sos_stg_aggr' |
||||
and name='summe'; |
||||
|
||||
|
||||
insert into tmp_tables ( |
||||
name, |
||||
caption, |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
) |
||||
select |
||||
'${fact_table_target.name}', |
||||
'${fact_table_target.caption}', |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
from sx_tables where name='${fact_table_source.name}' |
||||
; |
||||
|
||||
|
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${fact_table_source.name}' |
||||
and currentlyused=1; |
||||
<#foreach added_table in added_tables> |
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
'${added_table.prefix}' || name, |
||||
'${added_table.caption}: ' || caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${added_table.name}' |
||||
and currentlyused=1; |
||||
</#foreach> |
||||
|
||||
CREATE temp TABLE tmp_rpta_resultset |
||||
( |
||||
caption varchar(255), |
||||
uniquename varchar(255), |
||||
fieldclause text, |
||||
joinclause text, |
||||
whereclause text, |
||||
systeminfo_id integer |
||||
); |
||||
|
||||
insert into tmp_rpta_resultset(caption, |
||||
uniquename, |
||||
systeminfo_id) |
||||
select '${fact_table_target.caption}', |
||||
'${fact_table_target.name}', |
||||
7 |
||||
; |
||||
|
||||
|
||||
update tmp_rpta_resultset set fieldclause=' |
||||
<#foreach field_target in fields_target> |
||||
${field_target.table_name}.${field_target.name} as ${field_target.targetname}, |
||||
</#foreach> |
||||
null::varchar as dummy', |
||||
joinclause='${fact_table_source.name} |
||||
<#foreach added_table in added_tables> |
||||
left outer join ${added_table.name} on (${added_table.joinclause}) |
||||
</#foreach>'; |
||||
|
||||
select * into temp tmp_rs1 |
||||
from rpta_resultset |
||||
; |
||||
|
||||
update rpta_resultset set caption=T.caption, |
||||
fieldclause=T.fieldclause, |
||||
joinclause=T.joinclause, |
||||
whereclause=T.whereclause |
||||
from tmp_rpta_resultset T |
||||
where T.systeminfo_id=rpta_resultset.systeminfo_id |
||||
and T.uniquename=rpta_resultset.uniquename |
||||
; |
||||
|
||||
insert into rpta_resultset(caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id) |
||||
select caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id |
||||
from tmp_rpta_resultset |
||||
where 0=(select count(*) |
||||
from tmp_rs1 T |
||||
where T.systeminfo_id=tmp_rpta_resultset.systeminfo_id |
||||
and T.uniquename=tmp_rpta_resultset.uniquename) |
||||
; |
||||
drop table tmp_rpta_resultset; |
||||
drop table tmp_rs1; |
||||
|
||||
delete from sx_tables where name |
||||
in (select T.name from tmp_tables T); |
||||
|
||||
insert into sx_tables (name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id) |
||||
select name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id |
||||
from tmp_tables; |
||||
|
||||
|
||||
delete from sx_fields where table_name |
||||
in (select T.table_name from tmp_fields T); |
||||
|
||||
insert into sx_fields (table_name,name,caption,description,field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyUsed, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_cap, |
||||
foreignkey_int, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
) |
||||
select |
||||
F.table_name,F.name,F.caption,F.description,F.field_type, |
||||
F.field_size, |
||||
F.field_not_null, |
||||
F.currentlyUsed, |
||||
F.foreignkey_tab, |
||||
F.foreignkey_col, |
||||
F.foreignkey_cap, |
||||
F.foreignkey_int, |
||||
F.foreignkey_cond, |
||||
F.foreignkey_func, |
||||
F.check_integrity, |
||||
F.is_sum, |
||||
F.foreignkey_uniquename |
||||
|
||||
from tmp_fields F; |
||||
|
||||
|
||||
drop table tmp_fields; |
||||
drop table tmp_tables; |
||||
|
||||
|
||||
--rpta_column füllen: |
||||
select * into temp tmp_rc1 |
||||
from rpta_column; |
||||
|
||||
|
||||
create temp table tmp_rpta_column( |
||||
uniquename varchar(255) NOT NULL, |
||||
caption varchar(255), |
||||
srcfieldname varchar(255), |
||||
column_type integer, |
||||
col_function text, |
||||
is_aggregate smallint, |
||||
resultset_id integer, |
||||
description text, |
||||
custom integer default 0 |
||||
); |
||||
|
||||
insert into tmp_rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description) |
||||
select F.name as uniquename, |
||||
coalesce(T.caption,T.name) || ' - ' || F.caption, |
||||
F.name as srcfieldname, |
||||
1 as column_type, |
||||
(case when F.is_sum=1 then 'sum' else null::varchar end) as col_function, |
||||
(case when F.is_sum=1 then 1 else 0 end) as is_aggregate, |
||||
R.tid as resultset_id, |
||||
F.description |
||||
from rpta_resultset R, sx_fields F left outer join sx_tables T on (T.name=F.table_name) |
||||
where F.table_name='${fact_table_target.name}' |
||||
and R.uniquename='${fact_table_target.name}' |
||||
and F.currentlyused=1 |
||||
; |
||||
|
||||
update rpta_column set |
||||
caption=T.caption, |
||||
srcfieldname=T.srcfieldname, |
||||
column_type=T.column_type, |
||||
col_function=T.col_function, |
||||
is_aggregate=T.is_aggregate, |
||||
resultset_id=R.tid, |
||||
description=T.description, |
||||
custom=T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where T.uniquename=rpta_column.uniquename |
||||
and rpta_column.resultset_id=R.tid |
||||
and R.uniquename='${fact_table_target.name}' |
||||
; |
||||
insert into rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description, |
||||
custom) |
||||
select T.uniquename, |
||||
T.caption, |
||||
T.srcfieldname, |
||||
T.column_type, |
||||
T.col_function, |
||||
T.is_aggregate, |
||||
R.tid as resultset_id, |
||||
T.description, |
||||
T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where R.uniquename='${fact_table_target.name}' |
||||
and 0=(select count(*) from tmp_rc1 C |
||||
where C.uniquename=T.uniquename |
||||
and C.resultset_id=R.tid) |
||||
; |
||||
|
||||
drop table tmp_rpta_column; |
||||
drop table tmp_rc1; |
||||
|
||||
</#if> --wenn sos_stg_aggr_exists=1 |
@ -1,122 +0,0 @@
@@ -1,122 +0,0 @@
|
||||
|
||||
--Freemarker Template |
||||
|
||||
--Nummernkreis wurde von 45xxx auf 48xxx geändert |
||||
create temp table tmp_delete_mask(maskeninfo_id integer); |
||||
|
||||
insert into tmp_delete_mask(maskeninfo_id) |
||||
select tid from maskeninfo |
||||
where (tid=45000 and name='Tabellenausgabe Studierende (amtlich und intern)') |
||||
or (tid=45040 and name='Spalten und Spaltenlayouts verwalten') |
||||
or (tid=45080 and name='Stellenbesetzung und Beschäftigung (Liste)'); |
||||
|
||||
delete from maskeninfo where tid in (select maskeninfo_id from tmp_delete_mask); |
||||
delete from felderinfo where tid in (select felderinfo_id from masken_felder_bez where maskeninfo_id in (select maskeninfo_id from tmp_delete_mask)); |
||||
|
||||
delete from sachgeb_maske_bez where maskeninfo_id in (select maskeninfo_id from tmp_delete_mask); |
||||
delete from masken_felder_bez where maskeninfo_id in (select maskeninfo_id from tmp_delete_mask); |
||||
delete from maske_system_bez where maskeninfo_id in (select maskeninfo_id from tmp_delete_mask); |
||||
delete from themenbaum where maskeninfo_id in (select maskeninfo_id from tmp_delete_mask); |
||||
delete from macro_masken_bez where maskeninfo_id1 in (select maskeninfo_id from tmp_delete_mask); |
||||
delete from macro_masken_bez where maskeninfo_id2 in (select maskeninfo_id from tmp_delete_mask); |
||||
delete from macro_feld_wert where macro in (select maskeninfo_id from tmp_delete_mask); |
||||
|
||||
drop table tmp_delete_mask; |
||||
|
||||
|
||||
<#if '${SQLdialect}'='Postgres' > |
||||
|
||||
alter table rpta_resultset alter column fieldclause type text; |
||||
alter table rpta_resultset alter column joinclause type text; |
||||
alter table rpta_resultset alter column whereclause type text; |
||||
|
||||
</#if> |
||||
|
||||
--update current sos module to most recent version: |
||||
|
||||
update sx_fields set is_sum=0 |
||||
where table_name in ('dim_studiengang','sos_stg_aggr','sos_k_stort','sos_k_stuart','sos_k_stutyp','sos_k_stufrm') |
||||
and name !='summe'; |
||||
|
||||
|
||||
UPDATE sx_tables |
||||
SET caption = 'Standorte' |
||||
WHERE name='sos_k_stort'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Studienart' |
||||
WHERE name = 'sos_k_stuart'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Studiumstyp' |
||||
WHERE name = 'sos_k_stutyp'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Studienform' |
||||
WHERE name = 'sos_k_stufrm'; |
||||
|
||||
|
||||
|
||||
CREATE OR REPLACE VIEW sos_k_stutyp |
||||
( |
||||
apnr, |
||||
druck, |
||||
astat |
||||
) |
||||
AS |
||||
SELECT cifx.apnr, |
||||
cifx.druck, |
||||
astat |
||||
FROM cifx |
||||
WHERE cifx.key = 40; |
||||
|
||||
select * into temp tmp_sos_k_stutyp_astat |
||||
from sx_fields where table_name='sos_k_stutyp' |
||||
and name='astat'; |
||||
|
||||
INSERT INTO sx_fields |
||||
( |
||||
table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
) |
||||
select |
||||
'sos_k_stutyp', |
||||
'astat', |
||||
'astat', |
||||
'', |
||||
'CHAR', |
||||
'150', |
||||
0, |
||||
1, |
||||
0, |
||||
NULL, |
||||
NULL, |
||||
NULL, |
||||
NULL, |
||||
NULL, |
||||
NULL, |
||||
0, |
||||
1, |
||||
NULL |
||||
from xdummy |
||||
where 0=(select count(*) |
||||
from tmp_sos_k_stutyp_astat); |
||||
|
||||
drop table tmp_sos_k_stutyp_astat; |
||||
|
||||
--Neue Spaltenbreite bei 0.3: |
||||
alter table rpta_column alter column col_function type TEXT; |
||||
|
@ -1,64 +0,0 @@
@@ -1,64 +0,0 @@
|
||||
package de.superx.rpta; |
||||
|
||||
public class SvgProducer { |
||||
|
||||
public static void main(String[] args) { |
||||
// TODO Auto-generated method stub
|
||||
System.out.println(SimpleBarChart("40|110",100,120,50,"#cccccc","steelblue",true)); |
||||
|
||||
} |
||||
/* erzeugt Datenbalken aus "_graph"-Columns, mit Maxvalue Def. |
||||
* Beispielaufruf aus JR: |
||||
* <imageExpression>net.sf.jasperreports.renderers.SimpleDataRenderer.getInstance(de.superx.rpta.SvgProducer.SimpleBarChart($F{männlich},100,149,30,"#cccccc","steelblue",false).getBytes("UTF-8"))</imageExpression> |
||||
* |
||||
*/ |
||||
public static String SimpleBarChart(String barValueStr, double totalValue, double totalWidth, double height,String bgColor, String fgColor,boolean alignLeft) |
||||
{ |
||||
double barValue=0; |
||||
int delim=barValueStr.indexOf("|"); |
||||
if(delim!=0) |
||||
{ |
||||
barValue=Double.valueOf(barValueStr.substring(0, delim)); |
||||
totalValue=Double.valueOf(barValueStr.substring(delim+1)); |
||||
} |
||||
else |
||||
barValue=Double.valueOf(barValueStr); |
||||
|
||||
if(Double.valueOf(totalValue)==null) |
||||
totalValue=100; //percent is default
|
||||
String ret = generateSvg(totalValue, totalWidth, height, bgColor, fgColor, alignLeft, barValue); |
||||
return ret; |
||||
} |
||||
/* erzeugt Datenbalken aus "_graph"-Columns, zum maxValue 100 |
||||
* Beispielaufruf aus JR: |
||||
* <imageExpression>net.sf.jasperreports.renderers.SimpleDataRenderer.getInstance(de.superx.rpta.SvgProducer.SimpleBarChart($F{ Anteil Benutzer an Gesamtzahl (in %) },100,199,30,"#cccccc","steelblue",true).getBytes("UTF-8"))</imageExpression> * |
||||
*/ |
||||
public static String SimpleBarChart(double barValue, double totalValue, double totalWidth, double height,String bgColor, String fgColor,boolean alignLeft) |
||||
{ |
||||
|
||||
if(Double.valueOf(totalValue)==null) |
||||
totalValue=100; //percent is default
|
||||
String ret = generateSvg(totalValue, totalWidth, height, bgColor, fgColor, alignLeft, barValue); |
||||
return ret; |
||||
} |
||||
/* erzeugt svg-Code für Datenbalken aus "_graph"-Columns |
||||
* |
||||
*/ |
||||
private static String generateSvg(double totalValue, double totalWidth, double height, String bgColor, |
||||
String fgColor, boolean alignLeft, double barValue) { |
||||
//Compute width:
|
||||
double barWidth=totalWidth*(barValue/totalValue); |
||||
double x=0; |
||||
if(!alignLeft) |
||||
x=totalWidth-barWidth; //rechtsbündig
|
||||
String ret="<svg xmlns=\"http://www.w3.org/2000/svg\" width=\""+totalWidth+"px\" height=\""+height+"px\">"; |
||||
//background:
|
||||
ret+="<g><rect x=\"0\" y=\"0\" width=\""+totalWidth+"px\" height=\""+height+"px\" fill=\""+bgColor+"\"><title>"+totalValue+"</title></rect>"; |
||||
|
||||
//foreground:
|
||||
ret+="<rect class=\"chartBar\" width=\""+barWidth+"\" height=\""+(height-1) +"\" x=\""+x+"\" y=\"0\" rx=\"5\" ry=\"5\" fill=\""+fgColor+"\"><title>"+barValue+"</title></rect>"; |
||||
ret+="</g></svg>"; |
||||
return ret; |
||||
} |
||||
|
||||
} |
Binary file not shown.
Loading…
Reference in new issue