+citizen_child, citizen_guardianship, sitizen_spouse

This commit is contained in:
Ruslan 2024-09-16 16:18:55 +03:00
parent 5df5226086
commit 969f9d982c
40 changed files with 3111 additions and 149 deletions

View file

@ -25,6 +25,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -449,6 +449,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1433,7 +1437,7 @@ SELECT
ROUND((age_counts."51+_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "51+_year_percent",
'00' as recruitment_id,
'М' as gender,
'M' as gender,
'true' as registered
FROM age_counts, total_count;</sql>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -754,23 +758,47 @@
<schema_name/>
</partitioning>
<connection>postgres.person_registry</connection>
<sql>with
t1 as (select count(*) as first_reg_17
from recruits r
where r.system_pgs_status = '1'
and birth_date>= '2007-01-01'),
t2 as (select count(*) as first_reg_18
from recruits r
where r.system_pgs_status = '1'
and birth_date&lt; '2007-01-01'),
t3 as (select count(*) mil_spec_w
from recruits r
where r.system_pgs_status = '1'
and r.birth_date>= '2007-01-01'
and r.gender = 'FEMALE')
select t1.first_reg_17, t2.first_reg_18, t3.mil_spec_w, '00' as recruitment_id, 0 as returned_dep_liberty, 0 as punished, 0 as received_citizenship, 0 as first_reg_17_percent,
0 as first_reg_18_percent, 0 as returned_dep_liberty_percent, 0 as mil_spec_W_percent, 0 as punished_percent, 0 as received_citizenship_percent, 1 as mil_reg, 1 as org
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1</sql>
<sql>WITH
t1 AS (
SELECT COUNT(*) AS first_reg_17
FROM recruits r
WHERE r.system_pgs_status = '1'
AND AGE(CURRENT_DATE, r.birth_date) &lt; INTERVAL '18 years'
),
t2 AS (
-- Первоначальная постановка совершеннолетние
SELECT COUNT(*) AS first_reg_18
FROM recruits r
WHERE r.system_pgs_status = '1'
AND AGE(CURRENT_DATE, r.birth_date) >= INTERVAL '18 years'
),
t3 AS (
-- Совершеннолетние женщины с ВУС
SELECT COUNT(*) AS mil_spec_w
FROM recruits r
WHERE r.system_pgs_status = '1'
AND AGE(CURRENT_DATE, r.birth_date) >= INTERVAL '18 years'
AND r.gender = 'FEMALE'
)
SELECT
t1.first_reg_17,
t2.first_reg_18,
t3.mil_spec_w,
'00' AS recruitment_id,
0 AS returned_dep_liberty,
0 AS punished,
0 AS received_citizenship,
0 AS first_reg_17_percent,
0 AS first_reg_18_percent,
0 AS returned_dep_liberty_percent,
0 AS mil_spec_w_percent,
0 AS punished_percent,
0 AS received_citizenship_percent,
1 AS mil_reg,
1 AS org
FROM t1
FULL OUTER JOIN t2 ON 1 = 1
FULL OUTER JOIN t3 ON 1 = 1;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1166,7 +1170,7 @@ from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1 full outer join
</output>
</remotesteps>
<GUI>
<xloc>256</xloc>
<xloc>224</xloc>
<yloc>64</yloc>
<draw>Y</draw>
</GUI>

View file

@ -0,0 +1,653 @@
<?xml version="1.0" encoding="UTF-8"?>
<transformation>
<info>
<name>child</name>
<description/>
<extended_description/>
<trans_version/>
<trans_type>Normal</trans_type>
<directory>/</directory>
<parameters>
</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>2024/08/15 14:02:51.713</created_date>
<modified_user>-</modified_user>
<modified_date>2024/08/15 14:02:51.713</modified_date>
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
</notepads>
<connection>
<name>ervu-dashboard</name>
<server>dashboard-dbhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>dashboard-dbname</database>
<port>1111</port>
<username>dashboard-dbuser</username>
<password>Encrypted 2daf9dca008c89396af54aa72ce93bcc9</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>IS_CLUSTERED</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>PORT_NUMBER</code>
<attribute>1111</attribute>
</attribute>
<attribute>
<code>PRESERVE_RESERVED_WORD_CASE</code>
<attribute>Y</attribute>
</attribute>
<attribute>
<code>QUOTE_ALL_FIELDS</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>USE_POOLING</code>
<attribute>N</attribute>
</attribute>
</attributes>
</connection>
<connection>
<name>ervu_person_registry</name>
<server>person-dbhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>person-dbname</database>
<port>4444</port>
<username>person-dbuser</username>
<password>Encrypted 2be98afb80fd5818ba554aa72ce93bcc9</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>IS_CLUSTERED</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>PORT_NUMBER</code>
<attribute>4444</attribute>
</attribute>
<attribute>
<code>PRESERVE_RESERVED_WORD_CASE</code>
<attribute>Y</attribute>
</attribute>
<attribute>
<code>QUOTE_ALL_FIELDS</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>USE_POOLING</code>
<attribute>N</attribute>
</attribute>
</attributes>
</connection>
<order>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
</order>
<step>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu_person_registry</connection>
<sql>with child as
(select jsonb_array_elements(ri.info->'svedDeti'->'rebenok') ch,
ri.recruit_id
from public.recruits_info ri
where jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array')
select
r.id::uuid recruit_id,
ch->>'rodstvSvyazReb' kinship_type,
concat_ws(' ', ch->'svedFLBS'->'fio'->>'familiya',
ch->'svedFLBS'->'fio'->>'imya',
ch->'svedFLBS'->'fio'->>'otchestvo') full_name,
make_date(NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den','')::int) birth_date,
make_date(NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz','')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'den','')::int) death_date,
ch->'svedSmert'->>'nomerZapis' death_az_number,
ch->'svedAZRozhd'->'dataRozhdDok'->>'nomerZapis' birth_az_number
from public.recruits r
join child on r.id = child.recruit_id</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>N</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>208</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<commit>1000</commit>
<truncate>N</truncate>
<ignore_errors>N</ignore_errors>
<use_batch>Y</use_batch>
<specify_fields>N</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>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>416</xloc>
<yloc>208</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>
<attributes/>
</transformation>

View file

@ -448,6 +448,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -539,11 +543,61 @@
</connection>
<order>
<hop>
<from>Table input</from>
<from>Select values 4</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Select values 4</to>
<enabled>Y</enabled>
</hop>
</order>
<step>
<name>Select values 4</name>
<type>SelectValues</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<select_unspecified>N</select_unspecified>
<meta>
<name>issue_date</name>
<rename>issue_date</rename>
<type>Date</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask>yyyy-MM-dd</conversion_mask>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>448</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table input</name>
<type>TableInput</type>
@ -557,7 +611,7 @@
</partitioning>
<connection>ervu_person_registry</connection>
<sql>SELECT
full_name as fio,
full_name,
last_name,
first_name,
middle_name,
@ -566,7 +620,7 @@ birth_date,
extract(year from age(birth_date)) age,
birth_place,
phone,
system_id_ern,
--system_id_ern,
CASE WHEN (EXISTS (
SELECT 1
@ -575,7 +629,7 @@ CASE WHEN (EXISTS (
AND education->>'kodUrObr' IN ('1', '2', '3', '4', '5'))
OR EXISTS (
SELECT 1
FROM jsonb_array_elements(ri.info-&gt;'svedInObr'->'inObr') AS education
FROM jsonb_array_elements(ri.info->'svedInObr'->'inObr') AS education
WHERE jsonb_typeof(ri.info->'svedInObr'->'inObr') = 'array'
AND education->>'kodUrObr' IN ('1', '2', '3', '4', '5')
)) THEN 'Высшее'
@ -620,12 +674,11 @@ ri.info->'svedSemPolozh'->>'semPolozhNaim' marital_status,
) number_children_18_old,
ri.info->'pasportRF'->'aktPasportRF'->>'nomDok' passport_number,
ri.info->'pasportRF'->'aktPasportRF'->>'serDok' passport_series,
to_char((ri.info->'svedVoin'->'voin'->>'dataReg')::date, 'dd.mm.yyyy') as issue_date,
ri.recruit_id as citizen_id,
ri.info->'svedVoin'->'voin'->>'dataReg' issue_date,
ri.recruit_id, --id рекрута
r.target_recruitment_id as recruitment_id
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
</sql>
JOIN public.recruits r ON ri.recruit_id = r.id</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
@ -657,7 +710,7 @@ JOIN public.recruits r ON ri.recruit_id = r.id
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<schema>public</schema>
<schema>ervu_dashboard</schema>
<table>citizen</table>
<commit>1000</commit>
<truncate>N</truncate>
@ -684,7 +737,7 @@ JOIN public.recruits r ON ri.recruit_id = r.id
</output>
</remotesteps>
<GUI>
<xloc>464</xloc>
<xloc>672</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>

View file

@ -25,6 +25,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -411,11 +415,11 @@
<attributes_kjc/>
</entry>
<entry>
<name>SQL</name>
<name>SQL.ri</name>
<description/>
<type>SQL</type>
<attributes/>
<sql>delete from public.citizen</sql>
<sql>delete from ervu_dashboard.citizen</sql>
<useVariableSubstitution>F</useVariableSubstitution>
<sqlfromfile>F</sqlfromfile>
<sqlfilename/>
@ -428,6 +432,174 @@
<yloc>224</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>SQL.opekun</name>
<description/>
<type>SQL</type>
<attributes/>
<sql>delete from ervu_dashboard.citizen_guardianship</sql>
<useVariableSubstitution>F</useVariableSubstitution>
<sqlfromfile>F</sqlfromfile>
<sqlfilename/>
<sendOneStatement>F</sendOneStatement>
<connection>ervu-dashboard</connection>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>240</xloc>
<yloc>144</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>SQL.spouse</name>
<description/>
<type>SQL</type>
<attributes/>
<sql>delete from ervu_dashboard.citizen_spouse</sql>
<useVariableSubstitution>F</useVariableSubstitution>
<sqlfromfile>F</sqlfromfile>
<sqlfilename/>
<sendOneStatement>F</sendOneStatement>
<connection>ervu-dashboard</connection>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>240</xloc>
<yloc>304</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>SQL.child</name>
<description/>
<type>SQL</type>
<attributes/>
<sql>delete from ervu_dashboard.citizen_child</sql>
<useVariableSubstitution>F</useVariableSubstitution>
<sqlfromfile>F</sqlfromfile>
<sqlfilename/>
<sendOneStatement>F</sendOneStatement>
<connection>ervu-dashboard</connection>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>240</xloc>
<yloc>384</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>opekun</name>
<description/>
<type>TRANS</type>
<attributes/>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>${Internal.Entry.Current.Directory}/opekun.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>Y</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>
<run_configuration>Pentaho local</run_configuration>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>384</xloc>
<yloc>144</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>spouse</name>
<description/>
<type>TRANS</type>
<attributes/>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>${Internal.Entry.Current.Directory}/spouse.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>Y</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>
<run_configuration>Pentaho local</run_configuration>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>384</xloc>
<yloc>304</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>child</name>
<description/>
<type>TRANS</type>
<attributes/>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>${Internal.Entry.Current.Directory}/child.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>Y</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>
<run_configuration>Pentaho local</run_configuration>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>384</xloc>
<yloc>384</yloc>
<attributes_kjc/>
</entry>
</entries>
<hops>
<hop>
@ -441,7 +613,7 @@
</hop>
<hop>
<from>Start</from>
<to>SQL</to>
<to>SQL.ri</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
@ -449,7 +621,7 @@
<unconditional>Y</unconditional>
</hop>
<hop>
<from>SQL</from>
<from>SQL.ri</from>
<to>info_recruits</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
@ -457,6 +629,87 @@
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>SQL.opekun</from>
<to>opekun</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>SQL.spouse</from>
<to>spouse</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>SQL.child</from>
<to>child</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>child</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>spouse</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>opekun</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>Start</from>
<to>SQL.opekun</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>SQL.spouse</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>SQL.child</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
</hops>
<notepads>
</notepads>

View file

@ -0,0 +1,648 @@
<?xml version="1.0" encoding="UTF-8"?>
<transformation>
<info>
<name>opekun</name>
<description/>
<extended_description/>
<trans_version/>
<trans_type>Normal</trans_type>
<directory>/</directory>
<parameters>
</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>2024/08/15 14:02:51.713</created_date>
<modified_user>-</modified_user>
<modified_date>2024/08/15 14:02:51.713</modified_date>
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
</notepads>
<connection>
<name>ervu-dashboard</name>
<server>dashboard-dbhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>dashboard-dbname</database>
<port>1111</port>
<username>dashboard-dbuser</username>
<password>Encrypted 2daf9dca008c89396af54aa72ce93bcc9</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>IS_CLUSTERED</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>PORT_NUMBER</code>
<attribute>1111</attribute>
</attribute>
<attribute>
<code>PRESERVE_RESERVED_WORD_CASE</code>
<attribute>Y</attribute>
</attribute>
<attribute>
<code>QUOTE_ALL_FIELDS</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>USE_POOLING</code>
<attribute>N</attribute>
</attribute>
</attributes>
</connection>
<connection>
<name>ervu_person_registry</name>
<server>person-dbhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>person-dbname</database>
<port>4444</port>
<username>person-dbuser</username>
<password>Encrypted 2be98afb80fd5818ba554aa72ce93bcc9</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>IS_CLUSTERED</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>PORT_NUMBER</code>
<attribute>4444</attribute>
</attribute>
<attribute>
<code>PRESERVE_RESERVED_WORD_CASE</code>
<attribute>Y</attribute>
</attribute>
<attribute>
<code>QUOTE_ALL_FIELDS</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>USE_POOLING</code>
<attribute>N</attribute>
</attribute>
</attributes>
</connection>
<order>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
</order>
<step>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu_person_registry</connection>
<sql>with person as
(select jsonb_array_elements(ri.info->'svedOpekun'->'svedSoczPod') ch,
ri.recruit_id
from public.recruits_info ri
where jsonb_typeof(ri.info->'svedOpekun'->'svedSoczPod') = 'array')
select
r.id recruit_id,
concat_ws(' ', ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo') full_name,
make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(ch->'dataRozhdDok'->&gt;'den','')::int) birth_date,
ch->>'snils' snils
from public.recruits r
join person on r.id = person.recruit_id</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>N</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>208</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<schema>ervu_dashboard</schema>
<table>citizen_guardianship</table>
<commit>1000</commit>
<truncate>N</truncate>
<ignore_errors>N</ignore_errors>
<use_batch>Y</use_batch>
<specify_fields>N</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>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>416</xloc>
<yloc>208</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>
<attributes/>
</transformation>

View file

@ -0,0 +1,742 @@
<?xml version="1.0" encoding="UTF-8"?>
<transformation>
<info>
<name>spouse</name>
<description/>
<extended_description/>
<trans_version/>
<trans_type>Normal</trans_type>
<directory>/</directory>
<parameters>
</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>2024/08/15 14:02:51.713</created_date>
<modified_user>-</modified_user>
<modified_date>2024/08/15 14:02:51.713</modified_date>
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
</notepads>
<connection>
<name>ervu-dashboard</name>
<server>dashboard-dbhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>dashboard-dbname</database>
<port>1111</port>
<username>dashboard-dbuser</username>
<password>Encrypted 2daf9dca008c89396af54aa72ce93bcc9</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>IS_CLUSTERED</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>PORT_NUMBER</code>
<attribute>1111</attribute>
</attribute>
<attribute>
<code>PRESERVE_RESERVED_WORD_CASE</code>
<attribute>Y</attribute>
</attribute>
<attribute>
<code>QUOTE_ALL_FIELDS</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>USE_POOLING</code>
<attribute>N</attribute>
</attribute>
</attributes>
</connection>
<connection>
<name>ervu_person_registry</name>
<server>person-dbhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>person-dbname</database>
<port>4444</port>
<username>person-dbuser</username>
<password>Encrypted 2be98afb80fd5818ba554aa72ce93bcc9</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>IS_CLUSTERED</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>PORT_NUMBER</code>
<attribute>4444</attribute>
</attribute>
<attribute>
<code>PRESERVE_RESERVED_WORD_CASE</code>
<attribute>Y</attribute>
</attribute>
<attribute>
<code>QUOTE_ALL_FIELDS</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
<attribute>N</attribute>
</attribute>
<attribute>
<code>USE_POOLING</code>
<attribute>N</attribute>
</attribute>
</attributes>
</connection>
<order>
<hop>
<from>Select values</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Select values</to>
<enabled>Y</enabled>
</hop>
</order>
<step>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu_person_registry</connection>
<sql>with suprug as
(select jsonb_array_elements(ri.info->'svedSemPolozh'->'suprugi') supr,
ri.info->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' marriage_az_number,
ri.info->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend' marriage_date,
ri.info->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' divorce_az_number,
ri.info->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend' divorce_date,
case when (ri.info->'svedSemPolozh'->>'svedSuprIskl' = '1') then true
else false
end information_excluded,
ri.recruit_id
from public.recruits_info ri)
select
r.id recruit_id,
supr->>'rodstvSvyazSuprugNaim' kinship_type,
concat_ws(' ', supr->'svedFLBS'->'fio'->>'familiya',
supr->'svedFLBS'->'fio'->>'imya',
supr->'svedFLBS'->'fio'->>'otchestvo') full_name,
make_date(NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int) birth_date,
make_date(NULLIF(supr->'svedSmert'->>'god', '')::int,
NULLIF(supr->'svedSmert'->>'mesyacz','')::int,
NULLIF(supr->'svedSmert'->>'den','')::int) death_date,
supr->'svedSmert'->>'nomerZapis' death_az_number,
marriage_az_number,
marriage_date,
divorce_az_number,
divorce_date,
information_excluded
from public.recruits r
join suprug on r.id = suprug.recruit_id</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>N</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>192</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<schema>ervu_dashboard</schema>
<table>citizen_spouse</table>
<commit>1000</commit>
<truncate>N</truncate>
<ignore_errors>N</ignore_errors>
<use_batch>Y</use_batch>
<specify_fields>N</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>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>704</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Select values</name>
<type>SelectValues</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<select_unspecified>N</select_unspecified>
<meta>
<name>marriage_date</name>
<rename>marriage_date</rename>
<type>Date</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask>yyyy-MM-dd</conversion_mask>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
<meta>
<name>divorce_date</name>
<rename>divorce_date</rename>
<type>Date</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask>yyyy-MM-dd</conversion_mask>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
</fields>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>448</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>
</step>
<step_error_handling>
<error>
<source_step>Select values</source_step>
<target_step>Modified JavaScript value</target_step>
<is_enabled>N</is_enabled>
<nr_valuename/>
<descriptions_valuename/>
<fields_valuename/>
<codes_valuename/>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
</step_error_handling>
<slave-step-copy-partition-distribution>
</slave-step-copy-partition-distribution>
<slave_transformation>N</slave_transformation>
<attributes/>
</transformation>

View file

@ -25,6 +25,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -25,6 +25,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -415,7 +419,7 @@
<description/>
<type>SQL</type>
<attributes/>
<sql>delete from space.testrecruitment</sql>
<sql>delete from ervu_dashboard.recruitment</sql>
<useVariableSubstitution>F</useVariableSubstitution>
<sqlfromfile>F</sqlfromfile>
<sqlfilename/>

View file

@ -25,6 +25,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -448,6 +448,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -594,8 +598,8 @@ where r.code in ('12', '62','65') and rt2.idm_id is not null
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<schema>space</schema>
<table>testrecruitment</table>
<schema>ervu_dashboard</schema>
<table>recruitment</table>
<commit>1000</commit>
<truncate>N</truncate>
<ignore_errors>N</ignore_errors>

View file

@ -35,6 +35,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -777,8 +781,16 @@
</partitioning>
<connection>postgres.appeal-document-service</connection>
<sql>with
t1 as (select count(*) as total_appeals from public.appeal_document ad where vk_id = any('${VK_ARRAY}')),
t2 as (select (avg(trim(both '"' from (ad.extra_info -> 'resultDate')::text)::date - appeal_date)) as average_consideration from public.appeal_document ad where vk_id = any('${VK_ARRAY}'))
t1 as (select count(*) as total_appeals from public.appeal_document ad where
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR vk_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
),
t2 as (select (avg(trim(both '"' from (ad.extra_info -> 'resultDate')::text)::date - appeal_date)) as average_consideration from public.appeal_document ad where
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR vk_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
select t1.total_appeals, t2.average_consideration, '${REG_ID}' as recruitment_id,
0 as resolved, 0 as average_rating, 0 as average_to_face, 0 as average_epgu, 0 as average_to_face_percent, 0 as average_epgu_percent
from t1 full outer join t2 on 1 = 1</sql>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1023,19 +1027,34 @@ JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where subpoena_reason.type='3' and sub_stat_hist.code ='3' and subpoena.department_id = any('${VK_ARRAY}')),
where subpoena_reason.type='3' and sub_stat_hist.code ='3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t2 as (select count(distinct subpoena.id) as appeared_on_subpoenas FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where subpoena_reason.type='3' and sub_stat_hist.code in ('4.1','4.2') and subpoena.department_id = any('${VK_ARRAY}')),
where subpoena_reason.type='3' and sub_stat_hist.code in ('4.1','4.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t3 as (select count(distinct subpoena.id) as not_appeared_on_subpoenas FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where subpoena_reason.type='3' and sub_stat_hist.code ='5' and subpoena.department_id = any('${VK_ARRAY}'))
where subpoena_reason.type='3' and sub_stat_hist.code ='5'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
))
select t1.subpoenas_sent, t2.appeared_on_subpoenas, t3.not_appeared_on_subpoenas, 1 as org, '${REG_ID}' as recruitment_id, 'Весна' as spring_autumn,
0 as new_recruits, 0 as postponement_have_right, 0 as postponement_granted, 0 as appeared_on_subpoenas_percent, 0 as not_appeared_on_subpoenas_percent, 0 as postponement_have_right_percent, 0 as postponement_granted_percent
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1
@ -1077,19 +1096,34 @@ JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where subpoena_reason.type='3' and sub_stat_hist.code ='3' and subpoena.department_id = any('${VK_ARRAY}')),
where subpoena_reason.type='3' and sub_stat_hist.code ='3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t2 as (select count(distinct subpoena.id) as appeared_on_subpoenas FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where subpoena_reason.type='3' and sub_stat_hist.code in ('4.1','4.2') and subpoena.department_id = any('${VK_ARRAY}')),
where subpoena_reason.type='3' and sub_stat_hist.code in ('4.1','4.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t3 as (select count(distinct subpoena.id) as not_appeared_on_subpoenas FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where subpoena_reason.type='3' and sub_stat_hist.code ='5' and subpoena.department_id = any('${VK_ARRAY}'))
where subpoena_reason.type='3' and sub_stat_hist.code ='5'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
))
select t1.subpoenas_sent, t2.appeared_on_subpoenas, t3.not_appeared_on_subpoenas, 1 as org, '${REG_ID}' as recruitment_id, 'Осень' as spring_autumn,
0 as new_recruits, 0 as postponement_have_right, 0 as postponement_granted, 0 as appeared_on_subpoenas_percent, 0 as not_appeared_on_subpoenas_percent, 0 as postponement_have_right_percent, 0 as postponement_granted_percent
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -781,18 +785,43 @@
<schema_name/>
</partitioning>
<connection>postgres.person_registry</connection>
<sql>with
t1 as (select count(*) total_count from public.recruits r
where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')),
t2 as (select count(*) filter(where gender='MALE') male_count
from public.recruits r
where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')),
t3 as (select count(*) filter(where gender='FEMALE') female_count
from public.recruits r
where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}'))
select t1.total_count, t2.male_count, t3.female_count, '${REG_ID}' as recruitment_id,
0 as mobilization_criterion, 0 as volunteer_criterion, 0 as contract_criterion, 0 as mobilization_criterion_percent, 0 as volunteer_criterion_percent, 0 as contract_criterion_percent
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1</sql>
<sql>WITH
t1 AS (
SELECT COUNT(*) AS total_count
FROM public.recruits r
WHERE r.vu_current_info ->> 'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t2 AS (
SELECT COUNT(*) FILTER (WHERE gender = 'MALE') AS male_count
FROM public.recruits r
WHERE r.vu_current_info ->> 'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t3 AS (
SELECT COUNT(*) FILTER (WHERE gender = 'FEMALE') AS female_count
FROM public.recruits r
WHERE r.vu_current_info ->> 'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
)
SELECT t1.total_count, t2.male_count, t3.female_count, '${REG_ID}' AS recruitment_id,
0 AS mobilization_criterion, 0 AS volunteer_criterion, 0 AS contract_criterion,
0 AS mobilization_criterion_percent, 0 AS volunteer_criterion_percent, 0 AS contract_criterion_percent
FROM t1
FULL OUTER JOIN t2 ON 1 = 1
FULL OUTER JOIN t3 ON 1 = 1;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
@ -807,7 +836,7 @@ from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1</sql>
</output>
</remotesteps>
<GUI>
<xloc>144</xloc>
<xloc>128</xloc>
<yloc>304</yloc>
<draw>Y</draw>
</GUI>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -782,9 +786,24 @@
</partitioning>
<connection>postgres.person_registry</connection>
<sql>with
t1 as (select count(*) waiting_count from public.recruits r where r.system_pgs_status = '1' and target_recruitment_id = any('${VK_ARRAY}')),
t2 as (select count(*) filter(where gender='MALE') male_count from public.recruits r where r.system_pgs_status = '1' and target_recruitment_id = any('${VK_ARRAY}')),
t3 as (select count(*) filter(where gender='FEMALE') female_count from public.recruits r where r.system_pgs_status = '1' and target_recruitment_id = any('${VK_ARRAY}'))
t1 as (select count(*) waiting_count from public.recruits r where r.system_pgs_status = '1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t2 as (select count(*) filter(where gender='MALE') male_count from public.recruits r where r.system_pgs_status = '1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t3 as (select count(*) filter(where gender='FEMALE') female_count from public.recruits r where r.system_pgs_status = '1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
))
select t1.waiting_count, t2.male_count, t3.female_count, '${REG_ID}' as recruitment_id,
0 as mobilization_criterion, 0 as volunteer_criterion, 0 as contract_criterion, 0 as mobilization_criterion_percent, 0 as volunteer_criterion_percent, 0 as contract_criterion_percent
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1</sql>

View file

@ -449,6 +449,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1050,41 +1054,76 @@ JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code ='3' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code ='3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t2 as (select count(distinct subpoena.id) as appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code in ('4.1','4.2') and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code in ('4.1','4.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t3 as (select count(distinct subpoena.id) as not_appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code ='5' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code ='5'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t4 as (select count(*) as not_ap_good_reason FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code='5.1' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code='5.1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t5 as (select count(distinct subpoena.id) as ap_not_required FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code in ('3.8','5.2') and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code in ('3.8','5.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t6 as (select count(distinct rdi.id) as restrictions_applied from restriction_document_item rdi
join restriction_document on restriction_document.id = rdi.restriction_document_create_id
join subpoena on subpoena.id = restriction_document.subpoena_id
join subpoena_reason on subpoena_reason.id = subpoena.reason_id
where rdi.restriction_document_cancel_id is null and subpoena_reason.type = '3' and subpoena.department_id = any('${VK_ARRAY}')),
where rdi.restriction_document_cancel_id is null and subpoena_reason.type = '3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t7 as (select count(distinct rdi.id) as introduced_measures from restriction_document_item rdi
join restriction_document on restriction_document.id = rdi.restriction_document_create_id
join subpoena on subpoena.id = restriction_document.subpoena_id
join subpoena_reason on subpoena_reason.id = subpoena.reason_id
where rdi.restriction_document_cancel_id is null and rdi.applied_date is not null and subpoena_reason.type = '3' and subpoena.department_id = any('${VK_ARRAY}'))
where rdi.restriction_document_cancel_id is null and rdi.applied_date is not null and subpoena_reason.type = '3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
))
select t1.subpoena, t2.appeared, t3.not_appeared, t4.not_ap_good_reason, t5.ap_not_required, t6.restrictions_applied, t7.introduced_measures, 1 as mil_reg, '${REG_ID}' as recruitment_id, 1 as org,
0 as appeared_percent, 0 as not_appeared_percent, 0 as not_ap_good_reason_percent, 0 as ap_not_required_percent, 0 as restrictions_applied_percent, 0 as introduced_measures_percent, 0 as rest, 'Весна' as spring_autumn
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1 full outer join t4 on 1 = 1 full outer join t5 on 1 = 1 full outer join t6 on 1 = 1 full outer join t7 on 1 = 1
@ -1126,41 +1165,76 @@ JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code ='3' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code ='3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t2 as (select count(distinct subpoena.id) as appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code in ('4.1','4.2') and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code in ('4.1','4.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t3 as (select count(distinct subpoena.id) as not_appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code ='5' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code ='5'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t4 as (select count(*) as not_ap_good_reason FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code='5.1' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code='5.1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t5 as (select count(distinct subpoena.id) as ap_not_required FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='3' and sub_stat_hist.code in ('3.8','5.2') and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='3' and sub_stat_hist.code in ('3.8','5.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t6 as (select count(distinct rdi.id) as restrictions_applied from restriction_document_item rdi
join restriction_document on restriction_document.id = rdi.restriction_document_create_id
join subpoena on subpoena.id = restriction_document.subpoena_id
join subpoena_reason on subpoena_reason.id = subpoena.reason_id
where rdi.restriction_document_cancel_id is null and subpoena_reason.type = '3' and subpoena.department_id = any('${VK_ARRAY}')),
where rdi.restriction_document_cancel_id is null and subpoena_reason.type = '3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)),
t7 as (select count(distinct rdi.id) as introduced_measures from restriction_document_item rdi
join restriction_document on restriction_document.id = rdi.restriction_document_create_id
join subpoena on subpoena.id = restriction_document.subpoena_id
join subpoena_reason on subpoena_reason.id = subpoena.reason_id
where rdi.restriction_document_cancel_id is null and rdi.applied_date is not null and subpoena_reason.type = '3' and subpoena.department_id = any('${VK_ARRAY}'))
where rdi.restriction_document_cancel_id is null and rdi.applied_date is not null and subpoena_reason.type = '3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
))
select t1.subpoena, t2.appeared, t3.not_appeared, t4.not_ap_good_reason, t5.ap_not_required, t6.restrictions_applied, t7.introduced_measures, 1 as mil_reg, '${REG_ID}' as recruitment_id, 1 as org,
0 as appeared_percent, 0 as not_appeared_percent, 0 as not_ap_good_reason_percent, 0 as ap_not_required_percent, 0 as restrictions_applied_percent, 0 as introduced_measures_percent, 0 as rest, 'Осень' as spring_autumn
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1 full outer join t4 on 1 = 1 full outer join t5 on 1 = 1 full outer join t6 on 1 = 1 full outer join t7 on 1 = 1

View file

@ -449,6 +449,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -532,21 +536,21 @@
</partitioning>
<connection>ervu-dashboard</connection>
<sql>WITH
t1 AS (SELECT ARRAY_AGG(t.idm_id) AS RECRUITMENT48_ID FROM space.testrecruitment AS t WHERE t.code = '12'),
t2 AS (SELECT ARRAY_AGG(t.idm_id) AS RECRUITMENT62_ID FROM space.testrecruitment AS t WHERE t.code = '62'),
t3 AS (SELECT ARRAY_AGG(t.idm_id) AS RECRUITMENT65_ID FROM space.testrecruitment AS t WHERE t.code = '65')
t1 AS (SELECT ARRAY_AGG(t.idm_id) AS RECRUITMENT48_ID FROM ervu_dashboard.recruitment AS t WHERE t.code = '12'),
t2 AS (SELECT ARRAY_AGG(t.idm_id) AS RECRUITMENT62_ID FROM ervu_dashboard.recruitment AS t WHERE t.code = '62'),
t3 AS (SELECT ARRAY_AGG(t.idm_id) AS RECRUITMENT65_ID FROM ervu_dashboard.recruitment AS t WHERE t.code = '65')
SELECT
COALESCE(t1.RECRUITMENT48_ID, ARRAY['00']) AS VK_ARRAY_ID,
t1.RECRUITMENT48_ID AS VK_ARRAY_ID,
'12' AS RECRUITMENT_REG_ID
FROM t1
UNION ALL
SELECT
COALESCE(t2.RECRUITMENT62_ID, ARRAY['00']),
t2.RECRUITMENT62_ID,
'62'
FROM t2
UNION ALL
SELECT
COALESCE(t3.RECRUITMENT65_ID, ARRAY['00']),
t3.RECRUITMENT65_ID,
'65'
FROM t3;</sql>
<limit>10</limit>
@ -563,7 +567,7 @@ FROM t3;</sql>
</output>
</remotesteps>
<GUI>
<xloc>352</xloc>
<xloc>336</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1352,7 +1356,12 @@
SELECT COUNT(*) AS total
FROM public.recruits r
join public.recruits_info ri on ri.recruit_id=r.id
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
age_counts AS (
SELECT
@ -1366,7 +1375,12 @@ age_counts AS (
COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) >= 51) AS "51+_year_count"
FROM public.recruits r
join public.recruits_info ri on ri.recruit_id=r.id
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
)
SELECT
age_counts."17_year_count",
@ -1433,7 +1447,12 @@ FROM age_counts, total_count;</sql>
SELECT COUNT(*) AS total
FROM public.recruits r
join public.recruits_info ri on ri.recruit_id=r.id
WHERE r.gender = 'FEMALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.gender = 'FEMALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
age_counts AS (
SELECT
@ -1447,7 +1466,12 @@ age_counts AS (
COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) >= 51) AS "51+_year_count"
FROM public.recruits r
join public.recruits_info ri on ri.recruit_id=r.id
WHERE r.gender = 'FEMALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.gender = 'FEMALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
)
SELECT
age_counts."17_year_count",
@ -1514,7 +1538,12 @@ FROM age_counts, total_count;</sql>
SELECT COUNT(*) AS total
FROM public.recruits r
join public.recruits_info ri on ri.recruit_id=r.id
WHERE r.gender = 'MALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.gender = 'MALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
age_counts AS (
SELECT
@ -1528,7 +1557,12 @@ age_counts AS (
COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) >= 51) AS "51+_year_count"
FROM public.recruits r
join public.recruits_info ri on ri.recruit_id=r.id
WHERE r.gender = 'MALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.gender = 'MALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
)
SELECT
age_counts."17_year_count",
@ -1556,7 +1590,7 @@ SELECT
ROUND((age_counts."51+_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "51+_year_percent",
'${REG_ID}' as recruitment_id,
'М' as gender,
'M' as gender,
'true' as registered
FROM age_counts, total_count;</sql>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1266,7 +1270,12 @@ WITH status_info AS (
info->'svedTrud'->>'prOtsSvedTrud' = '1' AS no_info_work
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info -> 'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null and r.target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info -> 'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
summary AS (
SELECT
@ -1392,7 +1401,12 @@ WITH status_info AS (
info->'svedTrud'->>'prOtsSvedTrud' = '1' AS no_info_work
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info -> 'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null and r.target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info -> 'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND gender = 'FEMALE'
),
summary AS (
@ -1519,7 +1533,12 @@ WITH status_info AS (
info->'svedTrud'->>'prOtsSvedTrud' = '1' AS no_info_work
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info -> 'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null and r.target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info -> 'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND gender = 'MALE'
),
summary AS (

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1253,7 +1257,11 @@
WHERE
jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array'
AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND r.target_recruitment_id = any('${VK_ARRAY}')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'FEMALE'
),
children_birth_dates AS (
@ -1287,7 +1295,11 @@ final_counts AS (
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE
r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND r.target_recruitment_id = any('${VK_ARRAY}')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'FEMALE'
GROUP BY
COALESCE(children_under_18, 0)
@ -1300,7 +1312,11 @@ total_men AS (
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE
r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND r.target_recruitment_id = any('${VK_ARRAY}')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'FEMALE'
)
SELECT
@ -1359,7 +1375,11 @@ FROM
WHERE
jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array'
AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND r.target_recruitment_id = any('${VK_ARRAY}')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'MALE'
),
children_birth_dates AS (
@ -1393,7 +1413,11 @@ final_counts AS (
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE
r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND r.target_recruitment_id = any('${VK_ARRAY}')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'MALE'
GROUP BY
COALESCE(children_under_18, 0)
@ -1406,7 +1430,11 @@ total_men AS (
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE
r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND r.target_recruitment_id = any('${VK_ARRAY}')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'MALE'
)
SELECT
@ -1464,7 +1492,12 @@ FROM
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE
jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array'
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and r.target_recruitment_id = any('${VK_ARRAY}')
AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
children_birth_dates AS (
SELECT
@ -1495,7 +1528,12 @@ final_counts AS (
LEFT JOIN
children_count cc ON ri.recruit_id = cc.recruit_id
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' and r.target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
GROUP BY
COALESCE(children_under_18, 0)
),

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1269,7 +1273,12 @@
jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "E")') AS has_E
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
where r.vu_current_info -> 'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
aggregated AS (
SELECT
@ -1334,7 +1343,13 @@ FROM aggregated;</sql>
jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "E")') AS has_E
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') and r.gender = 'FEMALE'
where r.vu_current_info -> 'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'FEMALE'
),
aggregated AS (
SELECT
@ -1399,7 +1414,13 @@ FROM aggregated;</sql>
jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "E")') AS has_E
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') and r.gender = 'MALE'
where r.vu_current_info -> 'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR r.target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'MALE'
),
aggregated AS (
SELECT

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1232,7 +1236,12 @@
SELECT COUNT(*) AS total
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
education_status AS (
SELECT
@ -1242,7 +1251,7 @@ education_status AS (
EXISTS (
SELECT 1
FROM jsonb_array_elements(ri.info->'svedRObr'->'robr') AS education
WHERE jsonb_typeof(ri.info-&gt;'svedRObr'->'robr') = 'array'
WHERE jsonb_typeof(ri.info->'svedRObr'->'robr') = 'array'
AND education->>'kodUrObr' IN ('1', '2', '3', '4', '5')
) OR EXISTS (
SELECT 1
@ -1282,7 +1291,12 @@ education_status AS (
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
final_counts AS (
SELECT
@ -1340,7 +1354,12 @@ FROM final_counts, total_count;</sql>
SELECT COUNT(*) AS total
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' AND r.gender = 'FEMALE' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' AND r.gender = 'FEMALE'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
education_status AS (
SELECT
@ -1388,7 +1407,12 @@ education_status AS (
(ri.info->'svedRObr'->>'prOtsRObr' = '1' OR ri.info->'svedInObr'->>'prOtsInObr' = '1') AS has_no_data
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' AND r.gender = 'FEMALE' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' AND r.gender = 'FEMALE'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
final_counts AS (
SELECT
@ -1446,7 +1470,12 @@ FROM final_counts, total_count;</sql>
SELECT COUNT(*) AS total
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' AND r.gender = 'MALE' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' AND r.gender = 'MALE'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
education_status AS (
SELECT
@ -1494,7 +1523,12 @@ education_status AS (
(ri.info->'svedRObr'->>'prOtsRObr' = '1' OR ri.info->'svedInObr'->>'prOtsInObr' = '1') AS has_no_data
FROM public.recruits_info ri
JOIN public.recruits r ON ri.recruit_id = r.id
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' AND r.gender = 'MALE' and target_recruitment_id = any('${VK_ARRAY}')
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' AND r.gender = 'MALE'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
final_counts AS (
SELECT

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1209,7 +1213,12 @@ JOIN
public.recruits_info ri ON ri.recruit_id = r.id
WHERE
r.current_recruitment_id IS NOT NULL
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')</sql>
AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
@ -1282,7 +1291,12 @@ JOIN
public.recruits_info ri ON ri.recruit_id = r.id
WHERE
r.current_recruitment_id IS NOT NULL
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'FEMALE';
</sql>
<limit>0</limit>
@ -1357,7 +1371,12 @@ JOIN
public.recruits_info ri ON ri.recruit_id = r.id
WHERE
r.current_recruitment_id IS NOT NULL
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}')
AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
AND r.gender = 'MALE';
</sql>
<limit>0</limit>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -801,20 +805,43 @@
<schema_name/>
</partitioning>
<connection>postgres.person_registry</connection>
<sql>with
t1 as (select count(*) as first_reg_17
from recruits r
where r.system_pgs_status = '1'
and birth_date>= '2007-01-01' and target_recruitment_id = any('${VK_ARRAY}')),
t2 as (select count(*) as first_reg_18
from recruits r
where r.system_pgs_status = '1'
and birth_date&lt; '2007-01-01' and target_recruitment_id = any('${VK_ARRAY}')),
t3 as (select count(*) mil_spec_w
from recruits r
where r.system_pgs_status = '1'
and r.birth_date>= '2007-01-01'
and r.gender = 'FEMALE' and target_recruitment_id = any('${VK_ARRAY}'))
<sql>WITH
t1 AS (
SELECT COUNT(*) AS first_reg_17
FROM recruits r
WHERE r.system_pgs_status = '1'
AND AGE(CURRENT_DATE, r.birth_date) &lt; INTERVAL '18 years'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t2 AS (
-- Первоначальная постановка совершеннолетние
SELECT COUNT(*) AS first_reg_18
FROM recruits r
WHERE r.system_pgs_status = '1'
AND AGE(CURRENT_DATE, r.birth_date) >= INTERVAL '18 years'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t3 AS (
-- Совершеннолетние женщины с ВУС
SELECT COUNT(*) AS mil_spec_w
FROM recruits r
WHERE r.system_pgs_status = '1'
AND AGE(CURRENT_DATE, r.birth_date) >= INTERVAL '18 years'
AND r.gender = 'FEMALE'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
)
select t1.first_reg_17, t2.first_reg_18, t3.mil_spec_w, '${REG_ID}' as recruitment_id, 0 as returned_dep_liberty, 0 as punished, 0 as received_citizenship, 0 as first_reg_17_percent,
0 as first_reg_18_percent, 0 as returned_dep_liberty_percent, 0 as mil_spec_W_percent, 0 as punished_percent, 0 as received_citizenship_percent, 1 as mil_reg, 1 as org
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1</sql>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -994,11 +998,23 @@
(select count(*) as age_limit
from public.decision d --(БД решений)
inner join public.decision_type dt on dt.id = d.type_id and dt.code = '9'
where d.extra_info -> 'cause' = '"ageLimit"' and d.recruitment_id = any('${VK_ARRAY}')) ,
where d.extra_info -> 'cause' = '"ageLimit"'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR d.recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
) ,
t2 as (select count(*) as death
from public.decision d --(БД решений)
inner join public.decision_type dt on dt.id = d.type_id and dt.code = '9'
where d.extra_info -> 'cause' = '"notAlive"' and d.recruitment_id = any('${VK_ARRAY}'))
where d.extra_info -> 'cause' = '"notAlive"'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR d.recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
)
select t1.age_limit, t2.death, 1 as org, '${REG_ID}' as recruitment_id, 0 as deprivation_citizenship, 0 as travel_abroad, 0 as living_abroad, 0 as other,
0 as deprivation_citizen_percents, 0 as age_limit_percent, 0 as death_percent, 0 as travel_abroad_percent, 0 as living_abroad_percent, 0 as other_percent
from t1 full outer join t2 on 1 = 1
@ -1036,7 +1052,12 @@ from t1 full outer join t2 on 1 = 1
<connection>postgres.person_registry</connection>
<sql>select count(*) as removed_registry, 1 org
from recruits r
where r.system_pgs_status = '1.3' and target_recruitment_id = any('${VK_ARRAY}')</sql>
where r.system_pgs_status = '1.3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR target_recruitment_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>

View file

@ -462,6 +462,10 @@
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute>
<code>EXTRA_OPTION_POSTGRESQL.stringtype</code>
<attribute>unspecified</attribute>
</attribute>
<attribute>
<code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
<attribute>N</attribute>
@ -1103,55 +1107,115 @@ JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='1' and sub_stat_hist.code ='3' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='1' and sub_stat_hist.code ='3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t2 as (select round(avg(extract(day from subpoena_history.date_time::timestamp - (subpoena.send_date::timestamptz AT time zone 'UTC')::timestamp)), 1) as average_appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where subpoena_reason.type = '1' and (sub_stat_hist.code = '4.1' or sub_stat_hist.code = '4.2') and subpoena.department_id = any('${VK_ARRAY}')),
where subpoena_reason.type = '1' and (sub_stat_hist.code = '4.1' or sub_stat_hist.code = '4.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t3 as (select count(distinct subpoena.id) as appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='1' and sub_stat_hist.code in ('4.1','4.2') and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='1' and sub_stat_hist.code in ('4.1','4.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t4 as (select count(distinct subpoena.id) as not_appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='1' and sub_stat_hist.code ='5' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='1' and sub_stat_hist.code ='5'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t5 as (select count(*) as not_ap_good_reason FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='1' and sub_stat_hist.code='5.1' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='1' and sub_stat_hist.code='5.1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t6 as (select count(distinct subpoena.id) as ap_not_required FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type='1' and sub_stat_hist.code in ('3.8','5.2') and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type='1' and sub_stat_hist.code in ('3.8','5.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t7 as (select count(distinct rdi.id) as restrictions_applied from restriction_document_item rdi
join restriction_document on restriction_document.id = rdi.restriction_document_create_id
join subpoena on subpoena.id = restriction_document.subpoena_id
join subpoena_reason on subpoena_reason.id = subpoena.reason_id
where rdi.restriction_document_cancel_id is null and subpoena_reason.type = '1' and subpoena.department_id = any('${VK_ARRAY}')),
where rdi.restriction_document_cancel_id is null and subpoena_reason.type = '1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t8 as (select count(distinct rdi.id) as introduced_measures from restriction_document_item rdi
join restriction_document on restriction_document.id = rdi.restriction_document_create_id
join subpoena on subpoena.id = restriction_document.subpoena_id
join subpoena_reason on subpoena_reason.id = subpoena.reason_id
where rdi.restriction_document_cancel_id is null and rdi.applied_date is not null and subpoena_reason.type = '1' and subpoena.department_id = any('${VK_ARRAY}')),
where rdi.restriction_document_cancel_id is null and rdi.applied_date is not null and subpoena_reason.type = '1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t9 as (select count(distinct subpoena.id) as paper FROM subpoena
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
join subpoena_send_info on subpoena_send_info.subpoena_id = subpoena.id
where subpoena_reason.type = '1' and subpoena_send_info.delivery_code = '14' and subpoena.department_id = any('${VK_ARRAY}')),
where subpoena_reason.type = '1' and subpoena_send_info.delivery_code = '14'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t10 as (select count(distinct subpoena.id) as electron FROM subpoena
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
join subpoena_send_info on subpoena_send_info.subpoena_id = subpoena.id
where subpoena_reason.type = '1' and subpoena_send_info.delivery_code = '7' and subpoena.department_id = any('${VK_ARRAY}'))
where subpoena_reason.type = '1' and subpoena_send_info.delivery_code = '7'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
)
select t1.subpoena, t2.average_appeared, t3.appeared, t4.not_appeared, t5.not_ap_good_reason, t6.ap_not_required, t7.restrictions_applied, t8.introduced_measures, t9.paper, t10.electron, '${REG_ID}' as recruitment_id, 1 as org, 0 as mil_reg,
0 as appeared_percent, 0 as not_appeared_percent, 0 as not_ap_good_reason_percent, 0 as ap_not_required_percent, 0 as electron_percent, 0 as paper_percent, 0 as restrictions_applied_percent, 0 as introduced_measures_percent
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1 full outer join t4 on 1 = 1 full outer join t5 on 1 = 1 full outer join t6 on 1 = 1 full outer join t7 on 1 = 1 full outer join t8 on 1 = 1 full outer join t9 on 1 = 1 full outer join t10 on 1 = 1
@ -1193,55 +1257,115 @@ JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type !='1' and sub_stat_hist.code ='3' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type !='1' and sub_stat_hist.code ='3'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t2 as (select round(avg(extract(day from subpoena_history.date_time::timestamp - (subpoena.send_date::timestamptz AT time zone 'UTC')::timestamp)), 1) as average_appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where subpoena_reason.type != '1' and (sub_stat_hist.code = '4.1' or sub_stat_hist.code = '4.2') and subpoena.department_id = any('${VK_ARRAY}')),
where subpoena_reason.type != '1' and (sub_stat_hist.code = '4.1' or sub_stat_hist.code = '4.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t3 as (select count(distinct subpoena.id) as appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type !='1' and sub_stat_hist.code in ('4.1','4.2') and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type !='1' and sub_stat_hist.code in ('4.1','4.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t4 as (select count(distinct subpoena.id) as not_appeared FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type !='1' and sub_stat_hist.code ='5' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type !='1' and sub_stat_hist.code ='5'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t5 as (select count(*) as not_ap_good_reason FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type !='1' and sub_stat_hist.code='5.1' and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type !='1' and sub_stat_hist.code='5.1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t6 as (select count(distinct subpoena.id) as ap_not_required FROM subpoena
JOIN subpoena_history ON subpoena_history.subpoena_id = subpoena.id
JOIN subpoena_status AS sub_status ON sub_status.id = subpoena.status_id
JOIN subpoena_status AS sub_stat_hist ON sub_stat_hist.id = subpoena_history.status_id
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
where not subpoena_reason.type !='1' and sub_stat_hist.code in ('3.8','5.2') and subpoena.department_id = any('${VK_ARRAY}')),
where not subpoena_reason.type !='1' and sub_stat_hist.code in ('3.8','5.2')
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t7 as (select count(distinct rdi.id) as restrictions_applied from restriction_document_item rdi
join restriction_document on restriction_document.id = rdi.restriction_document_create_id
join subpoena on subpoena.id = restriction_document.subpoena_id
join subpoena_reason on subpoena_reason.id = subpoena.reason_id
where rdi.restriction_document_cancel_id is null and subpoena_reason.type != '1' and subpoena.department_id = any('${VK_ARRAY}')),
where rdi.restriction_document_cancel_id is null and subpoena_reason.type != '1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t8 as (select count(distinct rdi.id) as introduced_measures from restriction_document_item rdi
join restriction_document on restriction_document.id = rdi.restriction_document_create_id
join subpoena on subpoena.id = restriction_document.subpoena_id
join subpoena_reason on subpoena_reason.id = subpoena.reason_id
where rdi.restriction_document_cancel_id is null and rdi.applied_date is not null and subpoena_reason.type != '1' and subpoena.department_id = any('${VK_ARRAY}')),
where rdi.restriction_document_cancel_id is null and rdi.applied_date is not null and subpoena_reason.type != '1'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t9 as (select count(distinct subpoena.id) as paper FROM subpoena
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
join subpoena_send_info on subpoena_send_info.subpoena_id = subpoena.id
where subpoena_reason.type != '1' and subpoena_send_info.delivery_code = '14' and subpoena.department_id = any('${VK_ARRAY}')),
where subpoena_reason.type != '1' and subpoena_send_info.delivery_code = '14'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
),
t10 as (select count(distinct subpoena.id) as electron FROM subpoena
JOIN subpoena_reason ON subpoena_reason.id = subpoena.reason_id
join subpoena_send_info on subpoena_send_info.subpoena_id = subpoena.id
where subpoena_reason.type != '1' and subpoena_send_info.delivery_code = '7' and subpoena.department_id = any('${VK_ARRAY}'))
where subpoena_reason.type != '1' and subpoena_send_info.delivery_code = '7'
AND (
'${VK_ARRAY}' IS NULL
OR '${VK_ARRAY}' = '{}'
OR subpoena.department_id = ANY (string_to_array(NULLIF('${VK_ARRAY}', ''), ',')::uuid[])
)
)
select t1.subpoena, t2.average_appeared, t3.appeared, t4.not_appeared, t5.not_ap_good_reason, t6.ap_not_required, t7.restrictions_applied, t8.introduced_measures, t9.paper, t10.electron, '${REG_ID}' as recruitment_id, 1 as org, 1 as mil_reg,
0 as appeared_percent, 0 as not_appeared_percent, 0 as not_ap_good_reason_percent, 0 as ap_not_required_percent, 0 as electron_percent, 0 as paper_percent, 0 as restrictions_applied_percent, 0 as introduced_measures_percent
from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1 full outer join t4 on 1 = 1 full outer join t5 on 1 = 1 full outer join t6 on 1 = 1 full outer join t7 on 1 = 1 full outer join t8 on 1 = 1 full outer join t9 on 1 = 1 full outer join t10 on 1 = 1</sql>