From d3442b1f8517d01e78401d6c25d562dbd79ff5d1 Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Thu, 24 Jul 2025 11:27:02 +0300 Subject: [PATCH] ERVU-504: init family --- ...checkpoint_job_info_recruits_from_json.hpl | 278 ++- .../citizen_tables/child/delta_child.hpl | 99 +- .../citizen_tables/child/job_child.hwf | 98 +- .../child/job_recruit_last_update_date.hwf | 2 +- .../child/parallel/child_flow1.hpl | 229 ++- .../child/parallel/child_flow2.hpl | 145 +- .../child/parallel/child_flow3.hpl | 145 +- .../child/parallel/child_flow4.hpl | 145 +- .../child/parallel/child_flow5.hpl | 145 +- .../recruit_update_date_ervu_dashboard.hpl | 7 +- .../branching_citizen_guardianship.hpl | 173 ++ .../checkpoint_citizen_guardianship_error.hpl | 276 +++ .../checkpoint_job_citizen_guardianship.hpl | 733 +++++++ .../job_create_files_citizen_guardianship.hwf | 235 +++ .../state_citizen_guardianship_delta.json | 6 + .../state_citizen_guardianship_flow1.json | 4 + .../state_citizen_guardianship_flow2.json | 4 + .../state_citizen_guardianship_flow3.json | 4 + .../state_citizen_guardianship_flow4.json | 4 + .../state_citizen_guardianship_flow5.json | 4 + .../delta_citizen_guardianship.hpl | 166 ++ .../job_citizen_guardianship.hwf | 1718 +++++++++++++++++ .../job_recruit_last_update_date.hwf | 124 ++ .../parallel/citizen_guardianship_flow1.hpl | 253 +++ .../parallel/citizen_guardianship_flow2.hpl | 166 ++ .../parallel/citizen_guardianship_flow3.hpl | 166 ++ .../parallel/citizen_guardianship_flow4.hpl | 166 ++ .../parallel/citizen_guardianship_flow5.hpl | 166 ++ .../recruit_update_date_ervu_dashboard.hpl | 98 + .../recruitment_rows_five_flow_if_error.hpl | 261 +++ .../row_last_recruit_update_date.hpl | 109 ++ .../branching_citizen_spouse.hpl | 175 ++ .../checkpoint_citizen_spouse_error.hpl | 276 +++ .../checkpoint_job_citizen_spouse.hpl | 733 +++++++ .../job_create_files_citizen_spouse.hwf | 235 +++ .../state_citizen_spouse_delta.json | 6 + .../state_citizen_spouse_flow1.json | 4 + .../state_citizen_spouse_flow2.json | 4 + .../state_citizen_spouse_flow3.json | 4 + .../state_citizen_spouse_flow4.json | 4 + .../state_citizen_spouse_flow5.json | 4 + .../citizen_spouse/delta_citizen_spouse.hpl | 322 +++ .../citizen_spouse/job_citizen_spouse.hwf | 1716 ++++++++++++++++ .../job_recruit_last_update_date.hwf | 124 ++ .../parallel/citizen_spouse_flow1.hpl | 411 ++++ .../parallel/citizen_spouse_flow2.hpl | 320 +++ .../parallel/citizen_spouse_flow3.hpl | 320 +++ .../parallel/citizen_spouse_flow4.hpl | 320 +++ .../parallel/citizen_spouse_flow5.hpl | 320 +++ .../recruit_update_date_ervu_dashboard.hpl | 95 + .../recruitment_rows_five_flow_if_error.hpl | 261 +++ .../row_last_recruit_update_date.hpl | 109 ++ .../job_info_recruits_from_json.hwf | 21 +- .../supportive_jobs/job_create_files.hwf | 42 + .../job_create_files_for_test.hwf | 36 +- ...nt_rows_five_flow_citizen_guardianship.hpl | 121 ++ ...ruitment_rows_five_flow_citizen_spouse.hpl | 121 ++ 57 files changed, 11809 insertions(+), 424 deletions(-) create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_recruit_last_update_date.hwf create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_guardianship/row_last_recruit_update_date.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/job_create_files_citizen_spouse.hwf create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_delta.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/job_recruit_last_update_date.hwf create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/recruit_update_date_ervu_dashboard.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl create mode 100644 mappings_new/info_recruits/citizen_tables/citizen_spouse/row_last_recruit_update_date.hpl create mode 100644 mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl create mode 100644 mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl diff --git a/mappings_new/info_recruits/checkpoints/checkpoint_job_info_recruits_from_json.hpl b/mappings_new/info_recruits/checkpoints/checkpoint_job_info_recruits_from_json.hpl index cb521a8..b8d99cd 100644 --- a/mappings_new/info_recruits/checkpoints/checkpoint_job_info_recruits_from_json.hpl +++ b/mappings_new/info_recruits/checkpoints/checkpoint_job_info_recruits_from_json.hpl @@ -21,9 +21,9 @@ - JSON input state_job_???.json + JSON input state_job_passport.json Filter rows - N + Y JSON input state_child_delta.json @@ -31,9 +31,9 @@ Y - JSON input state_???_delta.json + JSON input state_passport_delta.json Filter rows - N + Y JSON input state_job_child.json @@ -129,7 +129,6 @@ N -1 - constant -1 job_child @@ -178,7 +177,6 @@ N -1 - constant -1 delta_child @@ -215,6 +213,108 @@ String + + + + + + = + pipeline + N + OR + + N + -1 + + constant + -1 + delta_passport + String + + + + + + = + status + N + AND + + N + -1 + + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + + constant + -1 + delta_passport + String + + + + + + + + = + pipeline + N + OR + + N + -1 + + constant + -1 + job_passport + String + + + + + + = + status + N + AND + + N + -1 + + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + + constant + -1 + job_passport + String + + = pipeline @@ -238,7 +338,7 @@ - JSON input state_???_delta.json + JSON input state_passport_delta.json JsonInput Y @@ -260,7 +360,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen/checkpoints/state_citizen_delta.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_delta.json N @@ -312,81 +412,6 @@ 832 - - JSON input state_job_???.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen/checkpoints/state_job_citizen.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 448 - 912 - - JSON input state_child_delta.json JsonInput @@ -462,6 +487,81 @@ 656 + + JSON input state_job_passport.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 448 + 912 + + JSON input state_job_child.json JsonInput @@ -598,13 +698,13 @@ none + Basic Y - - N 0 - Basic ${STATUS} + + 1520 @@ -622,13 +722,13 @@ none + Basic Y - - N 0 - Basic ${STATUS} + + 1520 diff --git a/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl b/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl index e758f3c..938c82b 100644 --- a/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl @@ -45,6 +45,11 @@ recruit_id recruit_id + + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -82,6 +87,31 @@ kinship_type Y + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + N @@ -104,32 +134,53 @@ ervu-dashboard N 0 - 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}' != '' -- Проверка на пустую строку + 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 +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; + + Y diff --git a/mappings_new/info_recruits/citizen_tables/child/job_child.hwf b/mappings_new/info_recruits/citizen_tables/child/job_child.hwf index 99c7624..358297b 100644 --- a/mappings_new/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings_new/info_recruits/citizen_tables/child/job_child.hwf @@ -108,13 +108,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow1.hpl Basic + + ID_F1 + IDM_FLOW1 + Y - N + Y local N N @@ -134,13 +138,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow2.hpl Basic + + ID_F2 + IDM_FLOW2 + Y - N + Y local N N @@ -160,13 +168,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow3.hpl Basic + + ID_F3 + IDM_FLOW3 + Y - N + Y local N N @@ -186,13 +198,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow4.hpl Basic + + ID_F4 + IDM_FLOW4 + Y - N + Y local N N @@ -212,13 +228,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow5.hpl Basic + + ID_F5 + IDM_FLOW5 + Y - N + Y local N N @@ -652,13 +672,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow1.hpl Basic + + ID_F1 + IDM_FLOW1 + Y - N + Y local N N @@ -678,13 +702,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow2.hpl Basic + + ID_F2 + IDM_FLOW2 + Y - N + Y local N N @@ -704,13 +732,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow3.hpl Basic + + ID_F3 + IDM_FLOW3 + Y - N + Y local N N @@ -730,13 +762,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow4.hpl Basic + + ID_F4 + IDM_FLOW4 + Y - N + Y local N N @@ -756,13 +792,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow5.hpl Basic + + ID_F5 + IDM_FLOW5 + Y - N + Y local N N @@ -1080,6 +1120,10 @@ ${PROJECT_HOME}/info_recruits/citizen_tables/child/delta_child.hpl Basic + + M_R_UP_DATE + ${M_R_UP_DATE} + Y N @@ -1093,7 +1137,7 @@ - Success delta_citizen + Success delta_child SUCCESS @@ -1143,7 +1187,7 @@ - error delta_citizen + error delta_child SUCCESS @@ -1425,14 +1469,14 @@ Simple child WHERE ERROR Y N - Y + N
branching_child.hpl Simple child WHERE SUCCESS Y - N - Y + Y + N checkpoint_child_error.hpl @@ -1639,14 +1683,14 @@ state_delta_child_success - Success delta_citizen + Success delta_child Y Y N state_delta_child_error - error delta_citizen + error delta_child Y Y N diff --git a/mappings_new/info_recruits/citizen_tables/child/job_recruit_last_update_date.hwf b/mappings_new/info_recruits/citizen_tables/child/job_recruit_last_update_date.hwf index fe4c912..5872f7e 100644 --- a/mappings_new/info_recruits/citizen_tables/child/job_recruit_last_update_date.hwf +++ b/mappings_new/info_recruits/citizen_tables/child/job_recruit_last_update_date.hwf @@ -41,7 +41,7 @@ N N N - ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/recruit_update_date_ervu_dashboard.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl Basic diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow1.hpl b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow1.hpl index 255ea10..507fc39 100644 --- a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow1.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow1.hpl @@ -64,6 +64,102 @@ 400 + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + + = + child_external_id + child_external_id + + + ervu_dashboard + citizen_child
+ + recruit_id + recruit_id + N + + + birth_az_number + birth_az_number + Y + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + full_name + full_name + Y + + + kinship_type + kinship_type + Y + + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + +
+ N + + + 944 + 288 + +
Select values 4 2 SelectValues @@ -115,31 +211,52 @@ ervu-dashboard N 0 - 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' + 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 +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; + Y @@ -147,70 +264,6 @@ join child on r.recruit_id = child.recruit_id 288 - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_child
- - recruit_id - recruit_id - N - - - birth_az_number - birth_az_number - Y - - - birth_date - birth_date - Y - - - death_az_number - death_az_number - Y - - - death_date - death_date - Y - - - full_name - full_name - Y - - - kinship_type - kinship_type - Y - -
- N - - - 944 - 288 - -
Select values 4 2 diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow2.hpl b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow2.hpl index 25a1f51..2dcd9d0 100644 --- a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow2.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow2.hpl @@ -26,52 +26,6 @@ Y
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - 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 - Y - - - 560 - 288 - - Insert / update InsertUpdate @@ -90,6 +44,13 @@ join child on r.recruit_id = child.recruit_id = recruit_id recruit_id + + + + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -128,6 +89,31 @@ join child on r.recruit_id = child.recruit_id kinship_type Y + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + N @@ -136,6 +122,73 @@ join child on r.recruit_id = child.recruit_id 288
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + + Y + + + 560 + 288 + + diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow3.hpl b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow3.hpl index b54983c..d4c23a4 100644 --- a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow3.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow3.hpl @@ -26,52 +26,6 @@ Y - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - 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 - Y - - - 672 - 352 - - Insert / update InsertUpdate @@ -90,6 +44,13 @@ join child on r.recruit_id = child.recruit_id = recruit_id recruit_id + + + + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -128,6 +89,31 @@ join child on r.recruit_id = child.recruit_id kinship_type Y + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + N @@ -136,6 +122,73 @@ join child on r.recruit_id = child.recruit_id 352
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + + Y + + + 672 + 352 + + diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow4.hpl b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow4.hpl index ae5598f..302b150 100644 --- a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow4.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow4.hpl @@ -26,52 +26,6 @@ Y - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - 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 - Y - - - 528 - 320 - - Insert / update InsertUpdate @@ -90,6 +44,13 @@ join child on r.recruit_id = child.recruit_id = recruit_id recruit_id + + + + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -128,6 +89,31 @@ join child on r.recruit_id = child.recruit_id kinship_type Y + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + N @@ -136,6 +122,73 @@ join child on r.recruit_id = child.recruit_id 320
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + + Y + + + 528 + 320 + + diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow5.hpl b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow5.hpl index 36bf1e2..4c647c2 100644 --- a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow5.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow5.hpl @@ -26,52 +26,6 @@ Y - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - 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 - Y - - - 560 - 368 - - Insert / update InsertUpdate @@ -90,6 +44,13 @@ join child on r.recruit_id = child.recruit_id = recruit_id recruit_id + + + + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -128,6 +89,31 @@ join child on r.recruit_id = child.recruit_id kinship_type Y + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + N @@ -136,6 +122,73 @@ join child on r.recruit_id = child.recruit_id 368
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + + Y + + + 560 + 368 + + diff --git a/mappings_new/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl b/mappings_new/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl index 5aa7685..6f63f21 100644 --- a/mappings_new/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl @@ -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 N @@ -74,11 +74,14 @@ limit 1 N N N + Y + N public N recruit_create
+ N Y N diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl new file mode 100644 index 0000000..dae18eb --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl @@ -0,0 +1,173 @@ + + + + branching_citizen_guardianship + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/09 09:54:43.724 + - + 2025/06/09 09:54:43.724 + + + + + + JSON input state_job_citizen_guardianship.json + Set variables + Y + + + Set variables + Write to log + N + + + + JSON input state_job_citizen_guardianship.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 816 + 448 + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + pipeline + PIPE + PARENT_WORKFLOW + + + status + STATUS + PARENT_WORKFLOW + + + Y + + + 1072 + 448 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Basic + Y + N + 0 + ${PIPE} +${STATUS} + + + pipeline + + + status + + + + + 1296 + 448 + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl new file mode 100644 index 0000000..cb265cc --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl @@ -0,0 +1,276 @@ + + + + checkpoint_citizen_guardianship_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/09 10:01:04.895 + - + 2025/06/09 10:01:04.895 + + + + + + Select values + Table output + N + + + Table input + Select values + N + + + Table input + Table output + Y + + + + Select values + SelectValues + + Y + + 1 + + none + + + + N + + idm_id + idm_id + String + -2 + -2 + + false + + + false + + + + + + + + + + 1008 + 608 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 736 + 448 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + N + N + N + N + + Y + + N + public + N + etl_checkpoints
+ + N + Y + N + Y + + + 1248 + 448 + +
+ + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl new file mode 100644 index 0000000..4805ac7 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl @@ -0,0 +1,733 @@ + + + + checkpoint_job_citizen_guardianship + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 14:19:02.590 + - + 2025/06/03 14:19:02.590 + + + + + + Filter rows + Abort + Y + + + JSON input state_citizen_guardianship_flow1.json + Filter rows + Y + + + JSON input state_citizen_guardianship_flow2.json + Filter rows + Y + + + JSON input state_citizen_guardianship_flow3.json + Filter rows + Y + + + JSON input state_citizen_guardianship_flow4.json + Filter rows + Y + + + JSON input state_citizen_guardianship_flow5.json + Filter rows + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1264 + 592 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_guardianship_flow1 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + - + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_guardianship_flow2 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_guardianship_flow3 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_guardianship_flow4 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_guardianship_flow5 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + = + pipeline + N + - + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + Abort + + + 944 + 592 + + + + JSON input state_citizen_guardianship_flow1.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 432 + + + + JSON input state_citizen_guardianship_flow2.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 512 + + + + JSON input state_citizen_guardianship_flow3.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 592 + + + + JSON input state_citizen_guardianship_flow4.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 672 + + + + JSON input state_citizen_guardianship_flow5.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 752 + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf new file mode 100644 index 0000000..dea1e91 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf @@ -0,0 +1,235 @@ + + + job_create_files_citizen_guardianship + Y + + + + - + 2025/05/26 16:48:00.210 + - + 2025/05/26 16:48:00.210 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 576 + 496 + + + + state_citizen_guardianship_flow2_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_guardianship_flow2" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json + N + 848 + 416 + + + + state_citizen_guardianship_flow1_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_guardianship_flow1" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json + N + 848 + 336 + + + + state_citizen_guardianship_flow3_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_guardianship_flow3" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json + N + 848 + 496 + + + + state_citizen_guardianship_flow4_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_guardianship_flow4" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json + N + 848 + 576 + + + + state_citizen_guardianship_flow5_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_guardianship_flow5" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json + N + 848 + 656 + + + + Success + + SUCCESS + + N + 1120 + 496 + + + + Delete file state_job_citizen_guardianship + + DELETE_FILE + + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + N + 848 + 256 + + + + + + Start + state_citizen_guardianship_flow3_new + Y + Y + Y + + + Start + state_citizen_guardianship_flow2_new + Y + Y + Y + + + Start + state_citizen_guardianship_flow1_new + Y + Y + Y + + + Start + state_citizen_guardianship_flow4_new + Y + Y + Y + + + Start + state_citizen_guardianship_flow5_new + Y + Y + Y + + + state_citizen_guardianship_flow5_new + Success + Y + Y + N + + + state_citizen_guardianship_flow4_new + Success + Y + Y + N + + + state_citizen_guardianship_flow3_new + Success + Y + Y + N + + + state_citizen_guardianship_flow2_new + Success + Y + Y + N + + + state_citizen_guardianship_flow1_new + Success + Y + Y + N + + + Start + Delete file state_job_citizen_guardianship + Y + Y + Y + + + Delete file state_job_citizen_guardianship + Success + Y + Y + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json new file mode 100644 index 0000000..902aa7c --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json @@ -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" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json new file mode 100644 index 0000000..92c9271 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow1" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json new file mode 100644 index 0000000..c23c438 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow2" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json new file mode 100644 index 0000000..d1a6c97 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow3" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json new file mode 100644 index 0000000..1d934c4 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow4" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json new file mode 100644 index 0000000..fb2c0f4 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow5" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl new file mode 100644 index 0000000..dddfe87 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl @@ -0,0 +1,166 @@ + + + + delta_citizen_guardianship + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 16:10:48.509 + - + 2025/06/03 16:10:48.509 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + + = + guardian_external_id + guardian_external_id + + + ervu_dashboard + citizen_guardianship
+ + recruit_id + recruit_id + N + + + first_name + first_name + Y + + + last_name + last_name + Y + + + middle_name + middle_name + Y + + + birth_date + birth_date + Y + + + full_name + full_name + Y + + + guardian_id_ern + guardian_id_ern + Y + + + guardian_external_id + guardian_external_id + N + + + snils + snils + Y + +
+ N + + + 1168 + 352 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 624 + 352 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf new file mode 100644 index 0000000..94e6505 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf @@ -0,0 +1,1718 @@ + + + job_citizen_guardianship + Y + + + + - + 2025/06/05 14:27:15.055 + - + 2025/06/05 14:27:15.055 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 624 + 400 + + + + Checks if files exist state_job_citizen_guardianship.json + + FILES_EXIST + + + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + + + N + 848 + 400 + + + + checkpoint_job_citizen_guardianship.hpl (2) + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl + Basic + + Y + + N + local + N + N + Y + N + 1136 + 1280 + + + + recruitment_rows_five_flow_citizen_guardianship.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl + + + Basic + + Y + + N + local + N + N + Y + Y + 1488 + 400 + + + + citizen_guardianship_flow1.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl + Basic + + + ID_F1 + IDM_FLOW1 + + Y + + Y + local + N + N + Y + N + 1808 + 80 + + + + citizen_guardianship_flow2.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl + Basic + + + ID_F2 + IDM_FLOW2 + + Y + + Y + local + N + N + Y + N + 1808 + 240 + + + + citizen_guardianship_flow3.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl + Basic + + + ID_F3 + IDM_FLOW3 + + Y + + Y + local + N + N + Y + N + 1808 + 400 + + + + citizen_guardianship_flow4.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl + Basic + + + ID_F4 + IDM_FLOW4 + + Y + + Y + local + N + N + Y + N + 1808 + 560 + + + + citizen_guardianship_flow5.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl + Basic + + + ID_F5 + IDM_FLOW5 + + Y + + Y + local + N + N + Y + N + 1808 + 720 + + + + Write state_citizen_guardianship_flow1 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json + N + 2096 + 80 + + + + Write state_citizen_guardianship_flow1 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json + N + 2096 + 160 + + + + Write state_citizen_guardianship_flow2 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json + N + 2096 + 240 + + + + Write state_citizen_guardianship_flow2 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json + N + 2096 + 320 + + + + Write state_citizen_guardianship_flow3 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json + N + 2096 + 400 + + + + Write state_citizen_guardianship_flow3 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json + N + 2096 + 480 + + + + Write state_citizen_guardianship_flow4 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json + N + 2096 + 560 + + + + Write state_citizen_guardianship_flow4 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json + N + 2096 + 640 + + + + Write state_citizen_guardianship_flow5 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json + N + 2096 + 720 + + + + Write state_citizen_guardianship_flow5 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json + N + 2096 + 800 + + + + Abort workflow + + ABORT + + N + N + 1472 + 208 + + + + checkpoint_job_citizen_guardianship.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl + Basic + + Y + + N + local + N + N + Y + N + 2496 + 384 + + + + Success new citizen + + SUCCESS + + N + 3024 + 384 + + + + state_job_citizen_guardianship_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_guardianship" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + N + 2784 + 384 + + + + state_job_citizen_guardianship_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_guardianship" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + N + 2784 + 480 + + + + state_job_citizen_guardianship_success 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_guardianship" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + N + 1360 + 1280 + + + + state_job_citizen_guardianship_error 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_guardianship" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + N + 1360 + 1376 + + + + branching_citizen_guardianship.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl + Basic + + Y + + N + local + N + N + Y + N + 1584 + 1280 + + + + Simple citizen_guardianship WHERE SUCCESS + + SIMPLE_EVAL + + SUCCESS + string + true + equal + equal + N + variable + STATUS + N + 2240 + 1792 + + + + Simple citizen_guardianship WHERE ERROR + + SIMPLE_EVAL + + ERROR + string + true + equal + equal + N + variable + STATUS + N + 1840 + 1280 + + + + checkpoint_citizen_guardianship_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2064 + 1280 + + + + recruitment_rows_five_flow_if_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl + Basic + + Y + + N + local + N + N + Y + Y + 2384 + 1280 + + + + Abort workflow 2 + + ABORT + + N + N + 2288 + 1040 + + + + citizen_guardianship_flow1.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl + Basic + + + ID_F1 + IDM_FLOW1 + + Y + + Y + local + N + N + Y + N + 2672 + 960 + + + + citizen_guardianship_flow2.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl + Basic + + + ID_F2 + IDM_FLOW2 + + Y + + Y + local + N + N + Y + N + 2672 + 1120 + + + + citizen_guardianship_flow3.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl + Basic + + + ID_F3 + IDM_FLOW3 + + Y + + Y + local + N + N + Y + N + 2672 + 1280 + + + + citizen_guardianship_flow4.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl + Basic + + + ID_F4 + IDM_FLOW4 + + Y + + Y + local + N + N + Y + N + 2672 + 1440 + + + + citizen_guardianship_flow5.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl + Basic + + + ID_F5 + IDM_FLOW5 + + Y + + Y + local + N + N + Y + N + 2672 + 1600 + + + + Write state_citizen_guardianship_flow1 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json + N + 2960 + 960 + + + + Write state_citizen_guardianship_flow1 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json + N + 2960 + 1040 + + + + Write state_citizen_guardianship_flow2 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json + N + 2960 + 1120 + + + + Write state_citizen_guardianship_flow2 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json + N + 2960 + 1200 + + + + Write state_citizen_guardianship_flow3 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json + N + 2960 + 1280 + + + + Write state_citizen_guardianship_flow3 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json + N + 2960 + 1360 + + + + Write state_citizen_guardianship_flow4 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json + N + 2960 + 1440 + + + + Write state_citizen_guardianship_flow4 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json + N + 2960 + 1520 + + + + Write state_citizen_guardianship_flow5 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json + N + 2960 + 1600 + + + + Write state_citizen_guardianship_flow5 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json + N + 2960 + 1680 + + + + Success after_error_citizen_guardianship_flow1 + + SUCCESS + + N + 3216 + 960 + + + + error after_error_citizen_guardianship_flow1 + + SUCCESS + + N + 3216 + 1040 + + + + Success after_error_citizen_guardianship_flow2 + + SUCCESS + + N + 3216 + 1120 + + + + error after_error_citizen_guardianship_flow2 + + SUCCESS + + N + 3216 + 1200 + + + + Success after_error_citizen_guardianship_flow3 + + SUCCESS + + N + 3216 + 1280 + + + + error after_error_citizen_guardianship_flow3 + + SUCCESS + + N + 3216 + 1360 + + + + Success after_error_citizen_guardianship_flow4 + + SUCCESS + + N + 3216 + 1440 + + + + error after_error_citizen_guardianship_flow4 + + SUCCESS + + N + 3216 + 1520 + + + + Success after_error_citizen_guardianship_flow5 + + SUCCESS + + N + 3216 + 1600 + + + + error after_error_citizen_guardianship_flow5 + + SUCCESS + + N + 3216 + 1680 + + + + job_recruit_last_update_date.hwf + + WORKFLOW + + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/job_recruit_last_update_date.hwf + Nothing + + Y + + N + local + N + N + Y + N + 2544 + 1792 + + + + delta_citizen_guardianship.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + Y + + N + local + N + N + Y + N + 2768 + 1792 + + + + Success delta_citizen_guardianship + + SUCCESS + + N + 3216 + 1792 + + + + state_delta_citizen_guardianship_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "delta_citizen_guardianship", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json + N + 2960 + 1792 + + + + state_delta_citizen_guardianship_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "delta_citizen_guardianship", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json + N + 2960 + 1872 + + + + error delta_citizen_guardianship + + SUCCESS + + N + 3216 + 1872 + + + + + + Start + Checks if files exist state_job_citizen_guardianship.json + Y + Y + Y + + + Checks if files exist state_job_citizen_guardianship.json + checkpoint_job_citizen_guardianship.hpl (2) + Y + Y + N + + + Checks if files exist state_job_citizen_guardianship.json + recruitment_rows_five_flow_citizen_guardianship.hpl + Y + N + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl + citizen_guardianship_flow1.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl + citizen_guardianship_flow2.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl + citizen_guardianship_flow3.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl + citizen_guardianship_flow4.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl + citizen_guardianship_flow5.hpl + Y + Y + N + + + citizen_guardianship_flow1.hpl + Write state_citizen_guardianship_flow1 SUCCESS + Y + Y + N + + + citizen_guardianship_flow1.hpl + Write state_citizen_guardianship_flow1 ERROR + Y + N + N + + + citizen_guardianship_flow2.hpl + Write state_citizen_guardianship_flow2 SUCCESS + Y + Y + N + + + citizen_guardianship_flow2.hpl + Write state_citizen_guardianship_flow2 ERROR + Y + N + N + + + citizen_guardianship_flow3.hpl + Write state_citizen_guardianship_flow3 SUCCESS + Y + Y + N + + + citizen_guardianship_flow3.hpl + Write state_citizen_guardianship_flow3 ERROR + Y + N + N + + + citizen_guardianship_flow4.hpl + Write state_citizen_guardianship_flow4 SUCCESS + Y + Y + N + + + citizen_guardianship_flow4.hpl + Write state_citizen_guardianship_flow4 ERROR + Y + N + N + + + citizen_guardianship_flow5.hpl + Write state_citizen_guardianship_flow5 SUCCESS + Y + Y + N + + + citizen_guardianship_flow5.hpl + Write state_citizen_guardianship_flow5 ERROR + Y + N + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl + Abort workflow + Y + N + N + + + Write state_citizen_guardianship_flow1 SUCCESS + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow1 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow2 SUCCESS + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow2 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow3 SUCCESS + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow3 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow4 SUCCESS + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow4 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow5 SUCCESS + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow5 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + state_job_citizen_guardianship_success + Success new citizen + Y + Y + N + + + state_job_citizen_guardianship_error + Success new citizen + Y + Y + N + + + checkpoint_job_citizen_guardianship.hpl + state_job_citizen_guardianship_success + Y + Y + N + + + checkpoint_job_citizen_guardianship.hpl + state_job_citizen_guardianship_error + Y + N + N + + + checkpoint_job_citizen_guardianship.hpl (2) + state_job_citizen_guardianship_success 2 + Y + Y + N + + + checkpoint_job_citizen_guardianship.hpl (2) + state_job_citizen_guardianship_error 2 + Y + N + N + + + state_job_citizen_guardianship_success 2 + branching_citizen_guardianship.hpl + Y + Y + N + + + state_job_citizen_guardianship_error 2 + branching_citizen_guardianship.hpl + Y + Y + N + + + Simple citizen_guardianship WHERE ERROR + checkpoint_citizen_guardianship_error.hpl + Y + N + Y + + + branching_citizen_guardianship.hpl + Simple citizen_guardianship WHERE ERROR + Y + N + N + + + branching_citizen_guardianship.hpl + Simple citizen_guardianship WHERE SUCCESS + Y + Y + N + + + checkpoint_citizen_guardianship_error.hpl + recruitment_rows_five_flow_if_error.hpl + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + Abort workflow 2 + Y + N + N + + + citizen_guardianship_flow1.hpl 2 + Write state_citizen_guardianship_flow1 SUCCESS 2 + Y + Y + N + + + citizen_guardianship_flow1.hpl 2 + Write state_citizen_guardianship_flow1 ERROR 2 + Y + N + N + + + citizen_guardianship_flow2.hpl 2 + Write state_citizen_guardianship_flow2 SUCCESS 2 + Y + Y + N + + + citizen_guardianship_flow2.hpl 2 + Write state_citizen_guardianship_flow2 ERROR 2 + Y + N + N + + + citizen_guardianship_flow3.hpl 2 + Write state_citizen_guardianship_flow3 SUCCESS 2 + Y + Y + N + + + citizen_guardianship_flow3.hpl 2 + Write state_citizen_guardianship_flow3 ERROR 2 + Y + N + N + + + citizen_guardianship_flow4.hpl 2 + Write state_citizen_guardianship_flow4 SUCCESS 2 + Y + Y + N + + + citizen_guardianship_flow4.hpl 2 + Write state_citizen_guardianship_flow4 ERROR 2 + Y + N + N + + + citizen_guardianship_flow5.hpl 2 + Write state_citizen_guardianship_flow5 SUCCESS 2 + Y + Y + N + + + citizen_guardianship_flow5.hpl 2 + Write state_citizen_guardianship_flow5 ERROR 2 + Y + N + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_guardianship_flow3.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_guardianship_flow2.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_guardianship_flow1.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_guardianship_flow4.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_guardianship_flow5.hpl 2 + Y + Y + N + + + Write state_citizen_guardianship_flow1 SUCCESS 2 + Success after_error_citizen_guardianship_flow1 + Y + Y + N + + + Write state_citizen_guardianship_flow1 ERROR 2 + error after_error_citizen_guardianship_flow1 + Y + Y + N + + + Write state_citizen_guardianship_flow2 SUCCESS 2 + Success after_error_citizen_guardianship_flow2 + Y + Y + N + + + Write state_citizen_guardianship_flow2 ERROR 2 + error after_error_citizen_guardianship_flow2 + Y + Y + N + + + Write state_citizen_guardianship_flow3 SUCCESS 2 + Success after_error_citizen_guardianship_flow3 + Y + Y + N + + + Write state_citizen_guardianship_flow3 ERROR 2 + error after_error_citizen_guardianship_flow3 + Y + Y + N + + + Write state_citizen_guardianship_flow4 SUCCESS 2 + Success after_error_citizen_guardianship_flow4 + Y + Y + N + + + Write state_citizen_guardianship_flow4 ERROR 2 + error after_error_citizen_guardianship_flow4 + Y + Y + N + + + Write state_citizen_guardianship_flow5 SUCCESS 2 + Success after_error_citizen_guardianship_flow5 + Y + Y + N + + + Write state_citizen_guardianship_flow5 ERROR 2 + error after_error_citizen_guardianship_flow5 + Y + Y + N + + + Simple citizen_guardianship WHERE SUCCESS + job_recruit_last_update_date.hwf + Y + Y + N + + + job_recruit_last_update_date.hwf + delta_citizen_guardianship.hpl + Y + Y + N + + + state_delta_citizen_guardianship_success + Success delta_citizen_guardianship + Y + Y + N + + + state_delta_citizen_guardianship_error + error delta_citizen_guardianship + Y + Y + N + + + delta_citizen_guardianship.hpl + state_delta_citizen_guardianship_success + Y + Y + N + + + delta_citizen_guardianship.hpl + state_delta_citizen_guardianship_error + Y + N + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_recruit_last_update_date.hwf b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_recruit_last_update_date.hwf new file mode 100644 index 0000000..e2dc7c9 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_recruit_last_update_date.hwf @@ -0,0 +1,124 @@ + + + job_recruit_last_update_date + Y + + + + - + 2025/06/02 14:48:05.666 + - + 2025/06/02 14:48:05.666 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 592 + 352 + + + + recruit_update_date_ervu_dashboard.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 784 + 352 + + + + row_last_recruit_update_date.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/row_last_recruit_update_date.hpl + Basic + + Y + + N + local + N + N + Y + N + 1056 + 352 + + + + Success + + SUCCESS + + N + 1232 + 352 + + + + + + Start + recruit_update_date_ervu_dashboard.hpl + Y + Y + Y + + + recruit_update_date_ervu_dashboard.hpl + row_last_recruit_update_date.hpl + Y + Y + N + + + row_last_recruit_update_date.hpl + Success + Y + Y + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl new file mode 100644 index 0000000..8bab0f2 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl @@ -0,0 +1,253 @@ + + + + citizen_guardianship_flow1 + Y + + + + Normal + 0 + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Select values 4 2 + N + + + Select values 4 2 + Get variables + N + + + Table input + Insert / update + Y + + + + Get variables + GetVariable + + Y + + 1 + + none + + + + + -1 + recruitment_id + -1 + none + String + ID_F1 + + + + + 976 + 400 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + + = + guardian_external_id + guardian_external_id + + + ervu_dashboard + citizen_guardianship
+ + recruit_id + recruit_id + N + + + first_name + first_name + Y + + + last_name + last_name + Y + + + middle_name + middle_name + Y + + + birth_date + birth_date + Y + + + full_name + full_name + Y + + + guardian_id_ern + guardian_id_ern + Y + + + guardian_external_id + guardian_external_id + N + + + snils + snils + Y + +
+ N + + + 944 + 288 + +
+ + Select values 4 2 + SelectValues + + Y + + 1 + + none + + + + N + + ID_F1 + ID_F1 + String + -2 + -2 + + false + + + false + + + + + + + + + + 720 + 400 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 448 + 288 + + + + + Select values 4 2 + Get variables + Y + + + + + + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl new file mode 100644 index 0000000..f2913e5 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl @@ -0,0 +1,166 @@ + + + + citizen_guardianship_flow2 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + + = + guardian_external_id + guardian_external_id + + + ervu_dashboard + citizen_guardianship
+ + recruit_id + recruit_id + N + + + first_name + first_name + Y + + + last_name + last_name + Y + + + middle_name + middle_name + Y + + + birth_date + birth_date + Y + + + full_name + full_name + Y + + + guardian_id_ern + guardian_id_ern + Y + + + guardian_external_id + guardian_external_id + N + + + snils + snils + Y + +
+ N + + + 1088 + 288 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 560 + 288 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl new file mode 100644 index 0000000..ac380d8 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl @@ -0,0 +1,166 @@ + + + + citizen_guardianship_flow3 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + + = + guardian_external_id + guardian_external_id + + + ervu_dashboard + citizen_guardianship
+ + recruit_id + recruit_id + N + + + first_name + first_name + Y + + + last_name + last_name + Y + + + middle_name + middle_name + Y + + + birth_date + birth_date + Y + + + full_name + full_name + Y + + + guardian_id_ern + guardian_id_ern + Y + + + guardian_external_id + guardian_external_id + N + + + snils + snils + Y + +
+ N + + + 1216 + 352 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 672 + 352 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl new file mode 100644 index 0000000..dadd9fc --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl @@ -0,0 +1,166 @@ + + + + citizen_guardianship_flow4 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + + = + guardian_external_id + guardian_external_id + + + ervu_dashboard + citizen_guardianship
+ + recruit_id + recruit_id + N + + + first_name + first_name + Y + + + last_name + last_name + Y + + + middle_name + middle_name + Y + + + birth_date + birth_date + Y + + + full_name + full_name + Y + + + guardian_id_ern + guardian_id_ern + Y + + + guardian_external_id + guardian_external_id + N + + + snils + snils + Y + +
+ N + + + 1072 + 320 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 528 + 320 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl new file mode 100644 index 0000000..21abfac --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl @@ -0,0 +1,166 @@ + + + + citizen_guardianship_flow5 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + + = + guardian_external_id + guardian_external_id + + + ervu_dashboard + citizen_guardianship
+ + recruit_id + recruit_id + N + + + first_name + first_name + Y + + + last_name + last_name + Y + + + middle_name + middle_name + Y + + + birth_date + birth_date + Y + + + full_name + full_name + Y + + + guardian_id_ern + guardian_id_ern + Y + + + guardian_external_id + guardian_external_id + N + + + snils + snils + Y + +
+ N + + + 1040 + 368 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 560 + 368 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl new file mode 100644 index 0000000..6f63f21 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl @@ -0,0 +1,98 @@ + + + + recruit_update_date_ervu_dashboard + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/02 14:50:31.833 + - + 2025/06/02 14:50:31.833 + + + + + + Table input + Table output + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 896 + 304 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + N + N + N + N + + Y + + N + public + N + recruit_create
+ + N + Y + N + Y + + + 1216 + 304 + +
+ + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl new file mode 100644 index 0000000..dc89572 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl @@ -0,0 +1,261 @@ + + + + recruitment_rows_five_flow_if_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/23 14:28:22.572 + - + 2025/05/23 14:28:22.572 + + + + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 880 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 512 + 288 + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/row_last_recruit_update_date.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/row_last_recruit_update_date.hpl new file mode 100644 index 0000000..5597125 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/row_last_recruit_update_date.hpl @@ -0,0 +1,109 @@ + + + + row_last_recruit_update_date + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/02 14:51:59.611 + - + 2025/06/02 14:51:59.611 + + + + + + Copy rows to result + Set variables + Y + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 992 + 320 + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + + MAX_RECRUIT_UPDATE_DATE + M_R_UP_DATE + GP_WORKFLOW + + + Y + + + 1232 + 320 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 688 + 320 + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl new file mode 100644 index 0000000..0987acb --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl @@ -0,0 +1,175 @@ + + + + branching_citizen_spouse + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/09 09:54:43.724 + - + 2025/06/09 09:54:43.724 + + + + + + JSON input state_job_citizen_spouse.json + Set variables + Y + + + Set variables + Write to log + N + + + + JSON input state_job_citizen_spouse.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 816 + 448 + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + + pipeline + PIPE + PARENT_WORKFLOW + + + + status + STATUS + PARENT_WORKFLOW + + + Y + + + 1072 + 448 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Basic + Y + N + 0 + ${PIPE} +${STATUS} + + + pipeline + + + status + + + + + 1296 + 448 + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl new file mode 100644 index 0000000..b1b8e7d --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl @@ -0,0 +1,276 @@ + + + + checkpoint_citizen_spouse_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/09 10:01:04.895 + - + 2025/06/09 10:01:04.895 + + + + + + Select values + Table output + N + + + Table input + Select values + N + + + Table input + Table output + Y + + + + Select values + SelectValues + + Y + + 1 + + none + + + + N + + idm_id + idm_id + String + -2 + -2 + + false + + + false + + + + + + + + + + 1008 + 608 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 736 + 448 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + N + N + N + N + + Y + + N + public + N + etl_checkpoints
+ + N + Y + N + Y + + + 1248 + 448 + +
+ + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl new file mode 100644 index 0000000..0b4d1d5 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl @@ -0,0 +1,733 @@ + + + + checkpoint_job_citizen_spouse + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 14:19:02.590 + - + 2025/06/03 14:19:02.590 + + + + + + Filter rows + Abort + Y + + + JSON input state_citizen_spouse_flow1.json + Filter rows + Y + + + JSON input state_citizen_spouse_flow2.json + Filter rows + Y + + + JSON input state_citizen_spouse_flow3.json + Filter rows + Y + + + JSON input state_citizen_spouse_flow4.json + Filter rows + Y + + + JSON input state_citizen_spouse_flow5.json + Filter rows + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1264 + 592 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_spouse_flow1 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + - + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_spouse_flow2 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_spouse_flow3 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_spouse_flow4 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + + + + + = + pipeline + N + - + + N + -1 + + constant + -1 + citizen_spouse_flow5 + String + + + + + + = + status + N + AND + + N + -1 + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + = + pipeline + N + - + + N + -1 + constant + -1 + recruits_info_flow1 + String + + + + Abort + + + 944 + 592 + + + + JSON input state_citizen_spouse_flow1.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 432 + + + + JSON input state_citizen_spouse_flow2.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 512 + + + + JSON input state_citizen_spouse_flow3.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 592 + + + + JSON input state_citizen_spouse_flow4.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 672 + + + + JSON input state_citizen_spouse_flow5.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 640 + 752 + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/job_create_files_citizen_spouse.hwf b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/job_create_files_citizen_spouse.hwf new file mode 100644 index 0000000..b88bb8f --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/job_create_files_citizen_spouse.hwf @@ -0,0 +1,235 @@ + + + job_create_files_citizen_spouse + Y + + + + - + 2025/05/26 16:48:00.210 + - + 2025/05/26 16:48:00.210 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 576 + 496 + + + + state_citizen_spouse_flow2_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_spouse_flow2" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + N + 848 + 416 + + + + state_citizen_spouse_flow1_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_spouse_flow1" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + N + 848 + 336 + + + + state_citizen_spouse_flow3_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_spouse_flow3" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + N + 848 + 496 + + + + state_citizen_spouse_flow4_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_spouse_flow4" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + N + 848 + 576 + + + + state_citizen_spouse_flow5_new + + WRITE_TO_FILE + + N + { + "status": "NEW", + "pipeline": "citizen_spouse_flow5" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + N + 848 + 656 + + + + Success + + SUCCESS + + N + 1120 + 496 + + + + Delete file state_job_citizen_spouse + + DELETE_FILE + + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouset/checkpoints/state_job_citizen_spouse.json + N + 848 + 256 + + + + + + Start + state_citizen_spouse_flow3_new + Y + Y + Y + + + Start + state_citizen_spouse_flow2_new + Y + Y + Y + + + Start + state_citizen_spouse_flow1_new + Y + Y + Y + + + Start + state_citizen_spouse_flow4_new + Y + Y + Y + + + Start + state_citizen_spouse_flow5_new + Y + Y + Y + + + state_citizen_spouse_flow5_new + Success + Y + Y + N + + + state_citizen_spouse_flow4_new + Success + Y + Y + N + + + state_citizen_spouse_flow3_new + Success + Y + Y + N + + + state_citizen_spouse_flow2_new + Success + Y + Y + N + + + state_citizen_spouse_flow1_new + Success + Y + Y + N + + + Start + Delete file state_job_citizen_spouse + Y + Y + Y + + + Delete file state_job_citizen_spouse + Success + Y + Y + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_delta.json b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_delta.json new file mode 100644 index 0000000..7e8643f --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_delta.json @@ -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" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json new file mode 100644 index 0000000..f58187b --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "citizen_spouse_flow1" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json new file mode 100644 index 0000000..8288406 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "citizen_spouse_flow2" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json new file mode 100644 index 0000000..18b8e64 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "citizen_spouse_flow3" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json new file mode 100644 index 0000000..e75285d --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "citizen_spouse_flow4" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json new file mode 100644 index 0000000..60a93bc --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "citizen_spouse_flow5" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl new file mode 100644 index 0000000..bdab8fa --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl @@ -0,0 +1,322 @@ + + + + delta_citizen_spouse + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 16:10:48.509 + - + 2025/06/03 16:10:48.509 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + 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 + + + ervu-dashboard + Y + N + N + Y + N + 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; + + + 816 + 176 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1168 + 352 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + + Y + + + 624 + 352 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf b/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf new file mode 100644 index 0000000..9c4b95a --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf @@ -0,0 +1,1716 @@ + + + job_citizen_spouse + Y + + + + - + 2025/06/05 14:27:15.055 + - + 2025/06/05 14:27:15.055 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 624 + 400 + + + + Checks if files exist state_job_citizen_spouse.json + + FILES_EXIST + + + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + + + N + 848 + 400 + + + + checkpoint_job_citizen_spouse.hpl (2) + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl + Basic + + Y + + N + local + N + N + Y + N + 1136 + 1280 + + + + recruitment_rows_five_flow_citizen_spouse.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1488 + 400 + + + + citizen_spouse_flow1.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl + Basic + + + ID_F1 + IDM_FLOW1 + + Y + + N + local + N + N + Y + N + 1808 + 80 + + + + citizen_spouse_flow2.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl + Basic + + + ID_F2 + IDM_FLOW2 + + Y + + N + local + N + N + Y + N + 1808 + 240 + + + + citizen_spouse_flow3.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl + Basic + + + ID_F3 + IDM_FLOW3 + + Y + + N + local + N + N + Y + N + 1808 + 400 + + + + citizen_spouse_flow4.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl + Basic + + + ID_F4 + IDM_FLOW4 + + Y + + N + local + N + N + Y + N + 1808 + 560 + + + + citizen_spouse_flow5.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl + Basic + + + ID_F5 + IDM_FLOW5 + + Y + + N + local + N + N + Y + N + 1808 + 720 + + + + Write state_citizen_spouse_flow1 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + N + 2096 + 80 + + + + Write state_citizen_spouse_flow1 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + N + 2096 + 160 + + + + Write state_citizen_spouse_flow2 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + N + 2096 + 240 + + + + Write state_citizen_spouse_flow2 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + N + 2096 + 320 + + + + Write state_citizen_spouse_flow3 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + N + 2096 + 400 + + + + Write state_citizen_spouse_flow3 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + N + 2096 + 480 + + + + Write state_citizen_spouse_flow4 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + N + 2096 + 560 + + + + Write state_citizen_spouse_flow4 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + N + 2096 + 640 + + + + Write state_citizen_spouse_flow5 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + N + 2096 + 720 + + + + Write state_citizen_spouse_flow5 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + N + 2096 + 800 + + + + Abort workflow + + ABORT + + N + N + 1472 + 208 + + + + checkpoint_job_citizen_spouse.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl + Basic + + Y + + N + local + N + N + Y + N + 2496 + 384 + + + + Success new citizen_spouse + + SUCCESS + + N + 3024 + 384 + + + + state_job_citizen_spouse_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_spouse" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + N + 2784 + 384 + + + + state_job_citizen_spouse_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_spouse" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + N + 2784 + 480 + + + + state_job_citizen_spouse_success 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_spouse" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + N + 1360 + 1280 + + + + state_job_citizen_spouse_error 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_spouse" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + N + 1360 + 1376 + + + + branching_citizen_spouse.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl + Basic + + Y + + N + local + N + N + Y + N + 1584 + 1280 + + + + Simple citizen_spouse WHERE SUCCESS + + SIMPLE_EVAL + + SUCCESS + string + true + equal + equal + N + variable + STATUS + N + 2240 + 1792 + + + + Simple citizen_spouse WHERE ERROR + + SIMPLE_EVAL + + ERROR + string + true + equal + equal + N + variable + STATUS + N + 1840 + 1280 + + + + checkpoint_citizen_spouse_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2064 + 1280 + + + + recruitment_rows_five_flow_if_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl + Basic + + Y + + N + local + N + N + Y + Y + 2384 + 1280 + + + + Abort workflow 2 + + ABORT + + N + N + 2288 + 1040 + + + + citizen_spouse_flow1.hpl 2 + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl + Basic + + + ID_F1 + IDM_FLOW1 + + Y + + N + local + N + N + Y + N + 2672 + 960 + + + + citizen_spouse_flow2.hpl 2 + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl + Basic + + + ID_F2 + IDM_FLOW2 + + Y + + N + local + N + N + Y + N + 2672 + 1120 + + + + citizen_spouse_flow3.hpl 2 + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl + Basic + + + ID_F3 + IDM_FLOW3 + + Y + + N + local + N + N + Y + N + 2672 + 1280 + + + + citizen_spouse_flow4.hpl 2 + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl + Basic + + + ID_F4 + IDM_FLOW4 + + Y + + N + local + N + N + Y + N + 2704 + 1424 + + + + citizen_spouse_flow5.hpl 2 + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl + Basic + + + ID_F5 + IDM_FLOW5 + + Y + + N + local + N + N + Y + N + 2672 + 1600 + + + + Write state_citizen_spouse_flow1 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + N + 2960 + 960 + + + + Write state_citizen_spouse_flow1 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + N + 2960 + 1040 + + + + Write state_citizen_spouse_flow2 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + N + 2960 + 1120 + + + + Write state_citizen_spouse_flow2 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + N + 2960 + 1200 + + + + Write state_citizen_spouse_flow3 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + N + 2960 + 1280 + + + + Write state_citizen_spouse_flow3 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + N + 2960 + 1360 + + + + Write state_citizen_spouse_flow4 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + N + 2960 + 1440 + + + + Write state_citizen_spouse_flow4 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + N + 2960 + 1520 + + + + Write state_citizen_spouse_flow5 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + N + 2960 + 1600 + + + + Write state_citizen_spouse_flow5 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + N + 2960 + 1680 + + + + Success after_error_citizen_spouse_flow1 + + SUCCESS + + N + 3216 + 960 + + + + error after_error_citizen_spouse_flow1 + + SUCCESS + + N + 3216 + 1040 + + + + Success after_error_citizen_spouse_flow2 + + SUCCESS + + N + 3216 + 1120 + + + + error after_error_citizen_spouse_flow2 + + SUCCESS + + N + 3216 + 1200 + + + + Success after_error_citizen_spouse_flow3 + + SUCCESS + + N + 3216 + 1280 + + + + error after_error_citizen_spouse_flow3 + + SUCCESS + + N + 3216 + 1360 + + + + Success after_error_citizen_spouse_flow4 + + SUCCESS + + N + 3216 + 1440 + + + + error after_error_citizen_spouse_flow4 + + SUCCESS + + N + 3216 + 1520 + + + + Success after_error_citizen_spouse_flow5 + + SUCCESS + + N + 3216 + 1600 + + + + error after_error_citizen_spouse_flow5 + + SUCCESS + + N + 3216 + 1680 + + + + job_recruit_last_update_date.hwf + + WORKFLOW + + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/job_recruit_last_update_date.hwf + Nothing + + Y + + N + local + N + N + Y + N + 2544 + 1792 + + + + delta_citizen_spouse.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + Y + + N + local + N + N + Y + N + 2768 + 1792 + + + + Success delta_citizen_spouse + + SUCCESS + + N + 3216 + 1792 + + + + state_delta_citizen_spouse_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "delta_citizen_spouse", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_delta.json + N + 2960 + 1792 + + + + state_delta_citizen_spouse_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "delta_citizen_spouse", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_delta.json + N + 2960 + 1872 + + + + error delta_citizen_spouse + + SUCCESS + + N + 3216 + 1872 + + + + + + Start + Checks if files exist state_job_citizen_spouse.json + Y + Y + Y + + + Checks if files exist state_job_citizen_spouse.json + checkpoint_job_citizen_spouse.hpl (2) + Y + Y + N + + + Checks if files exist state_job_citizen_spouse.json + recruitment_rows_five_flow_citizen_spouse.hpl + Y + N + N + + + recruitment_rows_five_flow_citizen_spouse.hpl + citizen_spouse_flow1.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl + citizen_spouse_flow2.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl + citizen_spouse_flow3.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl + citizen_spouse_flow4.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl + citizen_spouse_flow5.hpl + Y + Y + N + + + citizen_spouse_flow1.hpl + Write state_citizen_spouse_flow1 SUCCESS + Y + Y + N + + + citizen_spouse_flow1.hpl + Write state_citizen_spouse_flow1 ERROR + Y + N + N + + + citizen_spouse_flow2.hpl + Write state_citizen_spouse_flow2 SUCCESS + Y + Y + N + + + citizen_spouse_flow2.hpl + Write state_citizen_spouse_flow2 ERROR + Y + N + N + + + citizen_spouse_flow3.hpl + Write state_citizen_spouse_flow3 SUCCESS + Y + Y + N + + + citizen_spouse_flow3.hpl + Write state_citizen_spouse_flow3 ERROR + Y + N + N + + + citizen_spouse_flow4.hpl + Write state_citizen_spouse_flow4 SUCCESS + Y + Y + N + + + citizen_spouse_flow4.hpl + Write state_citizen_spouse_flow4 ERROR + Y + N + N + + + citizen_spouse_flow5.hpl + Write state_citizen_spouse_flow5 SUCCESS + Y + Y + N + + + citizen_spouse_flow5.hpl + Write state_citizen_spouse_flow5 ERROR + Y + N + N + + + recruitment_rows_five_flow_citizen_spouse.hpl + Abort workflow + Y + N + N + + + Write state_citizen_spouse_flow1 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow1 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow2 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow2 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow3 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow3 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow4 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow4 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow5 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow5 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + state_job_citizen_spouse_success + Success new citizen_spouse + Y + Y + N + + + state_job_citizen_spouse_error + Success new citizen_spouse + Y + Y + N + + + checkpoint_job_citizen_spouse.hpl + state_job_citizen_spouse_success + Y + Y + N + + + checkpoint_job_citizen_spouse.hpl + state_job_citizen_spouse_error + Y + N + N + + + checkpoint_job_citizen_spouse.hpl (2) + state_job_citizen_spouse_success 2 + Y + Y + N + + + checkpoint_job_citizen_spouse.hpl (2) + state_job_citizen_spouse_error 2 + Y + N + N + + + state_job_citizen_spouse_success 2 + branching_citizen_spouse.hpl + Y + Y + N + + + state_job_citizen_spouse_error 2 + branching_citizen_spouse.hpl + Y + Y + N + + + Simple citizen_spouse WHERE ERROR + checkpoint_citizen_spouse_error.hpl + Y + N + Y + + + branching_citizen_spouse.hpl + Simple citizen_spouse WHERE ERROR + Y + N + N + + + branching_citizen_spouse.hpl + Simple citizen_spouse WHERE SUCCESS + Y + Y + N + + + checkpoint_citizen_spouse_error.hpl + recruitment_rows_five_flow_if_error.hpl + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + Abort workflow 2 + Y + N + N + + + citizen_spouse_flow1.hpl 2 + Write state_citizen_spouse_flow1 SUCCESS 2 + Y + Y + N + + + citizen_spouse_flow1.hpl 2 + Write state_citizen_spouse_flow1 ERROR 2 + Y + N + N + + + citizen_spouse_flow2.hpl 2 + Write state_citizen_spouse_flow2 SUCCESS 2 + Y + Y + N + + + citizen_spouse_flow2.hpl 2 + Write state_citizen_spouse_flow2 ERROR 2 + Y + N + N + + + citizen_spouse_flow3.hpl 2 + Write state_citizen_spouse_flow3 SUCCESS 2 + Y + Y + N + + + citizen_spouse_flow3.hpl 2 + Write state_citizen_spouse_flow3 ERROR 2 + Y + N + N + + + citizen_spouse_flow4.hpl 2 + Write state_citizen_spouse_flow4 SUCCESS 2 + Y + Y + N + + + citizen_spouse_flow4.hpl 2 + Write state_citizen_spouse_flow4 ERROR 2 + Y + N + N + + + citizen_spouse_flow5.hpl 2 + Write state_citizen_spouse_flow5 SUCCESS 2 + Y + Y + N + + + citizen_spouse_flow5.hpl 2 + Write state_citizen_spouse_flow5 ERROR 2 + Y + N + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_spouse_flow3.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_spouse_flow2.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_spouse_flow1.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_spouse_flow4.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_spouse_flow5.hpl 2 + Y + Y + N + + + Write state_citizen_spouse_flow1 SUCCESS 2 + Success after_error_citizen_spouse_flow1 + Y + Y + N + + + Write state_citizen_spouse_flow1 ERROR 2 + error after_error_citizen_spouse_flow1 + Y + Y + N + + + Write state_citizen_spouse_flow2 SUCCESS 2 + Success after_error_citizen_spouse_flow2 + Y + Y + N + + + Write state_citizen_spouse_flow2 ERROR 2 + error after_error_citizen_spouse_flow2 + Y + Y + N + + + Write state_citizen_spouse_flow3 SUCCESS 2 + Success after_error_citizen_spouse_flow3 + Y + Y + N + + + Write state_citizen_spouse_flow3 ERROR 2 + error after_error_citizen_spouse_flow3 + Y + Y + N + + + Write state_citizen_spouse_flow4 SUCCESS 2 + Success after_error_citizen_spouse_flow4 + Y + Y + N + + + Write state_citizen_spouse_flow4 ERROR 2 + error after_error_citizen_spouse_flow4 + Y + Y + N + + + Write state_citizen_spouse_flow5 SUCCESS 2 + Success after_error_citizen_spouse_flow5 + Y + Y + N + + + Write state_citizen_spouse_flow5 ERROR 2 + error after_error_citizen_spouse_flow5 + Y + Y + N + + + Simple citizen_spouse WHERE SUCCESS + job_recruit_last_update_date.hwf + Y + Y + N + + + job_recruit_last_update_date.hwf + delta_citizen_spouse.hpl + Y + Y + N + + + state_delta_citizen_spouse_success + Success delta_citizen_spouse + Y + Y + N + + + state_delta_citizen_spouse_error + error delta_citizen_spouse + Y + Y + N + + + delta_citizen_spouse.hpl + state_delta_citizen_spouse_success + Y + Y + N + + + delta_citizen_spouse.hpl + state_delta_citizen_spouse_error + Y + N + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_recruit_last_update_date.hwf b/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_recruit_last_update_date.hwf new file mode 100644 index 0000000..544c1c7 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_recruit_last_update_date.hwf @@ -0,0 +1,124 @@ + + + job_recruit_last_update_date + Y + + + + - + 2025/06/02 14:48:05.666 + - + 2025/06/02 14:48:05.666 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 592 + 352 + + + + recruit_update_date_ervu_dashboard.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/recruit_update_date_ervu_dashboard.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 784 + 352 + + + + row_last_recruit_update_date.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/row_last_recruit_update_date.hpl + Basic + + Y + + N + local + N + N + Y + N + 1056 + 352 + + + + Success + + SUCCESS + + N + 1232 + 352 + + + + + + Start + recruit_update_date_ervu_dashboard.hpl + Y + Y + Y + + + recruit_update_date_ervu_dashboard.hpl + row_last_recruit_update_date.hpl + Y + Y + N + + + row_last_recruit_update_date.hpl + Success + Y + Y + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl new file mode 100644 index 0000000..4534b94 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl @@ -0,0 +1,411 @@ + + + + citizen_spouse_flow1 + Y + + + + Normal + 0 + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Select values 4 2 + N + + + Select values 4 2 + Get variables + N + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + 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 + + + ervu-dashboard + + Y + + N + + N + Y + N + 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; + + + + 704 + 144 + + + + Get variables + GetVariable + + Y + + 1 + + none + + + + + -1 + recruitment_id + -1 + none + String + ID_F1 + + + + + 976 + 400 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 944 + 288 + +
+ + Select values 4 2 + SelectValues + + Y + + 1 + + none + + + + N + + ID_F1 + ID_F1 + String + -2 + -2 + + false + + + false + + + + + + + + + + 720 + 400 + + + + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 448 + 288 + + + + + Select values 4 2 + Get variables + Y + + + + + + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl new file mode 100644 index 0000000..675d7b3 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl @@ -0,0 +1,320 @@ + + + + citizen_spouse_flow2 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1088 + 288 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 560 + 288 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + 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 + + + ervu-dashboard + Y + N + N + Y + N + 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; + + + 720 + 176 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl new file mode 100644 index 0000000..2607aaf --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl @@ -0,0 +1,320 @@ + + + + citizen_spouse_flow3 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1216 + 352 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 672 + 352 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + 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 + + + ervu-dashboard + Y + N + N + Y + N + 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; + + + 848 + 208 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl new file mode 100644 index 0000000..d80c4c2 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl @@ -0,0 +1,320 @@ + + + + citizen_spouse_flow4 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1072 + 320 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 528 + 320 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + 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 + + + ervu-dashboard + Y + N + N + Y + N + 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; + + + 688 + 176 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl new file mode 100644 index 0000000..bcc0fc2 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl @@ -0,0 +1,320 @@ + + + + citizen_spouse_flow5 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1040 + 368 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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; + Y + + + 560 + 368 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + 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 + + + ervu-dashboard + Y + N + N + Y + N + 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; + + + 736 + 192 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/recruit_update_date_ervu_dashboard.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/recruit_update_date_ervu_dashboard.hpl new file mode 100644 index 0000000..f0b4186 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/recruit_update_date_ervu_dashboard.hpl @@ -0,0 +1,95 @@ + + + + recruit_update_date_ervu_dashboard + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/02 14:50:31.833 + - + 2025/06/02 14:50:31.833 + + + + + + Table input + Table output + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 896 + 304 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + N + N + N + N + Y + N + public + N + recruit_create
+ N + Y + N + Y + + + 1216 + 304 + +
+ + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl new file mode 100644 index 0000000..4483bc8 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl @@ -0,0 +1,261 @@ + + + + recruitment_rows_five_flow_if_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/23 14:28:22.572 + - + 2025/05/23 14:28:22.572 + + + + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 880 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 512 + 288 + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/row_last_recruit_update_date.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/row_last_recruit_update_date.hpl new file mode 100644 index 0000000..5597125 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/row_last_recruit_update_date.hpl @@ -0,0 +1,109 @@ + + + + row_last_recruit_update_date + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/02 14:51:59.611 + - + 2025/06/02 14:51:59.611 + + + + + + Copy rows to result + Set variables + Y + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 992 + 320 + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + + MAX_RECRUIT_UPDATE_DATE + M_R_UP_DATE + GP_WORKFLOW + + + Y + + + 1232 + 320 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 688 + 320 + + + + + + diff --git a/mappings_new/info_recruits/job_info_recruits_from_json.hwf b/mappings_new/info_recruits/job_info_recruits_from_json.hwf index 967cb3a..4ede347 100644 --- a/mappings_new/info_recruits/job_info_recruits_from_json.hwf +++ b/mappings_new/info_recruits/job_info_recruits_from_json.hwf @@ -40,13 +40,10 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/job_child.hwf - - Nothing M_R_CR_DATE - ${M_R_CR_DATE} Y @@ -62,7 +59,7 @@ - Workflow 2 + job_passport.hwf WORKFLOW @@ -70,10 +67,20 @@ N N N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/job_passport.hwf + + + Nothing + + M_R_CR_DATE + + ${M_R_CR_DATE} + Y N + local N N Y @@ -250,8 +257,8 @@ Start - Workflow 2 - N + job_passport.hwf + Y Y Y @@ -326,7 +333,7 @@ N - Workflow 2 + job_passport.hwf Success Y Y diff --git a/mappings_new/info_recruits/supportive_jobs/job_create_files.hwf b/mappings_new/info_recruits/supportive_jobs/job_create_files.hwf index 3e8f21c..ec76164 100644 --- a/mappings_new/info_recruits/supportive_jobs/job_create_files.hwf +++ b/mappings_new/info_recruits/supportive_jobs/job_create_files.hwf @@ -98,6 +98,8 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/job_create_files_child.hwf + + Nothing Y @@ -127,6 +129,32 @@ ${PROJECT_HOME}/info_recruits/checkpoints/state_job_general_info_recruits.json N 944 + 880 + + + + job_create_files_passport.hwf + + WORKFLOW + + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/job_create_files_passport.hwf + + + Nothing + + Y + + N + local + N + N + Y + N + 944 768 @@ -188,6 +216,20 @@ Y N + + Start + job_create_files_passport.hwf + Y + Y + Y + + + job_create_files_passport.hwf + Success job_create_files_recruits_info.hwf + Y + Y + N + diff --git a/mappings_new/info_recruits/supportive_jobs/job_create_files_for_test.hwf b/mappings_new/info_recruits/supportive_jobs/job_create_files_for_test.hwf index 8367208..4a41633 100644 --- a/mappings_new/info_recruits/supportive_jobs/job_create_files_for_test.hwf +++ b/mappings_new/info_recruits/supportive_jobs/job_create_files_for_test.hwf @@ -63,7 +63,7 @@ ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/checkpoints/state_job_recruits_info.json N 752 - 448 + 512 @@ -87,13 +87,31 @@ "pipeline": "job_child" } N - UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json N 752 288 + + state_job_passport_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_passport" +} + N + + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + N + 752 + 432 + + @@ -138,6 +156,20 @@ Y N + + Start + state_job_passport_success + Y + Y + Y + + + state_job_passport_success + Success + Y + Y + N + diff --git a/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl new file mode 100644 index 0000000..d51fed4 --- /dev/null +++ b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl @@ -0,0 +1,121 @@ + + + + recruitment_rows_five_flow_child + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 832 + 304 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 464 + 304 + + + + + + diff --git a/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl new file mode 100644 index 0000000..d51fed4 --- /dev/null +++ b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl @@ -0,0 +1,121 @@ + + + + recruitment_rows_five_flow_child + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 832 + 304 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + N + + + 464 + 304 + + + + + +