6 changed files with 264 additions and 0 deletions
@ -0,0 +1,27 @@ |
|||||||
|
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='lm_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='lm_exam_unit_dim_studiengang'\ |
||||||
|
) and uniquename='lm_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;^ ^ ^ |
@ -0,0 +1 @@ |
|||||||
|
48110^7^ |
@ -0,0 +1,15 @@ |
|||||||
|
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^ |
@ -0,0 +1,214 @@ |
|||||||
|
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='lm_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>>;^ |
Loading…
Reference in new issue