+info_recruits

This commit is contained in:
Ruslan 2024-09-06 16:26:47 +03:00
parent 5a93e2bf48
commit ff00a27b65
19 changed files with 10329 additions and 395 deletions

View file

@ -76,9 +76,9 @@
<slaveservers>
</slaveservers>
<job-log-table>
<connection/>
<schema/>
<table/>
<connection>ervu-dashboard</connection>
<schema>public</schema>
<table>job_log</table>
<size_limit_lines/>
<interval/>
<timeout_days/>
@ -414,8 +414,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>112</yloc>
<xloc>976</xloc>
<yloc>16</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -464,8 +464,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>112</yloc>
<xloc>1184</xloc>
<yloc>16</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -512,8 +512,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>176</yloc>
<xloc>976</xloc>
<yloc>80</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -524,8 +524,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>176</yloc>
<xloc>1184</xloc>
<yloc>80</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -572,8 +572,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>240</yloc>
<xloc>976</xloc>
<yloc>144</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -584,8 +584,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>240</yloc>
<xloc>1184</xloc>
<yloc>144</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -632,8 +632,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>304</yloc>
<xloc>976</xloc>
<yloc>208</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -644,8 +644,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>304</yloc>
<xloc>1184</xloc>
<yloc>208</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -692,8 +692,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>368</yloc>
<xloc>976</xloc>
<yloc>272</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -704,8 +704,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>368</yloc>
<xloc>1184</xloc>
<yloc>272</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -752,8 +752,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>432</yloc>
<xloc>976</xloc>
<yloc>336</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -764,8 +764,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>432</yloc>
<xloc>1184</xloc>
<yloc>336</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -812,8 +812,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>496</yloc>
<xloc>976</xloc>
<yloc>400</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -824,8 +824,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>496</yloc>
<xloc>1184</xloc>
<yloc>400</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -872,8 +872,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>560</yloc>
<xloc>976</xloc>
<yloc>464</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -884,8 +884,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>560</yloc>
<xloc>1184</xloc>
<yloc>464</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -902,8 +902,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>112</yloc>
<xloc>752</xloc>
<yloc>16</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -920,8 +920,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>176</yloc>
<xloc>752</xloc>
<yloc>80</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -938,8 +938,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>240</yloc>
<xloc>752</xloc>
<yloc>144</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -956,8 +956,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>304</yloc>
<xloc>752</xloc>
<yloc>208</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -974,8 +974,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>368</yloc>
<xloc>752</xloc>
<yloc>272</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -992,8 +992,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>432</yloc>
<xloc>752</xloc>
<yloc>336</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1010,8 +1010,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>496</yloc>
<xloc>752</xloc>
<yloc>400</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1028,8 +1028,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>560</yloc>
<xloc>752</xloc>
<yloc>464</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1039,7 +1039,7 @@
<attributes/>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>${Internal.Entry.Current.Directory}/total_registered.driver_license(reg) .ktr</filename>
<filename>${Internal.Entry.Current.Directory}/total_registered.driver_license(reg).ktr</filename>
<transname/>
<arg_from_previous>N</arg_from_previous>
<params_from_previous>Y</params_from_previous>
@ -1076,8 +1076,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>640</yloc>
<xloc>976</xloc>
<yloc>544</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1088,8 +1088,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>640</yloc>
<xloc>1184</xloc>
<yloc>544</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1106,8 +1106,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>640</yloc>
<xloc>752</xloc>
<yloc>544</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1154,8 +1154,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>736</yloc>
<xloc>976</xloc>
<yloc>608</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1166,12 +1166,12 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>736</yloc>
<xloc>1184</xloc>
<yloc>608</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>SQL.totreg.chmi 2</name>
<name>SQL.totreg.chmi</name>
<description/>
<type>SQL</type>
<attributes/>
@ -1184,8 +1184,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>736</yloc>
<xloc>752</xloc>
<yloc>608</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1232,8 +1232,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>880</xloc>
<yloc>816</yloc>
<xloc>976</xloc>
<yloc>688</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1244,8 +1244,8 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1088</xloc>
<yloc>816</yloc>
<xloc>1184</xloc>
<yloc>688</yloc>
<attributes_kjc/>
</entry>
<entry>
@ -1262,8 +1262,242 @@
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>656</xloc>
<yloc>816</yloc>
<xloc>752</xloc>
<yloc>688</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>total_registered.marital_status(reg)</name>
<description/>
<type>TRANS</type>
<attributes/>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>${Internal.Entry.Current.Directory}/total_registered.marital_status(reg).ktr</filename>
<transname/>
<arg_from_previous>N</arg_from_previous>
<params_from_previous>Y</params_from_previous>
<exec_per_row>Y</exec_per_row>
<clear_rows>N</clear_rows>
<clear_files>N</clear_files>
<set_logfile>N</set_logfile>
<logfile/>
<logext/>
<add_date>N</add_date>
<add_time>N</add_time>
<loglevel>Basic</loglevel>
<cluster>N</cluster>
<slave_server_name/>
<set_append_logfile>N</set_append_logfile>
<wait_until_finished>Y</wait_until_finished>
<follow_abort_remote>N</follow_abort_remote>
<create_parent_folder>N</create_parent_folder>
<logging_remote_work>N</logging_remote_work>
<run_configuration>Pentaho local</run_configuration>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
<parameter>
<name>VK_ARRAY</name>
<stream_name>VK_ARRAY_ID</stream_name>
<value/>
</parameter>
<parameter>
<name>REG_ID</name>
<stream_name>RECRUITMENT_REG_ID</stream_name>
<value/>
</parameter>
</parameters>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>976</xloc>
<yloc>768</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>Success 13</name>
<description/>
<type>SUCCESS</type>
<attributes/>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1184</xloc>
<yloc>768</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>SQL.totreg.marstat</name>
<description/>
<type>SQL</type>
<attributes/>
<sql>DELETE FROM total_registered.marital_status where recruitment_id in ('48', '62', '65') and recording_date = current_date</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>752</xloc>
<yloc>768</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>total_registered.education_level(reg)</name>
<description/>
<type>TRANS</type>
<attributes/>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>${Internal.Entry.Current.Directory}/total_registered.education_level(reg).ktr</filename>
<transname/>
<arg_from_previous>N</arg_from_previous>
<params_from_previous>Y</params_from_previous>
<exec_per_row>Y</exec_per_row>
<clear_rows>N</clear_rows>
<clear_files>N</clear_files>
<set_logfile>N</set_logfile>
<logfile/>
<logext/>
<add_date>N</add_date>
<add_time>N</add_time>
<loglevel>Basic</loglevel>
<cluster>N</cluster>
<slave_server_name/>
<set_append_logfile>N</set_append_logfile>
<wait_until_finished>Y</wait_until_finished>
<follow_abort_remote>N</follow_abort_remote>
<create_parent_folder>N</create_parent_folder>
<logging_remote_work>N</logging_remote_work>
<run_configuration>Pentaho local</run_configuration>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
<parameter>
<name>VK_ARRAY</name>
<stream_name>VK_ARRAY_ID</stream_name>
<value/>
</parameter>
<parameter>
<name>REG_ID</name>
<stream_name>RECRUITMENT_REG_ID</stream_name>
<value/>
</parameter>
</parameters>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>976</xloc>
<yloc>848</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>Success 14</name>
<description/>
<type>SUCCESS</type>
<attributes/>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1184</xloc>
<yloc>848</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>SQL.totreg.edulev</name>
<description/>
<type>SQL</type>
<attributes/>
<sql>DELETE FROM total_registered.education_level where recruitment_id in ('48', '62', '65') and recording_date = current_date</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>752</xloc>
<yloc>848</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>total_registered.busyness(reg)</name>
<description/>
<type>TRANS</type>
<attributes/>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>${Internal.Entry.Current.Directory}/total_registered.busyness(reg).ktr</filename>
<transname/>
<arg_from_previous>N</arg_from_previous>
<params_from_previous>Y</params_from_previous>
<exec_per_row>Y</exec_per_row>
<clear_rows>N</clear_rows>
<clear_files>N</clear_files>
<set_logfile>N</set_logfile>
<logfile/>
<logext/>
<add_date>N</add_date>
<add_time>N</add_time>
<loglevel>Basic</loglevel>
<cluster>N</cluster>
<slave_server_name/>
<set_append_logfile>N</set_append_logfile>
<wait_until_finished>Y</wait_until_finished>
<follow_abort_remote>N</follow_abort_remote>
<create_parent_folder>N</create_parent_folder>
<logging_remote_work>N</logging_remote_work>
<run_configuration>Pentaho local</run_configuration>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
<parameter>
<name>VK_ARRAY</name>
<stream_name>VK_ARRAY_ID</stream_name>
<value/>
</parameter>
<parameter>
<name>REG_ID</name>
<stream_name>RECRUITMENT_REG_ID</stream_name>
<value/>
</parameter>
</parameters>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>976</xloc>
<yloc>928</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>Success 15</name>
<description/>
<type>SUCCESS</type>
<attributes/>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>1184</xloc>
<yloc>928</yloc>
<attributes_kjc/>
</entry>
<entry>
<name>SQL.totreg.busyn</name>
<description/>
<type>SQL</type>
<attributes/>
<sql>DELETE FROM total_registered.busyness where recruitment_id in ('48', '62', '65') and recording_date = current_date</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>752</xloc>
<yloc>928</yloc>
<attributes_kjc/>
</entry>
</entries>
@ -1498,7 +1732,7 @@
<to>SQL.totreg.drlic</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>N</enabled>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
@ -1507,7 +1741,7 @@
<to>total_registered.driver_license(reg)</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>N</enabled>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
@ -1516,25 +1750,25 @@
<to>Success 10</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>N</enabled>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>select_recruitments_region(reg)</from>
<to>SQL.totreg.chmi 2</to>
<to>SQL.totreg.chmi</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>N</enabled>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>SQL.totreg.chmi 2</from>
<from>SQL.totreg.chmi</from>
<to>total_registered.child_minor(reg)</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>N</enabled>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
@ -1543,7 +1777,7 @@
<to>Success 11</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>N</enabled>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
@ -1552,7 +1786,7 @@
<to>SQL.totreg.age</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>N</enabled>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
@ -1561,7 +1795,7 @@
<to>total_registered.age(reg)</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>N</enabled>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
@ -1570,7 +1804,88 @@
<to>Success 12</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>N</enabled>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>SQL.totreg.marstat</from>
<to>total_registered.marital_status(reg)</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>total_registered.marital_status(reg)</from>
<to>Success 13</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>select_recruitments_region(reg)</from>
<to>SQL.totreg.marstat</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>SQL.totreg.edulev</from>
<to>total_registered.education_level(reg)</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>total_registered.education_level(reg)</from>
<to>Success 14</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>select_recruitments_region(reg)</from>
<to>SQL.totreg.edulev</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>SQL.totreg.busyn</from>
<to>total_registered.busyness(reg)</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>total_registered.busyness(reg)</from>
<to>Success 15</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>select_recruitments_region(reg)</from>
<to>SQL.totreg.busyn</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>

File diff suppressed because it is too large Load diff

View file

@ -577,11 +577,6 @@
<to>Insert / update (total_registered.child_minor) 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input (person_registry)регион/мужчины</from>
<to>Get variables 4 2 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Get variables 4 2 2 2</from>
<to>Select values 4 2 2 2</to>
@ -593,7 +588,12 @@
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input (person_registry)регион/женщины</from>
<from>Table input (person_registry)РФ/мужчины</from>
<to>Get variables 4 2 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input (person_registry)РФ/женщины</from>
<to>Get variables 4 2 2 2</to>
<enabled>Y</enabled>
</hop>
@ -1232,7 +1232,7 @@
</GUI>
</step>
<step>
<name>Table input (person_registry)регион/все</name>
<name>Table input (person_registry)РФ/женщины</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
@ -1253,7 +1253,218 @@
WHERE
jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array'
AND r.vu_current_info->>'isMilitaryRegistered' = 'true'
AND target_recruitment_id = any('${VK_ARRAY}')
AND r.target_recruitment_id = any('${VK_ARRAY}')
AND r.gender = 'FEMALE'
),
children_birth_dates AS (
SELECT
recruit_id,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year
FROM
extracted_children
),
children_count AS (
SELECT
recruit_id,
COUNT(*) AS children_under_18
FROM
children_birth_dates
WHERE
make_date(year, month, day) > CURRENT_DATE - INTERVAL '18 years'
GROUP BY
recruit_id
),
final_counts AS (
SELECT
COALESCE(children_under_18, 0) AS children_count,
COUNT(*) AS num_people
FROM
public.recruits_info ri
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}')
AND r.gender = 'FEMALE'
GROUP BY
COALESCE(children_under_18, 0)
),
total_men AS (
SELECT
COUNT(*) AS total_men_count
FROM
public.recruits_info ri
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 r.gender = 'FEMALE'
)
SELECT
'W' AS gender,
'${REG_ID}' AS recruitment_id,
COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children,
COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child,
COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children,
COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children,
COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children,
ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS no_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS one_child_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS two_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS three_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS four_or_more_children_percent
FROM
final_counts;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>Y</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>256</xloc>
<yloc>288</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table input (person_registry)РФ/мужчины</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 extracted_children AS (
SELECT
ri.recruit_id,
jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child
FROM
public.recruits_info ri
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.gender = 'MALE'
),
children_birth_dates AS (
SELECT
recruit_id,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year
FROM
extracted_children
),
children_count AS (
SELECT
recruit_id,
COUNT(*) AS children_under_18
FROM
children_birth_dates
WHERE
make_date(year, month, day) > CURRENT_DATE - INTERVAL '18 years'
GROUP BY
recruit_id
),
final_counts AS (
SELECT
COALESCE(children_under_18, 0) AS children_count,
COUNT(*) AS num_people
FROM
public.recruits_info ri
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}')
AND r.gender = 'MALE'
GROUP BY
COALESCE(children_under_18, 0)
),
total_men AS (
SELECT
COUNT(*) AS total_men_count
FROM
public.recruits_info ri
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 r.gender = 'MALE'
)
SELECT
'M' AS gender,
'${REG_ID}' AS recruitment_id,
COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children,
COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child,
COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children,
COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children,
COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children,
ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS no_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS one_child_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS two_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS three_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_men_count FROM total_men), 0), 2) AS four_or_more_children_percent
FROM
final_counts;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>Y</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>256</xloc>
<yloc>192</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table input (person_registry)регион/все</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 extracted_children AS (
SELECT
ri.recruit_id,
jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child
FROM
public.recruits_info ri
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}')
),
children_birth_dates AS (
SELECT
@ -1283,6 +1494,8 @@ final_counts AS (
public.recruits_info ri
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}')
GROUP BY
COALESCE(children_under_18, 0)
),
@ -1324,194 +1537,6 @@ FROM
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table input (person_registry)регион/женщины</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 extracted_children AS (
SELECT
ri.recruit_id,
jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child
FROM
public.recruits_info ri
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.gender = 'FEMALE'
AND target_recruitment_id = any('${VK_ARRAY}')
),
children_birth_dates AS (
SELECT
recruit_id,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year
FROM
extracted_children
),
children_count AS (
SELECT
recruit_id,
COUNT(*) AS children_under_18
FROM
children_birth_dates
WHERE
AGE(make_date(year, month, day)) &lt; interval '18 years'
GROUP BY
recruit_id
),
final_counts AS (
SELECT
COALESCE(children_under_18, 0) AS children_count,
COUNT(*) AS num_people
FROM
public.recruits_info ri
LEFT JOIN
children_count cc ON ri.recruit_id = cc.recruit_id
GROUP BY
COALESCE(children_under_18, 0)
),
total_people AS (
SELECT SUM(num_people) AS total_count
FROM final_counts
)
SELECT
'W' AS gender,
'${REG_ID}' as recruitment_id,
COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children,
COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child,
COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children,
COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children,
COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children,
ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS no_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS one_child_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS two_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS three_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS four_or_more_children_percent
FROM
final_counts;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>Y</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>256</xloc>
<yloc>288</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table input (person_registry)регион/мужчины</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 extracted_children AS (
SELECT
ri.recruit_id,
jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child
FROM
public.recruits_info ri
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.gender = 'MALE'
AND target_recruitment_id = any('${VK_ARRAY}')
),
children_birth_dates AS (
SELECT
recruit_id,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month,
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year
FROM
extracted_children
),
children_count AS (
SELECT
recruit_id,
COUNT(*) AS children_under_18
FROM
children_birth_dates
WHERE
AGE(make_date(year, month, day)) &lt; interval '18 years'
GROUP BY
recruit_id
),
final_counts AS (
SELECT
COALESCE(children_under_18, 0) AS children_count,
COUNT(*) AS num_people
FROM
public.recruits_info ri
LEFT JOIN
children_count cc ON ri.recruit_id = cc.recruit_id
GROUP BY
COALESCE(children_under_18, 0)
),
total_people AS (
SELECT SUM(num_people) AS total_count
FROM final_counts
)
SELECT
'M' AS gender,
'${REG_ID}' as recruitment_id,
COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children,
COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child,
COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children,
COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children,
COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children,
ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS no_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS one_child_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS two_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS three_children_percent,
ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS four_or_more_children_percent
FROM
final_counts;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>Y</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>256</xloc>
<yloc>192</yloc>
<draw>Y</draw>
</GUI>
</step>
<step_error_handling>
</step_error_handling>
<slave-step-copy-partition-distribution>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff