ERVU-504: init family

This commit is contained in:
adel.ka 2025-07-24 11:27:02 +03:00
parent fcfb9fdb35
commit d3442b1f85
57 changed files with 11809 additions and 424 deletions

View file

@ -21,9 +21,9 @@
</notepads>
<order>
<hop>
<from>JSON input state_job_???.json</from>
<from>JSON input state_job_passport.json</from>
<to>Filter rows</to>
<enabled>N</enabled>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_child_delta.json</from>
@ -31,9 +31,9 @@
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_???_delta.json</from>
<from>JSON input state_passport_delta.json</from>
<to>Filter rows</to>
<enabled>N</enabled>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_job_child.json</from>
@ -129,7 +129,6 @@
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>job_child</text>
@ -178,7 +177,6 @@
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>delta_child</text>
@ -215,6 +213,108 @@
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>delta_passport</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>delta_passport</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>job_passport</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>job_passport</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
@ -238,7 +338,7 @@
</GUI>
</transform>
<transform>
<name>JSON input state_???_delta.json</name>
<name>JSON input state_passport_delta.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
@ -260,7 +360,7 @@
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen/checkpoints/state_citizen_delta.json</name>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_delta.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
@ -312,81 +412,6 @@
<yloc>832</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_job_???.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen/checkpoints/state_job_citizen.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>448</xloc>
<yloc>912</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_child_delta.json</name>
<type>JsonInput</type>
@ -462,6 +487,81 @@
<yloc>656</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_job_passport.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>448</xloc>
<yloc>912</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_job_child.json</name>
<type>JsonInput</type>
@ -598,13 +698,13 @@
<method>none</method>
<schema_name/>
</partitioning>
<loglevel>Basic</loglevel>
<displayHeader>Y</displayHeader>
<fields>
</fields>
<limitRows>N</limitRows>
<limitRowsNumber>0</limitRowsNumber>
<loglevel>Basic</loglevel>
<logmessage>${STATUS}</logmessage>
<fields>
</fields>
<attributes/>
<GUI>
<xloc>1520</xloc>
@ -622,13 +722,13 @@
<method>none</method>
<schema_name/>
</partitioning>
<loglevel>Basic</loglevel>
<displayHeader>Y</displayHeader>
<fields>
</fields>
<limitRows>N</limitRows>
<limitRowsNumber>0</limitRowsNumber>
<loglevel>Basic</loglevel>
<logmessage>${STATUS}</logmessage>
<fields>
</fields>
<attributes/>
<GUI>
<xloc>1520</xloc>

View file

@ -45,6 +45,11 @@
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<key>
<condition>=</condition>
<field>child_external_id</field>
<name>child_external_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<value>
@ -82,6 +87,31 @@
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>child_external_id</name>
<rename>child_external_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>child_id_ern</name>
<rename>child_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
@ -104,32 +134,53 @@
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with child as
(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch,
ri.recruit_id
from ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id --AND '${ID_F1}' != '' -- Проверка на пустую строку
<sql>WITH child AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id --AND '${ID_F1}' != '' -- Проверка на пустую строку
--AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
AND r.update_date >= '${M_R_UP_DATE}'::timestamp
WHERE jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_id::uuid recruit_id,
ch->>'naimRodstvSvyazReb' 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'->>'nomerZapis' birth_az_number
from ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
SELECT
r.recruit_id::uuid AS recruit_id,
ch->>'id' AS child_external_id,
NULLIF(ch->>'idERN', '') AS child_id_ern,
ch->>'naimRodstvSvyazReb' AS kinship_type,
ch->'svedFLBS'->'fio'->>'familiya' AS last_name,
ch->'svedFLBS'->'fio'->>'imya' AS first_name,
ch->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'svedFLBS'->'fio'->>'familiya',
ch->'svedFLBS'->'fio'->>'imya',
ch->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
MAKE_DATE(
NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'den', '')::int
) AS death_date,
ch->'svedSmert'->>'nomerZapis' AS death_az_number,
ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number
FROM ervu_dashboard.citizen r
JOIN child ON r.recruit_id = child.recruit_id;
</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>

View file

@ -108,13 +108,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow1.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F1</name>
<stream_name>IDM_FLOW1</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -134,13 +138,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow2.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F2</name>
<stream_name>IDM_FLOW2</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -160,13 +168,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow3.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F3</name>
<stream_name>IDM_FLOW3</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -186,13 +198,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow4.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F4</name>
<stream_name>IDM_FLOW4</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -212,13 +228,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow5.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F5</name>
<stream_name>IDM_FLOW5</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -652,13 +672,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow1.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F1</name>
<stream_name>IDM_FLOW1</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -678,13 +702,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow2.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F2</name>
<stream_name>IDM_FLOW2</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -704,13 +732,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow3.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F3</name>
<stream_name>IDM_FLOW3</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -730,13 +762,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow4.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F4</name>
<stream_name>IDM_FLOW4</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -756,13 +792,17 @@
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<exec_per_row>Y</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow5.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>ID_F5</name>
<stream_name>IDM_FLOW5</stream_name>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<params_from_previous>Y</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
@ -1080,6 +1120,10 @@
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/delta_child.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<parameter>
<name>M_R_UP_DATE</name>
<value>${M_R_UP_DATE}</value>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
@ -1093,7 +1137,7 @@
<attributes_hac/>
</action>
<action>
<name>Success delta_citizen</name>
<name>Success delta_child</name>
<description/>
<type>SUCCESS</type>
<attributes/>
@ -1143,7 +1187,7 @@
<attributes_hac/>
</action>
<action>
<name>error delta_citizen</name>
<name>error delta_child</name>
<description/>
<type>SUCCESS</type>
<attributes/>
@ -1425,14 +1469,14 @@
<to>Simple child WHERE ERROR</to>
<enabled>Y</enabled>
<evaluation>N</evaluation>
<unconditional>Y</unconditional>
<unconditional>N</unconditional>
</hop>
<hop>
<from>branching_child.hpl</from>
<to>Simple child WHERE SUCCESS</to>
<enabled>Y</enabled>
<evaluation>N</evaluation>
<unconditional>Y</unconditional>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>checkpoint_child_error.hpl</from>
@ -1639,14 +1683,14 @@
</hop>
<hop>
<from>state_delta_child_success</from>
<to>Success delta_citizen</to>
<to>Success delta_child</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_delta_child_error</from>
<to>error delta_citizen</to>
<to>error delta_child</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>

View file

@ -41,7 +41,7 @@
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/raw_data/info_recruits/recruit_update_date_ervu_dashboard.hpl</filename>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl</filename>
<logext/>
<logfile/>
<loglevel>Basic</loglevel>

View file

@ -64,6 +64,102 @@
<yloc>400</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>child_external_id</field>
<name>child_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>birth_az_number</name>
<rename>birth_az_number</rename>
<update>Y</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>death_az_number</name>
<rename>death_az_number</rename>
<update>Y</update>
</value>
<value>
<name>death_date</name>
<rename>death_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>child_external_id</name>
<rename>child_external_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>child_id_ern</name>
<rename>child_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>944</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Select values 4 2</name>
<type>SelectValues</type>
@ -115,31 +211,52 @@
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with child as
(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch,
ri.recruit_id
from ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F1}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
<sql>WITH child AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F1}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
WHERE jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_id::uuid recruit_id,
ch->>'naimRodstvSvyazReb' 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'->>'nomerZapis' birth_az_number
from ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
SELECT
r.recruit_id::uuid AS recruit_id,
ch->>'id' AS child_external_id,
NULLIF(ch->>'idERN', '') AS child_id_ern,
ch->>'naimRodstvSvyazReb' AS kinship_type,
ch->'svedFLBS'->'fio'->>'familiya' AS last_name,
ch->'svedFLBS'->'fio'->>'imya' AS first_name,
ch->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'svedFLBS'->'fio'->>'familiya',
ch->'svedFLBS'->'fio'->>'imya',
ch->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
MAKE_DATE(
NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'den', '')::int
) AS death_date,
ch->'svedSmert'->>'nomerZapis' AS death_az_number,
ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number
FROM ervu_dashboard.citizen r
JOIN child ON r.recruit_id = child.recruit_id;
</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
@ -147,70 +264,6 @@ join child on r.recruit_id = child.recruit_id</sql>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>birth_az_number</name>
<rename>birth_az_number</rename>
<update>Y</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>death_az_number</name>
<rename>death_az_number</rename>
<update>Y</update>
</value>
<value>
<name>death_date</name>
<rename>death_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>944</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>
<error>
<source_transform>Select values 4 2</source_transform>

View file

@ -26,52 +26,6 @@
<enabled>Y</enabled>
</hop>
</order>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with child as
(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch,
ri.recruit_id
from ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_id::uuid recruit_id,
ch->>'naimRodstvSvyazReb' 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'->>'nomerZapis' birth_az_number
from ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
@ -90,6 +44,13 @@ join child on r.recruit_id = child.recruit_id</sql>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>child_external_id</field>
<name>child_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
@ -128,6 +89,31 @@ join child on r.recruit_id = child.recruit_id</sql>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>child_external_id</name>
<rename>child_external_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>child_id_ern</name>
<rename>child_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
@ -136,6 +122,73 @@ join child on r.recruit_id = child.recruit_id</sql>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH child AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F2}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}'
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
WHERE jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
SELECT
r.recruit_id::uuid AS recruit_id,
ch->>'id' AS child_external_id,
NULLIF(ch->>'idERN', '') AS child_id_ern,
ch->>'naimRodstvSvyazReb' AS kinship_type,
ch->'svedFLBS'->'fio'->>'familiya' AS last_name,
ch->'svedFLBS'->'fio'->>'imya' AS first_name,
ch->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'svedFLBS'->'fio'->>'familiya',
ch->'svedFLBS'->'fio'->>'imya',
ch->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
MAKE_DATE(
NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'den', '')::int
) AS death_date,
ch->'svedSmert'->>'nomerZapis' AS death_az_number,
ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number
FROM ervu_dashboard.citizen r
JOIN child ON r.recruit_id = child.recruit_id;
</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>

View file

@ -26,52 +26,6 @@
<enabled>Y</enabled>
</hop>
</order>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with child as
(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch,
ri.recruit_id
from ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_id::uuid recruit_id,
ch->>'naimRodstvSvyazReb' 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'->>'nomerZapis' birth_az_number
from ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>672</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
@ -90,6 +44,13 @@ join child on r.recruit_id = child.recruit_id</sql>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>child_external_id</field>
<name>child_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
@ -128,6 +89,31 @@ join child on r.recruit_id = child.recruit_id</sql>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>child_external_id</name>
<rename>child_external_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>child_id_ern</name>
<rename>child_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
@ -136,6 +122,73 @@ join child on r.recruit_id = child.recruit_id</sql>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH child AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F3}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}'
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
WHERE jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
SELECT
r.recruit_id::uuid AS recruit_id,
ch->>'id' AS child_external_id,
NULLIF(ch->>'idERN', '') AS child_id_ern,
ch->>'naimRodstvSvyazReb' AS kinship_type,
ch->'svedFLBS'->'fio'->>'familiya' AS last_name,
ch->'svedFLBS'->'fio'->>'imya' AS first_name,
ch->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'svedFLBS'->'fio'->>'familiya',
ch->'svedFLBS'->'fio'->>'imya',
ch->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
MAKE_DATE(
NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'den', '')::int
) AS death_date,
ch->'svedSmert'->>'nomerZapis' AS death_az_number,
ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number
FROM ervu_dashboard.citizen r
JOIN child ON r.recruit_id = child.recruit_id;
</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>672</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>

View file

@ -26,52 +26,6 @@
<enabled>Y</enabled>
</hop>
</order>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with child as
(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch,
ri.recruit_id
from ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_id::uuid recruit_id,
ch->>'naimRodstvSvyazReb' 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'->>'nomerZapis' birth_az_number
from ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>528</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
@ -90,6 +44,13 @@ join child on r.recruit_id = child.recruit_id</sql>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>child_external_id</field>
<name>child_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
@ -128,6 +89,31 @@ join child on r.recruit_id = child.recruit_id</sql>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>child_external_id</name>
<rename>child_external_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>child_id_ern</name>
<rename>child_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
@ -136,6 +122,73 @@ join child on r.recruit_id = child.recruit_id</sql>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH child AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F4}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}'
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
WHERE jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
SELECT
r.recruit_id::uuid AS recruit_id,
ch->>'id' AS child_external_id,
NULLIF(ch->>'idERN', '') AS child_id_ern,
ch->>'naimRodstvSvyazReb' AS kinship_type,
ch->'svedFLBS'->'fio'->>'familiya' AS last_name,
ch->'svedFLBS'->'fio'->>'imya' AS first_name,
ch->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'svedFLBS'->'fio'->>'familiya',
ch->'svedFLBS'->'fio'->>'imya',
ch->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
MAKE_DATE(
NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'den', '')::int
) AS death_date,
ch->'svedSmert'->>'nomerZapis' AS death_az_number,
ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number
FROM ervu_dashboard.citizen r
JOIN child ON r.recruit_id = child.recruit_id;
</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>528</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>

View file

@ -26,52 +26,6 @@
<enabled>Y</enabled>
</hop>
</order>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with child as
(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch,
ri.recruit_id
from ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_id::uuid recruit_id,
ch->>'naimRodstvSvyazReb' 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'->>'nomerZapis' birth_az_number
from ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
@ -90,6 +44,13 @@ join child on r.recruit_id = child.recruit_id</sql>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>child_external_id</field>
<name>child_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
@ -128,6 +89,31 @@ join child on r.recruit_id = child.recruit_id</sql>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>child_external_id</name>
<rename>child_external_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>child_id_ern</name>
<rename>child_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
@ -136,6 +122,73 @@ join child on r.recruit_id = child.recruit_id</sql>
<yloc>368</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH child AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F5}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}'
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
WHERE jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
SELECT
r.recruit_id::uuid AS recruit_id,
ch->>'id' AS child_external_id,
NULLIF(ch->>'idERN', '') AS child_id_ern,
ch->>'naimRodstvSvyazReb' AS kinship_type,
ch->'svedFLBS'->'fio'->>'familiya' AS last_name,
ch->'svedFLBS'->'fio'->>'imya' AS first_name,
ch->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'svedFLBS'->'fio'->>'familiya',
ch->'svedFLBS'->'fio'->>'imya',
ch->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
MAKE_DATE(
NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'den', '')::int
) AS death_date,
ch->'svedSmert'->>'nomerZapis' AS death_az_number,
ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number
FROM ervu_dashboard.citizen r
JOIN child ON r.recruit_id = child.recruit_id;
</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>

View file

@ -45,8 +45,8 @@
updated_at AS system_update_date,
current_timestamp AS record_created,
'job_recruits_info' AS workflow
FROM ervu_person_registry_raw.recruits_info
WHERE updated_at = (SELECT MAX(updated_at) FROM ervu_person_registry_raw.recruits_info)
FROM ervu_dashboard.recruits_info
WHERE updated_at = (SELECT MAX(updated_at) FROM ervu_dashboard.recruits_info)
limit 1</sql>
<variables_active>N</variables_active>
<attributes/>
@ -74,11 +74,14 @@ limit 1</sql>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_monthly>Y</partitioning_monthly>
<return_field/>
<return_keys>N</return_keys>
<schema>public</schema>
<specify_fields>N</specify_fields>
<table>recruit_create</table>
<tablename_field/>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>

View file

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>branching_citizen_guardianship</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/09 09:54:43.724</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/09 09:54:43.724</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>JSON input state_job_citizen_guardianship.json</from>
<to>Set variables</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Set variables</from>
<to>Write to log</to>
<enabled>N</enabled>
</hop>
</order>
<transform>
<name>JSON input state_job_citizen_guardianship.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>816</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform>
<name>Set variables</name>
<type>SetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<field_name>pipeline</field_name>
<variable_name>PIPE</variable_name>
<variable_type>PARENT_WORKFLOW</variable_type>
</field>
<field>
<field_name>status</field_name>
<variable_name>STATUS</variable_name>
<variable_type>PARENT_WORKFLOW</variable_type>
</field>
</fields>
<use_formatting>Y</use_formatting>
<attributes/>
<GUI>
<xloc>1072</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform>
<name>Write to log</name>
<type>WriteToLog</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<loglevel>Basic</loglevel>
<displayHeader>Y</displayHeader>
<limitRows>N</limitRows>
<limitRowsNumber>0</limitRowsNumber>
<logmessage>${PIPE}
${STATUS}</logmessage>
<fields>
<field>
<name>pipeline</name>
</field>
<field>
<name>status</name>
</field>
</fields>
<attributes/>
<GUI>
<xloc>1296</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,276 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>checkpoint_citizen_guardianship_error</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/09 10:01:04.895</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/09 10:01:04.895</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Select values</from>
<to>Table output</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Select values</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<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>idm_id</name>
<rename>idm_id</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<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/>
<GUI>
<xloc>1008</xloc>
<yloc>608</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.citizen_guardianship cg on cg.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
FROM flow_data
),
result_max as ( --костыль
SELECT
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
FROM result_ma
),
for_checkpoints as (
SELECT
'job_child_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_child_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_child_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_child_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_child_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>736</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<fields>
</fields>
<ignore_errors>N</ignore_errors>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_monthly>Y</partitioning_monthly>
<return_field/>
<return_keys>N</return_keys>
<schema>public</schema>
<specify_fields>N</specify_fields>
<table>etl_checkpoints</table>
<tablename_field/>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>1248</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,733 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>checkpoint_job_citizen_guardianship</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/03 14:19:02.590</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/03 14:19:02.590</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Filter rows</from>
<to>Abort</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_guardianship_flow1.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_guardianship_flow2.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_guardianship_flow3.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_guardianship_flow4.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_guardianship_flow5.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Abort</name>
<type>Abort</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<abort_option>ABORT_WITH_ERROR</abort_option>
<always_log_rows>Y</always_log_rows>
<row_threshold>0</row_threshold>
<attributes/>
<GUI>
<xloc>1264</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>Filter rows</name>
<type>FilterRows</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<compare>
<condition>
<conditions>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_guardianship_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_guardianship_flow2</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_guardianship_flow3</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_guardianship_flow4</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_guardianship_flow5</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
</compare>
<send_true_to>Abort</send_true_to>
<attributes/>
<GUI>
<xloc>944</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_guardianship_flow1.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>432</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_guardianship_flow2.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>512</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_guardianship_flow3.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_guardianship_flow4.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>672</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_guardianship_flow5.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>752</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,235 @@
<?xml version="1.0" encoding="UTF-8"?>
<workflow>
<name>job_create_files_citizen_guardianship</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<created_user>-</created_user>
<created_date>2025/05/26 16:48:00.210</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/26 16:48:00.210</modified_date>
<parameters>
</parameters>
<actions>
<action>
<name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<DayOfMonth>1</DayOfMonth>
<hour>12</hour>
<intervalMinutes>60</intervalMinutes>
<intervalSeconds>0</intervalSeconds>
<minutes>0</minutes>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
<xloc>576</xloc>
<yloc>496</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_guardianship_flow2_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_guardianship_flow2"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>416</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_guardianship_flow1_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_guardianship_flow1"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>336</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_guardianship_flow3_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_guardianship_flow3"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>496</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_guardianship_flow4_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_guardianship_flow4"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>576</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_guardianship_flow5_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_guardianship_flow5"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>656</yloc>
<attributes_hac/>
</action>
<action>
<name>Success</name>
<description/>
<type>SUCCESS</type>
<attributes/>
<parallel>N</parallel>
<xloc>1120</xloc>
<yloc>496</yloc>
<attributes_hac/>
</action>
<action>
<name>Delete file state_job_citizen_guardianship</name>
<description/>
<type>DELETE_FILE</type>
<attributes/>
<fail_if_file_not_exists>N</fail_if_file_not_exists>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>256</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
<from>Start</from>
<to>state_citizen_guardianship_flow3_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_citizen_guardianship_flow2_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_citizen_guardianship_flow1_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_citizen_guardianship_flow4_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_citizen_guardianship_flow5_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>state_citizen_guardianship_flow5_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_citizen_guardianship_flow4_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_citizen_guardianship_flow3_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_citizen_guardianship_flow2_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_citizen_guardianship_flow1_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>Start</from>
<to>Delete file state_job_citizen_guardianship</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Delete file state_job_citizen_guardianship</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
</hops>
<notepads>
</notepads>
<attributes/>
</workflow>

View file

@ -0,0 +1,6 @@
{
"status": "SUCCESS",
"pipeline": "delta_citizen_guardianship",
"max_create_date": "3001-01-01 00:00:00",
"max_update_date": "2025/04/09 00:25:46.935442000"
}

View file

@ -0,0 +1,4 @@
{
"status": "SUCCESS",
"pipeline": "citizen_guardianship_flow1"
}

View file

@ -0,0 +1,4 @@
{
"status": "SUCCESS",
"pipeline": "citizen_guardianship_flow2"
}

View file

@ -0,0 +1,4 @@
{
"status": "SUCCESS",
"pipeline": "citizen_guardianship_flow3"
}

View file

@ -0,0 +1,4 @@
{
"status": "SUCCESS",
"pipeline": "citizen_guardianship_flow4"
}

View file

@ -0,0 +1,4 @@
{
"status": "SUCCESS",
"pipeline": "citizen_guardianship_flow5"
}

View file

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>delta_citizen_guardianship</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/03 16:10:48.509</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/03 16:10:48.509</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>guardian_external_id</field>
<name>guardian_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_guardianship</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>guardian_id_ern</name>
<rename>guardian_id_ern</rename>
<update>Y</update>
</value>
<value>
<name>guardian_external_id</name>
<rename>guardian_external_id</rename>
<update>N</update>
</value>
<value>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1168</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH person AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id --AND '${ID_F1}' != '' -- Проверка на пустую строку
--AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
AND r.update_date >= '${M_R_UP_DATE}'::timestamp
WHERE jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
ch->>'id' AS guardian_external_id,
NULLIF(ch->>'idERN', '') AS guardian_id_ern,
ch->'fioOpek'->>'familiya' AS last_name,
ch->'fioOpek'->>'imya' AS first_name,
ch->'fioOpek'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
ch->>'snils' AS snils
FROM ervu_dashboard.citizen r
JOIN person ON r.recruit_id = person.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>624</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<workflow>
<name>job_recruit_last_update_date</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<created_user>-</created_user>
<created_date>2025/06/02 14:48:05.666</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/02 14:48:05.666</modified_date>
<parameters>
</parameters>
<actions>
<action>
<name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<DayOfMonth>1</DayOfMonth>
<hour>12</hour>
<intervalMinutes>60</intervalMinutes>
<intervalSeconds>0</intervalSeconds>
<minutes>0</minutes>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
<xloc>592</xloc>
<yloc>352</yloc>
<attributes_hac/>
</action>
<action>
<name>recruit_update_date_ervu_dashboard.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl</filename>
<logext/>
<logfile/>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>784</xloc>
<yloc>352</yloc>
<attributes_hac/>
</action>
<action>
<name>row_last_recruit_update_date.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/raw_data/info_recruits/row_last_recruit_update_date.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>1056</xloc>
<yloc>352</yloc>
<attributes_hac/>
</action>
<action>
<name>Success</name>
<description/>
<type>SUCCESS</type>
<attributes/>
<parallel>N</parallel>
<xloc>1232</xloc>
<yloc>352</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
<from>Start</from>
<to>recruit_update_date_ervu_dashboard.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>recruit_update_date_ervu_dashboard.hpl</from>
<to>row_last_recruit_update_date.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>row_last_recruit_update_date.hpl</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
</hops>
<notepads>
</notepads>
<attributes/>
</workflow>

View file

@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_guardianship_flow1</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<pipeline_status>0</pipeline_status>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Select values 4 2</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Select values 4 2</from>
<to>Get variables</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Get variables</name>
<type>GetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<length>-1</length>
<name>recruitment_id</name>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
<variable>ID_F1</variable>
</field>
</fields>
<attributes/>
<GUI>
<xloc>976</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>guardian_external_id</field>
<name>guardian_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_guardianship</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>guardian_id_ern</name>
<rename>guardian_id_ern</rename>
<update>Y</update>
</value>
<value>
<name>guardian_external_id</name>
<rename>guardian_external_id</rename>
<update>N</update>
</value>
<value>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>944</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Select values 4 2</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>ID_F1</name>
<rename>ID_F1</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<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/>
<GUI>
<xloc>720</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH person AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F1}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
ch->>'id' AS guardian_external_id,
NULLIF(ch->>'idERN', '') AS guardian_id_ern,
ch->'fioOpek'->>'familiya' AS last_name,
ch->'fioOpek'->>'imya' AS first_name,
ch->'fioOpek'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
ch->>'snils' AS snils
FROM ervu_dashboard.citizen r
JOIN person ON r.recruit_id = person.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>448</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>
<error>
<source_transform>Select values 4 2</source_transform>
<target_transform>Get variables</target_transform>
<is_enabled>Y</is_enabled>
<nr_valuename/>
<descriptions_valuename/>
<fields_valuename/>
<codes_valuename/>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_guardianship_flow2</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>guardian_external_id</field>
<name>guardian_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_guardianship</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>guardian_id_ern</name>
<rename>guardian_id_ern</rename>
<update>Y</update>
</value>
<value>
<name>guardian_external_id</name>
<rename>guardian_external_id</rename>
<update>N</update>
</value>
<value>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1088</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH person AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F2}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
ch->>'id' AS guardian_external_id,
NULLIF(ch->>'idERN', '') AS guardian_id_ern,
ch->'fioOpek'->>'familiya' AS last_name,
ch->'fioOpek'->>'imya' AS first_name,
ch->'fioOpek'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
ch->>'snils' AS snils
FROM ervu_dashboard.citizen r
JOIN person ON r.recruit_id = person.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_guardianship_flow3</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>guardian_external_id</field>
<name>guardian_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_guardianship</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>guardian_id_ern</name>
<rename>guardian_id_ern</rename>
<update>Y</update>
</value>
<value>
<name>guardian_external_id</name>
<rename>guardian_external_id</rename>
<update>N</update>
</value>
<value>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1216</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH person AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F3}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
ch->>'id' AS guardian_external_id,
NULLIF(ch->>'idERN', '') AS guardian_id_ern,
ch->'fioOpek'->>'familiya' AS last_name,
ch->'fioOpek'->>'imya' AS first_name,
ch->'fioOpek'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
ch->>'snils' AS snils
FROM ervu_dashboard.citizen r
JOIN person ON r.recruit_id = person.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>672</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_guardianship_flow4</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>guardian_external_id</field>
<name>guardian_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_guardianship</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>guardian_id_ern</name>
<rename>guardian_id_ern</rename>
<update>Y</update>
</value>
<value>
<name>guardian_external_id</name>
<rename>guardian_external_id</rename>
<update>N</update>
</value>
<value>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1072</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH person AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F4}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
ch->>'id' AS guardian_external_id,
NULLIF(ch->>'idERN', '') AS guardian_id_ern,
ch->'fioOpek'->>'familiya' AS last_name,
ch->'fioOpek'->>'imya' AS first_name,
ch->'fioOpek'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
ch->>'snils' AS snils
FROM ervu_dashboard.citizen r
JOIN person ON r.recruit_id = person.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>528</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_guardianship_flow5</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>guardian_external_id</field>
<name>guardian_external_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_guardianship</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>guardian_id_ern</name>
<rename>guardian_id_ern</rename>
<update>Y</update>
</value>
<value>
<name>guardian_external_id</name>
<rename>guardian_external_id</rename>
<update>N</update>
</value>
<value>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1040</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH person AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id
AND '${ID_F5}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
ch->>'id' AS guardian_external_id,
NULLIF(ch->>'idERN', '') AS guardian_id_ern,
ch->'fioOpek'->>'familiya' AS last_name,
ch->'fioOpek'->>'imya' AS first_name,
ch->'fioOpek'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz', '')::int,
NULLIF(ch->'dataRozhdDok'->>'den', '')::int
) AS birth_date,
ch->>'snils' AS snils
FROM ervu_dashboard.citizen r
JOIN person ON r.recruit_id = person.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>recruit_update_date_ervu_dashboard</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/02 14:50:31.833</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/02 14:50:31.833</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>SELECT
created_at AS system_create_date,
updated_at AS system_update_date,
current_timestamp AS record_created,
'job_recruits_info' AS workflow
FROM ervu_dashboard.recruits_info
WHERE updated_at = (SELECT MAX(updated_at) FROM ervu_dashboard.recruits_info)
limit 1</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>896</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<fields>
</fields>
<ignore_errors>N</ignore_errors>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_monthly>Y</partitioning_monthly>
<return_field/>
<return_keys>N</return_keys>
<schema>public</schema>
<specify_fields>N</specify_fields>
<table>recruit_create</table>
<tablename_field/>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>1216</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,261 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>recruitment_rows_five_flow_if_error</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/23 14:28:22.572</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/23 14:28:22.572</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Copy rows to result</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Copy rows to result</name>
<type>RowsToResult</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>880</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.citizen_guardianship cg on cg.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
FROM flow_data
),
result_max as ( --костыль
SELECT
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
FROM result_ma
),
remains as (
select
CASE
WHEN created_at >= (select cr_flow1 from result_max) and flow_num = 1 THEN created_at
ELSE null
END as cr_flow1,
CASE
WHEN created_at >= (select cr_flow1 from result_max) and flow_num = 1 THEN idm_id
ELSE null
END as idm_flow1,
CASE
WHEN created_at >= (select cr_flow2 from result_max) and flow_num = 2 THEN created_at
ELSE null
END as cr_flow2,
CASE
WHEN created_at >= (select cr_flow2 from result_max) and flow_num = 2 THEN idm_id
ELSE null
END as idm_flow2,
CASE
WHEN created_at >= (select cr_flow3 from result_max) and flow_num = 3 THEN created_at
ELSE null
END as cr_flow3,
CASE
WHEN created_at >= (select cr_flow3 from result_max) and flow_num = 3 THEN idm_id
ELSE null
END as idm_flow3,
CASE
WHEN created_at >= (select cr_flow4 from result_max) and flow_num = 4 THEN created_at
ELSE null
END as cr_flow4,
CASE
WHEN created_at >= (select cr_flow4 from result_max) and flow_num = 4 THEN idm_id
ELSE null
END as idm_flow4,
CASE
WHEN created_at >= (select cr_flow5 from result_max) and flow_num = 5 THEN created_at
ELSE null
END as cr_flow5,
CASE
WHEN created_at >= (select cr_flow5 from result_max) and flow_num = 5 THEN idm_id
ELSE null
END as idm_flow5
from splitted
),
idm1 as (
select
cr_flow1,
idm_flow1
from remains
where cr_flow1 is not null and idm_flow1 is not null
),
idm2 as (
select
cr_flow2,
idm_flow2
from remains
where cr_flow2 is not null and idm_flow2 is not null
),
idm3 as (
select
cr_flow3,
idm_flow3
from remains
where cr_flow3 is not null and idm_flow3 is not null
),
idm4 as (
select
cr_flow4,
idm_flow4
from remains
where cr_flow4 is not null and idm_flow4 is not null
),
idm5 as (
select
cr_flow5,
idm_flow5
from remains
where cr_flow5 is not null and idm_flow5 is not null
)
select
i1.*,
i2.*,
i3.*,
i4.*,
i5.*
FROM
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm1) i1
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm2) i2 ON i1.rn = i2.rn
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm3) i3 ON i1.rn = i3.rn
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm4) i4 ON i1.rn = i4.rn
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm5) i5 ON i1.rn = i5.rn
ORDER BY COALESCE(i1.rn, i2.rn, i3.rn, i4.rn, i5.rn)
limit 2</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>512</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>row_last_recruit_update_date</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/02 14:51:59.611</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/02 14:51:59.611</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Copy rows to result</from>
<to>Set variables</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Copy rows to result</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Copy rows to result</name>
<type>RowsToResult</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>992</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<name>Set variables</name>
<type>SetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<default_value/>
<field_name>MAX_RECRUIT_UPDATE_DATE</field_name>
<variable_name>M_R_UP_DATE</variable_name>
<variable_type>GP_WORKFLOW</variable_type>
</field>
</fields>
<use_formatting>Y</use_formatting>
<attributes/>
<GUI>
<xloc>1232</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>SELECT
system_update_date AS MAX_RECRUIT_UPDATE_DATE--,
--record_created
FROM public.recruit_create
WHERE system_update_date = (select max(system_update_date) from public.recruit_create)
and workflow = 'job_recruits_info'
order by record_created desc
limit 1</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>branching_citizen_spouse</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/09 09:54:43.724</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/09 09:54:43.724</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>JSON input state_job_citizen_spouse.json</from>
<to>Set variables</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Set variables</from>
<to>Write to log</to>
<enabled>N</enabled>
</hop>
</order>
<transform>
<name>JSON input state_job_citizen_spouse.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>816</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform>
<name>Set variables</name>
<type>SetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<default_value/>
<field_name>pipeline</field_name>
<variable_name>PIPE</variable_name>
<variable_type>PARENT_WORKFLOW</variable_type>
</field>
<field>
<default_value/>
<field_name>status</field_name>
<variable_name>STATUS</variable_name>
<variable_type>PARENT_WORKFLOW</variable_type>
</field>
</fields>
<use_formatting>Y</use_formatting>
<attributes/>
<GUI>
<xloc>1072</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform>
<name>Write to log</name>
<type>WriteToLog</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<loglevel>Basic</loglevel>
<displayHeader>Y</displayHeader>
<limitRows>N</limitRows>
<limitRowsNumber>0</limitRowsNumber>
<logmessage>${PIPE}
${STATUS}</logmessage>
<fields>
<field>
<name>pipeline</name>
</field>
<field>
<name>status</name>
</field>
</fields>
<attributes/>
<GUI>
<xloc>1296</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,276 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>checkpoint_citizen_spouse_error</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/09 10:01:04.895</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/09 10:01:04.895</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Select values</from>
<to>Table output</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Select values</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<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>idm_id</name>
<rename>idm_id</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<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/>
<GUI>
<xloc>1008</xloc>
<yloc>608</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.citizen_spouse sp ON sp.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
FROM flow_data
),
result_max as ( --костыль
SELECT
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
FROM result_ma
),
for_checkpoints as (
SELECT
'job_citizen_spouse_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_spouse_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_spouse_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_spouse_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_spouse_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>736</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<fields>
</fields>
<ignore_errors>N</ignore_errors>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_monthly>Y</partitioning_monthly>
<return_field/>
<return_keys>N</return_keys>
<schema>public</schema>
<specify_fields>N</specify_fields>
<table>etl_checkpoints</table>
<tablename_field/>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>1248</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,733 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>checkpoint_job_citizen_spouse</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/03 14:19:02.590</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/03 14:19:02.590</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Filter rows</from>
<to>Abort</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_spouse_flow1.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_spouse_flow2.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_spouse_flow3.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_spouse_flow4.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>JSON input state_citizen_spouse_flow5.json</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Abort</name>
<type>Abort</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<abort_option>ABORT_WITH_ERROR</abort_option>
<always_log_rows>Y</always_log_rows>
<row_threshold>0</row_threshold>
<attributes/>
<GUI>
<xloc>1264</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>Filter rows</name>
<type>FilterRows</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<compare>
<condition>
<conditions>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_spouse_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_spouse_flow2</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_spouse_flow3</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_spouse_flow4</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>citizen_spouse_flow5</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
</compare>
<send_true_to>Abort</send_true_to>
<attributes/>
<GUI>
<xloc>944</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_spouse_flow1.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>432</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_spouse_flow2.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>512</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_spouse_flow3.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_spouse_flow4.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>672</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_citizen_spouse_flow5.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>752</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,235 @@
<?xml version="1.0" encoding="UTF-8"?>
<workflow>
<name>job_create_files_citizen_spouse</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<created_user>-</created_user>
<created_date>2025/05/26 16:48:00.210</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/26 16:48:00.210</modified_date>
<parameters>
</parameters>
<actions>
<action>
<name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<DayOfMonth>1</DayOfMonth>
<hour>12</hour>
<intervalMinutes>60</intervalMinutes>
<intervalSeconds>0</intervalSeconds>
<minutes>0</minutes>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
<xloc>576</xloc>
<yloc>496</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_spouse_flow2_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_spouse_flow2"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>416</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_spouse_flow1_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_spouse_flow1"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>336</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_spouse_flow3_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_spouse_flow3"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>496</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_spouse_flow4_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_spouse_flow4"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>576</yloc>
<attributes_hac/>
</action>
<action>
<name>state_citizen_spouse_flow5_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "citizen_spouse_flow5"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>656</yloc>
<attributes_hac/>
</action>
<action>
<name>Success</name>
<description/>
<type>SUCCESS</type>
<attributes/>
<parallel>N</parallel>
<xloc>1120</xloc>
<yloc>496</yloc>
<attributes_hac/>
</action>
<action>
<name>Delete file state_job_citizen_spouse</name>
<description/>
<type>DELETE_FILE</type>
<attributes/>
<fail_if_file_not_exists>N</fail_if_file_not_exists>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouset/checkpoints/state_job_citizen_spouse.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>256</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
<from>Start</from>
<to>state_citizen_spouse_flow3_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_citizen_spouse_flow2_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_citizen_spouse_flow1_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_citizen_spouse_flow4_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_citizen_spouse_flow5_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>state_citizen_spouse_flow5_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_citizen_spouse_flow4_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_citizen_spouse_flow3_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_citizen_spouse_flow2_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_citizen_spouse_flow1_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>Start</from>
<to>Delete file state_job_citizen_spouse</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Delete file state_job_citizen_spouse</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
</hops>
<notepads>
</notepads>
<attributes/>
</workflow>

View file

@ -0,0 +1,6 @@
{
"status": "SUCCESS",
"pipeline": "delta_citizen_spouse",
"max_create_date": "2025/04/08 20:21:38.528691000",
"max_update_date": "2025/04/09 00:25:46.935442000"
}

View file

@ -0,0 +1,4 @@
{
"status": "NEW",
"pipeline": "citizen_spouse_flow1"
}

View file

@ -0,0 +1,4 @@
{
"status": "NEW",
"pipeline": "citizen_spouse_flow2"
}

View file

@ -0,0 +1,4 @@
{
"status": "NEW",
"pipeline": "citizen_spouse_flow3"
}

View file

@ -0,0 +1,4 @@
{
"status": "NEW",
"pipeline": "citizen_spouse_flow4"
}

View file

@ -0,0 +1,4 @@
{
"status": "NEW",
"pipeline": "citizen_spouse_flow5"
}

View file

@ -0,0 +1,322 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>delta_citizen_spouse</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/03 16:10:48.509</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/03 16:10:48.509</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Execute SQL script</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Execute SQL script</name>
<type>ExecSql</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<arguments>
<argument>
<name>recruit_id</name>
</argument>
<argument>
<name>birth_date</name>
</argument>
<argument>
<name>death_az_number</name>
</argument>
<argument>
<name>death_date</name>
</argument>
<argument>
<name>divorce_az_number</name>
</argument>
<argument>
<name>first_name</name>
</argument>
<argument>
<name>full_name</name>
</argument>
<argument>
<name>information_excluded</name>
</argument>
<argument>
<name>kinship_type</name>
</argument>
<argument>
<name>last_name</name>
</argument>
<argument>
<name>marriage_az_number</name>
</argument>
<argument>
<name>marriage_date</name>
</argument>
<argument>
<name>middle_name</name>
</argument>
<argument>
<name>spouse_external_id</name>
</argument>
<argument>
<name>spouse_id_ern</name>
</argument>
</arguments>
<connection>ervu-dashboard</connection>
<execute_each_row>Y</execute_each_row>
<quoteString>N</quoteString>
<replace_variables>N</replace_variables>
<set_params>Y</set_params>
<single_statement>N</single_statement>
<sql>INSERT INTO ervu_dashboard.citizen_spouse (
recruit_id,
birth_date,
death_az_number,
death_date,
divorce_az_number,
first_name,
full_name,
information_excluded,
kinship_type,
last_name,
marriage_az_number,
marriage_date,
middle_name,
spouse_external_id,
spouse_id_ern
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
ON CONFLICT (recruit_id, spouse_external_id)
DO UPDATE SET
birth_date = EXCLUDED.birth_date,
death_az_number = EXCLUDED.death_az_number,
death_date = EXCLUDED.death_date,
divorce_az_number = EXCLUDED.divorce_az_number,
first_name = EXCLUDED.first_name,
full_name = EXCLUDED.full_name,
information_excluded = EXCLUDED.information_excluded,
kinship_type = EXCLUDED.kinship_type,
last_name = EXCLUDED.last_name,
marriage_az_number = EXCLUDED.marriage_az_number,
marriage_date = EXCLUDED.marriage_date,
middle_name = EXCLUDED.middle_name,
spouse_id_ern = EXCLUDED.spouse_id_ern;</sql>
<attributes/>
<GUI>
<xloc>816</xloc>
<yloc>176</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<key>
<condition>=</condition>
<field>spouse_external_id</field>
<name>spouse_external_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_spouse</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>death_az_number</name>
<rename>death_az_number</rename>
<update>Y</update>
</value>
<value>
<name>death_date</name>
<rename>death_date</rename>
<update>Y</update>
</value>
<value>
<name>divorce_az_number</name>
<rename>divorce_az_number</rename>
<update>Y</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>information_excluded</name>
<rename>information_excluded</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>marriage_az_number</name>
<rename>marriage_az_number</rename>
<update>Y</update>
</value>
<value>
<name>marriage_date</name>
<rename>marriage_date</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>spouse_external_id</name>
<rename>spouse_external_id</rename>
<update>N</update>
</value>
<value>
<name>spouse_id_ern</name>
<rename>spouse_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1168</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH suprug AS (
SELECT
ri.recruit_id,
supr.supri AS supr,
supr.supri->>'id' AS spouse_external_id,
NULLIF(supr.supri->>'idERN', '') AS spouse_id_ern,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend' AS marriage_date,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend' AS divorce_date,
CASE
WHEN (ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1') THEN true
ELSE false
END AS information_excluded
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r
ON r.recruit_id = ri.recruit_id --AND '${ID_F1}' != '' -- Проверка на пустую строку
--AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
AND r.update_date >= '${M_R_UP_DATE}'::timestamp
JOIN LATERAL (
SELECT jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri
WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array'
) AS supr ON true
)
SELECT
r.recruit_id,
supr.spouse_external_id,
supr.spouse_id_ern,
supr.supr->>'rodstvSvyazSuprugNaim' AS kinship_type,
supr.supr->'svedFLBS'->'fio'->>'familiya' AS last_name,
supr.supr->'svedFLBS'->'fio'->>'imya' AS first_name,
supr.supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
supr.supr->'svedFLBS'->'fio'->>'familiya',
supr.supr->'svedFLBS'->'fio'->>'imya',
supr.supr->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int
) AS birth_date,
(supr.supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date,
supr.supr->'svedSmert'->>'nomerZapis' AS death_az_number,
marriage_az_number,
marriage_date::date,
divorce_az_number,
divorce_date::date,
information_excluded
FROM ervu_dashboard.citizen r
JOIN suprug supr ON r.recruit_id = supr.recruit_id;
</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>624</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<workflow>
<name>job_recruit_last_update_date</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<created_user>-</created_user>
<created_date>2025/06/02 14:48:05.666</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/02 14:48:05.666</modified_date>
<parameters>
</parameters>
<actions>
<action>
<name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<DayOfMonth>1</DayOfMonth>
<hour>12</hour>
<intervalMinutes>60</intervalMinutes>
<intervalSeconds>0</intervalSeconds>
<minutes>0</minutes>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
<xloc>592</xloc>
<yloc>352</yloc>
<attributes_hac/>
</action>
<action>
<name>recruit_update_date_ervu_dashboard.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/recruit_update_date_ervu_dashboard.hpl</filename>
<logext/>
<logfile/>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>784</xloc>
<yloc>352</yloc>
<attributes_hac/>
</action>
<action>
<name>row_last_recruit_update_date.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/raw_data/info_recruits/row_last_recruit_update_date.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>1056</xloc>
<yloc>352</yloc>
<attributes_hac/>
</action>
<action>
<name>Success</name>
<description/>
<type>SUCCESS</type>
<attributes/>
<parallel>N</parallel>
<xloc>1232</xloc>
<yloc>352</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
<from>Start</from>
<to>recruit_update_date_ervu_dashboard.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>recruit_update_date_ervu_dashboard.hpl</from>
<to>row_last_recruit_update_date.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>row_last_recruit_update_date.hpl</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
</hops>
<notepads>
</notepads>
<attributes/>
</workflow>

View file

@ -0,0 +1,411 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_spouse_flow1</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<pipeline_status>0</pipeline_status>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Select values 4 2</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Select values 4 2</from>
<to>Get variables</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Execute SQL script</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Execute SQL script</name>
<type>ExecSql</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<arguments>
<argument>
<name>recruit_id</name>
</argument>
<argument>
<name>birth_date</name>
</argument>
<argument>
<name>death_az_number</name>
</argument>
<argument>
<name>death_date</name>
</argument>
<argument>
<name>divorce_az_number</name>
</argument>
<argument>
<name>first_name</name>
</argument>
<argument>
<name>full_name</name>
</argument>
<argument>
<name>information_excluded</name>
</argument>
<argument>
<name>kinship_type</name>
</argument>
<argument>
<name>last_name</name>
</argument>
<argument>
<name>marriage_az_number</name>
</argument>
<argument>
<name>marriage_date</name>
</argument>
<argument>
<name>middle_name</name>
</argument>
<argument>
<name>spouse_external_id</name>
</argument>
<argument>
<name>spouse_id_ern</name>
</argument>
</arguments>
<connection>ervu-dashboard</connection>
<delete_field/>
<execute_each_row>Y</execute_each_row>
<insert_field/>
<quoteString>N</quoteString>
<read_field/>
<replace_variables>N</replace_variables>
<set_params>Y</set_params>
<single_statement>N</single_statement>
<sql>INSERT INTO ervu_dashboard.citizen_spouse (
recruit_id,
birth_date,
death_az_number,
death_date,
divorce_az_number,
first_name,
full_name,
information_excluded,
kinship_type,
last_name,
marriage_az_number,
marriage_date,
middle_name,
spouse_external_id,
spouse_id_ern
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
ON CONFLICT (recruit_id, spouse_external_id)
DO UPDATE SET
birth_date = EXCLUDED.birth_date,
death_az_number = EXCLUDED.death_az_number,
death_date = EXCLUDED.death_date,
divorce_az_number = EXCLUDED.divorce_az_number,
first_name = EXCLUDED.first_name,
full_name = EXCLUDED.full_name,
information_excluded = EXCLUDED.information_excluded,
kinship_type = EXCLUDED.kinship_type,
last_name = EXCLUDED.last_name,
marriage_az_number = EXCLUDED.marriage_az_number,
marriage_date = EXCLUDED.marriage_date,
middle_name = EXCLUDED.middle_name,
spouse_id_ern = EXCLUDED.spouse_id_ern;</sql>
<update_field/>
<attributes/>
<GUI>
<xloc>704</xloc>
<yloc>144</yloc>
</GUI>
</transform>
<transform>
<name>Get variables</name>
<type>GetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<length>-1</length>
<name>recruitment_id</name>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
<variable>ID_F1</variable>
</field>
</fields>
<attributes/>
<GUI>
<xloc>976</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<key>
<condition>=</condition>
<field>spouse_external_id</field>
<name>spouse_external_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_spouse</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>death_az_number</name>
<rename>death_az_number</rename>
<update>Y</update>
</value>
<value>
<name>death_date</name>
<rename>death_date</rename>
<update>Y</update>
</value>
<value>
<name>divorce_az_number</name>
<rename>divorce_az_number</rename>
<update>Y</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>information_excluded</name>
<rename>information_excluded</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>marriage_az_number</name>
<rename>marriage_az_number</rename>
<update>Y</update>
</value>
<value>
<name>marriage_date</name>
<rename>marriage_date</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>spouse_external_id</name>
<rename>spouse_external_id</rename>
<update>N</update>
</value>
<value>
<name>spouse_id_ern</name>
<rename>spouse_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>944</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Select values 4 2</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>ID_F1</name>
<rename>ID_F1</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<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/>
<GUI>
<xloc>720</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH suprug AS (
SELECT
ri.recruit_id,
supr.supri AS supr,
supr.supri->>'id' AS spouse_external_id,
NULLIF(supr.supri->>'idERN', '') AS spouse_id_ern,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend' AS marriage_date,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend' AS divorce_date,
CASE
WHEN (ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1') THEN true
ELSE false
END AS information_excluded
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
AND '${ID_F1}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
JOIN LATERAL (
SELECT jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri
WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array'
) AS supr ON true
)
SELECT
r.recruit_id,
supr.spouse_external_id,
supr.spouse_id_ern,
supr.supr->>'rodstvSvyazSuprugNaim' AS kinship_type,
supr.supr->'svedFLBS'->'fio'->>'familiya' AS last_name,
supr.supr->'svedFLBS'->'fio'->>'imya' AS first_name,
supr.supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
supr.supr->'svedFLBS'->'fio'->>'familiya',
supr.supr->'svedFLBS'->'fio'->>'imya',
supr.supr->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int
) AS birth_date,
(supr.supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date,
supr.supr->'svedSmert'->>'nomerZapis' AS death_az_number,
marriage_az_number,
marriage_date::date,
divorce_az_number,
divorce_date::date,
information_excluded
FROM ervu_dashboard.citizen r
JOIN suprug supr ON r.recruit_id = supr.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>448</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>
<error>
<source_transform>Select values 4 2</source_transform>
<target_transform>Get variables</target_transform>
<is_enabled>Y</is_enabled>
<nr_valuename/>
<descriptions_valuename/>
<fields_valuename/>
<codes_valuename/>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,320 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_spouse_flow2</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Execute SQL script</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<key>
<condition>=</condition>
<field>spouse_external_id</field>
<name>spouse_external_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_spouse</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>death_az_number</name>
<rename>death_az_number</rename>
<update>Y</update>
</value>
<value>
<name>death_date</name>
<rename>death_date</rename>
<update>Y</update>
</value>
<value>
<name>divorce_az_number</name>
<rename>divorce_az_number</rename>
<update>Y</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>information_excluded</name>
<rename>information_excluded</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>marriage_az_number</name>
<rename>marriage_az_number</rename>
<update>Y</update>
</value>
<value>
<name>marriage_date</name>
<rename>marriage_date</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>spouse_external_id</name>
<rename>spouse_external_id</rename>
<update>N</update>
</value>
<value>
<name>spouse_id_ern</name>
<rename>spouse_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1088</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH suprug AS (
SELECT
ri.recruit_id,
supr.supri AS supr,
supr.supri->>'id' AS spouse_external_id,
NULLIF(supr.supri->>'idERN', '') AS spouse_id_ern,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend' AS marriage_date,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend' AS divorce_date,
CASE
WHEN (ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1') THEN true
ELSE false
END AS information_excluded
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
AND '${ID_F2}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
JOIN LATERAL (
SELECT jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri
WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array'
) AS supr ON true
)
SELECT
r.recruit_id,
supr.spouse_external_id,
supr.spouse_id_ern,
supr.supr->>'rodstvSvyazSuprugNaim' AS kinship_type,
supr.supr->'svedFLBS'->'fio'->>'familiya' AS last_name,
supr.supr->'svedFLBS'->'fio'->>'imya' AS first_name,
supr.supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
supr.supr->'svedFLBS'->'fio'->>'familiya',
supr.supr->'svedFLBS'->'fio'->>'imya',
supr.supr->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int
) AS birth_date,
(supr.supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date,
supr.supr->'svedSmert'->>'nomerZapis' AS death_az_number,
marriage_az_number,
marriage_date::date,
divorce_az_number,
divorce_date::date,
information_excluded
FROM ervu_dashboard.citizen r
JOIN suprug supr ON r.recruit_id = supr.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Execute SQL script</name>
<type>ExecSql</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<arguments>
<argument>
<name>recruit_id</name>
</argument>
<argument>
<name>birth_date</name>
</argument>
<argument>
<name>death_az_number</name>
</argument>
<argument>
<name>death_date</name>
</argument>
<argument>
<name>divorce_az_number</name>
</argument>
<argument>
<name>first_name</name>
</argument>
<argument>
<name>full_name</name>
</argument>
<argument>
<name>information_excluded</name>
</argument>
<argument>
<name>kinship_type</name>
</argument>
<argument>
<name>last_name</name>
</argument>
<argument>
<name>marriage_az_number</name>
</argument>
<argument>
<name>marriage_date</name>
</argument>
<argument>
<name>middle_name</name>
</argument>
<argument>
<name>spouse_external_id</name>
</argument>
<argument>
<name>spouse_id_ern</name>
</argument>
</arguments>
<connection>ervu-dashboard</connection>
<execute_each_row>Y</execute_each_row>
<quoteString>N</quoteString>
<replace_variables>N</replace_variables>
<set_params>Y</set_params>
<single_statement>N</single_statement>
<sql>INSERT INTO ervu_dashboard.citizen_spouse (
recruit_id,
birth_date,
death_az_number,
death_date,
divorce_az_number,
first_name,
full_name,
information_excluded,
kinship_type,
last_name,
marriage_az_number,
marriage_date,
middle_name,
spouse_external_id,
spouse_id_ern
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
ON CONFLICT (recruit_id, spouse_external_id)
DO UPDATE SET
birth_date = EXCLUDED.birth_date,
death_az_number = EXCLUDED.death_az_number,
death_date = EXCLUDED.death_date,
divorce_az_number = EXCLUDED.divorce_az_number,
first_name = EXCLUDED.first_name,
full_name = EXCLUDED.full_name,
information_excluded = EXCLUDED.information_excluded,
kinship_type = EXCLUDED.kinship_type,
last_name = EXCLUDED.last_name,
marriage_az_number = EXCLUDED.marriage_az_number,
marriage_date = EXCLUDED.marriage_date,
middle_name = EXCLUDED.middle_name,
spouse_id_ern = EXCLUDED.spouse_id_ern;</sql>
<attributes/>
<GUI>
<xloc>720</xloc>
<yloc>176</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,320 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_spouse_flow3</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Execute SQL script</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<key>
<condition>=</condition>
<field>spouse_external_id</field>
<name>spouse_external_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_spouse</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>death_az_number</name>
<rename>death_az_number</rename>
<update>Y</update>
</value>
<value>
<name>death_date</name>
<rename>death_date</rename>
<update>Y</update>
</value>
<value>
<name>divorce_az_number</name>
<rename>divorce_az_number</rename>
<update>Y</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>information_excluded</name>
<rename>information_excluded</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>marriage_az_number</name>
<rename>marriage_az_number</rename>
<update>Y</update>
</value>
<value>
<name>marriage_date</name>
<rename>marriage_date</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>spouse_external_id</name>
<rename>spouse_external_id</rename>
<update>N</update>
</value>
<value>
<name>spouse_id_ern</name>
<rename>spouse_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1216</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH suprug AS (
SELECT
ri.recruit_id,
supr.supri AS supr,
supr.supri->>'id' AS spouse_external_id,
NULLIF(supr.supri->>'idERN', '') AS spouse_id_ern,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend' AS marriage_date,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend' AS divorce_date,
CASE
WHEN (ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1') THEN true
ELSE false
END AS information_excluded
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
AND '${ID_F3}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
JOIN LATERAL (
SELECT jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri
WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array'
) AS supr ON true
)
SELECT
r.recruit_id,
supr.spouse_external_id,
supr.spouse_id_ern,
supr.supr->>'rodstvSvyazSuprugNaim' AS kinship_type,
supr.supr->'svedFLBS'->'fio'->>'familiya' AS last_name,
supr.supr->'svedFLBS'->'fio'->>'imya' AS first_name,
supr.supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
supr.supr->'svedFLBS'->'fio'->>'familiya',
supr.supr->'svedFLBS'->'fio'->>'imya',
supr.supr->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int
) AS birth_date,
(supr.supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date,
supr.supr->'svedSmert'->>'nomerZapis' AS death_az_number,
marriage_az_number,
marriage_date::date,
divorce_az_number,
divorce_date::date,
information_excluded
FROM ervu_dashboard.citizen r
JOIN suprug supr ON r.recruit_id = supr.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>672</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<name>Execute SQL script</name>
<type>ExecSql</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<arguments>
<argument>
<name>recruit_id</name>
</argument>
<argument>
<name>birth_date</name>
</argument>
<argument>
<name>death_az_number</name>
</argument>
<argument>
<name>death_date</name>
</argument>
<argument>
<name>divorce_az_number</name>
</argument>
<argument>
<name>first_name</name>
</argument>
<argument>
<name>full_name</name>
</argument>
<argument>
<name>information_excluded</name>
</argument>
<argument>
<name>kinship_type</name>
</argument>
<argument>
<name>last_name</name>
</argument>
<argument>
<name>marriage_az_number</name>
</argument>
<argument>
<name>marriage_date</name>
</argument>
<argument>
<name>middle_name</name>
</argument>
<argument>
<name>spouse_external_id</name>
</argument>
<argument>
<name>spouse_id_ern</name>
</argument>
</arguments>
<connection>ervu-dashboard</connection>
<execute_each_row>Y</execute_each_row>
<quoteString>N</quoteString>
<replace_variables>N</replace_variables>
<set_params>Y</set_params>
<single_statement>N</single_statement>
<sql>INSERT INTO ervu_dashboard.citizen_spouse (
recruit_id,
birth_date,
death_az_number,
death_date,
divorce_az_number,
first_name,
full_name,
information_excluded,
kinship_type,
last_name,
marriage_az_number,
marriage_date,
middle_name,
spouse_external_id,
spouse_id_ern
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
ON CONFLICT (recruit_id, spouse_external_id)
DO UPDATE SET
birth_date = EXCLUDED.birth_date,
death_az_number = EXCLUDED.death_az_number,
death_date = EXCLUDED.death_date,
divorce_az_number = EXCLUDED.divorce_az_number,
first_name = EXCLUDED.first_name,
full_name = EXCLUDED.full_name,
information_excluded = EXCLUDED.information_excluded,
kinship_type = EXCLUDED.kinship_type,
last_name = EXCLUDED.last_name,
marriage_az_number = EXCLUDED.marriage_az_number,
marriage_date = EXCLUDED.marriage_date,
middle_name = EXCLUDED.middle_name,
spouse_id_ern = EXCLUDED.spouse_id_ern;</sql>
<attributes/>
<GUI>
<xloc>848</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,320 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_spouse_flow4</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Execute SQL script</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<key>
<condition>=</condition>
<field>spouse_external_id</field>
<name>spouse_external_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_spouse</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>death_az_number</name>
<rename>death_az_number</rename>
<update>Y</update>
</value>
<value>
<name>death_date</name>
<rename>death_date</rename>
<update>Y</update>
</value>
<value>
<name>divorce_az_number</name>
<rename>divorce_az_number</rename>
<update>Y</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>information_excluded</name>
<rename>information_excluded</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>marriage_az_number</name>
<rename>marriage_az_number</rename>
<update>Y</update>
</value>
<value>
<name>marriage_date</name>
<rename>marriage_date</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>spouse_external_id</name>
<rename>spouse_external_id</rename>
<update>N</update>
</value>
<value>
<name>spouse_id_ern</name>
<rename>spouse_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1072</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH suprug AS (
SELECT
ri.recruit_id,
supr.supri AS supr,
supr.supri->>'id' AS spouse_external_id,
NULLIF(supr.supri->>'idERN', '') AS spouse_id_ern,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend' AS marriage_date,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend' AS divorce_date,
CASE
WHEN (ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1') THEN true
ELSE false
END AS information_excluded
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
AND '${ID_F4}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
JOIN LATERAL (
SELECT jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri
WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array'
) AS supr ON true
)
SELECT
r.recruit_id,
supr.spouse_external_id,
supr.spouse_id_ern,
supr.supr->>'rodstvSvyazSuprugNaim' AS kinship_type,
supr.supr->'svedFLBS'->'fio'->>'familiya' AS last_name,
supr.supr->'svedFLBS'->'fio'->>'imya' AS first_name,
supr.supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
supr.supr->'svedFLBS'->'fio'->>'familiya',
supr.supr->'svedFLBS'->'fio'->>'imya',
supr.supr->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int
) AS birth_date,
(supr.supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date,
supr.supr->'svedSmert'->>'nomerZapis' AS death_az_number,
marriage_az_number,
marriage_date::date,
divorce_az_number,
divorce_date::date,
information_excluded
FROM ervu_dashboard.citizen r
JOIN suprug supr ON r.recruit_id = supr.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>528</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<name>Execute SQL script</name>
<type>ExecSql</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<arguments>
<argument>
<name>recruit_id</name>
</argument>
<argument>
<name>birth_date</name>
</argument>
<argument>
<name>death_az_number</name>
</argument>
<argument>
<name>death_date</name>
</argument>
<argument>
<name>divorce_az_number</name>
</argument>
<argument>
<name>first_name</name>
</argument>
<argument>
<name>full_name</name>
</argument>
<argument>
<name>information_excluded</name>
</argument>
<argument>
<name>kinship_type</name>
</argument>
<argument>
<name>last_name</name>
</argument>
<argument>
<name>marriage_az_number</name>
</argument>
<argument>
<name>marriage_date</name>
</argument>
<argument>
<name>middle_name</name>
</argument>
<argument>
<name>spouse_external_id</name>
</argument>
<argument>
<name>spouse_id_ern</name>
</argument>
</arguments>
<connection>ervu-dashboard</connection>
<execute_each_row>Y</execute_each_row>
<quoteString>N</quoteString>
<replace_variables>N</replace_variables>
<set_params>Y</set_params>
<single_statement>N</single_statement>
<sql>INSERT INTO ervu_dashboard.citizen_spouse (
recruit_id,
birth_date,
death_az_number,
death_date,
divorce_az_number,
first_name,
full_name,
information_excluded,
kinship_type,
last_name,
marriage_az_number,
marriage_date,
middle_name,
spouse_external_id,
spouse_id_ern
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
ON CONFLICT (recruit_id, spouse_external_id)
DO UPDATE SET
birth_date = EXCLUDED.birth_date,
death_az_number = EXCLUDED.death_az_number,
death_date = EXCLUDED.death_date,
divorce_az_number = EXCLUDED.divorce_az_number,
first_name = EXCLUDED.first_name,
full_name = EXCLUDED.full_name,
information_excluded = EXCLUDED.information_excluded,
kinship_type = EXCLUDED.kinship_type,
last_name = EXCLUDED.last_name,
marriage_az_number = EXCLUDED.marriage_az_number,
marriage_date = EXCLUDED.marriage_date,
middle_name = EXCLUDED.middle_name,
spouse_id_ern = EXCLUDED.spouse_id_ern;</sql>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>176</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,320 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>citizen_spouse_flow5</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Execute SQL script</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<key>
<condition>=</condition>
<field>spouse_external_id</field>
<name>spouse_external_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_spouse</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>death_az_number</name>
<rename>death_az_number</rename>
<update>Y</update>
</value>
<value>
<name>death_date</name>
<rename>death_date</rename>
<update>Y</update>
</value>
<value>
<name>divorce_az_number</name>
<rename>divorce_az_number</rename>
<update>Y</update>
</value>
<value>
<name>first_name</name>
<rename>first_name</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>information_excluded</name>
<rename>information_excluded</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>last_name</name>
<rename>last_name</rename>
<update>Y</update>
</value>
<value>
<name>marriage_az_number</name>
<rename>marriage_az_number</rename>
<update>Y</update>
</value>
<value>
<name>marriage_date</name>
<rename>marriage_date</rename>
<update>Y</update>
</value>
<value>
<name>middle_name</name>
<rename>middle_name</rename>
<update>Y</update>
</value>
<value>
<name>spouse_external_id</name>
<rename>spouse_external_id</rename>
<update>N</update>
</value>
<value>
<name>spouse_id_ern</name>
<rename>spouse_id_ern</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1040</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH suprug AS (
SELECT
ri.recruit_id,
supr.supri AS supr,
supr.supri->>'id' AS spouse_external_id,
NULLIF(supr.supri->>'idERN', '') AS spouse_id_ern,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend' AS marriage_date,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend' AS divorce_date,
CASE
WHEN (ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1') THEN true
ELSE false
END AS information_excluded
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
AND '${ID_F5}' != ''
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
JOIN LATERAL (
SELECT jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri
WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array'
) AS supr ON true
)
SELECT
r.recruit_id,
supr.spouse_external_id,
supr.spouse_id_ern,
supr.supr->>'rodstvSvyazSuprugNaim' AS kinship_type,
supr.supr->'svedFLBS'->'fio'->>'familiya' AS last_name,
supr.supr->'svedFLBS'->'fio'->>'imya' AS first_name,
supr.supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
CONCAT_WS(' ',
supr.supr->'svedFLBS'->'fio'->>'familiya',
supr.supr->'svedFLBS'->'fio'->>'imya',
supr.supr->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(supr.supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int
) AS birth_date,
(supr.supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date,
supr.supr->'svedSmert'->>'nomerZapis' AS death_az_number,
marriage_az_number,
marriage_date::date,
divorce_az_number,
divorce_date::date,
information_excluded
FROM ervu_dashboard.citizen r
JOIN suprug supr ON r.recruit_id = supr.recruit_id;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform>
<name>Execute SQL script</name>
<type>ExecSql</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<arguments>
<argument>
<name>recruit_id</name>
</argument>
<argument>
<name>birth_date</name>
</argument>
<argument>
<name>death_az_number</name>
</argument>
<argument>
<name>death_date</name>
</argument>
<argument>
<name>divorce_az_number</name>
</argument>
<argument>
<name>first_name</name>
</argument>
<argument>
<name>full_name</name>
</argument>
<argument>
<name>information_excluded</name>
</argument>
<argument>
<name>kinship_type</name>
</argument>
<argument>
<name>last_name</name>
</argument>
<argument>
<name>marriage_az_number</name>
</argument>
<argument>
<name>marriage_date</name>
</argument>
<argument>
<name>middle_name</name>
</argument>
<argument>
<name>spouse_external_id</name>
</argument>
<argument>
<name>spouse_id_ern</name>
</argument>
</arguments>
<connection>ervu-dashboard</connection>
<execute_each_row>Y</execute_each_row>
<quoteString>N</quoteString>
<replace_variables>N</replace_variables>
<set_params>Y</set_params>
<single_statement>N</single_statement>
<sql>INSERT INTO ervu_dashboard.citizen_spouse (
recruit_id,
birth_date,
death_az_number,
death_date,
divorce_az_number,
first_name,
full_name,
information_excluded,
kinship_type,
last_name,
marriage_az_number,
marriage_date,
middle_name,
spouse_external_id,
spouse_id_ern
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
ON CONFLICT (recruit_id, spouse_external_id)
DO UPDATE SET
birth_date = EXCLUDED.birth_date,
death_az_number = EXCLUDED.death_az_number,
death_date = EXCLUDED.death_date,
divorce_az_number = EXCLUDED.divorce_az_number,
first_name = EXCLUDED.first_name,
full_name = EXCLUDED.full_name,
information_excluded = EXCLUDED.information_excluded,
kinship_type = EXCLUDED.kinship_type,
last_name = EXCLUDED.last_name,
marriage_az_number = EXCLUDED.marriage_az_number,
marriage_date = EXCLUDED.marriage_date,
middle_name = EXCLUDED.middle_name,
spouse_id_ern = EXCLUDED.spouse_id_ern;</sql>
<attributes/>
<GUI>
<xloc>736</xloc>
<yloc>192</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>recruit_update_date_ervu_dashboard</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/02 14:50:31.833</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/02 14:50:31.833</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>SELECT
created_at AS system_create_date,
updated_at AS system_update_date,
current_timestamp AS record_created,
'job_recruits_info' AS workflow
FROM ervu_dashboard.recruits_info
WHERE updated_at = (SELECT MAX(updated_at) FROM ervu_dashboard.recruits_info)
limit 1</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>896</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<fields>
</fields>
<ignore_errors>N</ignore_errors>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_monthly>Y</partitioning_monthly>
<return_keys>N</return_keys>
<schema>public</schema>
<specify_fields>N</specify_fields>
<table>recruit_create</table>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>1216</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,261 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>recruitment_rows_five_flow_if_error</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/05/23 14:28:22.572</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/23 14:28:22.572</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Copy rows to result</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Copy rows to result</name>
<type>RowsToResult</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>880</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.citizen_spouse sp on sp.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
FROM flow_data
),
result_max as ( --костыль
SELECT
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
FROM result_ma
),
remains as (
select
CASE
WHEN created_at >= (select cr_flow1 from result_max) and flow_num = 1 THEN created_at
ELSE null
END as cr_flow1,
CASE
WHEN created_at >= (select cr_flow1 from result_max) and flow_num = 1 THEN idm_id
ELSE null
END as idm_flow1,
CASE
WHEN created_at >= (select cr_flow2 from result_max) and flow_num = 2 THEN created_at
ELSE null
END as cr_flow2,
CASE
WHEN created_at >= (select cr_flow2 from result_max) and flow_num = 2 THEN idm_id
ELSE null
END as idm_flow2,
CASE
WHEN created_at >= (select cr_flow3 from result_max) and flow_num = 3 THEN created_at
ELSE null
END as cr_flow3,
CASE
WHEN created_at >= (select cr_flow3 from result_max) and flow_num = 3 THEN idm_id
ELSE null
END as idm_flow3,
CASE
WHEN created_at >= (select cr_flow4 from result_max) and flow_num = 4 THEN created_at
ELSE null
END as cr_flow4,
CASE
WHEN created_at >= (select cr_flow4 from result_max) and flow_num = 4 THEN idm_id
ELSE null
END as idm_flow4,
CASE
WHEN created_at >= (select cr_flow5 from result_max) and flow_num = 5 THEN created_at
ELSE null
END as cr_flow5,
CASE
WHEN created_at >= (select cr_flow5 from result_max) and flow_num = 5 THEN idm_id
ELSE null
END as idm_flow5
from splitted
),
idm1 as (
select
cr_flow1,
idm_flow1
from remains
where cr_flow1 is not null and idm_flow1 is not null
),
idm2 as (
select
cr_flow2,
idm_flow2
from remains
where cr_flow2 is not null and idm_flow2 is not null
),
idm3 as (
select
cr_flow3,
idm_flow3
from remains
where cr_flow3 is not null and idm_flow3 is not null
),
idm4 as (
select
cr_flow4,
idm_flow4
from remains
where cr_flow4 is not null and idm_flow4 is not null
),
idm5 as (
select
cr_flow5,
idm_flow5
from remains
where cr_flow5 is not null and idm_flow5 is not null
)
select
i1.*,
i2.*,
i3.*,
i4.*,
i5.*
FROM
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm1) i1
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm2) i2 ON i1.rn = i2.rn
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm3) i3 ON i1.rn = i3.rn
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm4) i4 ON i1.rn = i4.rn
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm5) i5 ON i1.rn = i5.rn
ORDER BY COALESCE(i1.rn, i2.rn, i3.rn, i4.rn, i5.rn)
limit 2</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>512</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>row_last_recruit_update_date</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/06/02 14:51:59.611</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/02 14:51:59.611</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Copy rows to result</from>
<to>Set variables</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Copy rows to result</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Copy rows to result</name>
<type>RowsToResult</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>992</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<name>Set variables</name>
<type>SetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<default_value/>
<field_name>MAX_RECRUIT_UPDATE_DATE</field_name>
<variable_name>M_R_UP_DATE</variable_name>
<variable_type>GP_WORKFLOW</variable_type>
</field>
</fields>
<use_formatting>Y</use_formatting>
<attributes/>
<GUI>
<xloc>1232</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>SELECT
system_update_date AS MAX_RECRUIT_UPDATE_DATE--,
--record_created
FROM public.recruit_create
WHERE system_update_date = (select max(system_update_date) from public.recruit_create)
and workflow = 'job_recruits_info'
order by record_created desc
limit 1</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -40,13 +40,10 @@
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/job_child.hwf</filename>
<logext/>
<logfile/>
<loglevel>Nothing</loglevel>
<parameters>
<parameter>
<name>M_R_CR_DATE</name>
<stream_name/>
<value>${M_R_CR_DATE}</value>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
@ -62,7 +59,7 @@
<attributes_hac/>
</action>
<action>
<name>Workflow 2</name>
<name>job_passport.hwf</name>
<description/>
<type>WORKFLOW</type>
<attributes/>
@ -70,10 +67,20 @@
<add_time>N</add_time>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/passport/job_passport.hwf</filename>
<logext/>
<logfile/>
<loglevel>Nothing</loglevel>
<parameters>
<parameter>
<name>M_R_CR_DATE</name>
<stream_name/>
<value>${M_R_CR_DATE}</value>
</parameter>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
@ -250,8 +257,8 @@
</hop>
<hop>
<from>Start</from>
<to>Workflow 2</to>
<enabled>N</enabled>
<to>job_passport.hwf</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
@ -326,7 +333,7 @@
<unconditional>N</unconditional>
</hop>
<hop>
<from>Workflow 2</from>
<from>job_passport.hwf</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>

View file

@ -98,6 +98,8 @@
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/job_create_files_child.hwf</filename>
<logext/>
<logfile/>
<loglevel>Nothing</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
@ -127,6 +129,32 @@
<filename>${PROJECT_HOME}/info_recruits/checkpoints/state_job_general_info_recruits.json</filename>
<parallel>N</parallel>
<xloc>944</xloc>
<yloc>880</yloc>
<attributes_hac/>
</action>
<action>
<name>job_create_files_passport.hwf</name>
<description/>
<type>WORKFLOW</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/job_create_files_passport.hwf</filename>
<logext/>
<logfile/>
<loglevel>Nothing</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>944</xloc>
<yloc>768</yloc>
<attributes_hac/>
</action>
@ -188,6 +216,20 @@
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>Start</from>
<to>job_create_files_passport.hwf</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>job_create_files_passport.hwf</from>
<to>Success job_create_files_recruits_info.hwf</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
</hops>
<notepads>
<notepad>

View file

@ -63,7 +63,7 @@
<filename>${PROJECT_HOME}/info_recruits/raw_data/info_recruits/checkpoints/state_job_recruits_info.json</filename>
<parallel>N</parallel>
<xloc>752</xloc>
<yloc>448</yloc>
<yloc>512</yloc>
<attributes_hac/>
</action>
<action>
@ -87,13 +87,31 @@
"pipeline": "job_child"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<encoding/>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json</filename>
<parallel>N</parallel>
<xloc>752</xloc>
<yloc>288</yloc>
<attributes_hac/>
</action>
<action>
<name>state_job_passport_success</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "SUCCESS",
"pipeline": "job_passport"
}</content>
<createParentFolder>N</createParentFolder>
<encoding/>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json</filename>
<parallel>N</parallel>
<xloc>752</xloc>
<yloc>432</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
@ -138,6 +156,20 @@
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_job_passport_success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>state_job_passport_success</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
</hops>
<notepads>
</notepads>

View file

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>recruitment_rows_five_flow_child</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/04/18 09:48:01.970</created_date>
<modified_user>-</modified_user>
<modified_date>2025/04/18 09:48:01.970</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Copy rows to result</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Copy rows to result</name>
<type>RowsToResult</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>832</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
from ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num,
((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position
FROM ordered
),
pivoted AS (
SELECT
position,
MAX(CASE WHEN flow_num = 1 THEN created_at END) AS cr_flow1,
MAX(CASE WHEN flow_num = 1 THEN idm_id::text END) AS idm_flow1,
MAX(CASE WHEN flow_num = 2 THEN created_at END) AS cr_flow2,
MAX(CASE WHEN flow_num = 2 THEN idm_id::text END) AS idm_flow2,
MAX(CASE WHEN flow_num = 3 THEN created_at END) AS cr_flow3,
MAX(CASE WHEN flow_num = 3 THEN idm_id::text END) AS idm_flow3,
MAX(CASE WHEN flow_num = 4 THEN created_at END) AS cr_flow4,
MAX(CASE WHEN flow_num = 4 THEN idm_id::text END) AS idm_flow4,
MAX(CASE WHEN flow_num = 5 THEN created_at END) AS cr_flow5,
MAX(CASE WHEN flow_num = 5 THEN idm_id::text END) AS idm_flow5
FROM splitted
GROUP BY position
ORDER BY position
)
SELECT
cr_flow1,
IDM_FLOW1::uuid,
cr_flow2,
IDM_FLOW2::uuid,
cr_flow3,
IDM_FLOW3::uuid,
cr_flow4,
IDM_FLOW4::uuid,
cr_flow5,
IDM_FLOW5::uuid
FROM pivoted
limit 3</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>464</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>recruitment_rows_five_flow_child</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/04/18 09:48:01.970</created_date>
<modified_user>-</modified_user>
<modified_date>2025/04/18 09:48:01.970</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Copy rows to result</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Copy rows to result</name>
<type>RowsToResult</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>832</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
from ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num,
((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position
FROM ordered
),
pivoted AS (
SELECT
position,
MAX(CASE WHEN flow_num = 1 THEN created_at END) AS cr_flow1,
MAX(CASE WHEN flow_num = 1 THEN idm_id::text END) AS idm_flow1,
MAX(CASE WHEN flow_num = 2 THEN created_at END) AS cr_flow2,
MAX(CASE WHEN flow_num = 2 THEN idm_id::text END) AS idm_flow2,
MAX(CASE WHEN flow_num = 3 THEN created_at END) AS cr_flow3,
MAX(CASE WHEN flow_num = 3 THEN idm_id::text END) AS idm_flow3,
MAX(CASE WHEN flow_num = 4 THEN created_at END) AS cr_flow4,
MAX(CASE WHEN flow_num = 4 THEN idm_id::text END) AS idm_flow4,
MAX(CASE WHEN flow_num = 5 THEN created_at END) AS cr_flow5,
MAX(CASE WHEN flow_num = 5 THEN idm_id::text END) AS idm_flow5
FROM splitted
GROUP BY position
ORDER BY position
)
SELECT
cr_flow1,
IDM_FLOW1::uuid,
cr_flow2,
IDM_FLOW2::uuid,
cr_flow3,
IDM_FLOW3::uuid,
cr_flow4,
IDM_FLOW4::uuid,
cr_flow5,
IDM_FLOW5::uuid
FROM pivoted
limit 3</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>464</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>