Compare commits
No commits in common. 'master' and 'rpta_0.1_Release' have entirely different histories.
master
...
rpta_0.1_R
145 changed files with 770 additions and 18111 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,16 +1,10 @@
@@ -1,16 +1,10 @@
|
||||
edit/rpta/rpta_column_layout_add_column.inc |
||||
doku/rpta_modul/rpta.html |
||||
WEB-INF/conf/edustore/db/bin/SQL_ENV_rpta.sam |
||||
images/icons/file-excel_rpta.svg |
||||
images/icons/magic.svg |
||||
WEB-INF/conf/edustore/db/module/rpta/schluesseltabellen/sx_stylesheets_einfuegen.sql |
||||
WEB-INF/lib/superx-rpta.jar |
||||
WEB-INF/reports/simple_table.jrtx |
||||
WEB-INF/reports/48110_leistungen_und_studiengaenge.jrxml |
||||
WEB-INF/reports/48110_leistungen_und_studiengaenge_shortcomment.jrxml |
||||
xml/rpta_groupLayout.xml |
||||
xml/tabelle_jrxml_a4_quer.xsl |
||||
xml/tabelle_jrxml_book_without_cover.xsl |
||||
xml/tabelle_xls_48140.xsl |
||||
xml/rpta_templates.xsl |
||||
xml/rpta_assistent.xsl |
||||
|
@ -1,740 +0,0 @@
@@ -1,740 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<transformation> |
||||
<info> |
||||
<name>excel_into_tmp_stip_meldung</name> |
||||
<description/> |
||||
<extended_description/> |
||||
<trans_version/> |
||||
<trans_type>Normal</trans_type> |
||||
<trans_status>0</trans_status> |
||||
<directory>/</directory> |
||||
<parameters> |
||||
<parameter> |
||||
<name>Hochschule</name> |
||||
<default_value>361</default_value> |
||||
<description/> |
||||
</parameter> |
||||
<parameter> |
||||
<name>Modus</name> |
||||
<default_value>2</default_value> |
||||
<description>2=Löschen und Hinzufügen oder nur 1=Hinzufügen</description> |
||||
</parameter> |
||||
<parameter> |
||||
<name>PATH_TO_UPLOADFILE</name> |
||||
<default_value>file:///home/superx/Downloads/Template_für_die_manuelle_Schnittstelle_des_STBB.xlsx</default_value> |
||||
<description>Pfad zur Exceldatei mit Quelldaten</description> |
||||
</parameter> |
||||
</parameters> |
||||
<log> |
||||
<trans-log-table> |
||||
<connection/> |
||||
<schema/> |
||||
<table/> |
||||
<size_limit_lines/> |
||||
<interval/> |
||||
<timeout_days/> |
||||
<field> |
||||
<id>ID_BATCH</id> |
||||
<enabled>Y</enabled> |
||||
<name>ID_BATCH</name> |
||||
</field> |
||||
<field> |
||||
<id>CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>CHANNEL_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>TRANSNAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>TRANSNAME</name> |
||||
</field> |
||||
<field> |
||||
<id>STATUS</id> |
||||
<enabled>Y</enabled> |
||||
<name>STATUS</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_READ</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_READ</name> |
||||
<subject/> |
||||
</field> |
||||
<field> |
||||
<id>LINES_WRITTEN</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_WRITTEN</name> |
||||
<subject/> |
||||
</field> |
||||
<field> |
||||
<id>LINES_UPDATED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_UPDATED</name> |
||||
<subject/> |
||||
</field> |
||||
<field> |
||||
<id>LINES_INPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_INPUT</name> |
||||
<subject/> |
||||
</field> |
||||
<field> |
||||
<id>LINES_OUTPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_OUTPUT</name> |
||||
<subject/> |
||||
</field> |
||||
<field> |
||||
<id>LINES_REJECTED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_REJECTED</name> |
||||
<subject/> |
||||
</field> |
||||
<field> |
||||
<id>ERRORS</id> |
||||
<enabled>Y</enabled> |
||||
<name>ERRORS</name> |
||||
</field> |
||||
<field> |
||||
<id>STARTDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>STARTDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>ENDDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>ENDDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>LOGDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOGDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>DEPDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>DEPDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>REPLAYDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>REPLAYDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>LOG_FIELD</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOG_FIELD</name> |
||||
</field> |
||||
<field> |
||||
<id>EXECUTING_SERVER</id> |
||||
<enabled>N</enabled> |
||||
<name>EXECUTING_SERVER</name> |
||||
</field> |
||||
<field> |
||||
<id>EXECUTING_USER</id> |
||||
<enabled>N</enabled> |
||||
<name>EXECUTING_USER</name> |
||||
</field> |
||||
<field> |
||||
<id>CLIENT</id> |
||||
<enabled>N</enabled> |
||||
<name>CLIENT</name> |
||||
</field> |
||||
</trans-log-table> |
||||
<perf-log-table> |
||||
<connection/> |
||||
<schema/> |
||||
<table/> |
||||
<interval/> |
||||
<timeout_days/> |
||||
<field> |
||||
<id>ID_BATCH</id> |
||||
<enabled>Y</enabled> |
||||
<name>ID_BATCH</name> |
||||
</field> |
||||
<field> |
||||
<id>SEQ_NR</id> |
||||
<enabled>Y</enabled> |
||||
<name>SEQ_NR</name> |
||||
</field> |
||||
<field> |
||||
<id>LOGDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOGDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>TRANSNAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>TRANSNAME</name> |
||||
</field> |
||||
<field> |
||||
<id>STEPNAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>STEPNAME</name> |
||||
</field> |
||||
<field> |
||||
<id>STEP_COPY</id> |
||||
<enabled>Y</enabled> |
||||
<name>STEP_COPY</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_READ</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_READ</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_WRITTEN</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_WRITTEN</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_UPDATED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_UPDATED</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_INPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_INPUT</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_OUTPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_OUTPUT</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_REJECTED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_REJECTED</name> |
||||
</field> |
||||
<field> |
||||
<id>ERRORS</id> |
||||
<enabled>Y</enabled> |
||||
<name>ERRORS</name> |
||||
</field> |
||||
<field> |
||||
<id>INPUT_BUFFER_ROWS</id> |
||||
<enabled>Y</enabled> |
||||
<name>INPUT_BUFFER_ROWS</name> |
||||
</field> |
||||
<field> |
||||
<id>OUTPUT_BUFFER_ROWS</id> |
||||
<enabled>Y</enabled> |
||||
<name>OUTPUT_BUFFER_ROWS</name> |
||||
</field> |
||||
</perf-log-table> |
||||
<channel-log-table> |
||||
<connection/> |
||||
<schema/> |
||||
<table/> |
||||
<timeout_days/> |
||||
<field> |
||||
<id>ID_BATCH</id> |
||||
<enabled>Y</enabled> |
||||
<name>ID_BATCH</name> |
||||
</field> |
||||
<field> |
||||
<id>CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>CHANNEL_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>LOG_DATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOG_DATE</name> |
||||
</field> |
||||
<field> |
||||
<id>LOGGING_OBJECT_TYPE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOGGING_OBJECT_TYPE</name> |
||||
</field> |
||||
<field> |
||||
<id>OBJECT_NAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>OBJECT_NAME</name> |
||||
</field> |
||||
<field> |
||||
<id>OBJECT_COPY</id> |
||||
<enabled>Y</enabled> |
||||
<name>OBJECT_COPY</name> |
||||
</field> |
||||
<field> |
||||
<id>REPOSITORY_DIRECTORY</id> |
||||
<enabled>Y</enabled> |
||||
<name>REPOSITORY_DIRECTORY</name> |
||||
</field> |
||||
<field> |
||||
<id>FILENAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>FILENAME</name> |
||||
</field> |
||||
<field> |
||||
<id>OBJECT_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>OBJECT_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>OBJECT_REVISION</id> |
||||
<enabled>Y</enabled> |
||||
<name>OBJECT_REVISION</name> |
||||
</field> |
||||
<field> |
||||
<id>PARENT_CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>PARENT_CHANNEL_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>ROOT_CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>ROOT_CHANNEL_ID</name> |
||||
</field> |
||||
</channel-log-table> |
||||
<step-log-table> |
||||
<connection/> |
||||
<schema/> |
||||
<table/> |
||||
<timeout_days/> |
||||
<field> |
||||
<id>ID_BATCH</id> |
||||
<enabled>Y</enabled> |
||||
<name>ID_BATCH</name> |
||||
</field> |
||||
<field> |
||||
<id>CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>CHANNEL_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>LOG_DATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOG_DATE</name> |
||||
</field> |
||||
<field> |
||||
<id>TRANSNAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>TRANSNAME</name> |
||||
</field> |
||||
<field> |
||||
<id>STEPNAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>STEPNAME</name> |
||||
</field> |
||||
<field> |
||||
<id>STEP_COPY</id> |
||||
<enabled>Y</enabled> |
||||
<name>STEP_COPY</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_READ</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_READ</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_WRITTEN</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_WRITTEN</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_UPDATED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_UPDATED</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_INPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_INPUT</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_OUTPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_OUTPUT</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_REJECTED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_REJECTED</name> |
||||
</field> |
||||
<field> |
||||
<id>ERRORS</id> |
||||
<enabled>Y</enabled> |
||||
<name>ERRORS</name> |
||||
</field> |
||||
<field> |
||||
<id>LOG_FIELD</id> |
||||
<enabled>N</enabled> |
||||
<name>LOG_FIELD</name> |
||||
</field> |
||||
</step-log-table> |
||||
<metrics-log-table> |
||||
<connection/> |
||||
<schema/> |
||||
<table/> |
||||
<timeout_days/> |
||||
<field> |
||||
<id>ID_BATCH</id> |
||||
<enabled>Y</enabled> |
||||
<name>ID_BATCH</name> |
||||
</field> |
||||
<field> |
||||
<id>CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>CHANNEL_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>LOG_DATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOG_DATE</name> |
||||
</field> |
||||
<field> |
||||
<id>METRICS_DATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>METRICS_DATE</name> |
||||
</field> |
||||
<field> |
||||
<id>METRICS_CODE</id> |
||||
<enabled>Y</enabled> |
||||
<name>METRICS_CODE</name> |
||||
</field> |
||||
<field> |
||||
<id>METRICS_DESCRIPTION</id> |
||||
<enabled>Y</enabled> |
||||
<name>METRICS_DESCRIPTION</name> |
||||
</field> |
||||
<field> |
||||
<id>METRICS_SUBJECT</id> |
||||
<enabled>Y</enabled> |
||||
<name>METRICS_SUBJECT</name> |
||||
</field> |
||||
<field> |
||||
<id>METRICS_TYPE</id> |
||||
<enabled>Y</enabled> |
||||
<name>METRICS_TYPE</name> |
||||
</field> |
||||
<field> |
||||
<id>METRICS_VALUE</id> |
||||
<enabled>Y</enabled> |
||||
<name>METRICS_VALUE</name> |
||||
</field> |
||||
</metrics-log-table> |
||||
</log> |
||||
<maxdate> |
||||
<connection/> |
||||
<table/> |
||||
<field/> |
||||
<offset>0.0</offset> |
||||
<maxdiff>0.0</maxdiff> |
||||
</maxdate> |
||||
<size_rowset>10000</size_rowset> |
||||
<sleep_time_empty>50</sleep_time_empty> |
||||
<sleep_time_full>50</sleep_time_full> |
||||
<unique_connections>N</unique_connections> |
||||
<feedback_shown>Y</feedback_shown> |
||||
<feedback_size>50000</feedback_size> |
||||
<using_thread_priorities>Y</using_thread_priorities> |
||||
<shared_objects_file/> |
||||
<capture_step_performance>N</capture_step_performance> |
||||
<step_performance_capturing_delay>1000</step_performance_capturing_delay> |
||||
<step_performance_capturing_size_limit>100</step_performance_capturing_size_limit> |
||||
<dependencies> |
||||
</dependencies> |
||||
<partitionschemas> |
||||
</partitionschemas> |
||||
<slaveservers> |
||||
</slaveservers> |
||||
<clusterschemas> |
||||
</clusterschemas> |
||||
<created_user>-</created_user> |
||||
<created_date>2022/06/27 15:49:54.602</created_date> |
||||
<modified_user>-</modified_user> |
||||
<modified_date>2022/06/27 15:49:54.602</modified_date> |
||||
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key> |
||||
<is_key_private>N</is_key_private> |
||||
</info> |
||||
<notepads> |
||||
</notepads> |
||||
<order> |
||||
<hop> |
||||
<from>Microsoft Excel Input</from> |
||||
<to>Table output tmp_stip_meldung</to> |
||||
<enabled>Y</enabled> |
||||
</hop> |
||||
</order> |
||||
<step> |
||||
<name>Microsoft Excel Input</name> |
||||
<type>ExcelInput</type> |
||||
<description/> |
||||
<distribute>Y</distribute> |
||||
<custom_distribution/> |
||||
<copies>1</copies> |
||||
<partitioning> |
||||
<method>none</method> |
||||
<schema_name/> |
||||
</partitioning> |
||||
<header>Y</header> |
||||
<noempty>Y</noempty> |
||||
<stoponempty>N</stoponempty> |
||||
<filefield/> |
||||
<sheetfield/> |
||||
<sheetrownumfield/> |
||||
<rownumfield/> |
||||
<sheetfield/> |
||||
<filefield/> |
||||
<limit>0</limit> |
||||
<encoding>UTF-8</encoding> |
||||
<add_to_result_filenames>Y</add_to_result_filenames> |
||||
<accept_filenames>N</accept_filenames> |
||||
<accept_field/> |
||||
<accept_stepname/> |
||||
<file> |
||||
<name>${PATH_TO_UPLOADFILE}</name> |
||||
<filemask/> |
||||
<exclude_filemask/> |
||||
<file_required>N</file_required> |
||||
<include_subfolders>N</include_subfolders> |
||||
</file> |
||||
<fields> |
||||
<field> |
||||
<name>Matrikel-Nr.</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format>#</format> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Vorname</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Nachname</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Status</name> |
||||
<type>Integer</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal>.</decimal> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Fach</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Abschluss</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Adresszusatz</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Straße</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>PLZ</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Ort</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Fördermonat</name> |
||||
<type>Number</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
<field> |
||||
<name>Bafög</name> |
||||
<type>String</type> |
||||
<length>-1</length> |
||||
<precision>-1</precision> |
||||
<trim_type>none</trim_type> |
||||
<repeat>N</repeat> |
||||
<format/> |
||||
<currency/> |
||||
<decimal/> |
||||
<group/> |
||||
</field> |
||||
</fields> |
||||
<sheets> |
||||
<sheet> |
||||
<name>Tabellenausgabe Studierend..1</name> |
||||
<startrow>3</startrow> |
||||
<startcol>0</startcol> |
||||
</sheet> |
||||
</sheets> |
||||
<strict_types>N</strict_types> |
||||
<error_ignored>N</error_ignored> |
||||
<error_line_skipped>N</error_line_skipped> |
||||
<bad_line_files_destination_directory/> |
||||
<bad_line_files_extension>warning</bad_line_files_extension> |
||||
<error_line_files_destination_directory/> |
||||
<error_line_files_extension>error</error_line_files_extension> |
||||
<line_number_files_destination_directory/> |
||||
<line_number_files_extension>line</line_number_files_extension> |
||||
<shortFileFieldName/> |
||||
<pathFieldName/> |
||||
<hiddenFieldName/> |
||||
<lastModificationTimeFieldName/> |
||||
<uriNameFieldName/> |
||||
<rootUriNameFieldName/> |
||||
<extensionFieldName/> |
||||
<sizeFieldName/> |
||||
<spreadsheet_type>POI</spreadsheet_type> |
||||
<cluster_schema/> |
||||
<remotesteps> |
||||
<input> |
||||
</input> |
||||
<output> |
||||
</output> |
||||
</remotesteps> |
||||
<GUI> |
||||
<xloc>112</xloc> |
||||
<yloc>112</yloc> |
||||
<draw>Y</draw> |
||||
</GUI> |
||||
</step> |
||||
|
||||
<step> |
||||
<name>Table output tmp_stip_meldung</name> |
||||
<type>TableOutput</type> |
||||
<description/> |
||||
<distribute>Y</distribute> |
||||
<custom_distribution/> |
||||
<copies>1</copies> |
||||
<partitioning> |
||||
<method>none</method> |
||||
<schema_name/> |
||||
</partitioning> |
||||
<connection>eduetl</connection> |
||||
<schema/> |
||||
<table>tmp_stip_meldung</table> |
||||
<commit>100000</commit> |
||||
<truncate>N</truncate> |
||||
<ignore_errors>N</ignore_errors> |
||||
<use_batch>Y</use_batch> |
||||
<specify_fields>Y</specify_fields> |
||||
<partitioning_enabled>N</partitioning_enabled> |
||||
<partitioning_field/> |
||||
<partitioning_daily>N</partitioning_daily> |
||||
<partitioning_monthly>Y</partitioning_monthly> |
||||
<tablename_in_field>N</tablename_in_field> |
||||
<tablename_field/> |
||||
<tablename_in_table>Y</tablename_in_table> |
||||
<return_keys>N</return_keys> |
||||
<return_field/> |
||||
<fields> |
||||
<field> |
||||
<column_name>matrikel_nr</column_name> |
||||
<stream_name>Matrikel-Nr.</stream_name> |
||||
</field> |
||||
<field> |
||||
<column_name>foerdermonat</column_name> |
||||
<stream_name>Fördermonat</stream_name> |
||||
</field> |
||||
<field> |
||||
<column_name>bafoeg</column_name> |
||||
<stream_name>Bafög</stream_name> |
||||
</field> |
||||
</fields> |
||||
<cluster_schema/> |
||||
<remotesteps> |
||||
<input> |
||||
</input> |
||||
<output> |
||||
</output> |
||||
</remotesteps> |
||||
<GUI> |
||||
<xloc>544</xloc> |
||||
<yloc>112</yloc> |
||||
<draw>Y</draw> |
||||
</GUI> |
||||
</step> |
||||
|
||||
<step_error_handling> |
||||
</step_error_handling> |
||||
<slave-step-copy-partition-distribution> |
||||
</slave-step-copy-partition-distribution> |
||||
<slave_transformation>N</slave_transformation> |
||||
</transformation> |
@ -1,33 +0,0 @@
@@ -1,33 +0,0 @@
|
||||
update tmp_stip_meldung |
||||
set userinfo_id=1, |
||||
zeitstempel=now() |
||||
; |
||||
--delete from tmp_stip_meldung where bafoeg is null; |
||||
--delete from tmp_stip_meldung where foerdermonat is null and bafoeg = 'j'; |
||||
|
||||
|
||||
delete from stip_meldung |
||||
where matrikel_nr in (select M.matrikel_nr::integer from tmp_stip_meldung M) -- Hinzufügen |
||||
; |
||||
|
||||
delete from stip_meldung where ${Modus}=2; -- Löschen und Hinzufügen |
||||
|
||||
INSERT INTO stip_meldung |
||||
( |
||||
matrikel_nr, |
||||
foerdermonat, |
||||
bafoeg, |
||||
userinfo_id, |
||||
zeitstempel |
||||
) |
||||
select distinct |
||||
matrikel_nr::integer, |
||||
foerdermonat, |
||||
bafoeg, |
||||
userinfo_id, |
||||
zeitstempel |
||||
from tmp_stip_meldung |
||||
; |
||||
|
||||
|
||||
drop table tmp_stip_meldung; |
@ -1,443 +0,0 @@
@@ -1,443 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<job> |
||||
<name>stip_meldung_upload</name> |
||||
<description/> |
||||
<extended_description/> |
||||
<job_version/> |
||||
<job_status>0</job_status> |
||||
<directory>/</directory> |
||||
<created_user>-</created_user> |
||||
<created_date>2022/06/27 14:59:09.135</created_date> |
||||
<modified_user>-</modified_user> |
||||
<modified_date>2022/06/27 14:59:09.135</modified_date> |
||||
<parameters> |
||||
<parameter> |
||||
<name>Hochschule</name> |
||||
<default_value>361</default_value> |
||||
<description/> |
||||
</parameter> |
||||
<parameter> |
||||
<name>Modus</name> |
||||
<default_value>1</default_value> |
||||
<description>2=Löschen und Hinzufügen oder nur 1=Hinzufügen</description> |
||||
</parameter> |
||||
<parameter> |
||||
<name>PATH_TO_UPLOADFILE</name> |
||||
<default_value>file:///home/superx/Downloads/Tabellenausgabe_Studierende_(amtlich_und_intern)-8.xlsx</default_value> |
||||
<description>Pfad zur Exceldatei mit Quelldaten</description> |
||||
</parameter> |
||||
</parameters> |
||||
<slaveservers> |
||||
</slaveservers> |
||||
<job-log-table> |
||||
<connection/> |
||||
<schema/> |
||||
<table/> |
||||
<size_limit_lines/> |
||||
<interval/> |
||||
<timeout_days/> |
||||
<field> |
||||
<id>ID_JOB</id> |
||||
<enabled>Y</enabled> |
||||
<name>ID_JOB</name> |
||||
</field> |
||||
<field> |
||||
<id>CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>CHANNEL_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>JOBNAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>JOBNAME</name> |
||||
</field> |
||||
<field> |
||||
<id>STATUS</id> |
||||
<enabled>Y</enabled> |
||||
<name>STATUS</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_READ</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_READ</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_WRITTEN</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_WRITTEN</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_UPDATED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_UPDATED</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_INPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_INPUT</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_OUTPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_OUTPUT</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_REJECTED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_REJECTED</name> |
||||
</field> |
||||
<field> |
||||
<id>ERRORS</id> |
||||
<enabled>Y</enabled> |
||||
<name>ERRORS</name> |
||||
</field> |
||||
<field> |
||||
<id>STARTDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>STARTDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>ENDDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>ENDDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>LOGDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOGDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>DEPDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>DEPDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>REPLAYDATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>REPLAYDATE</name> |
||||
</field> |
||||
<field> |
||||
<id>LOG_FIELD</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOG_FIELD</name> |
||||
</field> |
||||
<field> |
||||
<id>EXECUTING_SERVER</id> |
||||
<enabled>N</enabled> |
||||
<name>EXECUTING_SERVER</name> |
||||
</field> |
||||
<field> |
||||
<id>EXECUTING_USER</id> |
||||
<enabled>N</enabled> |
||||
<name>EXECUTING_USER</name> |
||||
</field> |
||||
<field> |
||||
<id>START_JOB_ENTRY</id> |
||||
<enabled>N</enabled> |
||||
<name>START_JOB_ENTRY</name> |
||||
</field> |
||||
<field> |
||||
<id>CLIENT</id> |
||||
<enabled>N</enabled> |
||||
<name>CLIENT</name> |
||||
</field> |
||||
</job-log-table> |
||||
<jobentry-log-table> |
||||
<connection/> |
||||
<schema/> |
||||
<table/> |
||||
<timeout_days/> |
||||
<field> |
||||
<id>ID_BATCH</id> |
||||
<enabled>Y</enabled> |
||||
<name>ID_BATCH</name> |
||||
</field> |
||||
<field> |
||||
<id>CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>CHANNEL_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>LOG_DATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOG_DATE</name> |
||||
</field> |
||||
<field> |
||||
<id>JOBNAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>TRANSNAME</name> |
||||
</field> |
||||
<field> |
||||
<id>JOBENTRYNAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>STEPNAME</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_READ</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_READ</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_WRITTEN</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_WRITTEN</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_UPDATED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_UPDATED</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_INPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_INPUT</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_OUTPUT</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_OUTPUT</name> |
||||
</field> |
||||
<field> |
||||
<id>LINES_REJECTED</id> |
||||
<enabled>Y</enabled> |
||||
<name>LINES_REJECTED</name> |
||||
</field> |
||||
<field> |
||||
<id>ERRORS</id> |
||||
<enabled>Y</enabled> |
||||
<name>ERRORS</name> |
||||
</field> |
||||
<field> |
||||
<id>RESULT</id> |
||||
<enabled>Y</enabled> |
||||
<name>RESULT</name> |
||||
</field> |
||||
<field> |
||||
<id>NR_RESULT_ROWS</id> |
||||
<enabled>Y</enabled> |
||||
<name>NR_RESULT_ROWS</name> |
||||
</field> |
||||
<field> |
||||
<id>NR_RESULT_FILES</id> |
||||
<enabled>Y</enabled> |
||||
<name>NR_RESULT_FILES</name> |
||||
</field> |
||||
<field> |
||||
<id>LOG_FIELD</id> |
||||
<enabled>N</enabled> |
||||
<name>LOG_FIELD</name> |
||||
</field> |
||||
<field> |
||||
<id>COPY_NR</id> |
||||
<enabled>N</enabled> |
||||
<name>COPY_NR</name> |
||||
</field> |
||||
</jobentry-log-table> |
||||
<channel-log-table> |
||||
<connection/> |
||||
<schema/> |
||||
<table/> |
||||
<timeout_days/> |
||||
<field> |
||||
<id>ID_BATCH</id> |
||||
<enabled>Y</enabled> |
||||
<name>ID_BATCH</name> |
||||
</field> |
||||
<field> |
||||
<id>CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>CHANNEL_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>LOG_DATE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOG_DATE</name> |
||||
</field> |
||||
<field> |
||||
<id>LOGGING_OBJECT_TYPE</id> |
||||
<enabled>Y</enabled> |
||||
<name>LOGGING_OBJECT_TYPE</name> |
||||
</field> |
||||
<field> |
||||
<id>OBJECT_NAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>OBJECT_NAME</name> |
||||
</field> |
||||
<field> |
||||
<id>OBJECT_COPY</id> |
||||
<enabled>Y</enabled> |
||||
<name>OBJECT_COPY</name> |
||||
</field> |
||||
<field> |
||||
<id>REPOSITORY_DIRECTORY</id> |
||||
<enabled>Y</enabled> |
||||
<name>REPOSITORY_DIRECTORY</name> |
||||
</field> |
||||
<field> |
||||
<id>FILENAME</id> |
||||
<enabled>Y</enabled> |
||||
<name>FILENAME</name> |
||||
</field> |
||||
<field> |
||||
<id>OBJECT_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>OBJECT_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>OBJECT_REVISION</id> |
||||
<enabled>Y</enabled> |
||||
<name>OBJECT_REVISION</name> |
||||
</field> |
||||
<field> |
||||
<id>PARENT_CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>PARENT_CHANNEL_ID</name> |
||||
</field> |
||||
<field> |
||||
<id>ROOT_CHANNEL_ID</id> |
||||
<enabled>Y</enabled> |
||||
<name>ROOT_CHANNEL_ID</name> |
||||
</field> |
||||
</channel-log-table> |
||||
<pass_batchid>N</pass_batchid> |
||||
<shared_objects_file/> |
||||
<entries> |
||||
<entry> |
||||
<name>START</name> |
||||
<description/> |
||||
<type>SPECIAL</type> |
||||
<start>Y</start> |
||||
<dummy>N</dummy> |
||||
<repeat>N</repeat> |
||||
<schedulerType>0</schedulerType> |
||||
<intervalSeconds>0</intervalSeconds> |
||||
<intervalMinutes>60</intervalMinutes> |
||||
<hour>12</hour> |
||||
<minutes>0</minutes> |
||||
<weekDay>1</weekDay> |
||||
<DayOfMonth>1</DayOfMonth> |
||||
<parallel>N</parallel> |
||||
<draw>Y</draw> |
||||
<nr>0</nr> |
||||
<xloc>64</xloc> |
||||
<yloc>112</yloc> |
||||
</entry> |
||||
<entry> |
||||
<name>tmp_stip_meldung</name> |
||||
<description/> |
||||
<type>SQL</type> |
||||
<sql>drop table if exists tmp_stip_meldung;

create table tmp_stip_meldung
(
 matrikel_nr varchar(255),
 foerdermonat float,
 bafoeg char(1),
 userinfo_id integer,
 zeitstempel timestamp
)
;</sql> |
||||
<useVariableSubstitution>F</useVariableSubstitution> |
||||
<sqlfromfile>F</sqlfromfile> |
||||
<sqlfilename/> |
||||
<sendOneStatement>F</sendOneStatement> |
||||
<connection>eduetl</connection> |
||||
<parallel>N</parallel> |
||||
<draw>Y</draw> |
||||
<nr>0</nr> |
||||
<xloc>208</xloc> |
||||
<yloc>112</yloc> |
||||
</entry> |
||||
<entry> |
||||
<name>excel_into_stip_meldung</name> |
||||
<description/> |
||||
<type>TRANS</type> |
||||
<specification_method>filename</specification_method> |
||||
<trans_object_id/> |
||||
<filename>${Internal.Job.Filename.Directory}/excel_into_stip_meldung.ktr</filename> |
||||
<transname/> |
||||
<arg_from_previous>N</arg_from_previous> |
||||
<params_from_previous>N</params_from_previous> |
||||
<exec_per_row>N</exec_per_row> |
||||
<clear_rows>N</clear_rows> |
||||
<clear_files>N</clear_files> |
||||
<set_logfile>N</set_logfile> |
||||
<logfile/> |
||||
<logext/> |
||||
<add_date>N</add_date> |
||||
<add_time>N</add_time> |
||||
<loglevel>Basic</loglevel> |
||||
<cluster>N</cluster> |
||||
<slave_server_name/> |
||||
<set_append_logfile>N</set_append_logfile> |
||||
<wait_until_finished>Y</wait_until_finished> |
||||
<follow_abort_remote>N</follow_abort_remote> |
||||
<create_parent_folder>N</create_parent_folder> |
||||
<logging_remote_work>N</logging_remote_work> |
||||
<parameters> |
||||
<pass_all_parameters>Y</pass_all_parameters> |
||||
</parameters> |
||||
<parallel>N</parallel> |
||||
<draw>Y</draw> |
||||
<nr>0</nr> |
||||
<xloc>448</xloc> |
||||
<yloc>112</yloc> |
||||
</entry> |
||||
<entry> |
||||
<name>Success</name> |
||||
<description/> |
||||
<type>SUCCESS</type> |
||||
<parallel>N</parallel> |
||||
<draw>Y</draw> |
||||
<nr>0</nr> |
||||
<xloc>976</xloc> |
||||
<yloc>112</yloc> |
||||
</entry> |
||||
<entry> |
||||
<name>Update stip_meldung</name> |
||||
<description/> |
||||
<type>SQL</type> |
||||
<sql/> |
||||
<useVariableSubstitution>T</useVariableSubstitution> |
||||
<sqlfromfile>T</sqlfromfile> |
||||
<sqlfilename>${Internal.Job.Filename.Directory}/stip_meldung_fuellen.sql</sqlfilename> |
||||
<sendOneStatement>F</sendOneStatement> |
||||
<connection>eduetl</connection> |
||||
<parallel>N</parallel> |
||||
<draw>Y</draw> |
||||
<nr>0</nr> |
||||
<xloc>688</xloc> |
||||
<yloc>112</yloc> |
||||
</entry> |
||||
</entries> |
||||
<hops> |
||||
<hop> |
||||
<from>START</from> |
||||
<to>tmp_stip_meldung</to> |
||||
<from_nr>0</from_nr> |
||||
<to_nr>0</to_nr> |
||||
<enabled>Y</enabled> |
||||
<evaluation>Y</evaluation> |
||||
<unconditional>Y</unconditional> |
||||
</hop> |
||||
<hop> |
||||
<from>tmp_stip_meldung</from> |
||||
<to>excel_into_stip_meldung</to> |
||||
<from_nr>0</from_nr> |
||||
<to_nr>0</to_nr> |
||||
<enabled>Y</enabled> |
||||
<evaluation>Y</evaluation> |
||||
<unconditional>N</unconditional> |
||||
</hop> |
||||
<hop> |
||||
<from>Update stip_meldung</from> |
||||
<to>Success</to> |
||||
<from_nr>0</from_nr> |
||||
<to_nr>0</to_nr> |
||||
<enabled>Y</enabled> |
||||
<evaluation>Y</evaluation> |
||||
<unconditional>N</unconditional> |
||||
</hop> |
||||
<hop> |
||||
<from>excel_into_stip_meldung</from> |
||||
<to>Update stip_meldung</to> |
||||
<from_nr>0</from_nr> |
||||
<to_nr>0</to_nr> |
||||
<enabled>Y</enabled> |
||||
<evaluation>Y</evaluation> |
||||
<unconditional>N</unconditional> |
||||
</hop> |
||||
</hops> |
||||
<notepads> |
||||
</notepads> |
||||
</job> |
@ -1,41 +0,0 @@
@@ -1,41 +0,0 @@
|
||||
--Freemarker Template |
||||
--Achtung: Macro fügt Inhalte ein |
||||
--Bitte nur Freemarker Variablen füllen |
||||
<sqlvars> |
||||
<sqlvar name="sx_jobs_exists">select sp_table_exists('sx_jobs') from xdummy;</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#assign jobs = [ |
||||
{"uniquename":"stip_meldung_upload", "caption":"Stipendiaten-Daten hochladen", "filepath":"rpta/etl/stip_meldung_upload/stip_meldung_upload.kjb","sachgebiete_id":330, |
||||
"kenn_profil":"","hs_nr":"","modus_supported":1,"params":"", |
||||
"check_sql":"select count(*) from stip_meldung"} |
||||
] /> |
||||
|
||||
|
||||
|
||||
|
||||
--- Freemarker Magic |
||||
<#if sx_jobs_exists=1> |
||||
<#foreach job in jobs> |
||||
delete from sx_jobs where uniquename='${job.uniquename}'; |
||||
</#foreach> |
||||
<#if SQLdialect='Postgres'> |
||||
select sp_update_sequence('sx_jobs'); |
||||
</#if> |
||||
<#foreach job in jobs> |
||||
insert into sx_jobs (uniquename,caption,filepath,sachgebiete_id,kenn_profil,hs_nr,modus_supported,params |
||||
<#if SQLdialect='Postgres'>,check_sql |
||||
</#if>) |
||||
values ('${job.uniquename}','${job.caption}','${job.filepath}',${job.sachgebiete_id},<#if job.kenn_profil!="">${job.kenn_profil}<#else>null::integer</#if>, |
||||
<#if job.hs_nr!="">${job.hs_nr}<#else>null::integer</#if>,${job.modus_supported},'${job.params}' |
||||
<#if SQLdialect='Postgres'> |
||||
,'${job.check_sql}' |
||||
</#if> |
||||
); |
||||
</#foreach> |
||||
|
||||
<#if SQLdialect='Postgres'> |
||||
select sp_update_sequence('sx_jobs'); |
||||
</#if> |
||||
|
||||
</#if> |
@ -1,149 +0,0 @@
@@ -1,149 +0,0 @@
|
||||
--Freemarker Template |
||||
<#include "SQL_lingua_franca"/> |
||||
<#include "SuperX_general"/> |
||||
-- |
||||
--Autor D. Quathamer 2024 |
||||
<sqlvars> |
||||
<sqlvar name="column_layouts" type="hashsequence"><![CDATA[ |
||||
select L.tid, |
||||
L.uniquename, |
||||
L.caption, |
||||
L.whereclause, |
||||
L.uniquename as target_tablename, |
||||
R.uniquename as resultset_uniquename, |
||||
'tmp_' || R.uniquename as resultset_tablename, |
||||
R.fieldclause as resultset_fieldclause, |
||||
R.joinclause as resultset_joinclause, |
||||
R.whereclause as resultset_whereclause, |
||||
R.systeminfo_id as resultset_systeminfo_id |
||||
from rpta_resultset R, rpta_column_layout L |
||||
where L.resultset_id=R.tid |
||||
and L.is_virtual=0 |
||||
]]> |
||||
</sqlvar> |
||||
|
||||
<sqlvar name="columns" type="hashsequence"><![CDATA[ |
||||
SELECT L.tid as layout_id, |
||||
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.is_virtual=0 |
||||
order by CL.sortnr |
||||
; |
||||
]]></sqlvar> |
||||
|
||||
</sqlvars> |
||||
|
||||
<#if column_layouts?has_content> |
||||
|
||||
<#foreach column_layout in column_layouts> |
||||
|
||||
<#if columns?has_content> |
||||
|
||||
--zuerst resultset aufbauen: |
||||
create temp table ${column_layout.resultset_tablename} as |
||||
select ${column_layout.resultset_fieldclause} |
||||
from ${column_layout.resultset_joinclause} |
||||
where 1=1 |
||||
<#if column_layout.resultset_whereclause != ""> |
||||
${column_layout.resultset_whereclause} </#if> |
||||
; |
||||
|
||||
--dann das Spaltenlayout |
||||
select |
||||
--zuerst die Basisdaten: |
||||
<#foreach column in columns> |
||||
<#if column.layout_id=column_layout.tid> |
||||
|
||||
<#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> |
||||
|
||||
</#if> |
||||
</#foreach> |
||||
null::char(1) as dummycol |
||||
into temp tmp_stud |
||||
from ${column_layout.resultset_tablename} |
||||
where 1=1 |
||||
<#if column_layout.whereclause !=""> |
||||
and ${column_layout.whereclause} |
||||
</#if> |
||||
; |
||||
|
||||
drop table if exists ${column_layout.target_tablename} ; |
||||
|
||||
<#assign index_clause="" /> |
||||
|
||||
--ergebnistabelle: |
||||
create table ${column_layout.target_tablename} as select |
||||
--zuerst die nicht-Aggregate: |
||||
<#assign groupby=0 /> |
||||
<#foreach column in columns> |
||||
<#if column.layout_id=column_layout.tid> |
||||
|
||||
<#if column.is_aggregate==0> |
||||
<#assign groupby=groupby+1 /> |
||||
${column.targetfieldname}, |
||||
|
||||
<#assign index_clause=index_clause+ " |
||||
create index ix_${column_layout.target_tablename}_${groupby} on ${column_layout.target_tablename}(${column.targetfieldname});" /> |
||||
</#if> |
||||
|
||||
|
||||
|
||||
|
||||
</#if> |
||||
</#foreach> |
||||
--dann die Aggregate: |
||||
<#foreach column in columns> |
||||
<#if column.layout_id=column_layout.tid> |
||||
|
||||
<#if column.is_aggregate==1 && column.coltype!="computedColumn"> |
||||
sum(${column.targetfieldname}) as ${column.targetfieldname}, |
||||
</#if> |
||||
|
||||
</#if> |
||||
</#foreach> |
||||
null::char(1) as dummycol |
||||
from tmp_stud |
||||
where 1=1 |
||||
<#if groupby !=0 > |
||||
group by |
||||
<#list 1..groupby as i>${i} |
||||
<#if i != groupby> |
||||
, |
||||
</#if> |
||||
</#list> |
||||
</#if> |
||||
|
||||
; |
||||
|
||||
${index_clause} |
||||
|
||||
|
||||
drop table if exists tmp_stud; |
||||
drop table if exists tmp_gesamt; |
||||
|
||||
|
||||
</#if> --wenn columns?has_content |
||||
drop table ${column_layout.resultset_tablename}; |
||||
</#foreach> -- Ende Schleife column_layouts |
||||
</#if> --gibt es column_layouts |
||||
|
@ -1,122 +0,0 @@
@@ -1,122 +0,0 @@
|
||||
--Freemarker Template |
||||
<#include "SQL_lingua_franca"/> |
||||
<#include "SuperX_general"/> |
||||
-- |
||||
--Autor D. Quathamer 2024 |
||||
<sqlvars> |
||||
<sqlvar name="basetables" type="hashsequence"><![CDATA[ |
||||
SELECT distinct T.name, |
||||
R.is_virtual, |
||||
T.name as runtime_tablename, |
||||
R.caption, |
||||
R.uniquename, |
||||
R.fieldclause, |
||||
R.joinclause, |
||||
R.whereclause, |
||||
R.systeminfo_id |
||||
from sx_tables T, rpta_resultset R |
||||
where T.name=R.uniquename |
||||
and R.is_virtual=0 |
||||
|
||||
]]> |
||||
</sqlvar> |
||||
<sqlvar name="basetable_columns" type="hashsequence"><![CDATA[ |
||||
SELECT distinct T.name as table_name, |
||||
F.name, |
||||
F.is_sum, |
||||
R.uniquename as rpta_name |
||||
from sx_tables T, rpta_resultset R , sx_fields F |
||||
where T.name=R.uniquename |
||||
and R.is_virtual=0 |
||||
and F.table_name=T.name |
||||
order by F.is_sum,2,3 |
||||
|
||||
|
||||
]]> |
||||
</sqlvar> |
||||
<sqlvar name="rpta_clauses" type="hashsequence"><![CDATA[ |
||||
select distinct R.uniquename as rpta_uniquename, R.fieldclause, R.joinclause, R.whereclause from sx_tables T, rpta_resultset R |
||||
where T.name=R.uniquename |
||||
and R.is_virtual=0 |
||||
]]> |
||||
</sqlvar> |
||||
|
||||
</sqlvars> |
||||
|
||||
<#if basetables?has_content> |
||||
<#foreach basetable in basetables> |
||||
|
||||
|
||||
<#if basetable.is_virtual==0> |
||||
<#foreach rpta_clause in rpta_clauses> |
||||
<#if rpta_clause.rpta_uniquename=basetable.uniquename> |
||||
<#if rpta_clause.joinclause?exists && rpta_clause.joinclause !=''> |
||||
<#assign sqlString = "select current_timestamp as creation_date, " + rpta_clause.fieldclause + " from " + rpta_clause.joinclause + " where 1=1 " + rpta_clause.whereclause /> |
||||
<#else> |
||||
|
||||
<#assign sqlString = "select current_timestamp as creation_date, " + rpta_clause.fieldclause + " where 1=1 " + rpta_clause.whereclause /> |
||||
|
||||
</#if> |
||||
|
||||
drop table if exists ${basetable.runtime_tablename}; |
||||
|
||||
|
||||
|
||||
create temp table tmp_${basetable.runtime_tablename} as |
||||
${sqlString} |
||||
; |
||||
</#if> |
||||
</#foreach> |
||||
--Summierung: |
||||
<#if basetable_columns?has_content> |
||||
<#assign groupby=0 /> |
||||
|
||||
drop table if exists ${basetable.runtime_tablename}; |
||||
|
||||
|
||||
create table ${basetable.runtime_tablename} as |
||||
select |
||||
<#foreach basetable_column in basetable_columns> |
||||
<#if basetable_column.rpta_name=basetable.uniquename> |
||||
<#if basetable_column.is_sum=0> |
||||
<#assign groupby=groupby+1 /> |
||||
${basetable_column.name}, |
||||
<#else> |
||||
sum(${basetable_column.name})::float as ${basetable_column.name}, |
||||
</#if> |
||||
|
||||
</#if> |
||||
|
||||
</#foreach> |
||||
creation_date |
||||
from tmp_${basetable.runtime_tablename} |
||||
group by |
||||
<#list 1..groupby as i>${i}, |
||||
</#list> |
||||
creation_date |
||||
; |
||||
|
||||
|
||||
drop table tmp_${basetable.runtime_tablename}; |
||||
|
||||
</#if> --Ende Summierung |
||||
|
||||
--TODO: indizes |
||||
<#foreach basetable_column in basetable_columns> |
||||
<#if basetable_column.rpta_name=basetable.uniquename> |
||||
|
||||
<#if basetable_column.is_sum=0> |
||||
create index ix_${basetable.runtime_tablename}_${basetable_column.name} on ${basetable.runtime_tablename}(${basetable_column.name}); |
||||
--create index ix_tid_stg_dashboard_mw on ${basetable.runtime_tablename}(tid_stg); |
||||
--create index ix_sem_rueck_beur_ein_dashboard_mw on ${basetable.runtime_tablename}(sem_rueck_beur_ein); |
||||
</#if> |
||||
|
||||
</#if> |
||||
</#foreach> |
||||
|
||||
</#if> --Ende is_virtual=0 |
||||
</#foreach> |
||||
|
||||
|
||||
|
||||
</#if> |
@ -1,96 +0,0 @@
@@ -1,96 +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> |
||||
|
||||
truncate table rpta_exam_unit; |
||||
|
||||
insert into rpta_exam_unit (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, |
||||
shortcomment, |
||||
panerk |
||||
) |
||||
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, |
||||
<#if TableFieldExists?exists && TableFieldExists('lm_exam_unit','shortcomment')> |
||||
substring(shortcomment from 1 for 255) as shortcomment, |
||||
<#else> |
||||
null::varchar(255) as shortcomment, |
||||
</#if> |
||||
panerk |
||||
|
||||
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, |
||||
null::varchar(255) as shortcomment, |
||||
(select L.panerk from sos_lab L where L.labnr=sos_lab_pord.labnr and L.sourcesystem = 5) |
||||
FROM sos_lab_pord |
||||
WHERE sourcesystem = 5 |
||||
; |
||||
|
||||
</#if> |
@ -1,7 +0,0 @@
@@ -1,7 +0,0 @@
|
||||
|
||||
select * from xdummy; |
||||
--bei Postgres in HIS1 laufen alle Scripte in Transaktionen, daher muss man |
||||
--für vacuum erst committen |
||||
commit; |
||||
vacuum rpta_exam_unit; |
||||
|
@ -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,32 +0,0 @@
@@ -1,32 +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 in ('sos_stud_astat','sos_stud_astat_gew')\ |
||||
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^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Abschluss-Sicht' order by 3,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^ ^ ^ |
||||
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^ ^ ^ ^ |
||||
48014^Filter Studierende^100^0^0^140^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='SOS_STUD_FILTER' order by 2;^^^ |
||||
48015^Nur Endsemester^21^0^0^140^80^1^integer^30^0^1^<<SQL>> select 1,'ja' from xdummy^Eintrag^ ^ |
||||
48016^Matrikel-Nr.^35^350^-1^140^80^1^char^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,20 +0,0 @@
@@ -1,20 +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^48014^ |
||||
48000^48015^ |
||||
48000^48016^ |
||||
48000^48018^ |
||||
48000^48022^ |
||||
48000^48023^ |
@ -1,181 +0,0 @@
@@ -1,181 +0,0 @@
|
||||
48000^Tabellenausgabe Studierende (amtlich und intern)^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<sqlvars>\ |
||||
<sqlvar name="my_base_rs"><![CDATA[\ |
||||
select R.uniquename\ |
||||
from rpta_resultset R, rpta_column_layout L\ |
||||
where L.resultset_id=R.tid\ |
||||
and L.uniquename=<<Spaltenlayout>>;]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||
SELECT distinct T.name,\ |
||||
R.is_virtual,\ |
||||
name as runtime_tablename\ |
||||
from sx_tables T, rpta_resultset R \ |
||||
where T.name=R.uniquename\ |
||||
and T.name='${my_base_rs}'\ |
||||
and R.is_virtual=0\ |
||||
\ |
||||
union\ |
||||
select R.uniquename,\ |
||||
R.is_virtual,\ |
||||
'tmp_' || R.uniquename as runtime_tablename\ |
||||
from rpta_resultset R where R.uniquename='${my_base_rs}'\ |
||||
and R.is_virtual=1\ |
||||
;\ |
||||
]]>\ |
||||
</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,\ |
||||
R.is_virtual,\ |
||||
L.sortclause\ |
||||
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,\ |
||||
F.sql_code as format_sql,\ |
||||
F.uniquename as format_uniquename,\ |
||||
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_column C, rpta_column_type T,rpta_column2layout CL \ |
||||
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||
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>\ |
||||
<sqlvar name="endsemester"><![CDATA[\ |
||||
SELECT max(tid)\ |
||||
from semester \ |
||||
where 1=1\ |
||||
/* and tid >= <<Seit Semester>> */\ |
||||
/* and tid <= <<Bis Semester>> */\ |
||||
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||
and substring('' || tid from 5 for 1)='<<Semestertyp>>'\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
]]></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 semester_filter ="1=1\ |
||||
/* and sem_rueck_beur_ein >= <<Seit Semester>> */\ |
||||
/* and sem_rueck_beur_ein <= <<Bis Semester>> */\ |
||||
" />\ |
||||
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||
<#assign semester_filter = semester_filter+ " and substring('' || sem_rueck_beur_ein from 5 for 1)='<<Semestertyp>>'" />\ |
||||
</#if>\ |
||||
<#if "<<Nur Endsemester>>"="1">\ |
||||
--nur Endsemester\ |
||||
<#assign semester_filter = semester_filter+ " and 1=1 and sem_rueck_beur_ein = "+endsemester /> \ |
||||
</#if>\ |
||||
\ |
||||
<#assign filter="<<Köpfe oder Fälle ?>>\ |
||||
/* and sem_rueck_beur_ein = <<Semester>> */\ |
||||
/* and stichtag = <<Stichtag>> */\ |
||||
/* and <<Hochschulzugangsberechtigung>> */\ |
||||
/* and <<Hörerstatus>>*/\ |
||||
/* and geschlecht = <<Geschlecht>> */\ |
||||
/* and fach_sem_zahl <= <<bis Fachsemester>> */\ |
||||
/* and substring('' || sem_rueck_beur_ein from 5 for 1)='<<Semestertyp>>' */\ |
||||
/* and ${<<Filter Studierende>>} */\ |
||||
" />\ |
||||
\ |
||||
<#assign filter= filter + " and " + jahr_filter />\ |
||||
\ |
||||
<#assign filter= filter + " and " + semester_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>> */\ |
||||
/* <#assign filter = filter + " and tid_stg in (select L2.tid from lehr_stg_ab L2 where L2.abschluss in "+Abschluss.allNeededKeysList +")" /> --<<Abschluss>> */\ |
||||
\ |
||||
<#assign mtknr_filter="matrikel_nr::varchar(255)" />\ |
||||
<#if K_SOS_MTKNR_EXT=1>\ |
||||
<#assign mtknr_filter="pseudonym" />\ |
||||
</#if>\ |
||||
<#assign matrikel_nr_sel="" />\ |
||||
/*<#assign matrikel_nr_sel=<<Matrikel-Nr.>> />*/\ |
||||
\ |
||||
\ |
||||
<#if matrikel_nr_sel !="">\ |
||||
<#assign filter=filter+" and "+mtknr_filter+"='"+matrikel_nr_sel+"'" />\ |
||||
</#if>\ |
||||
<#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>\ |
||||
\ |
||||
\ |
||||
<@rpta_interpret_column_layout nonvirtualTableFilter=filter />\ |
||||
\ |
||||
</#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>\ |
||||
<#if 1=0>\ |
||||
Column CID=0 heading_text="sortnr" center_heading explanation=""\ |
||||
row_selectable heading_platform readonly\ |
||||
width=5 text_size=60\ |
||||
</#if>\ |
||||
@@@^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,12 +0,0 @@
@@ -1,12 +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;^^ ^ |
||||
48048^Spalte (Schlüssel)^15^0^0^150^80^1^char^200^0^1^<<SQL>> select C.uniquename,C.caption from rpta_column C where 1=1 /* and resultset_id=<<Virtuelle Tabelle>> */\ |
||||
/* and tid in (select L.column_id from rpta_column2layout L\ |
||||
where L.layout_id=<<Spaltenlayout>>) */\ |
||||
order by 2;^^^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48040^330^ |
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
48040^48040^ |
||||
48040^48041^ |
||||
48040^48042^ |
||||
48040^48043^ |
||||
48040^48044^ |
||||
48040^48045^ |
||||
48040^48046^ |
||||
48040^48047^ |
||||
48040^48048^ |
@ -1,109 +0,0 @@
@@ -1,109 +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>> */\ |
||||
/* and C.uniquename = <<Spalte (Schlüssel)>> */\ |
||||
;\ |
||||
\ |
||||
\ |
||||
\ |
||||
update tmp_rpta_column set resultset_str=R.caption\ |
||||
from rpta_resultset R\ |
||||
where R.tid=tmp_rpta_column.resultset_id;\ |
||||
\ |
||||
\ |
||||
\ |
||||
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;^ ^^ |
||||
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_RPTA_STELL_FILTER' order by 2;^ ^^ |
||||
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^Besetzung anzeigen^150^0^0^150^120^1^sql^30^1^1^<<SQL>> select 'z','einschl. zukünftige' from xdummy union select 'a','nur aktuelle' from xdummy;^^<<SQL>>select 'z','einschl. zukünftige' from xdummy^ |
||||
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 union select 'z','einschl. zukünftige' from xdummy^ ^<<SQL>> select 'z','einschl. zukünftige' from xdummy^ |
||||
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,229 +0,0 @@
@@ -1,229 +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,\ |
||||
F.sql_code as format_sql,\ |
||||
F.uniquename as format_uniquename,\ |
||||
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_column C, rpta_column_type T,rpta_column2layout CL \ |
||||
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||
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>>) "/>\ |
||||
\ |
||||
<#if "<<Stellenanzeige>>"="'z'">\ |
||||
<#assign filter="sva_sgd_aggr.d_gueltig_ende >= date_val(<<Datum>>) "/>\ |
||||
</#if>\ |
||||
\ |
||||
<#assign filter = filter + "\ |
||||
/* 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>\ |
||||
\ |
||||
<#if "<<Stellenanzeige>>"="'besetzt'">\ |
||||
<#assign filter = filter + " and 0 < (select count(*) from sva_pbe_aggr PB where S.stellen_nr =PB.stellen_nr and date_val(<<Datum>>) between PB.d_besetz_anfang \ |
||||
and PB.d_besetz_ende )" />\ |
||||
</#if>\ |
||||
<#if "<<Stellenanzeige>>"="'frei'">\ |
||||
<#assign filter = filter + " and 0 = (select count(*) from sva_pbe_aggr PB where S.stellen_nr =PB.stellen_nr and date_val(<<Datum>>) between PB.d_besetz_anfang \ |
||||
and PB.d_besetz_ende )" />\ |
||||
</#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 <#if '<<Besetzung anzeigen>>'='a'>\ |
||||
--nur aktuelle, ohne zukünftig:\ |
||||
sva_pbe_aggr_d_besetz_anfang > date_val(<<Datum>>)\ |
||||
or \ |
||||
</#if>\ |
||||
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,30 +0,0 @@
@@ -1,30 +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^^ |
||||
48116^Hochschulzugangsberechtigung^120^300^-1^200^200^1^sql^30^0^999^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^999^<<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,-1000 from sichten where name_intern ='sos_kst_fb_stgabint'\ |
||||
union 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^999^<<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^999^<<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^999^<<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^999^<<SQL>> SELECT apnr,druck FROM cif where key = 9003 and apnr between 1 and 4 order by 1;^ ^ ^ |
||||
48133^Spalten^3002^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;^ ^ ^ |
||||
48134^tablestylesheet^3001^0^0^100^150^1^char^200^1^1^<<SQL>>\ |
||||
select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=48110^ ^<<SQL>>select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=48110 and ord=1^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48110^7^ |
@ -1,16 +0,0 @@
@@ -1,16 +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^ |
||||
48110^48134^ |
@ -1,112 +0,0 @@
@@ -1,112 +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,\ |
||||
L.sortclause\ |
||||
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,\ |
||||
F.sql_code as format_sql,\ |
||||
F.uniquename as format_uniquename,\ |
||||
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_column C, rpta_column_type T,rpta_column2layout CL \ |
||||
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||
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>>' */\ |
||||
/* and fach_sem_zahl <= <<bis Fachsemester>> */\ |
||||
" />\ |
||||
\ |
||||
<#assign filter = filter + " and 's_' || tid_stg in "+Studiengang.allNeededKeysList /> \ |
||||
<#assign filter = filter + " and tid_stg in (select tid from lehr_stg_ab where stg in "+Fächer.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>\ |
||||
\ |
||||
\ |
||||
\ |
||||
<@rpta_interpret_column_layout nonvirtualTableFilter=1/>\ |
||||
\ |
||||
\ |
||||
</#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,16 +0,0 @@
@@ -1,16 +0,0 @@
|
||||
48150^Benutzer/in^50^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^hidden^^ |
||||
48151^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;^hidden^^ |
||||
48152^Spaltenlayouts verwalten^110^0^0^140^80^1^char^255^0^18^ ^ ^<<SQL>> select '../edit/rpta/rpta_column_layout_list.jsp' from xdummy;^ |
||||
48153^Name^20^0^0^150^150^1^char^50^0^0^^^^ |
||||
48154^Schlüssel^30^0^0^150^200^1^char^200^0^0^ ^ ^^ |
||||
48155^Virtuelle Tabellen bearbeiten^100^0^0^140^80^1^char^255^0^18^ ^ ^<<SQL>> select '../edit/rpta/rpta_resultset_list.jsp' from xdummy;^ |
||||
48156^Virtuelle Tabelle^5^0^0^150^200^1^integer^200^1^1^<<SQL>> select tid,caption from rpta_resultset where 1=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^ |
||||
48157^Spaltentyp^200^0^0^150^200^1^integer^200^1^1^<<SQL>> select tid,caption from rpta_column_type order by 2;^^<<SQL>> select tid,caption from rpta_column_type\ |
||||
where uniquename='physicalColumn'^ |
||||
48158^Komponente^1^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,name from systeminfo order by 2;^ ^^ |
||||
48159^Quellfeld^7^0^0^150^200^1^char^200^0^1^<<SQL>> select F.name,coalesce(trim(F.caption),'Feld') || ' (' || trim(F.name) || ')' \ |
||||
from sx_fields F, rpta_resultset R\ |
||||
where F.table_name=R.uniquename\ |
||||
/* and R.tid=<<Virtuelle Tabelle>> */\ |
||||
and currentlyused=1\ |
||||
order by 1^ ^^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48150^330^ |
@ -1,10 +0,0 @@
@@ -1,10 +0,0 @@
|
||||
48150^48150^ |
||||
48150^48151^ |
||||
48150^48152^ |
||||
48150^48153^ |
||||
48150^48154^ |
||||
48150^48155^ |
||||
48150^48156^ |
||||
48150^48157^ |
||||
48150^48158^ |
||||
48150^48159^ |
@ -1,122 +0,0 @@
@@ -1,122 +0,0 @@
|
||||
48150^Spalte anlegen^--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),\ |
||||
column_type_uniquename 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)\ |
||||
);\ |
||||
\ |
||||
begin work;\ |
||||
\ |
||||
insert into tmp_rpta_column (--ord,\ |
||||
-- tid,\ |
||||
-- uniquename,\ |
||||
-- caption,\ |
||||
-- srcfieldname,\ |
||||
column_type,\ |
||||
column_type_str,\ |
||||
column_type_uniquename,\ |
||||
-- col_function,\ |
||||
-- is_aggregate,\ |
||||
resultset_id\ |
||||
-- custom,\ |
||||
-- description,\ |
||||
-- targetfieldname,\ |
||||
-- nextedit\ |
||||
) \ |
||||
select \ |
||||
T.tid,\ |
||||
T.caption as column_type_str,\ |
||||
T.uniquename as column_type_uniquename,\ |
||||
<<Virtuelle Tabelle>> as resultset_id\ |
||||
FROM rpta_column_type T \ |
||||
where T.tid=<<Spaltentyp>> \ |
||||
;\ |
||||
\ |
||||
update tmp_rpta_column set resultset_str=R.caption\ |
||||
from rpta_resultset R\ |
||||
where R.tid=tmp_rpta_column.resultset_id;\ |
||||
\ |
||||
/*update tmp_rpta_column set srcfieldname=F.name,\ |
||||
is_aggregate=F.is_sum,\ |
||||
uniquename=F.name,\ |
||||
caption=F.caption\ |
||||
from sx_fields F, rpta_resultset R\ |
||||
where F.table_name=R.uniquename\ |
||||
and R.tid=tmp_rpta_column.resultset_id\ |
||||
and F.name=<<Quellfeld>>\ |
||||
and tmp_rpta_column.column_type_uniquename='physicalColumn'; */\ |
||||
\ |
||||
\ |
||||
/* update tmp_rpta_column set uniquename=<<Schlüssel>>; */\ |
||||
/* update tmp_rpta_column set caption=<<Name>>;*/\ |
||||
\ |
||||
update tmp_rpta_column set uniquename='Created ' || timestamp_str(now())\ |
||||
where uniquename is null;\ |
||||
update tmp_rpta_column set caption='Created ' || timestamp_str(now())\ |
||||
where caption is null;\ |
||||
\ |
||||
\ |
||||
select sp_update_sequence('rpta_column');\ |
||||
\ |
||||
insert into rpta_column( uniquename,\ |
||||
caption,\ |
||||
srcfieldname,\ |
||||
column_type,\ |
||||
col_function,\ |
||||
is_aggregate,\ |
||||
resultset_id,\ |
||||
custom,\ |
||||
description,\ |
||||
targetfieldname)\ |
||||
select uniquename,\ |
||||
caption,\ |
||||
srcfieldname,\ |
||||
column_type,\ |
||||
col_function,\ |
||||
is_aggregate,\ |
||||
resultset_id,\ |
||||
custom,\ |
||||
description,\ |
||||
targetfieldname\ |
||||
from tmp_rpta_column;\ |
||||
\ |
||||
update tmp_rpta_column set tid=currval('rpta_column_tid_seq');\ |
||||
\ |
||||
\ |
||||
commit;\ |
||||
\ |
||||
select 'Ergebnis' as s1, \ |
||||
' Eintrag angelegt:' || coalesce(C.caption,'Unbenannt') || ' (' || coalesce(C.uniquename,'TID: ' || C.tid::varchar) || ') [' || C.column_type_str || ']' as ergebnis2,\ |
||||
'../edit/rpta/rpta_column_edit.jsp|tid=' || C.tid as nextedit\ |
||||
from tmp_rpta_column C\ |
||||
;^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="Ergebnis" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=50 text_size=100\ |
||||
Column CID=0 heading_text="Spalte" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=50 text_size=100\ |
||||
Column CID=1 heading_text="Bearbeiten" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=5 text_size=200\ |
||||
@@@^^^Spaltendefinitionen anlegen^drop table tmp_rpta_column;^^1^440^360^0^1^ ^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
331^48150^ |
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
48180^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)\ |
||||
and is_virtual=0\ |
||||
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 is_virtual=0\ |
||||
order by sortnr, caption\ |
||||
limit 1^ |
||||
48181^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;^ |
||||
48182^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;^ ^ ^ |
||||
48183^Abschluss^40^0^0^100^200^3^char^1500^0^1^<<SQL>> select apnr, druck from cifx where key=35 order by 2;^ ^ ^ |
||||
48184^bis Fachsemester^1000^300^-1^200^100^1^integer^30^0^0^^ ^ ^ |
||||
48185^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^ |
||||
48186^Hochschulzugangsberechtigung^120^300^-1^200^200^1^sql^30^0^1^hs_zugangsber^ ^ ^ |
||||
48187^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;^ |
||||
48188^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;^ ^ ^ |
||||
48189^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;^ ^ ^ |
||||
48190^Semester^100^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^hidden^ ^ |
||||
48191^Stichtag^23^330^-1^130^100^1^sql^30^0^1^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende';^hidden^ ^ |
||||
48192^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';^ |
||||
48193^Jahr^110^0^0^140^80^1^integer^30^0^13^^ ^ ^ |
||||
48194^Filter Studierende^100^0^0^140^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='SOS_STUD_FILTER' order by 2;^ ^ ^ |
||||
48195^Nur Endsemester^21^0^0^140^80^1^integer^30^0^1^<<SQL>> select 1,'ja' from xdummy^Eintrag^ ^ |
||||
48198^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';^ |
||||
48202^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;^ ^ ^ |
||||
48203^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 @@
|
||||
48180^7^ |
@ -1,19 +0,0 @@
@@ -1,19 +0,0 @@
|
||||
48180^48180^ |
||||
48180^48181^ |
||||
48180^48182^ |
||||
48180^48183^ |
||||
48180^48184^ |
||||
48180^48185^ |
||||
48180^48186^ |
||||
48180^48187^ |
||||
48180^48188^ |
||||
48180^48189^ |
||||
48180^48190^ |
||||
48180^48191^ |
||||
48180^48192^ |
||||
48180^48193^ |
||||
48180^48194^ |
||||
48180^48195^ |
||||
48180^48198^ |
||||
48180^48202^ |
||||
48180^48203^ |
@ -1,274 +0,0 @@
@@ -1,274 +0,0 @@
|
||||
48180^Tabellenausgabe Studierende (amtlich und intern) (optimiert)^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<sqlvars>\ |
||||
<sqlvar name="column_layout" type="hash"><![CDATA[\ |
||||
select R.uniquename as resultset_uniquename,\ |
||||
L.uniquename,\ |
||||
L.caption,\ |
||||
L.whereclause,\ |
||||
L.is_virtual\ |
||||
from rpta_resultset R, rpta_column_layout L\ |
||||
where L.resultset_id=R.tid\ |
||||
and L.uniquename=<<Spaltenlayout>>;]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||
<#if column_layout.is_virtual==1>\ |
||||
SELECT distinct T.name,\ |
||||
1::smallint as is_virtual,\ |
||||
name as runtime_tablename\ |
||||
from sx_tables T, rpta_resultset R \ |
||||
where T.name=R.uniquename\ |
||||
and T.name='${column_layout.resultset_uniquename}'\ |
||||
<#else> \ |
||||
select L.uniquename,\ |
||||
L.is_virtual,\ |
||||
L.uniquename as runtime_tablename\ |
||||
from rpta_column_layout L where L.uniquename='${column_layout.uniquename}'\ |
||||
;\ |
||||
</#if>\ |
||||
]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="rpta_resultset" type="hash"><![CDATA[\ |
||||
select caption,\ |
||||
uniquename,\ |
||||
fieldclause,\ |
||||
joinclause,\ |
||||
whereclause,\ |
||||
systeminfo_id\ |
||||
from rpta_resultset\ |
||||
where uniquename='${basetable.runtime_tablename}';\ |
||||
\ |
||||
]]></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,\ |
||||
F.sql_code as format_sql,\ |
||||
F.uniquename as format_uniquename,\ |
||||
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_column C, rpta_column_type T,rpta_column2layout CL \ |
||||
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||
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>\ |
||||
<sqlvar name="endsemester"><![CDATA[\ |
||||
SELECT max(tid)\ |
||||
from semester \ |
||||
where 1=1\ |
||||
/* and tid >= <<Seit Semester>> */\ |
||||
/* and tid <= <<Bis Semester>> */\ |
||||
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||
and substring('' || tid from 5 for 1)='<<Semestertyp>>'\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
]]></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 semester_filter ="1=1\ |
||||
/* and sem_rueck_beur_ein >= <<Seit Semester>> */\ |
||||
/* and sem_rueck_beur_ein <= <<Bis Semester>> */\ |
||||
" />\ |
||||
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||
<#assign semester_filter = semester_filter+ " and substring('' || sem_rueck_beur_ein from 5 for 1)='<<Semestertyp>>'" />\ |
||||
</#if>\ |
||||
<#if "<<Nur Endsemester>>"="1">\ |
||||
--nur Endsemester\ |
||||
<#assign semester_filter = semester_filter+ " and 1=1 and sem_rueck_beur_ein = "+endsemester /> \ |
||||
</#if>\ |
||||
\ |
||||
<#if basetable.is_virtual==1>\ |
||||
\ |
||||
<#assign filter="<<Köpfe oder Fälle ?>>\ |
||||
/* 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>>' */\ |
||||
/* and ${<<Filter Studierende>>} */\ |
||||
" />\ |
||||
\ |
||||
<#else>\ |
||||
<#assign filter="1=1" />\ |
||||
</#if>\ |
||||
\ |
||||
<#assign filter= filter + " and " + jahr_filter />\ |
||||
\ |
||||
<#assign filter= filter + " and " + semester_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}\ |
||||
;\ |
||||
\ |
||||
\ |
||||
\ |
||||
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_rs\ |
||||
from ${basetable.runtime_tablename}\ |
||||
where 1=1\ |
||||
<#if rpta_column_layout.whereclause !="">\ |
||||
and ${rpta_column_layout.whereclause}\ |
||||
</#if>\ |
||||
<#if rpta_column_layout.is_virtual ==0>\ |
||||
and ${filter}\ |
||||
</#if>\ |
||||
\ |
||||
;\ |
||||
\ |
||||
<#else>\ |
||||
--wenn column_layout.is_virtual=0,\ |
||||
--also die Tabelle ist schon da:\ |
||||
<#assign groupby=0 />\ |
||||
\ |
||||
select <#foreach column in columns>\ |
||||
<#if column.is_aggregate==1 && column.coltype!="computedColumn">\ |
||||
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
||||
<#elseif column.coltype="computedColumn">\ |
||||
null::float as ${column.targetfieldname},\ |
||||
<#elseif column.is_visible==1>\ |
||||
<#assign groupby=groupby+1 />\ |
||||
${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_rs\ |
||||
from ${basetable.runtime_tablename}\ |
||||
where ${filter}\ |
||||
<#if groupby !=0 >\ |
||||
group by\ |
||||
<#list 1..groupby as i>${i}\ |
||||
<#if i != groupby>\ |
||||
,\ |
||||
</#if>\ |
||||
</#list>\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
</#if>\ |
||||
--ergebnistabelle:\ |
||||
select \ |
||||
--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_gesamt\ |
||||
from tmp_rs\ |
||||
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_rs\ |
||||
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_rs;\ |
||||
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^48180^ |
@ -1,39 +0,0 @@
@@ -1,39 +0,0 @@
|
||||
48220^Studiengang^39^0^0^150^200^6^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('MAN-STG-Kostenstellen-Sicht','MAN-Studiengang-Sicht') and aktiv=1 order by 3,2;^^^ |
||||
48221^Kennzahl^100^0^0^150^200^1^char^255^0^1^<<SQL>> select C.id,trim(C.name) || ' - (' || C.id || ')',P.sortnr,P.sortnr2\ |
||||
from man_reports R,man_catalogue_rpt P, man_catalogue C\ |
||||
where C.id=P.catalogue_id\ |
||||
and R.id=P.report_id\ |
||||
/* and P.report_id=<<Bericht>>*/\ |
||||
and P.active>=1\ |
||||
and R.active=1\ |
||||
--and C.timeunit='S'\ |
||||
--and C.calcratio=0\ |
||||
--and C.cacheing>0\ |
||||
order by 3,4,2^ ^ ^ |
||||
48222^Institution^2^0^0^150^200^1^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='MAN-Kostenstellen-Sicht' and aktiv=1 order by type,name;^^^ |
||||
48223^Start-Jahr^4^0^0^100^50^1^integer^30^0^1^<<SQL>> SELECT distinct tid,druck FROM man_jahr order by 1;^^<<SQL>> SELECT tid,druck FROM man_jahr where tid=(year(today())-5) ;^ |
||||
48224^Startsemester^7^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from man_semester order by tid DESC;^^^ |
||||
48225^tablestylesheet^121^0^0^100^200^1^char^200^0^13^<<SQL>> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=888881430^hidden^<<SQL>> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=888881430 and S.ord=1^ |
||||
48226^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_man_kennz_aggr'\ |
||||
and R.systeminfo_id=200)\ |
||||
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_man_kennz_aggr'\ |
||||
and R.systeminfo_id=200) and uniquename='man_kennz_aggr_tuhh_behoerdenbericht';^ |
||||
48227^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;^^^ |
||||
48228^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^0^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^hidden^<<SQL>> select 1,'Ja' from xdummy^ |
||||
48229^Ausgabeformat^2001^0^0^100^150^1^char^200^0^1^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and nature::smallint<100 order by nature::smallint^^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and description='HTML';^ |
||||
48230^Endsemester^8^0^0^140^100^1^integer^30^0^1^<<SQL>> select tid, eintrag from man_semester order by tid DESC;^^^ |
||||
48231^End-Jahr^5^0^0^100^50^1^integer^30^0^1^<<SQL>> SELECT distinct tid,druck FROM man_jahr order by 1;^^<<SQL>> SELECT tid,druck FROM man_jahr where tid=(year(today())-1) ;^ |
||||
48232^Zeitraumtyp^110^0^0^100^150^1^char^30^1^1^<<SQL>> select 'S', 'Semester' from xdummy union select 'J', 'Jahr' from xdummy^hidden^<<SQL>> select 'S', 'Semester' from xdummy^ |
||||
48233^Bericht^1^0^0^150^200^1^char^30^1^1^<<SQL>> select R.id,trim(R.name) || ' - (' || R.id || ')' from man_reports R where 0<(select count(*) from man_catalogue_rpt P, man_catalogue C\ |
||||
where C.id=P.catalogue_id\ |
||||
and C.fromclause is not null\ |
||||
and P.report_id=R.id) and R.active=1 order by 2^ ^<<SQL>> select id,name || ' - (' || id || ')' from man_reports where id='TUHH_KENNZ' and active=1;^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48220^200^ |
@ -1,14 +0,0 @@
@@ -1,14 +0,0 @@
|
||||
48220^48220^ |
||||
48220^48221^ |
||||
48220^48222^ |
||||
48220^48223^ |
||||
48220^48224^ |
||||
48220^48225^ |
||||
48220^48226^ |
||||
48220^48227^ |
||||
48220^48228^ |
||||
48220^48229^ |
||||
48220^48230^ |
||||
48220^48231^ |
||||
48220^48232^ |
||||
48220^48233^ |
@ -1,166 +0,0 @@
@@ -1,166 +0,0 @@
|
||||
48220^Management-Bericht Kennzahlen^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<sqlvars>\ |
||||
<sqlvar name="my_base_rs"><![CDATA[\ |
||||
select R.uniquename\ |
||||
from rpta_resultset R, rpta_column_layout L\ |
||||
where L.resultset_id=R.tid\ |
||||
and L.uniquename=<<Spaltenlayout>>;]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||
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,\ |
||||
L.sortclause\ |
||||
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,\ |
||||
F.sql_code as format_sql,\ |
||||
F.uniquename as format_uniquename,\ |
||||
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_column C, rpta_column_type T,rpta_column2layout CL \ |
||||
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||
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>\ |
||||
<sqlvar name="endsemester"><![CDATA[\ |
||||
SELECT max(tid)\ |
||||
from semester \ |
||||
where 1=1\ |
||||
/* and tid >= <<Startsemester>> */\ |
||||
/* and tid <= <<Endsemester>> */\ |
||||
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||
and substring('' || tid from 5 for 1)='<<Semestertyp>>'\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
]]></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 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 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="1=1\ |
||||
/* and geschlecht=<<Geschlecht>> */\ |
||||
/* and catalogue_id=<<Kennzahl>> */ \ |
||||
/* and sem >= <<Startsemester>> */\ |
||||
/* and sem <= <<Endsemester>> */\ |
||||
/* and jahr >= <<Start-Jahr>> */\ |
||||
/* and jahr <= <<End-Jahr>> */\ |
||||
" />\ |
||||
\ |
||||
\ |
||||
<#assign institutionparam="" />\ |
||||
/* <#assign institutionparam=<<Institution>> /> */\ |
||||
<#assign studiengangparam="" />\ |
||||
/* <#assign studiengangparam="<<Studiengang>>" /> */\ |
||||
\ |
||||
--Rechte prüfen:\ |
||||
--SQL Fehler () abfangen:\ |
||||
<#assign instRechteList=Institution.allNeededKeysList />\ |
||||
<#assign studiengangRechteList=Studiengang.allNeededKeysList />\ |
||||
<#if instRechteList=="()">\ |
||||
<#assign instRechteList="('-9xy!')" />\ |
||||
</#if>\ |
||||
<#if studiengangRechteList=="()">\ |
||||
<#assign studiengangRechteList="('-9xy!')" />\ |
||||
</#if>\ |
||||
--zuerst Rechte prüfen:\ |
||||
<#assign filter = filter + " and (1!=1 or ch110_institut in "+instRechteList+" or studiengang in "+studiengangRechteList+" )" />\ |
||||
--jetzt Selektion Inst/Studiengang mit höherer Priorität: \ |
||||
<#if institutionparam !="" && institutionparam !="'root'">\ |
||||
<#assign filter = filter + " and ch110_institut in "+.vars["Institution"].allNeededKeys /> \ |
||||
</#if>\ |
||||
/* <#assign filter = filter + " and studiengang in "+.vars["Studiengang"].allNeededKeys /> --<<Studiengang>>*/ \ |
||||
\ |
||||
\ |
||||
<#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>\ |
||||
\ |
||||
\ |
||||
\ |
||||
<@rpta_interpret_column_layout nonvirtualTableFilter=filter/>\ |
||||
\ |
||||
\ |
||||
\ |
||||
</#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>\ |
||||
@@@^^^Übersicht über vorberechnete Kennzahlen^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^1^600^360^0^^<<SQL>>SELECT description FROM rpta_column_layout where tid=<<Spaltenlayout>>;^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
200^48220^ |
@ -1,30 +0,0 @@
@@ -1,30 +0,0 @@
|
||||
48250^Beschäftigungsstelle (Person)^1^0^0^200^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;^^^ |
||||
48251^Datum^0^350^-1^150^80^1^date^10^1^0^^^<<SQL>> select today() from xdummy^ |
||||
48252^Vertragsart^10^380^-1^200^160^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA-Vertragsart-Sicht' and aktiv=1 order by type,name;^^^ |
||||
48253^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;^^^ |
||||
48254^Geschlecht^81^310^-1^100^70^1^integer^4^0^1^<<SQL>> SELECT apnr,druck FROM cif where key = 9003 and apnr between 1 and 4 order by 1;^^^ |
||||
48255^Personal-Nr.^50^350^-1^150^80^1^integer^10^0^0^^^^ |
||||
48256^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^^ |
||||
48257^Filter Personal^120^310^-1^100^300^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_PERS_FILTER' order by 2;^^^ |
||||
48258^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^^ |
||||
48259^Alter (bis)^21^170^-1^100^70^1^integer^5^0^0^^^^ |
||||
48260^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_pbv_aggr_pgd'\ |
||||
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_pbv_aggr_pgd'\ |
||||
and R.systeminfo_id=6)\ |
||||
order by sortnr, caption\ |
||||
limit 1 \ |
||||
;^ |
||||
48262^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^^ |
||||
48264^BVL-Gruppe^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^^ |
||||
48267^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^^ |
||||
48269^Alter (von)^20^0^0^80^70^1^integer^4^0^0^^^^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48250^6^ |
@ -1,15 +0,0 @@
@@ -1,15 +0,0 @@
|
||||
48250^48250^ |
||||
48250^48251^ |
||||
48250^48252^ |
||||
48250^48253^ |
||||
48250^48254^ |
||||
48250^48255^ |
||||
48250^48256^ |
||||
48250^48257^ |
||||
48250^48258^ |
||||
48250^48259^ |
||||
48250^48260^ |
||||
48250^48262^ |
||||
48250^48264^ |
||||
48250^48267^ |
||||
48250^48269^ |
@ -1,124 +0,0 @@
@@ -1,124 +0,0 @@
|
||||
48250^Beschäftigungsverhältnisse^--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_pbv_aggr_pgd' />\ |
||||
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,\ |
||||
L.sortclause\ |
||||
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,\ |
||||
F.sql_code as format_sql,\ |
||||
F.uniquename as format_uniquename,\ |
||||
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_column C, rpta_column_type T,rpta_column2layout CL \ |
||||
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||
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_pbv_aggr.d_besch_von <= date_val(<<Datum>>) \ |
||||
and sva_pbv_aggr.d_besch_bis >= date_val(<<Datum>>) "/>\ |
||||
\ |
||||
<#assign filter= filter + "\ |
||||
and sva_pbv_aggr.ch110_besch_st in "+.vars["Beschäftigungsstelle (Person)"].allNeededKeysList + "\ |
||||
/* and kapitel = <<Kapitel>> */\ |
||||
/* and titel = <<Titel>> */\ |
||||
/* and d_befristung <= date_val(<<Befristet bis>>)*/\ |
||||
/* and teilzeitart in (<<Teilzeitart>>) */\ |
||||
/* and ca501_staat <<Staatsangehörigkeit>> */\ |
||||
/* and geschlecht= <<Geschlecht>> */\ |
||||
/* and ${<<Filter Personal>>} */\ |
||||
" />\ |
||||
\ |
||||
/* <#assign filter = filter + " and sva_pbv_aggr.kostenstelle in "+.vars["Kostenstelle (Person)"].allNeededKeysList /> -- <<Kostenstelle (Person)>> */\ |
||||
/* <#assign filter = filter + " and sva_pbv_aggr.ca107_dienstart in "+.vars["Dienstart"].allNeededKeysList /> -- <<Dienstart>> */\ |
||||
/* <#assign filter = filter + " and sva_pbv_aggr.ca108_amtsbez in "+.vars["Amtsbezeichnung"].allNeededKeysList /> -- <<Amtsbezeichnung>> */\ |
||||
/* <#assign filter = filter + " and sva_pbv_aggr.ch212_geldgeber in "+.vars["Geldgeber"].allNeededKeysList /> -- <<Geldgeber>> */\ |
||||
/* <#assign filter = filter + " and sva_pbv_aggr.vertart in "+.vars["Vertragsart"].allNeededKeysList /> -- <<Vertragsart>> */\ |
||||
\ |
||||
\ |
||||
\ |
||||
\ |
||||
\ |
||||
<#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>\ |
||||
\ |
||||
\ |
||||
<@rpta_interpret_column_layout nonvirtualTableFilter=filter />\ |
||||
\ |
||||
</#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^ ^^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^48250^ |
@ -1,33 +0,0 @@
@@ -1,33 +0,0 @@
|
||||
48280^Studiengang^39^0^0^150^200^6^char^30^0^999^<<SQL>> select tid,name,sortnr from sichten where art in ('MAN-STG-Kostenstellen-Sicht','MAN-Studiengang-Sicht') and aktiv=1 order by 3,2;^ ^ ^ |
||||
48281^Kennzahl^100^0^0^150^200^2^char^255^0^1^<<SQL>> select C.id,trim(C.name) || ' - (' || C.id || ')'\ |
||||
from kenn_katalog C\ |
||||
where \ |
||||
C.id in (select distinct kenn_zahl from sxc_zahl_wert where sxc_bestand_id=<<Bestand>>)\ |
||||
order by id^ ^ ^ |
||||
48282^Institution^2^0^0^150^200^1^char^30^0^999^<<SQL>>select tid,type,name from sichten where art ='MAN-Kostenstellen-Sicht' and aktiv=1 order by type,name;^ ^ ^ |
||||
48283^Start-Jahr^4^0^0^100^50^1^integer^30^0^1^<<SQL>> SELECT distinct ord,name FROM aggregierung where kategorie='KENN-Jahr' order by 1;^ ^<<SQL>> SELECT ord,name FROM aggregierung where kategorie='KENN-Jahr' and ord=(year(today())-1) ;^ |
||||
48284^Startsemester^7^0^0^140^80^1^integer^30^0^999^<<SQL>> select tid, eintrag from man_semester order by tid DESC;^ ^ ^ |
||||
48285^tablestylesheet^121^0^0^100^200^1^char^200^0^13^<<SQL>> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=888881430^hidden^<<SQL>> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=888881430 and S.ord=1^ |
||||
48286^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_sxc_zahl_wert'\ |
||||
and R.systeminfo_id=200)\ |
||||
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_sxc_zahl_wert'\ |
||||
and R.systeminfo_id=200) and uniquename='sxc_zahl_wert_stammdaten_nrw';^ |
||||
48287^Spalten^3001^0^0^150^190^10^char^30^0^999^<<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>>) \ |
||||
and L.is_visible=1\ |
||||
order by 2;^ ^ ^ |
||||
48288^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^0^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^hidden^<<SQL>> select 1,'Ja' from xdummy^ |
||||
48289^Ausgabeformat^4001^0^0^100^150^1^char^200^0^1^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and nature::smallint<100 order by nature::smallint^ ^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and description='HTML';^ |
||||
48290^Endsemester^8^0^0^140^100^1^integer^30^0^999^<<SQL>> select tid, eintrag from man_semester order by tid DESC;^ ^ ^ |
||||
48291^End-Jahr^5^0^0^100^50^1^integer^30^0^1^<<SQL>> SELECT distinct ord,name FROM aggregierung where kategorie='KENN-Jahr' order by 1;^ ^<<SQL>> SELECT ord,name FROM aggregierung where kategorie='KENN-Jahr' and ord=(year(today())-1) ;^ |
||||
48292^Zeitraumtyp^110^0^0^100^150^1^char^30^1^1^<<SQL>> select 'S', 'Semester' from xdummy union select 'J', 'Jahr' from xdummy^hidden^<<SQL>> select 'S', 'Semester' from xdummy^ |
||||
48293^Bestand^1^0^0^150^200^1^char^30^1^1^<<SQL>> select tid,name from sxc_bestand;^ ^<<SQL>> select tid,name from sxc_bestand order by tid;^ |
||||
48294^Hochschule^1^0^0^150^200^5^char^30^0^12^<<SQL>> select tid, type, name,sortnr from sichten where art in('SXC_Hochschulen-Sicht') and aktiv=1 order by sortnr desc, name;^ ^ ^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48280^200^ |
@ -1,15 +0,0 @@
@@ -1,15 +0,0 @@
|
||||
48280^48280^ |
||||
48280^48281^ |
||||
48280^48282^ |
||||
48280^48283^ |
||||
48280^48284^ |
||||
48280^48285^ |
||||
48280^48286^ |
||||
48280^48287^ |
||||
48280^48288^ |
||||
48280^48289^ |
||||
48280^48290^ |
||||
48280^48291^ |
||||
48280^48292^ |
||||
48280^48293^ |
||||
48280^48294^ |
@ -1,141 +0,0 @@
@@ -1,141 +0,0 @@
|
||||
48280^SuperX-Connect Kennzahlen^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<sqlvars>\ |
||||
<sqlvar name="my_base_rs"><![CDATA[\ |
||||
select R.uniquename\ |
||||
from rpta_resultset R, rpta_column_layout L\ |
||||
where L.resultset_id=R.tid\ |
||||
and L.uniquename=<<Spaltenlayout>>;]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||
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,\ |
||||
L.sortclause\ |
||||
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,\ |
||||
F.sql_code as format_sql,\ |
||||
F.uniquename as format_uniquename,\ |
||||
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_column C, rpta_column_type T,rpta_column2layout CL \ |
||||
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||
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>\ |
||||
<sqlvar name="endsemester"><![CDATA[\ |
||||
SELECT max(tid)\ |
||||
from semester \ |
||||
where 1=1\ |
||||
/* and tid >= <<Startsemester>> */\ |
||||
/* and tid <= <<Endsemester>> */\ |
||||
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||
and substring('' || tid from 5 for 1)='<<Semestertyp>>'\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
]]></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 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 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="1=1\ |
||||
/* and hs_nr in (<<Hochschule>>) */\ |
||||
/* and geschlecht=<<Geschlecht>> */\ |
||||
/* and kenn_katalog.id in (<<Kennzahl>>) */ \ |
||||
/* and jahr >= <<Start-Jahr>> */\ |
||||
/* and jahr <= <<End-Jahr>> */\ |
||||
" />\ |
||||
\ |
||||
\ |
||||
\ |
||||
<#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>\ |
||||
\ |
||||
\ |
||||
\ |
||||
<@rpta_interpret_column_layout nonvirtualTableFilter=filter/>\ |
||||
\ |
||||
\ |
||||
</#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>\ |
||||
@@@^ ^ ^Übersicht über vorberechnete Kennzahlen^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^1^600^360^^0^<<SQL>>SELECT description FROM rpta_column_layout where tid=<<Spaltenlayout>>;^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
360^48280^ |
@ -1,30 +0,0 @@
@@ -1,30 +0,0 @@
|
||||
48310^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 in ('rpta_erfolg_ba_ma_uebergang'))\ |
||||
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_erfolg_ba_ma_uebergang') and uniquename='ba_ma_uebergang_nach_abschluss';^ |
||||
48311^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;^ |
||||
48312^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;^ ^ ^ |
||||
48313^Abschluss^40^0^0^100^200^3^char^1500^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Abschluss-Sicht' order by 3,2;^ ^ ^ |
||||
48314^bis Fachsemester^1000^300^-1^200^100^1^integer^30^0^0^^ ^ ^ |
||||
48315^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^ ^ ^ |
||||
48316^Hochschulzugangsberechtigung^120^300^-1^200^200^1^sql^30^0^1^hs_zugangsber^ ^ ^ |
||||
48317^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;^ |
||||
48318^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;^ ^ ^ |
||||
48319^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;^ ^ ^ |
||||
48320^Semester^100^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^hidden^ ^ |
||||
48321^Richtung^38^0^0^150^190^1^char^30^0^1^<<SQL>>select 'gw','Grundständig zu weiterf.' from xdummy union select 'wg','Weiterf. zu Grundständig' from xdummy order by 1;^ ^ ^ |
||||
48322^Hörerstatus^200^330^-1^140^150^1^sql^30^0^1^<<SQL>> select apnr, eintrag from hoererstatus where apnr like 'hrst%' order by 2^ ^ ^ |
||||
48323^Jahr^110^0^0^140^80^1^integer^30^0^13^ ^ ^ ^ |
||||
48324^Filter Studierende^100^0^0^140^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='SOS_STUD_FILTER' order by 2;^^^ |
||||
48325^Nur Endsemester^21^0^0^140^80^1^integer^30^0^1^<<SQL>> select 1,'ja' from xdummy^Eintrag^ ^ |
||||
48326^Matrikel-Nr.^35^350^-1^140^80^1^char^30^0^13^^^^ |
||||
48328^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';^ |
||||
48332^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;^ ^ ^ |
||||
48333^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 @@
|
||||
48310^7^ |
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
48310^48310^ |
||||
48310^48311^ |
||||
48310^48312^ |
||||
48310^48313^ |
||||
48310^48314^ |
||||
48310^48315^ |
||||
48310^48316^ |
||||
48310^48317^ |
||||
48310^48318^ |
||||
48310^48319^ |
||||
48310^48320^ |
||||
48310^48321^ |
||||
48310^48322^ |
||||
48310^48323^ |
||||
48310^48324^ |
||||
48310^48325^ |
||||
48310^48326^ |
||||
48310^48328^ |
||||
48310^48332^ |
||||
48310^48333^ |
@ -1,202 +0,0 @@
@@ -1,202 +0,0 @@
|
||||
48310^Übergang Bachelor-Master bzw. vorheriger Abschluss bei Master-Studienbeginn^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<sqlvars>\ |
||||
<sqlvar name="my_base_rs"><![CDATA[\ |
||||
select R.uniquename\ |
||||
from rpta_resultset R, rpta_column_layout L\ |
||||
where L.resultset_id=R.tid\ |
||||
and L.uniquename=<<Spaltenlayout>>;]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||
SELECT distinct T.name,\ |
||||
R.is_virtual,\ |
||||
name as runtime_tablename\ |
||||
from sx_tables T, rpta_resultset R \ |
||||
where T.name=R.uniquename\ |
||||
and T.name='${my_base_rs}'\ |
||||
and R.is_virtual=0\ |
||||
\ |
||||
union\ |
||||
select R.uniquename,\ |
||||
R.is_virtual,\ |
||||
'tmp_' || R.uniquename as runtime_tablename\ |
||||
from rpta_resultset R where R.uniquename='${my_base_rs}'\ |
||||
and R.is_virtual=1\ |
||||
;\ |
||||
]]>\ |
||||
</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,\ |
||||
R.is_virtual,\ |
||||
L.sortclause\ |
||||
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,\ |
||||
F.sql_code as format_sql,\ |
||||
F.uniquename as format_uniquename,\ |
||||
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_column C, rpta_column_type T,rpta_column2layout CL \ |
||||
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||
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>\ |
||||
<sqlvar name="endsemester"><![CDATA[\ |
||||
SELECT max(tid)\ |
||||
from semester \ |
||||
where 1=1\ |
||||
/* and tid >= <<Seit Semester>> */\ |
||||
/* and tid <= <<Bis Semester>> */\ |
||||
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||
and substring('' || tid from 5 for 1)='<<Semestertyp>>'\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
]]></sqlvar>\ |
||||
<sqlvar name="SOS_MTKNR_EXT">\ |
||||
select 1 from xdummy where 0 != (select \ |
||||
count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\ |
||||
and apnr=1)\ |
||||
union select 0 from xdummy where 0 = (select \ |
||||
count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\ |
||||
and apnr=1)\ |
||||
;\ |
||||
</sqlvar>\ |
||||
\ |
||||
</sqlvars>\ |
||||
\ |
||||
<#assign richtung="" />\ |
||||
/* <#assign richtung=<<Richtung>> />*/\ |
||||
<#if richtung="" && rpta_column_layout.whereclause?index_of("gw") != -1>\ |
||||
<#assign richtung="gw" />\ |
||||
<#elseif richtung="" && rpta_column_layout.whereclause?index_of("wg") != -1>\ |
||||
<#assign richtung="wg" />\ |
||||
<#else>\ |
||||
<#assign richtung="gw" />\ |
||||
</#if>\ |
||||
\ |
||||
\ |
||||
<#assign mtknr_filter=basetable.name+".matrikel_nr::varchar(255)" />\ |
||||
<#if SOS_MTKNR_EXT=1>\ |
||||
<#assign mtknr_filter=basetable.name+".pseudonym" />\ |
||||
</#if>\ |
||||
<#if richtung="gw" >\ |
||||
<#assign tid_stg_col="abschluss_vorher_tid_stg" />\ |
||||
<#assign stg_col="abschluss_vorher_stg" />\ |
||||
<#assign abschluss_col="abschluss_vorher_abschluss" />\ |
||||
<#assign semester_col="abschluss_vorher_semester" />\ |
||||
</#if>\ |
||||
<#if richtung="wg" >\ |
||||
<#assign tid_stg_col="einschr_nachher_tid_stg" />\ |
||||
<#assign stg_col="einschr_nachher_stg" />\ |
||||
<#assign abschluss_col="einschr_nachher_abschluss" />\ |
||||
<#assign semester_col="einschr_nachher_semester" />\ |
||||
</#if>\ |
||||
<#assign filter="1=1" />\ |
||||
/* <#assign filter=filter+" and richtung='"+richtung+"'" /> --<<Richtung>> */\ |
||||
\ |
||||
<#assign studiengang_filter = "" />\ |
||||
/* <#assign studiengang_filter = Studiengang.allNeededKeysList /> --<<Studiengang>> */ \ |
||||
<#if studiengang_filter != "" >\ |
||||
<#assign filter=filter + " and ('s_' || erfolg_ba_ma_uebergang."+tid_stg_col+"_1 in "+ studiengang_filter/> \ |
||||
<#list 2..5 as fachnr>\ |
||||
<#assign filter=filter + " or 's_' || erfolg_ba_ma_uebergang."+tid_stg_col+"_"+fachnr+" in "+ studiengang_filter /> \ |
||||
</#list>\ |
||||
<#assign filter=filter + ")" />\ |
||||
</#if>\ |
||||
\ |
||||
<#assign fach_filter = "" />\ |
||||
/* <#assign fach_filter = Fächer.allNeededKeysList /> --<<Fächer>> */ \ |
||||
<#if fach_filter != "" >\ |
||||
<#assign filter=filter + " and (erfolg_ba_ma_uebergang."+stg_col+"_1 in "+ fach_filter/> \ |
||||
<#list 2..5 as fachnr>\ |
||||
<#assign filter=filter + " or erfolg_ba_ma_uebergang."+stg_col+"_"+fachnr+" in "+ fach_filter /> \ |
||||
</#list>\ |
||||
<#assign filter=filter + ")" />\ |
||||
</#if>\ |
||||
\ |
||||
/* \ |
||||
<#assign filter = filter + " and " +abschluss_col+" in "+Studienabschluss.allNeededKeysList /> --<<Studienabschluss>> */\ |
||||
\ |
||||
\ |
||||
/* <#assign filter=filter+" and "+ semester_col+" >=" + "<<Seit Semester>>" /> */\ |
||||
/* <#assign filter=filter+" and "+ semester_col+" <=" + "<<Bis Semester>>" /> */\ |
||||
\ |
||||
<#assign filter=filter+" \ |
||||
/* and geschlecht = <<Geschlecht>> */\ |
||||
/* and einschr_nachher_<<Hörerstatus>>*/\ |
||||
/* and <<Matrikel-Nr.>>=${mtknr_filter} */\ |
||||
" />\ |
||||
\ |
||||
\ |
||||
/* \ |
||||
<#assign filter = filter + " and '' || "+basetable.name+".ca12_staat in "+Staatsangehörigkeit.allNeededKeysList /> --<<Staatsangehörigkeit>> */\ |
||||
\ |
||||
<#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>\ |
||||
\ |
||||
\ |
||||
<@rpta_interpret_column_layout nonvirtualTableFilter=filter />\ |
||||
\ |
||||
</#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>\ |
||||
<#if 1=0>\ |
||||
Column CID=0 heading_text="sortnr" center_heading explanation=""\ |
||||
row_selectable heading_platform readonly\ |
||||
width=5 text_size=60\ |
||||
</#if>\ |
||||
@@@^Studienfach^Anzahl bzw. Anteil^Übergang nach Abschluss zu einem neuen Studiengang oder vorheriger Abschluss bei Studienbeginn^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^48310^ |
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
48380^Basistabelle^0^0^0^150^450^1^integer^30^0^1^<<SQL>> select tid, uniquename || ' - ' || caption from rpta_resultset order by caption;^ ^ ^ |
||||
48381^zu löschendes Spaltenlayout^0^0^0^200^380^1^integer^30^1^1^<<SQL>> select tid, uniquename || ' - ' || caption from rpta_column_layout where 1=1 /* and <<Basistabelle>>=resultset_id*/ order by caption;^^^ |
||||
48382^gew. Layout löschen?^1^0^0^200^100^1^char^30^1^1^<<SQL>> select 'J', 'ja, Layout löschen' from xdummy union select 'N', 'nein, nicht löschen' from xdummy order by 2;^^^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48380^9^ |
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
48380^48380^ |
||||
48380^48381^ |
||||
48380^48382^ |
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
48380^Spaltenlayout löschen^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--Layout löschen\ |
||||
-- Ist nur für User erlaubt, die Administratoren sind\ |
||||
--Autor: M. Winterstein nach Maske löschen von D. Quathamer\ |
||||
--Datum: 18.08.2025\ |
||||
\ |
||||
--create temp table tmp_loesch (layout_tid integer, layout_uniquename varchar(255), best_tid integer);\ |
||||
--insert into tmp_loesch(layout_tid, layout_uniquename) \ |
||||
--values (<<zu löschendes Spaltenlayout>>, <<Spaltenlayout (bestätigen)>>);\ |
||||
--update tmp_loesch set best_tid=0 where best_tid is null;\ |
||||
\ |
||||
<#if <<gew. Layout löschen?>> ='J'>\ |
||||
delete from rpta_column2layout where layout_id in (<<zu löschendes Spaltenlayout>>)\ |
||||
and 1=(select administration from userinfo where tid=<<UserID>>);\ |
||||
delete from rpta_column_layout where tid=<<zu löschendes Spaltenlayout>> \ |
||||
and 1=(select administration from userinfo where tid=<<UserID>>);\ |
||||
select sp_update_sequence('rpta_column_layout');\ |
||||
select sp_update_sequence('rpta_column2layout');\ |
||||
</#if>\ |
||||
\ |
||||
--drop table tmp_ergebnis;\ |
||||
create temp table tmp_ergebnis \ |
||||
(sp1 varchar(50),\ |
||||
sp2 varchar(200)\ |
||||
); \ |
||||
insert into tmp_ergebnis \ |
||||
select 'Ergebnis', 'Spaltenlayout erfolgreich gelöscht' from xdummy where 0= (select count(*) from rpta_column_layout where tid=<<zu löschendes Spaltenlayout>> );\ |
||||
insert into tmp_ergebnis \ |
||||
select 'Ergebnis', 'Kein Löschen ausgewählt! Spaltenlayout wurde nicht gelöscht' from xdummy where <<gew. Layout löschen?>> != 'J';\ |
||||
insert into tmp_ergebnis \ |
||||
select 'Ergebnis', 'Benutzerrechte reichen nicht aus. Spaltenlayout wurde nicht gelöscht' from xdummy where (select administration from userinfo where tid=<<UserID>>)!= 1;\ |
||||
\ |
||||
--drop table tmp_loesch;\ |
||||
select sp1,sp2 from tmp_ergebnis;^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="Ergebnis " center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=50 text_size=100\ |
||||
Column CID=1 heading_text=" Wert " center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=150 text_size=200\ |
||||
@@@^ ^ ^Eine vorhandene Maske löschen^drop table tmp_ergebnis;^^2^440^360^0^1^ ^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
8^48380^ |
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
48410^Basistabelle^0^0^0^150^450^1^integer^30^0^1^<<SQL>> select tid, uniquename || ' - ' || caption from rpta_resultset order by caption;^ ^ ^ |
||||
48411^Neuer Name^2^0^0^150^250^1^char^100^1^0^^ ^ ^ |
||||
48412^Neuer Schlüssel^1^0^0^150^200^1^char^30^1^0^^ ^ ^ |
||||
48413^Erläuterung^12^0^0^150^400^1^char^240^0^0^^ ^ ^ |
||||
48414^Art der Kopie^1065^0^0^100^150^1^char^30^1^1^<<SQL>> select 'makro','Makrobericht' from xdummy \ |
||||
union select 'sximport','SX-Importkopie' from xdummy\ |
||||
union select 'standard','Standardkopie' from xdummy\ |
||||
;^hidden^<<SQL>> select 'standard','Standardkopie' from xdummy;^ |
||||
48415^Achtung:^100^0^0^400^450^1^char^100^0^8^<<SQL>> select 'Vorhandene Spaltenlayouts mit gleichem Schlüssel werden überschrieben!' from xdummy;^ ^<<SQL>> select 'Vorhandene Spaltenlayouts mit gleichem Schlüssel werden überschrieben!' from xdummy;^ |
||||
48416^zu kopierendes Spaltenlayout^1^0^0^150^450^1^integer^30^1^1^<<SQL>> select tid, uniquename || ' - ' || caption from rpta_column_layout where 1=1 /* and <<Basistabelle>>=resultset_id*/ order by caption;^ ^ ^ |
||||
48417^vorh. Layout überschreiben?^80^0^0^100^150^1^char^30^1^1^<<SQL>> select 'J', 'ja, vorh. Layout überschreiben' from xdummy union select 'N', 'nein, nicht überschreiben' from xdummy order by 2;^ ^<<SQL>> select 'N', 'nein, nicht überschreiben' from xdummy order by 2;^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48410^9^ |
@ -1,8 +0,0 @@
@@ -1,8 +0,0 @@
|
||||
48410^48410^ |
||||
48410^48411^ |
||||
48410^48412^ |
||||
48410^48413^ |
||||
48410^48414^ |
||||
48410^48415^ |
||||
48410^48416^ |
||||
48410^48417^ |
@ -1,133 +0,0 @@
@@ -1,133 +0,0 @@
|
||||
48410^Spaltenlayout kopieren^--freemarker template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
<sqlvars>\ |
||||
<sqlvar name="start_serial">\ |
||||
select max(tid)+1 from rpta_column2layout;\ |
||||
</sqlvar>\ |
||||
<sqlvar name="layout_exists">\ |
||||
select count(*) from rpta_column_layout where uniquename=<<Neuer Schlüssel>>;\ |
||||
</sqlvar>\ |
||||
</sqlvars>\ |
||||
--Autor: D. Quathamer\ |
||||
--Datum: 2.4.2002\ |
||||
\ |
||||
<#assign zeichen1="<"> \ |
||||
<#assign zeichen2=">"> \ |
||||
<#assign zeichen3="/"> \ |
||||
<#if SQLdialect='Postgres'>\ |
||||
begin work;\ |
||||
</#if>\ |
||||
\ |
||||
create temp table tmp_rpta_column_layout \ |
||||
(\ |
||||
tid integer NOT NULL, --vorher serial\ |
||||
uniquename varchar(255) NOT NULL,\ |
||||
caption varchar(255),\ |
||||
resultset_id integer,\ |
||||
whereclause text,\ |
||||
description text,\ |
||||
userinfo_id integer,\ |
||||
sortnr integer,\ |
||||
sortclause text,\ |
||||
is_virtual smallint DEFAULT 1 NOT NULL\ |
||||
);\ |
||||
\ |
||||
create temp table tmp_rpta_column2layout \ |
||||
(\ |
||||
tid serial NOT NULL, \ |
||||
column_id integer,\ |
||||
layout_id integer,\ |
||||
sortnr smallint,\ |
||||
is_visible smallint DEFAULT 1,\ |
||||
visible_size smallint,\ |
||||
format_code_id integer,\ |
||||
targetfieldname varchar(255),\ |
||||
caption varchar(255),\ |
||||
description text\ |
||||
);\ |
||||
ALTER SEQUENCE tmp_rpta_column2layout_tid_seq RESTART with ${start_serial};\ |
||||
insert into tmp_rpta_column_layout select * from rpta_column_layout where tid=<<zu kopierendes Spaltenlayout>>;\ |
||||
\ |
||||
insert into tmp_rpta_column2layout \ |
||||
(\ |
||||
column_id,\ |
||||
layout_id,\ |
||||
sortnr,\ |
||||
is_visible,\ |
||||
visible_size,\ |
||||
format_code_id,\ |
||||
targetfieldname,\ |
||||
caption,\ |
||||
description\ |
||||
)\ |
||||
select \ |
||||
column_id,\ |
||||
layout_id,\ |
||||
sortnr,\ |
||||
is_visible,\ |
||||
visible_size,\ |
||||
format_code_id,\ |
||||
targetfieldname,\ |
||||
caption,\ |
||||
description\ |
||||
from rpta_column2layout where layout_id=<<zu kopierendes Spaltenlayout>>;\ |
||||
\ |
||||
update tmp_rpta_column_layout set uniquename=<<Neuer Schlüssel>>;\ |
||||
update tmp_rpta_column_layout set caption=<<Neuer Name>>; \ |
||||
update tmp_rpta_column_layout set userinfo_id=<<UserID>>;\ |
||||
/*update tmp_rpta_column_layout set description=<<Erläuterung>>;*/\ |
||||
\ |
||||
<#if <<vorh. Layout überschreiben?>> ='J' || layout_exists=0 >\ |
||||
--Falls das neue Layout bereits existiert, wird es gelöscht:\ |
||||
delete from rpta_column2layout where layout_id = (select tid from rpta_column_layout where uniquename=<<Neuer Schlüssel>>)\ |
||||
and (select administration from userinfo where tid=<<UserID>>)= 1;\ |
||||
delete from rpta_column_layout where uniquename=<<Neuer Schlüssel>>\ |
||||
and (select administration from userinfo where tid=<<UserID>>)= 1;\ |
||||
\ |
||||
update tmp_rpta_column_layout set tid = (select (max(tid)+1) from rpta_column_layout);\ |
||||
update tmp_rpta_column2layout set layout_id = (select tid from tmp_rpta_column_layout);\ |
||||
\ |
||||
\ |
||||
insert into rpta_column_layout select * from tmp_rpta_column_layout \ |
||||
where (select administration from userinfo where tid=<<UserID>>)= 1;\ |
||||
insert into rpta_column2layout select * from tmp_rpta_column2layout \ |
||||
where (select administration from userinfo where tid=<<UserID>>)= 1;\ |
||||
select sp_update_sequence('rpta_column_layout');\ |
||||
select sp_update_sequence('rpta_column2layout');\ |
||||
\ |
||||
\ |
||||
<#if SQLdialect='Postgres'>\ |
||||
commit;\ |
||||
</#if>\ |
||||
</#if>\ |
||||
\ |
||||
create temp table tmp_ergebnis \ |
||||
(sp1 varchar(150),\ |
||||
sp2 varchar(150), sp3 varchar(150)); \ |
||||
\ |
||||
insert into tmp_ergebnis (sp1,sp2)\ |
||||
select 'Ergebnis', 'Benutzerrechte reichen nicht aus. Spaltenlayout wurde nicht kopiert' from xdummy where (select administration from userinfo where tid=<<UserID>>)!= 1;\ |
||||
<#if <<vorh. Layout überschreiben?>> ='J' || layout_exists=0 >\ |
||||
insert into tmp_ergebnis (sp1,sp2,sp3)\ |
||||
select 'Neues Spaltenlayout:',uniquename || '- ' || caption,'../edit/rpta/rpta_column_layout_edit.jsp|tid=' || tid from rpta_column_layout where tid = (select tid from tmp_rpta_column_layout);\ |
||||
<#else>\ |
||||
insert into tmp_ergebnis (sp1,sp2)\ |
||||
select 'Ergebnis', 'kein Überschreiben gewünscht!' from xdummy ;\ |
||||
</#if>\ |
||||
\ |
||||
\ |
||||
select sp1,sp2,sp3 as nextedit from tmp_ergebnis ;^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="Ergebnis " center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=50 text_size=100\ |
||||
Column CID=1 heading_text=" Wert " center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=50 text_size=100\ |
||||
Column CID=2 heading_text=" Bearbeiten" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=50 text_size=100\ |
||||
@@@^ ^ ^Eine neue Maske kopieren^drop table tmp_ergebnis;drop table tmp_rpta_column_layout;drop table tmp_rpta_column2layout;^^2^440^360^^1^^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
8^48410^ |
@ -1,41 +0,0 @@
@@ -1,41 +0,0 @@
|
||||
48430^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 in ('rpta_zul_antr_aggr','rpta_zul_antr_aggr_archiv')\ |
||||
and R.systeminfo_id=130)\ |
||||
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_zul_antr_aggr_archiv'\ |
||||
and R.systeminfo_id=130);^ |
||||
48431^Seit Semester^10^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select case when tid % 10 = 1 then tid+1 else tid+9 end,\ |
||||
(select eintrag from semester where tid in \ |
||||
(select case when tid % 10 = 1 then tid+1 else tid+9 end from semester where today() between sem_beginn and sem_ende)) \ |
||||
from semester \ |
||||
where today() between sem_beginn and sem_ende;^ |
||||
48432^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;^ ^ ^ |
||||
48433^Abschluss^40^0^0^100^200^3^char^1500^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Abschluss-Sicht' order by 3,2;^ ^ ^ |
||||
48434^bis Fachsemester^1000^300^-1^200^100^1^integer^30^0^999^^ ^ ^ |
||||
48435^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^ ^ ^ |
||||
48436^Hochschulzugangsberechtigung^120^300^-1^200^200^1^sql^30^0^999^hs_zugangsber^ ^ ^ |
||||
48437^Bis Semester^20^350^-1^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select case when tid % 10 = 1 then tid+1 else tid+9 end,\ |
||||
(select eintrag from semester where tid in \ |
||||
(select case when tid % 10 = 1 then tid+1 else tid+9 end from semester where today() between sem_beginn and sem_ende)) \ |
||||
from semester \ |
||||
where today() between sem_beginn and sem_ende;^ |
||||
48438^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;^ ^ ^ |
||||
48439^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;^ ^ ^ |
||||
48440^Semester^100^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^hidden^ ^ |
||||
48441^Stichtag^23^330^-1^130^100^1^sql^30^1^999^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende';^ ^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende' and appl_key='0';^ |
||||
48442^Hörerstatus^200^330^-1^140^150^1^sql^30^0^999^<<SQL>> select apnr, eintrag from hoererstatus order by 2^ ^<<SQL>> select apnr, eintrag from hoererstatus where eintrag='alle';^ |
||||
48443^Jahr^110^0^0^140^80^1^integer^30^0^13^^ ^ ^ |
||||
48444^Filter Studierende^100^0^0^140^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='SOS_STUD_FILTER' order by 2;^ ^ ^ |
||||
48445^Nur Endsemester^21^0^0^140^80^1^integer^30^0^999^<<SQL>> select 1,'ja' from xdummy^Eintrag^ ^ |
||||
48446^Matrikel-Nr.^35^350^-1^140^80^1^char^30^0^13^^ ^ ^ |
||||
48448^Köpfe oder Fälle ?^0^0^0^140^150^1^sql^70^0^999^<<SQL>> select apnr, eintrag from koepfe_oder_faelle order by 2^ ^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag = 'Fälle';^ |
||||
48452^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;^ ^ ^ |
||||
48453^Spalten^3001^0^0^150^190^10^char^30^0^999^<<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;^ ^ ^ |
||||
48454^Bewerbungen^1^0^0^150^200^1^sql^30^0^1^<<SQL>> select '=1 and antrnr=1','Antragsfächer (je 1. Fach des 1. Antrages)' from xdummy union select '=1','Anträge (je 1. Fach)' from xdummy union select '= fachnr and antrnr=1','Antragsfächer (des 1. Antrages)' from xdummy union select '=fachnr','Antragsfächer (alle)' from xdummy order by 2;^^<<SQL>> select '=1 and antrnr=1','Antragsfächer (je 1. Fach des 1. Antrages)' from xdummy;^ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
48430^7^ |
@ -1,21 +0,0 @@
@@ -1,21 +0,0 @@
|
||||
48430^48430^ |
||||
48430^48431^ |
||||
48430^48432^ |
||||
48430^48433^ |
||||
48430^48434^ |
||||
48430^48435^ |
||||
48430^48436^ |
||||
48430^48437^ |
||||
48430^48438^ |
||||
48430^48439^ |
||||
48430^48440^ |
||||
48430^48441^ |
||||
48430^48442^ |
||||
48430^48443^ |
||||
48430^48444^ |
||||
48430^48445^ |
||||
48430^48446^ |
||||
48430^48448^ |
||||
48430^48452^ |
||||
48430^48453^ |
||||
48430^48454^ |
@ -1,157 +0,0 @@
@@ -1,157 +0,0 @@
|
||||
48430^Bewerbungen und Zulassungen^--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
--\ |
||||
--Autor D. Quathamer 2024\ |
||||
<sqlvars>\ |
||||
<sqlvar name="my_base_rs"><![CDATA[\ |
||||
select R.uniquename\ |
||||
from rpta_resultset R, rpta_column_layout L\ |
||||
where L.resultset_id=R.tid\ |
||||
and L.uniquename=<<Spaltenlayout>>;]]>\ |
||||
</sqlvar>\ |
||||
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||
SELECT distinct T.name,\ |
||||
R.is_virtual,\ |
||||
name as runtime_tablename\ |
||||
from sx_tables T, rpta_resultset R \ |
||||
where T.name=R.uniquename\ |
||||
and T.name='${my_base_rs}'\ |
||||
and R.is_virtual=0\ |
||||
\ |
||||
union\ |
||||
select R.uniquename,\ |
||||
R.is_virtual,\ |
||||
'tmp_' || R.uniquename as runtime_tablename\ |
||||
from rpta_resultset R where R.uniquename='${my_base_rs}'\ |
||||
and R.is_virtual=1\ |
||||
;\ |
||||
]]>\ |
||||
</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,\ |
||||
R.is_virtual,\ |
||||
L.sortclause\ |
||||
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,\ |
||||
F.sql_code as format_sql,\ |
||||
F.uniquename as format_uniquename,\ |
||||
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_column C, rpta_column_type T,rpta_column2layout CL \ |
||||
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||
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>\ |
||||
<sqlvar name="endsemester"><![CDATA[\ |
||||
SELECT max(tid)\ |
||||
from semester \ |
||||
where 1=1\ |
||||
/* and tid >= <<Seit Semester>> */\ |
||||
/* and tid <= <<Bis Semester>> */\ |
||||
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||
and substring('' || tid from 5 for 1)='<<Semestertyp>>'\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
]]></sqlvar>\ |
||||
</sqlvars>\ |
||||
\ |
||||
<#assign semester_filter ="1=1\ |
||||
/* and bewsem >= <<Seit Semester>> */\ |
||||
/* and bewsem <= <<Bis Semester>> */\ |
||||
" />\ |
||||
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||
<#assign semester_filter = semester_filter+ " and substring('' || bewsem from 5 for 1)='<<Semestertyp>>'" />\ |
||||
</#if>\ |
||||
<#if "<<Nur Endsemester>>"="1">\ |
||||
--nur Endsemester\ |
||||
<#assign semester_filter = semester_filter+ " and 1=1 and bewsem = "+endsemester /> \ |
||||
</#if>\ |
||||
\ |
||||
<#assign filter="1=1\ |
||||
/* and bewsem = <<Semester>> */\ |
||||
--/* and stichtag = <<Stichtag>> */\ |
||||
--/* and <<Hochschulzugangsberechtigung>> */\ |
||||
--/* and <<Hörerstatus>>*/\ |
||||
/* and geschlecht = <<Geschlecht>> */\ |
||||
/* and substring('' || bewsem from 5 for 1)='<<Semestertyp>>' */\ |
||||
/* and ${<<Filter Studierende>>} */\ |
||||
/* and fachnr <<Bewerbungen>> */\ |
||||
" />\ |
||||
\ |
||||
<#assign filter= filter + " and " + semester_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>> */\ |
||||
/* <#assign filter = filter + " and tid_stg in (select L2.tid from lehr_stg_ab L2 where L2.abschluss in "+Abschluss.allNeededKeysList +")" /> --<<Abschluss>> */\ |
||||
\ |
||||
\ |
||||
<#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>\ |
||||
\ |
||||
\ |
||||
<@rpta_interpret_column_layout nonvirtualTableFilter=1/>\ |
||||
\ |
||||
</#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>\ |
||||
<#if 1=0>\ |
||||
Column CID=0 heading_text="sortnr" center_heading explanation=""\ |
||||
row_selectable heading_platform readonly\ |
||||
width=5 text_size=60\ |
||||
</#if>\ |
||||
@@@^Studienfach^Anzahl bzw. Anteil^Bewerbungen und Zulassungen^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 @@
|
||||
130^48430^ |
@ -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,384 +0,0 @@
@@ -1,384 +0,0 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="sos_lab_aggr_exists"> |
||||
select sp_table_exists('sos_lab_aggr') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source"> |
||||
select name |
||||
from sx_tables where name ='sos_lab_aggr' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"> |
||||
select 1::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'dim_studiengang.tid=sos_lab_aggr.tid_stg' as joinclause |
||||
from sx_tables where name in ('dim_studiengang') |
||||
order by 1 |
||||
</sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
<#if fact_table_source?exists> |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source}' |
||||
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 |
||||
</#if> |
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if sos_lab_aggr_exists==1 && fact_table_source?exists > |
||||
|
||||
<#assign fact_table_target = {"name":"rpta_sos_lab_aggr", "caption":"Absolvierende"} |
||||
/> |
||||
|
||||
|
||||
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_aggr' |
||||
and name!='summe'; |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='sos_lab_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}' |
||||
; |
||||
|
||||
|
||||
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}' |
||||
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} |
||||
<#foreach added_table in added_tables> |
||||
left outer join ${added_table.name} on (${added_table.joinclause}) |
||||
</#foreach>', |
||||
whereclause='and stichtag=(select ST.tid from sos_stichtag ST where ST.appl_key=''2'') and abschnitt=2 and pstatus=''BE'''; |
||||
|
||||
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_aggr_exists=1 |
@ -1,400 +0,0 @@
@@ -1,400 +0,0 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="zul_antr_aggr_archiv_exists"> |
||||
select sp_table_exists('zul_antr_aggr_archiv') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source"> |
||||
select name |
||||
from sx_tables where name ='zul_antr_aggr_archiv' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"> |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
<#if fact_table_source?exists> |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source}' |
||||
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 |
||||
</#if> |
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if zul_antr_aggr_archiv_exists==1 && fact_table_source?exists > |
||||
|
||||
<#assign fact_table_target = {"name":"rpta_zul_antr_aggr_archiv", "caption":"Bewerbungen und Zulassungen historisiert"} |
||||
/> |
||||
|
||||
|
||||
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 = 'Institution' |
||||
-- WHERE name='man_organigramm'; |
||||
-- 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; |
||||
|
||||
|
||||
|
||||
update sx_fields set |
||||
is_sum=0 |
||||
where table_name='zul_antr_aggr_archiv' |
||||
and name not in ('value','value1','value2'); |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='zul_antr_aggr_archiv' |
||||
and name in ('value','value1','value2'); |
||||
|
||||
|
||||
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}' |
||||
; |
||||
|
||||
|
||||
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}' |
||||
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}', |
||||
130 |
||||
; |
||||
|
||||
|
||||
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} |
||||
<#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 zul_antr_aggr_archiv_exists=1 |
@ -1,400 +0,0 @@
@@ -1,400 +0,0 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="zul_antr_aggr_exists"> |
||||
select sp_table_exists('zul_antr_aggr') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source"> |
||||
select name |
||||
from sx_tables where name ='zul_antr_aggr' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"> |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
<#if fact_table_source?exists> |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source}' |
||||
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 |
||||
</#if> |
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if zul_antr_aggr_exists==1 && fact_table_source?exists > |
||||
|
||||
<#assign fact_table_target = {"name":"rpta_zul_antr_aggr", "caption":"Bewerbungen und Zulassungen"} |
||||
/> |
||||
|
||||
|
||||
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 = 'Institution' |
||||
-- WHERE name='man_organigramm'; |
||||
-- 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; |
||||
|
||||
|
||||
|
||||
update sx_fields set |
||||
is_sum=0 |
||||
where table_name='zul_antr_aggr' |
||||
and name not in ('value','value1','value2'); |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='zul_antr_aggr' |
||||
and name in ('value','value1','value2'); |
||||
|
||||
|
||||
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}' |
||||
; |
||||
|
||||
|
||||
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}' |
||||
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}', |
||||
130 |
||||
; |
||||
|
||||
|
||||
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} |
||||
<#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 zul_antr_aggr_exists=1 |
@ -1,405 +0,0 @@
@@ -1,405 +0,0 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="erfolg_ba_ma_uebergang_exists"> |
||||
select sp_table_exists('erfolg_ba_ma_uebergang') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source"> |
||||
select name |
||||
from sx_tables where name ='erfolg_ba_ma_uebergang' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"> |
||||
select 1::smallint as sortnr, |
||||
name , |
||||
trim(name) || '_abschluss_vorher_1_' as prefix, |
||||
caption ||' 1 (Abschluss vorher)' as caption, |
||||
'dim_studiengang.tid=erfolg_ba_ma_uebergang.abschluss_vorher_tid_stg_1' as joinclause |
||||
from sx_tables where name in ('dim_studiengang') |
||||
union |
||||
select 20::smallint as sortnr, |
||||
name, |
||||
trim(name) || '_abschlussart_vorher_' as prefix, |
||||
caption ||' 1 (Abschlussart vorher)' as caption, |
||||
'erfolg_ba_ma_uebergang.abschluss_vorher_abschlussart=erfolg_ba_ma_abschlussart.apnr and erfolg_ba_ma_abschlussart.key=1' as joinclause |
||||
from sx_tables where name in ('erfolg_ba_ma_abschlussart') |
||||
union |
||||
select 30::smallint as sortnr, |
||||
name, |
||||
trim(name) || '_abschluss_vorher_' as prefix, |
||||
caption ||' (Abschluss vorher)' as caption, |
||||
'erfolg_ba_ma_uebergang.abschluss_vorher_abschluss=sos_k_abint.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_abint') |
||||
union |
||||
select 40::smallint as sortnr, |
||||
name, |
||||
trim(name) || '_einschr_nachher_' as prefix, |
||||
caption ||' (Einschr. nachher)' as caption, |
||||
'erfolg_ba_ma_uebergang.einschr_nachher_abschluss=k_abint.abint' as joinclause |
||||
from sx_tables where name in ('k_abint') |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
<#if fact_table_source?exists> |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source}' |
||||
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 |
||||
</#if> |
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if erfolg_ba_ma_uebergang_exists==1 && fact_table_source?exists > |
||||
|
||||
<#assign fact_table_target = {"name":"rpta_erfolg_ba_ma_uebergang", "caption":"Übergang Bacherlor - Master"} |
||||
/> |
||||
|
||||
|
||||
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='erfolg_ba_ma_uebergang' |
||||
and name!='summe'; |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='erfolg_ba_ma_uebergang' |
||||
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}' |
||||
; |
||||
|
||||
|
||||
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}' |
||||
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}', |
||||
120 |
||||
; |
||||
|
||||
|
||||
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} |
||||
<#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 erfolg_ba_ma_uebergang_exists=1 |
@ -1,948 +0,0 @@
@@ -1,948 +0,0 @@
|
||||
96^RPTA-Makros^<#macro rpta_column_layout_fuellen>\ |
||||
CREATE temp TABLE tmp_rpta_column\ |
||||
(\ |
||||
uniquename varchar(255) NOT NULL,\ |
||||
caption varchar(255),\ |
||||
caption_in_ergebnistabelle 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,\ |
||||
description_in_ergebnistabelle 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,\ |
||||
sortclause text,\ |
||||
description text,\ |
||||
is_virtual smallint default 1\ |
||||
);\ |
||||
\ |
||||
insert into tmp_rpta_column_layout(\ |
||||
resultset_id,\ |
||||
uniquename,\ |
||||
caption,\ |
||||
whereclause,\ |
||||
<#if rpta_column_layout.sortclause?has_content>\ |
||||
sortclause,\ |
||||
</#if>\ |
||||
<#if rpta_column_layout.is_virtual?has_content>\ |
||||
is_virtual,\ |
||||
</#if>\ |
||||
description\ |
||||
)\ |
||||
select tid,\ |
||||
'${rpta_column_layout.uniquename}',\ |
||||
'${rpta_column_layout.caption}',\ |
||||
'${rpta_column_layout.whereclause}',\ |
||||
<#if rpta_column_layout.sortclause?has_content>\ |
||||
'${rpta_column_layout.sortclause}',\ |
||||
</#if>\ |
||||
<#if rpta_column_layout.is_virtual?has_content>\ |
||||
'${rpta_column_layout.is_virtual}',\ |
||||
</#if>\ |
||||
'${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,\ |
||||
caption_in_ergebnistabelle,\ |
||||
srcfieldname,\ |
||||
targetfieldname,\ |
||||
column_type,\ |
||||
col_function,\ |
||||
is_visible,\ |
||||
visible_size,\ |
||||
is_aggregate,\ |
||||
sortnr,\ |
||||
description,\ |
||||
description_in_ergebnistabelle,\ |
||||
format_code_uniquename\ |
||||
)\ |
||||
select R.tid,\ |
||||
'${column.uniquename}',\ |
||||
<#if column.caption?exists>\ |
||||
'${column.caption}',\ |
||||
<#else>\ |
||||
'${column.caption_der_spalte}',\ |
||||
</#if>\ |
||||
<#if column.caption_in_ergebnistabelle?exists>\ |
||||
'${column.caption_in_ergebnistabelle}',\ |
||||
<#else>\ |
||||
'${column.caption}',\ |
||||
</#if>\ |
||||
'${column.srcfieldname}',\ |
||||
<#if !column.targetfieldname?exists || column.targetfieldname=="">'${column.srcfieldname}' <#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}'<#elseif column.description_der_spalte?exists>'${column.description_der_spalte}'<#else>null::varchar </#if>,\ |
||||
<#if column.description_in_ergebnistabelle?exists>'${column.description_in_ergebnistabelle}'<#elseif 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 resultset_id in (select tid\ |
||||
FROM rpta_resultset\ |
||||
where uniquename='${rpta_column_layout.rpta_resultset}')\ |
||||
;\ |
||||
--falls neu\ |
||||
insert into rpta_column_layout\ |
||||
(uniquename,\ |
||||
caption,\ |
||||
resultset_id,\ |
||||
whereclause,\ |
||||
sortclause,\ |
||||
description,\ |
||||
is_virtual)\ |
||||
select uniquename,\ |
||||
caption,\ |
||||
resultset_id,\ |
||||
whereclause,\ |
||||
<#if rpta_column_layout.sortclause?has_content>\ |
||||
sortclause,\ |
||||
<#else>\ |
||||
null::text as sortclause,\ |
||||
</#if>\ |
||||
description,\ |
||||
is_virtual\ |
||||
FROM tmp_rpta_column_layout T\ |
||||
where not exists (select T2.uniquename from tmp_rpta_column_layout_target T2\ |
||||
where T2.uniquename=T.uniquename);\ |
||||
\ |
||||
--falls geändert, uniquename muss bleiben\ |
||||
update rpta_column_layout\ |
||||
set (caption, resultset_id, whereclause,sortclause, description, is_virtual)\ |
||||
= ( select caption, resultset_id,\ |
||||
whereclause,\ |
||||
<#if rpta_column_layout.sortclause?has_content>\ |
||||
sortclause,\ |
||||
<#else>\ |
||||
null::text as sortclause,\ |
||||
</#if>\ |
||||
description,\ |
||||
is_virtual\ |
||||
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_in_ergebnistabelle,\ |
||||
T.description_in_ergebnistabelle,\ |
||||
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>\ |
||||
\ |
||||
<#macro rpta_interpret_column_layout nonvirtualTableFilter>\ |
||||
<#assign columnLayoutHasTreeColumn=0 />\ |
||||
\ |
||||
<#assign treeColumnSrcFieldname="" />\ |
||||
<#assign treeColumnTargetFieldname="" />\ |
||||
<#assign treeColumnMaskFieldname="" />\ |
||||
select \ |
||||
--zuerst die Basisdaten:\ |
||||
<#foreach column in columns>\ |
||||
<#if column.coltype=="treeColumn">\ |
||||
<#assign columnLayoutHasTreeColumn=1 />\ |
||||
<#assign treeColumnSrcFieldname=column.srcfieldname />\ |
||||
<#assign treeColumnTargetFieldname=column.targetfieldname />\ |
||||
<#assign treeColumnMaskFieldname=column.colfunction />\ |
||||
null::varchar(255) as ${column.targetfieldname},\ |
||||
<#elseif column.coltype=="physicalColumn">\ |
||||
${column.srcfieldname} as ${column.targetfieldname},\ |
||||
<#elseif column.coltype=="logicalColumn">\ |
||||
${column.colfunction} as ${column.targetfieldname},\ |
||||
<#elseif column.coltype=="preparingColumn">\ |
||||
${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}\ |
||||
where 1=1 \ |
||||
<#if rpta_column_layout.whereclause !="">\ |
||||
and ${rpta_column_layout.whereclause}\ |
||||
</#if>\ |
||||
<#if basetable.is_virtual==0>\ |
||||
and ${nonvirtualTableFilter}\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
--ergebnistabelle:\ |
||||
select \ |
||||
--zuerst die nicht-Aggregate:\ |
||||
<#assign groupby=0 />\ |
||||
-- preparingColumns ausgeschlossen, da sie von processingColumns aggregiert werden\ |
||||
-- computedColumns immer mitnehmen, da später im finalen select verarbeitet\ |
||||
<#foreach column in columns>\ |
||||
<#if (column.is_aggregate==0 && column.coltype!="preparingColumn" && column.coltype!="processingColumn") || column.coltype=="computedColumn"> \ |
||||
<#assign groupby=groupby+1 />\ |
||||
${column.targetfieldname},\ |
||||
<#elseif column.is_aggregate==0 && column.coltype=="processingColumn"> \ |
||||
<#assign groupby=groupby+1 />\ |
||||
<#if column.colfunction?has_content>\ |
||||
${column.colfunction} as ${column.targetfieldname},\ |
||||
<#else>\ |
||||
${column.srcfieldname} as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
--dann die Aggregate:\ |
||||
-- preparingColumns ausgeschlossen, da sie von processingColumns aggregiert werden\ |
||||
-- computedColumns ausgeschlossen, da später im finalen select verarbeitet\ |
||||
<#foreach column in columns>\ |
||||
<#if column.is_aggregate==1 \ |
||||
&& column.colfunction?has_content \ |
||||
&& column.coltype=="processingColumn"> \ |
||||
${column.colfunction} as ${column.targetfieldname},\ |
||||
<#elseif column.is_aggregate==1 \ |
||||
&& (column.coltype == "logicalColumn" || column.coltype == "lookupColumn" || column.coltype == "physicalColumn")> \ |
||||
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
null::char(1) as dummycol\ |
||||
into temp tmp_stud2\ |
||||
from tmp_stud\ |
||||
where 1=1\ |
||||
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\ |
||||
;\ |
||||
<#if columnLayoutHasTreeColumn==1>\ |
||||
<#assign columnLayoutWithTreeColumnAdditionalGrouping=sichtHasAdditionalGrouping(treeColumnTargetFieldname) />\ |
||||
\ |
||||
--Sichtaufbau:\ |
||||
--Zuerst leere Zieltabelle anlegen:\ |
||||
select \ |
||||
<#foreach column in columns>\ |
||||
${column.targetfieldname},\ |
||||
</#foreach>\ |
||||
null::integer as sortnr\ |
||||
into temp tmp_stud3\ |
||||
from tmp_stud\ |
||||
where 1=0;\ |
||||
--maxEbene ermitteln:\ |
||||
<#assign maxEbene=0 />\ |
||||
<#foreach einElement in .vars[treeColumnMaskFieldname].elements>\ |
||||
<#if einElement.level > maxEbene >\ |
||||
<#assign maxEbene=einElement.level />\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
-- ##################################################\ |
||||
-- ######## Start der Schleife ######################\ |
||||
-- ##################################################\ |
||||
<#assign sortnr=0>\ |
||||
--Schleife, über Fächer im ausgewählten Baum, Reihenfolge genau wie im Baum\ |
||||
--diese Kommentare werden schon im 1. Schritt von generateSql gelöscht\ |
||||
--für Entwicklungszwecke kann man tricksen\ |
||||
<@addcomment "SCHLEIFE"/>\ |
||||
\ |
||||
<#foreach einElement in .vars[treeColumnMaskFieldname].elements>\ |
||||
<@addcomment "${einElement.name}"/>\ |
||||
\ |
||||
--zuerst Summenzeile:\ |
||||
<#assign sortnr=sortnr+1>\ |
||||
insert into tmp_stud3(\ |
||||
<#foreach column in columns>\ |
||||
${column.targetfieldname},\ |
||||
</#foreach>\ |
||||
sortnr)\ |
||||
select\ |
||||
<#foreach column in columns>\ |
||||
<#if column.targetfieldname=treeColumnTargetFieldname>\ |
||||
'${einElement.name}',\ |
||||
<#elseif column.targetfieldname="ebene">\ |
||||
${einElement.level},\ |
||||
<#elseif column.targetfieldname=treeColumnSrcFieldname>\ |
||||
null::char(1),\ |
||||
<#elseif column.is_aggregate==1 \ |
||||
&& column.colfunction?has_content \ |
||||
&& column.coltype=="processingColumn"> \ |
||||
${column.colfunction} as ${column.targetfieldname},\ |
||||
<#elseif column.is_aggregate==1 \ |
||||
&& (column.coltype == "logicalColumn" || column.coltype == "lookupColumn" || column.coltype == "physicalColumn")> \ |
||||
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
||||
<#else>\ |
||||
null,\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
--(${einElement.level}*10000) + ${sortnr} as sortnr\ |
||||
${sortnr} *10000 as sortnr\ |
||||
from tmp_stud\ |
||||
where ${treeColumnSrcFieldname} in ${einElement.subkeys}\ |
||||
\ |
||||
;\ |
||||
\ |
||||
--Unterste Ebene die Werte:\ |
||||
<#if columnLayoutWithTreeColumnAdditionalGrouping != "" \ |
||||
&& einElement.level == maxEbene >\ |
||||
<#assign sortnr=sortnr+1>\ |
||||
insert into tmp_stud3(\ |
||||
<#foreach column in columns>\ |
||||
${column.targetfieldname},\ |
||||
</#foreach>\ |
||||
sortnr)\ |
||||
select\ |
||||
<#foreach column in columns>\ |
||||
<#if column.targetfieldname=treeColumnTargetFieldname>\ |
||||
'${einElement.name}',\ |
||||
<#elseif column.targetfieldname="ebene">\ |
||||
<#if einElement.level == maxEbene >\ |
||||
${einElement.level+ 1},\ |
||||
<#else>\ |
||||
${einElement.level},\ |
||||
</#if>\ |
||||
<#elseif column.targetfieldname=treeColumnSrcFieldname>\ |
||||
null::char(1),\ |
||||
<#elseif column.is_aggregate==1 \ |
||||
&& column.colfunction?has_content \ |
||||
&& column.coltype=="processingColumn"> \ |
||||
${column.colfunction} as ${column.targetfieldname},\ |
||||
<#elseif column.is_aggregate==1 \ |
||||
&& (column.coltype == "logicalColumn" || column.coltype == "lookupColumn" || column.coltype == "physicalColumn")> \ |
||||
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
||||
<#else>\ |
||||
${column.targetfieldname},\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
${sortnr} *10000 --(${einElement.level}*10000) + ${sortnr} as sortnr\ |
||||
from tmp_stud\ |
||||
where s_tid_stg in ${einElement.subkeys}\ |
||||
group by ${columnLayoutWithTreeColumnAdditionalGrouping}\ |
||||
;\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
\ |
||||
drop table tmp_stud2;\ |
||||
select * into tmp_stud2\ |
||||
from tmp_stud3;\ |
||||
drop table tmp_stud3;\ |
||||
--Ende Sicht\ |
||||
</#if>\ |
||||
\ |
||||
<#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 myfieldclause=column.targetfieldname />\ |
||||
<#if column.coltype=="computedColumn">\ |
||||
<#assign myfieldclause=column.colfunction />\ |
||||
</#if>\ |
||||
<@format_code2sql selectclause=myfieldclause format_code_uniquename=column.format_uniquename format_sql=column.format_sql /> as ${column.targetfieldname}\ |
||||
\ |
||||
<#if colnr < number_of_visible_colums>,</#if>\ |
||||
</#if> \ |
||||
</#foreach>\ |
||||
from tmp_stud2\ |
||||
order by \ |
||||
<#if rpta_column_layout.sortclause?has_content>\ |
||||
${rpta_column_layout.sortclause}\ |
||||
<#else>\ |
||||
<#list 1..number_of_visible_colums as i>${i}\ |
||||
<#if i != number_of_visible_colums>\ |
||||
,\ |
||||
</#if>\ |
||||
</#list>\ |
||||
</#if>\ |
||||
;\ |
||||
\ |
||||
<#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;\ |
||||
\ |
||||
</#macro>\ |
||||
\ |
||||
<#function sichtHasAdditionalGrouping treeColumnTargetFieldnameParam>\ |
||||
<#assign ret="" />\ |
||||
<#foreach column in columns>\ |
||||
<#if column.targetfieldname !=treeColumnTargetFieldnameParam\ |
||||
&& column.targetfieldname!="ebene"\ |
||||
&& column.is_aggregate==0 \ |
||||
>\ |
||||
<#assign ret=column.targetfieldname />\ |
||||
</#if>\ |
||||
</#foreach>\ |
||||
<#return ret />\ |
||||
</#function>\ |
||||
<#macro rpta_column_fuellen>\ |
||||
CREATE temp TABLE tmp_rpta_column\ |
||||
(\ |
||||
uniquename varchar(255) NOT NULL,\ |
||||
caption varchar(255),\ |
||||
caption_in_ergebnistabelle 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,\ |
||||
description_in_ergebnistabelle TEXT,\ |
||||
format_code_uniquename varchar(255),\ |
||||
format_code_id integer\ |
||||
);\ |
||||
\ |
||||
<#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}',\ |
||||
<#if column.caption?exists>\ |
||||
'${column.caption}',\ |
||||
<#else>\ |
||||
'${column.caption_der_spalte}',\ |
||||
</#if>\ |
||||
'${column.srcfieldname}',\ |
||||
<#if !column.targetfieldname?exists || column.targetfieldname=="">'${column.srcfieldname}' <#else>'${column.targetfieldname}' </#if>,\ |
||||
T.tid as column_type,\ |
||||
<#if column.col_function?exists>'${column.col_function}'<#else>null::varchar </#if>,\ |
||||
0,\ |
||||
0,\ |
||||
${column.is_aggregate},\ |
||||
${sortnr*10},\ |
||||
<#if column.description?exists>'${column.description}'<#elseif column.description_der_spalte?exists>'${column.description_der_spalte}'<#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_resultset.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_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;\ |
||||
\ |
||||
drop table tmp_rpta_column;\ |
||||
</#macro>\ |
||||
\ |
||||
<#macro rpta_column2layout_fuellen>\ |
||||
CREATE temp TABLE tmp_rpta_column\ |
||||
(\ |
||||
uniquename varchar(255) NOT NULL,\ |
||||
caption varchar(255),\ |
||||
caption_in_ergebnistabelle varchar(255),\ |
||||
srcfieldname varchar(255),\ |
||||
targetfieldname varchar(255),\ |
||||
column_type_u varchar(255),\ |
||||
column_type integer,\ |
||||
col_function text,\ |
||||
is_visible smallint,\ |
||||
visible_size smallint,\ |
||||
is_aggregate smallint,\ |
||||
resultset_id integer,\ |
||||
sortnr integer,\ |
||||
description TEXT,\ |
||||
description_in_ergebnistabelle 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,\ |
||||
sortclause text,\ |
||||
description text,\ |
||||
is_virtual smallint default 1\ |
||||
);\ |
||||
\ |
||||
insert into tmp_rpta_column_layout(\ |
||||
resultset_id,\ |
||||
uniquename,\ |
||||
caption,\ |
||||
whereclause,\ |
||||
<#if rpta_column_layout.sortclause?has_content>\ |
||||
sortclause,\ |
||||
</#if>\ |
||||
<#if rpta_column_layout.is_virtual?has_content>\ |
||||
is_virtual,\ |
||||
</#if>\ |
||||
description\ |
||||
)\ |
||||
select tid,\ |
||||
'${rpta_column_layout.uniquename}',\ |
||||
'${rpta_column_layout.caption}',\ |
||||
'${rpta_column_layout.whereclause}',\ |
||||
<#if rpta_column_layout.sortclause?has_content>\ |
||||
'${rpta_column_layout.sortclause}',\ |
||||
</#if>\ |
||||
<#if rpta_column_layout.is_virtual?has_content>\ |
||||
'${rpta_column_layout.is_virtual}',\ |
||||
</#if>\ |
||||
'${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,\ |
||||
caption_in_ergebnistabelle,\ |
||||
srcfieldname,\ |
||||
targetfieldname,\ |
||||
column_type_u,\ |
||||
col_function,\ |
||||
is_visible,\ |
||||
visible_size,\ |
||||
is_aggregate,\ |
||||
sortnr,\ |
||||
description,\ |
||||
description_in_ergebnistabelle,\ |
||||
format_code_uniquename\ |
||||
)\ |
||||
select R.tid,\ |
||||
'${column.uniquename}',\ |
||||
<#if column.caption?exists>\ |
||||
'${column.caption}'\ |
||||
<#elseif column.caption_der_spalte?exists>\ |
||||
'${column.caption_der_spalte}'\ |
||||
<#else> null::varchar\ |
||||
</#if>,\ |
||||
<#if column.caption_in_ergebnistabelle?exists>\ |
||||
'${column.caption_in_ergebnistabelle}'\ |
||||
<#else> null::varchar\ |
||||
</#if>,\ |
||||
<#if column.srcfieldname?exists> '${column.srcfieldname}' <#else>null::varchar </#if>,\ |
||||
<#if column.srcfieldname?exists>\ |
||||
<#if !column.targetfieldname?exists || column.targetfieldname=="">'${column.srcfieldname}' <#else>'${column.targetfieldname}' </#if>\ |
||||
<#else> null::varchar </#if>,\ |
||||
<#if column.column_type?exists> '${column.column_type}' <#else> null::varchar </#if>,\ |
||||
<#if column.col_function?exists>'${column.col_function}'<#else>null::varchar </#if>,\ |
||||
${column.is_visible},\ |
||||
${column.visible_size},\ |
||||
<#if column.is_aggregate?exists> ${column.is_aggregate} <#else>null </#if>,\ |
||||
${sortnr*10},\ |
||||
<#if column.description?exists>'${column.description}'<#elseif column.description_der_spalte?exists>'${column.description_der_spalte}'<#else>null::varchar </#if>,\ |
||||
<#if column.description_in_ergebnistabelle?exists>'${column.description_in_ergebnistabelle}'<#elseif 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 \ |
||||
where R.uniquename='${rpta_column_layout.rpta_resultset}';\ |
||||
\ |
||||
\ |
||||
</#foreach>\ |
||||
\ |
||||
update tmp_rpta_column set column_type=C.tid\ |
||||
from rpta_column_type C\ |
||||
where C.uniquename=tmp_rpta_column.column_type_u;\ |
||||
\ |
||||
\ |
||||
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,\ |
||||
sortclause,\ |
||||
description,\ |
||||
is_virtual)\ |
||||
select uniquename,\ |
||||
caption,\ |
||||
resultset_id,\ |
||||
whereclause,\ |
||||
<#if rpta_column_layout.sortclause?has_content>\ |
||||
sortclause,\ |
||||
<#else>\ |
||||
null::text as sortclause,\ |
||||
</#if>\ |
||||
description,\ |
||||
is_virtual\ |
||||
FROM tmp_rpta_column_layout T\ |
||||
where not exists (select T2.uniquename from tmp_rpta_column_layout_target T2\ |
||||
where T2.uniquename=T.uniquename);\ |
||||
\ |
||||
--falls geändert, uniquename muss bleiben\ |
||||
update rpta_column_layout\ |
||||
--set (caption, resultset_id, whereclause,<#if rpta_column_layout.sortclause?has_content>sortclause,</#if> description, is_virtual)\ |
||||
set (caption, resultset_id, whereclause,sortclause, description, is_virtual)\ |
||||
= ( select caption, resultset_id,\ |
||||
whereclause,\ |
||||
<#if rpta_column_layout.sortclause?has_content>\ |
||||
sortclause,\ |
||||
<#else>\ |
||||
null::text as sortclause,\ |
||||
</#if>\ |
||||
description,\ |
||||
is_virtual\ |
||||
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\ |
||||
--nur die aus diesem Durchgang\ |
||||
where T.description is not null\ |
||||
)\ |
||||
;\ |
||||
\ |
||||
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_in_ergebnistabelle,\ |
||||
T.description_in_ergebnistabelle,\ |
||||
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>\ |
||||
\ |
||||
<#macro format_code2sql selectclause format_code_uniquename format_sql>\ |
||||
<#if format_code_uniquename=="MASK_ZERO">\ |
||||
(case when ${selectclause}=0 then null else ${selectclause} end)\ |
||||
<#elseif format_code_uniquename=="MASK_ZERO_INT">\ |
||||
(case when ${selectclause}=0 then null::integer else ${selectclause}::integer end)\ |
||||
<#elseif format_sql=="">\ |
||||
${selectclause}\ |
||||
<#else>\ |
||||
${selectclause}${format_sql}\ |
||||
</#if>\ |
||||
</#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,150 +0,0 @@
@@ -1,150 +0,0 @@
|
||||
--freemarker template |
||||
|
||||
-- für das RPTA-Makro wird schleifenrelation type text benötigt |
||||
-- Umstellung auf schleifenrelation type text erfolgt in Kern 5.3 |
||||
-- nach kern 5.3-Installation kann folgender alter table entfernt werden |
||||
alter table macro_masken_bez alter column schleifenrelation type text; |
||||
|
||||
<#assign makros = [ |
||||
{"tid":"48140"} |
||||
] /> |
||||
<#assign masken = [ |
||||
{"makro":"48140", "tid":"48110", "sortnr":"10", |
||||
"schleifenrelation":"<<SQL>> |
||||
SELECT DISTINCT |
||||
((((''_''::text || COALESCE(c.lid, btrim(l.fb::text)::character varying)::text) || ''_''::text) || btrim(l.stg::text)) || ''_''::text) || btrim(l.abschluss::text) AS apnr, |
||||
(btrim(k.dtxt::text) || '' ''::text) || ((( SELECT a.druck FROM cifx a WHERE a.key = 35 AND a.apnr = l.abschluss))::text) AS druck |
||||
FROM |
||||
k_stg k, |
||||
lehr_stg_ab l |
||||
LEFT JOIN cifx c ON c.key = 90 AND (c.sourcesystem = ANY (ARRAY[5, 6, 10, 12, 15])) AND c.apnr = l.fb |
||||
WHERE k.stg = l.stg |
||||
and c.apnr=<<Fachbereich>> |
||||
and l.abschluss in (''BA'',''MA'')", |
||||
"schleifenfeldname":"Studiengang","schleifenfstand":"12.03.2025", "schleifenfsicht":"<<Studiengang-Sicht>>"} |
||||
] /> |
||||
<#assign felder = [ |
||||
] /> |
||||
|
||||
-- ab hier nicht mehr ändern: |
||||
CREATE TEMP TABLE tmp_macro_masken_bez ( |
||||
maskeninfo_id1 integer NOT NULL, |
||||
maskeninfo_id2 integer NOT NULL, |
||||
active integer DEFAULT 1 NOT NULL, |
||||
sortnr smallint NOT NULL, |
||||
schleifenrelation text, |
||||
schleifenfeldname character(255), |
||||
alias character(255), |
||||
schleifenfstand character(255), |
||||
schleifenfsicht character(255), |
||||
aktion character(255) |
||||
); |
||||
CREATE TEMP TABLE tmp_macro_feld_wert ( |
||||
macro integer NOT NULL, |
||||
sortnr integer NOT NULL, |
||||
feldname character(255) NOT NULL, |
||||
alias character(255) NOT NULL, |
||||
value character(255), |
||||
value_caption character(255), |
||||
feldstand character(255), |
||||
feldsicht character(255), |
||||
active integer DEFAULT 1 NOT NULL |
||||
); |
||||
<#foreach makro in makros> |
||||
<#foreach maske in masken> |
||||
<#if maske.makro==makro.tid> |
||||
insert into tmp_macro_masken_bez(maskeninfo_id1, |
||||
maskeninfo_id2, |
||||
active, |
||||
sortnr, |
||||
schleifenrelation, |
||||
schleifenfeldname, |
||||
schleifenfstand, |
||||
schleifenfsicht) |
||||
select ${makro.tid},--maskeninfo_id1, |
||||
${maske.tid},--maskeninfo_id2, |
||||
1,--active, |
||||
${maske.sortnr}, --sortnr, |
||||
'${maske.schleifenrelation}', --schleifenrelation, |
||||
'${maske.schleifenfeldname}', --schleifenfeldname, |
||||
'${maske.schleifenfstand}', --schleifenfstand, |
||||
'${maske.schleifenfsicht}' --schleifenfsicht |
||||
from xdummy; |
||||
|
||||
<#foreach feld in felder> |
||||
<#if feld.makro==makro.tid && feld.sortnr==maske.sortnr> |
||||
--Tab.12: alle ohne Exmatr |
||||
insert into tmp_macro_feld_wert |
||||
( macro, |
||||
sortnr, |
||||
feldname, |
||||
alias, |
||||
value, |
||||
value_caption, |
||||
feldstand, |
||||
feldsicht, |
||||
active) |
||||
SELECT ${makro.tid}, --macro |
||||
${maske.sortnr},--sortnr |
||||
'${feld.feldname}',--feldname, |
||||
'',--alias, |
||||
'${feld.value}', --value, |
||||
'',--value_caption, |
||||
'', --feldstand, |
||||
'',--feldsicht, |
||||
1 --active |
||||
FROM xdummy; |
||||
</#if> |
||||
</#foreach> |
||||
</#if> |
||||
</#foreach> |
||||
</#foreach> |
||||
|
||||
delete from macro_masken_bez where maskeninfo_id1 in (select maskeninfo_id1 from tmp_macro_masken_bez) |
||||
; |
||||
insert into macro_masken_bez |
||||
(maskeninfo_id1, |
||||
maskeninfo_id2, |
||||
active, |
||||
sortnr, |
||||
schleifenrelation, |
||||
schleifenfeldname, |
||||
alias, |
||||
schleifenfstand, |
||||
schleifenfsicht, |
||||
aktion) |
||||
select maskeninfo_id1, |
||||
maskeninfo_id2, |
||||
active, |
||||
sortnr, |
||||
schleifenrelation, |
||||
schleifenfeldname, |
||||
alias, |
||||
schleifenfstand, |
||||
schleifenfsicht, |
||||
aktion |
||||
FROM tmp_macro_masken_bez |
||||
; |
||||
delete from macro_feld_wert where macro in (select macro from tmp_macro_feld_wert); |
||||
insert into macro_feld_wert |
||||
( macro, |
||||
sortnr, |
||||
feldname, |
||||
alias, |
||||
value, |
||||
value_caption, |
||||
feldstand, |
||||
feldsicht, |
||||
active) |
||||
SELECT macro, |
||||
sortnr, |
||||
feldname, |
||||
alias, |
||||
value, |
||||
value_caption, |
||||
feldstand, |
||||
feldsicht, |
||||
active |
||||
FROM tmp_macro_feld_wert; |
||||
drop table tmp_macro_masken_bez; |
||||
drop table tmp_macro_feld_wert; |
@ -1,417 +0,0 @@
@@ -1,417 +0,0 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="man_kennz_aggr_exists"> |
||||
select sp_table_exists('man_kennz_aggr') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source"> |
||||
select name |
||||
from sx_tables where name ='man_kennz_aggr' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"> |
||||
select 1::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'man_studiengang.tid_ref=man_kennz_aggr.studiengang' as joinclause |
||||
from sx_tables where name in ('man_studiengang') |
||||
union |
||||
select 10::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'man_organigramm.key_apnr=man_kennz_aggr.ch110_institut' as joinclause |
||||
from sx_tables where name in ('man_organigramm') |
||||
union |
||||
select 20::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'man_catalogue.id=man_kennz_aggr.catalogue_id' as joinclause |
||||
from sx_tables where name in ('man_catalogue') |
||||
order by 1 |
||||
</sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
<#if fact_table_source?exists> |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source}' |
||||
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 |
||||
</#if> |
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if man_kennz_aggr_exists==1 && fact_table_source?exists > |
||||
|
||||
<#assign fact_table_target = {"name":"rpta_man_kennz_aggr", "caption":"Management Kennzahlen"} |
||||
/> |
||||
|
||||
|
||||
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 = 'Institution' |
||||
WHERE name='man_organigramm'; |
||||
-- 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; |
||||
|
||||
|
||||
|
||||
update sx_fields set |
||||
is_sum=0 |
||||
where table_name='man_kennz_aggr' |
||||
and name not in ('value','value1','value2'); |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='man_kennz_aggr' |
||||
and name in ('value','value1','value2'); |
||||
|
||||
|
||||
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}' |
||||
; |
||||
|
||||
|
||||
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}' |
||||
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}', |
||||
200 |
||||
; |
||||
|
||||
|
||||
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} |
||||
<#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 man_kennz_aggr_exists=1 |
@ -1,472 +0,0 @@
@@ -1,472 +0,0 @@
|
||||
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="sva_pbv_aggr_exists"> |
||||
select sp_table_exists('sva_pbv_aggr') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source"> |
||||
select name |
||||
from sx_tables where name ='sva_pbv_aggr' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"><![CDATA[ |
||||
|
||||
--Vorbereitung: |
||||
UPDATE sx_tables |
||||
SET caption = 'Personen-Grunddaten' |
||||
WHERE name='sva_pgd'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Arbeitszeit' |
||||
WHERE name='sva_paz'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Finanzierung' |
||||
WHERE name='sva_pfi'; |
||||
|
||||
select 1::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_pgd.pgd_join_id=sva_pbv_aggr.personal_nr' as joinclause |
||||
from sx_tables where name in ('sva_pgd') |
||||
union select 5::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_paz.pgd_join_id=sva_pbv_aggr.personal_nr and sva_paz.pbv_nr=sva_pbv_aggr.besch_verh_nr and sva_pbv_aggr.d_besch_von between sva_paz.von and sva_paz.bis' as joinclause |
||||
from sx_tables where name in ('sva_paz') |
||||
union select 7::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_pfi.pfi_serial=sva_pbv_aggr.pfi_serial ' as joinclause |
||||
from sx_tables where name in ('sva_pfi') |
||||
union select 10::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_k_dienstart.apnr=sva_pbv_aggr.ca107_dienstart' as joinclause |
||||
from sx_tables where name in ('sva_k_dienstart') |
||||
union select 20::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_k_amtsdienst.apnr=sva_pbv_aggr.ca108_amtsbez' as joinclause |
||||
from sx_tables where name in ('sva_k_amtsdienst') |
||||
union select 30::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_k_vertragsart.apnr=sva_pbv_aggr.vertart' as joinclause |
||||
from sx_tables where name in ('sva_k_vertragsart') |
||||
union select 40::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_k_bvlgruppe.apnr=sva_pbv_aggr.ca109_key_bvl' as joinclause |
||||
from sx_tables where name in ('sva_k_bvlgruppe') |
||||
union select 50::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sva_k_funktionsart.apnr=sva_pbv_aggr.funktionsart' as joinclause |
||||
from sx_tables where name in ('sva_k_funktionsart') |
||||
|
||||
]]></sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
<#if fact_table_source?exists> |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source}' |
||||
and currentlyused=1 |
||||
|
||||
union |
||||
</#if> |
||||
select tid,table_name, |
||||
name, |
||||
'sva_pgd_' || name as targetname |
||||
from sx_fields where table_name ='sva_pgd' |
||||
and currentlyused=1 |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sva_paz_' || name as targetname |
||||
from sx_fields where table_name ='sva_paz' |
||||
and currentlyused=1 |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sva_pfi_' || name as targetname |
||||
from sx_fields where table_name ='sva_pfi' |
||||
and currentlyused=1 |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sva_k_vertragsart_' || name as targetname |
||||
from sx_fields where table_name ='sva_k_vertragsart' |
||||
and currentlyused=1 |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sva_k_dienstart_' || name as targetname |
||||
from sx_fields where table_name ='sva_k_dienstart' |
||||
and currentlyused=1 |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sva_k_funktionsart_' || name as targetname |
||||
from sx_fields where table_name ='sva_k_funktionsart' |
||||
and currentlyused=1 |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sva_k_amtsdienst_' || name as targetname |
||||
from sx_fields where table_name ='sva_k_amtsdienst' |
||||
and currentlyused=1 |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'sva_k_bvlgruppe_' || name as targetname |
||||
from sx_fields where table_name ='sva_k_bvlgruppe' |
||||
and currentlyused=1 |
||||
order by 1 |
||||
|
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if sva_pbv_aggr_exists==1 && fact_table_source?exists > |
||||
|
||||
<#assign fact_table_target = {"name":"sva_pbv_aggr_pgd", "caption":"Personal"} |
||||
/> |
||||
|
||||
|
||||
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_pbv_aggr' |
||||
and name!='vzae'; |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='sva_pbv_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}' |
||||
; |
||||
|
||||
|
||||
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}' |
||||
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} |
||||
<#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_pbv_aggr_exists=1 |
@ -1,431 +0,0 @@
@@ -1,431 +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"> |
||||
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[ |
||||
<#if fact_table_source?exists > |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source}' |
||||
--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', |
||||
'pktxt', |
||||
'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 |
||||
</#if> |
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if sos_lab_pord_exists==1 && fact_table_source?exists > |
||||
|
||||
<#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}' |
||||
; |
||||
|
||||
|
||||
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}' |
||||
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} |
||||
<#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,195 +0,0 @@
@@ -1,195 +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_layout = {"uniquename":"rpta_exam_unit_dim_studiengang_note", |
||||
"caption":"Prüfungsergebnisse", |
||||
"rpta_resultset":"rpta_exam_unit_dim_studiengang", |
||||
"whereclause":"((modulart=''P'' and sourcesystem=6) or (part=''MP'' and sourcesystem=5)) |
||||
and pstatus in (''BE'',''NB'',''EN'') |
||||
and (((panerk != ''J'' and sourcesystem=6) or (panerk is null and sourcesystem=6)) |
||||
or ((panerk != ''I'' and panerk != ''J'' and panerk != ''H'' and sourcesystem=5) or (panerk is null and sourcesystem=5)))", |
||||
"sortclause":"dim_studiengang_stg,dim_studiengang_abschluss,sem_der_pruefung,pdtxt", |
||||
"description":"Prüfung und Noten" |
||||
} |
||||
/> |
||||
|
||||
<#assign rpta_columns = [ |
||||
|
||||
{"uniquename":"dim_studiengang_stg", |
||||
"srcfieldname":"dim_studiengang_stg", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"Fach", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":10, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"dim_studiengang_abschluss", |
||||
"srcfieldname":"dim_studiengang_abschluss", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"Abschluss", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":10, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"sem_der_pruefung", |
||||
"srcfieldname":"sem_der_pruefung", |
||||
"targetfieldname":"sem_der_pruefung", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"Semester der Prüfung (Schlüssel)", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"sem_der_pruefung_str", |
||||
"srcfieldname":"sem_der_pruefung", |
||||
"targetfieldname":"sem_der_pruefung_str", |
||||
"column_type":"lookupColumn", |
||||
"col_function":"select eintrag from semester where tid=sem_der_pruefung", |
||||
"format_code":"", |
||||
"caption":"Semester der Prüfung", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":10, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"elementnr", |
||||
"srcfieldname":"elementnr", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"pnr", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":10, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pdtxt", |
||||
"srcfieldname":"pdtxt", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"Name der Prüfung", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":40, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"summe", |
||||
"srcfieldname":"summe", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"Teilnehmer", |
||||
"is_visible":"1", |
||||
"is_aggregate":1, |
||||
"visible_size":15, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"note_case", |
||||
"srcfieldname":"note", |
||||
"targetfieldname":"note_case", |
||||
"column_type":"preparingColumn", |
||||
"col_function":"(case when note > 6 then null else note end)", |
||||
"format_code":"", |
||||
"caption":"Durchschnittsnote * Vorbereitend", |
||||
"is_visible":"0", |
||||
"is_aggregate":0, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"note_schnitt", |
||||
"srcfieldname":"note_case", |
||||
"targetfieldname":"note_schnitt", |
||||
"column_type":"processingColumn", |
||||
"col_function":"avg(note_case)", |
||||
"format_code":"", |
||||
"caption":"Durchschnittsnote * Weiterverarbeitend", |
||||
"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":0, |
||||
"visible_size":25, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pstatus_nb_sum", |
||||
"srcfieldname":"", |
||||
"targetfieldname":"pstatus_nb_sum", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"(case when pstatus in (''NB'',''EN'') then 1 else 0 end)", |
||||
"format_code":"", |
||||
"caption":"Durchfallquote in % * Logisch", |
||||
"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":0, |
||||
"visible_size":25, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pvermerk_ne_sum", |
||||
"srcfieldname":"", |
||||
"targetfieldname":"pvermerk_ne_sum", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"(case when pvermerk in (''NE'',''N'') then 1 else 0 end)", |
||||
"format_code":"", |
||||
"caption":"Nicht erschienen", |
||||
"is_visible":"1", |
||||
"is_aggregate":1, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"rpta_exam_unit_shortcomment", |
||||
"srcfieldname":"shortcomment", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"Kurzkommentar", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":10, |
||||
"description":""} |
||||
|
||||
|
||||
] /> |
||||
|
||||
|
||||
<@rpta_column_layout_fuellen /> |
||||
|
||||
|
||||
|
||||
|
@ -1,443 +0,0 @@
@@ -1,443 +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'' and sourcesystem=6) or (part=''MP'' and sourcesystem=5))", |
||||
"description":"Prüfung und Noten" |
||||
}] |
||||
/> |
||||
|
||||
<#assign rpta_columns = [ |
||||
|
||||
{"uniquename":"dim_studiengang_stg", |
||||
"srcfieldname":"dim_studiengang_stg", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"Fach", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":10, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"dim_studiengang_abschluss", |
||||
"srcfieldname":"dim_studiengang_abschluss", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"Abschluss", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":10, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"sem_der_pruefung", |
||||
"srcfieldname":"sem_der_pruefung", |
||||
"targetfieldname":"sem_der_pruefung", |
||||
"column_type":"preparingColumn", |
||||
"col_function":"sem_der_pruefung", |
||||
"format_code":"", |
||||
"caption":"Semester der Prüfung", |
||||
"is_visible":"0", |
||||
"is_aggregate":0, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"sem_der_pruefung_min_process", |
||||
"srcfieldname":"sem_der_pruefung", |
||||
"targetfieldname":"sem_der_pruefung_min_process", |
||||
"column_type":"processingColumn", |
||||
"col_function":"min", |
||||
"format_code":"", |
||||
"caption":"Semester der Prüfung (Min)", |
||||
"is_visible":"1", |
||||
"is_aggregate":1, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"sem_der_pruefung_max_process", |
||||
"srcfieldname":"sem_der_pruefung", |
||||
"targetfieldname":"sem_der_pruefung_max_process", |
||||
"column_type":"processingColumn", |
||||
"col_function":"max", |
||||
"format_code":"", |
||||
"caption":"Semester der Prüfung (Max)", |
||||
"is_visible":"1", |
||||
"is_aggregate":1, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"elementnr", |
||||
"srcfieldname":"elementnr", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"pnr", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":10, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pdtxt", |
||||
"srcfieldname":"pdtxt", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"format_code":"", |
||||
"caption":"Name der Prüfung", |
||||
"is_visible":"1", |
||||
"is_aggregate":0, |
||||
"visible_size":40, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"summe", |
||||
"srcfieldname":"summe", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"sum", |
||||
"format_code":"", |
||||
"caption":"Teilnehmer", |
||||
"is_visible":"1", |
||||
"is_aggregate":1, |
||||
"visible_size":15, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"note_case", |
||||
"srcfieldname":"note", |
||||
"targetfieldname":"note_case", |
||||
"column_type":"preparingColumn", |
||||
"col_function":"(case when note > 6 then null else note end)", |
||||
"format_code":"", |
||||
"caption":"Durchschnittsnote % *", |
||||
"is_visible":"0", |
||||
"is_aggregate":0, |
||||
"visible_size":5, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"note_schnitt", |
||||
"srcfieldname":"note_case", |
||||
"targetfieldname":"note_schnitt", |
||||
"column_type":"processingColumn", |
||||
"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":25, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pstatus_nb", |
||||
"srcfieldname":"pstatus", |
||||
"targetfieldname":"pstatus_nb", |
||||
"column_type":"preparingColumn", |
||||
"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":25, |
||||
"description":""}, |
||||
|
||||
{"uniquename":"pvermerk_ne", |
||||
"srcfieldname":"pvermerk", |
||||
"targetfieldname":"pvermerk_ne", |
||||
"column_type":"preparingColumn", |
||||
"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":25, |
||||
"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; |
||||
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue