From 99f890c2ab7d080b870c3cbb30daf7cf1d89828e Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Tue, 29 Jul 2025 19:28:45 +0300 Subject: [PATCH 01/34] ERVU-504: fixes --- .../citizen_tables/child/delta_child.hpl | 234 +++++++++--------- .../child/parallel/child_flow1.hpl | 14 +- .../child/parallel/child_flow2.hpl | 230 ++++++++--------- .../child/parallel/child_flow3.hpl | 230 ++++++++--------- .../child/parallel/child_flow4.hpl | 228 ++++++++--------- .../child/parallel/child_flow5.hpl | 228 ++++++++--------- .../delta_citizen_guardianship.hpl | 120 ++++----- .../parallel/citizen_guardianship_flow1.hpl | 6 +- .../parallel/citizen_guardianship_flow2.hpl | 120 ++++----- .../parallel/citizen_guardianship_flow3.hpl | 120 ++++----- .../parallel/citizen_guardianship_flow4.hpl | 120 ++++----- .../parallel/citizen_guardianship_flow5.hpl | 120 ++++----- 12 files changed, 890 insertions(+), 880 deletions(-) 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 825963c..6883e72 100644 --- a/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl @@ -133,6 +133,51 @@ DO UPDATE SET 224 + + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count + is_minor + SUM + + + has_minor_child + is_minor + MAX + + + has_dead_child + is_dead + MAX + + + Y + + + recruit_id + + + N + grp + + + 864 + 272 + + Insert / update InsertUpdate @@ -227,122 +272,6 @@ DO UPDATE SET 352 - - Table input - TableInput - - N - - 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_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'->'svedDeti'->'rebenok') = 'array' -) -SELECT - r.recruit_id::uuid AS recruit_id, - ch->>'id' AS child_external_id, - NULLIF(ch->>'idERN', '') AS child_id_ern, - CASE NULLIF(ch->>'rodstvSvyazReb', '')::int - WHEN 1 THEN 3 - WHEN 2 THEN 4 - ELSE NULL - END 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 - - - 624 - 352 - - - - Group by - GroupBy - - N - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - minors_count - is_minor - SUM - - - has_minor_child - is_minor - MAX - - - has_dead_child - is_dead - MAX - - - Y - - - recruit_id - - - N - grp - - - 864 - 272 - - Select values SelectValues @@ -443,6 +372,77 @@ JOIN child ON r.recruit_id = child.recruit_id; 224 + + Table input + TableInput + + N + + 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_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'->'svedDeti'->'rebenok') = 'array' +) +SELECT + r.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + ELSE NULL + END 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 + + + 624 + 352 + + Update Update @@ -456,7 +456,7 @@ JOIN child ON r.recruit_id = child.recruit_id; 100 ervu-dashboard - N + Y 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 737f32e..41a73d2 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 @@ -35,7 +35,7 @@ 9 58 656 - 80 + 32 Привожу minor_count к нужному формату Как это пофиксить без Select хз((( Часа три искал решения @@ -212,19 +212,16 @@ DO UPDATE SET minors_count is_minor SUM - has_minor_child is_minor MAX - has_dead_child is_dead MAX - Y @@ -234,7 +231,6 @@ DO UPDATE SET N - grp @@ -350,19 +346,15 @@ DO UPDATE SET has_dead_child - has_minor_child - minors_count - recruit_id - N @@ -558,12 +550,14 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard - N + Y + = recruit_id recruit_id + ervu_dashboard citizen
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 f22806d..c9d6126 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 @@ -133,6 +133,51 @@ DO UPDATE SET 96
+ + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count + is_minor + SUM + + + has_minor_child + is_minor + MAX + + + has_dead_child + is_dead + MAX + + + Y + + + recruit_id + + + N + grp + + + 704 + 208 + + Insert / update InsertUpdate @@ -227,119 +272,6 @@ DO UPDATE SET 288 - - Table input - TableInput - - N - - 1 - - none - - - ervu-dashboard - N - 0 - WITH child AS ( - SELECT - ri.recruit_id, - ch AS child_json, - 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 - FROM ervu_dashboard.recruits_info ri - JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id - CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch - WHERE - '${ID_F2}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -SELECT - ctz.recruit_id::uuid AS recruit_id, - child_json->>'id' AS child_external_id, - NULLIF(child_json->>'idERN', '') AS child_id_ern, - CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int - WHEN 1 THEN 3 - WHEN 2 THEN 4 - END AS kinship_type, - child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, - child_json->'svedFLBS'->'fio'->>'imya' AS first_name, - child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, - CONCAT_WS(' ', - child_json->'svedFLBS'->'fio'->>'familiya', - child_json->'svedFLBS'->'fio'->>'imya', - child_json->'svedFLBS'->'fio'->>'otchestvo' - ) AS full_name, - ch.birth_date, - ch.death_date, - child_json->'svedSmert'->>'nomerZapis' AS death_az_number, - child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (ch.death_date IS NOT NULL) AS is_dead, - (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.citizen ctz - JOIN child ch ON ctz.recruit_id = ch.recruit_id; - Y - - - 560 - 288 - - - - Group by - GroupBy - - N - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - minors_count - is_minor - SUM - - - has_minor_child - is_minor - MAX - - - has_dead_child - is_dead - MAX - - - Y - - - recruit_id - - - N - grp - - - 704 - 208 - - Select values SelectValues @@ -440,6 +372,74 @@ FROM ervu_dashboard.citizen ctz 160 + + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + WITH child AS ( + SELECT + ri.recruit_id, + ch AS child_json, + 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 + FROM ervu_dashboard.recruits_info ri + JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id + CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch + WHERE + '${ID_F2}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' +) +SELECT + ctz.recruit_id::uuid AS recruit_id, + child_json->>'id' AS child_external_id, + NULLIF(child_json->>'idERN', '') AS child_id_ern, + CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END AS kinship_type, + child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, + child_json->'svedFLBS'->'fio'->>'imya' AS first_name, + child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + CONCAT_WS(' ', + child_json->'svedFLBS'->'fio'->>'familiya', + child_json->'svedFLBS'->'fio'->>'imya', + child_json->'svedFLBS'->'fio'->>'otchestvo' + ) AS full_name, + ch.birth_date, + ch.death_date, + child_json->'svedSmert'->>'nomerZapis' AS death_az_number, + child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (ch.death_date IS NOT NULL) AS is_dead, + (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.citizen ctz + JOIN child ch ON ctz.recruit_id = ch.recruit_id; + Y + + + 560 + 288 + + Update Update @@ -453,12 +453,14 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard - N + Y + = recruit_id recruit_id + ervu_dashboard citizen
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 cb692ba..eb0de50 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 @@ -133,6 +133,51 @@ DO UPDATE SET 208
+ + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count + is_minor + SUM + + + has_minor_child + is_minor + MAX + + + has_dead_child + is_dead + MAX + + + Y + + + recruit_id + + + N + grp + + + 896 + 256 + + Insert / update InsertUpdate @@ -227,119 +272,6 @@ DO UPDATE SET 352 - - Table input - TableInput - - N - - 1 - - none - - - ervu-dashboard - N - 0 - WITH child AS ( - SELECT - ri.recruit_id, - ch AS child_json, - 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 - FROM ervu_dashboard.recruits_info ri - JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id - CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch - WHERE - '${ID_F3}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -SELECT - ctz.recruit_id::uuid AS recruit_id, - child_json->>'id' AS child_external_id, - NULLIF(child_json->>'idERN', '') AS child_id_ern, - CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int - WHEN 1 THEN 3 - WHEN 2 THEN 4 - END AS kinship_type, - child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, - child_json->'svedFLBS'->'fio'->>'imya' AS first_name, - child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, - CONCAT_WS(' ', - child_json->'svedFLBS'->'fio'->>'familiya', - child_json->'svedFLBS'->'fio'->>'imya', - child_json->'svedFLBS'->'fio'->>'otchestvo' - ) AS full_name, - ch.birth_date, - ch.death_date, - child_json->'svedSmert'->>'nomerZapis' AS death_az_number, - child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (ch.death_date IS NOT NULL) AS is_dead, - (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.citizen ctz - JOIN child ch ON ctz.recruit_id = ch.recruit_id; - Y - - - 672 - 352 - - - - Group by - GroupBy - - N - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - minors_count - is_minor - SUM - - - has_minor_child - is_minor - MAX - - - has_dead_child - is_dead - MAX - - - Y - - - recruit_id - - - N - grp - - - 896 - 256 - - Select values SelectValues @@ -440,6 +372,74 @@ FROM ervu_dashboard.citizen ctz 208 + + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + WITH child AS ( + SELECT + ri.recruit_id, + ch AS child_json, + 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 + FROM ervu_dashboard.recruits_info ri + JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id + CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch + WHERE + '${ID_F3}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' +) +SELECT + ctz.recruit_id::uuid AS recruit_id, + child_json->>'id' AS child_external_id, + NULLIF(child_json->>'idERN', '') AS child_id_ern, + CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END AS kinship_type, + child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, + child_json->'svedFLBS'->'fio'->>'imya' AS first_name, + child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + CONCAT_WS(' ', + child_json->'svedFLBS'->'fio'->>'familiya', + child_json->'svedFLBS'->'fio'->>'imya', + child_json->'svedFLBS'->'fio'->>'otchestvo' + ) AS full_name, + ch.birth_date, + ch.death_date, + child_json->'svedSmert'->>'nomerZapis' AS death_az_number, + child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (ch.death_date IS NOT NULL) AS is_dead, + (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.citizen ctz + JOIN child ch ON ctz.recruit_id = ch.recruit_id; + Y + + + 672 + 352 + + Update Update @@ -453,12 +453,14 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard - N + Y + = recruit_id recruit_id + ervu_dashboard citizen
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 1bf1f51..4b64f5f 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 @@ -133,6 +133,51 @@ DO UPDATE SET 176
+ + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count + is_minor + SUM + + + has_minor_child + is_minor + MAX + + + has_dead_child + is_dead + MAX + + + Y + + + recruit_id + + + N + grp + + + 736 + 224 + + Insert / update InsertUpdate @@ -227,119 +272,6 @@ DO UPDATE SET 320 - - Table input - TableInput - - N - - 1 - - none - - - ervu-dashboard - N - 0 - WITH child AS ( - SELECT - ri.recruit_id, - ch AS child_json, - 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 - FROM ervu_dashboard.recruits_info ri - JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id - CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch - WHERE - '${ID_F4}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -SELECT - ctz.recruit_id::uuid AS recruit_id, - child_json->>'id' AS child_external_id, - NULLIF(child_json->>'idERN', '') AS child_id_ern, - CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int - WHEN 1 THEN 3 - WHEN 2 THEN 4 - END AS kinship_type, - child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, - child_json->'svedFLBS'->'fio'->>'imya' AS first_name, - child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, - CONCAT_WS(' ', - child_json->'svedFLBS'->'fio'->>'familiya', - child_json->'svedFLBS'->'fio'->>'imya', - child_json->'svedFLBS'->'fio'->>'otchestvo' - ) AS full_name, - ch.birth_date, - ch.death_date, - child_json->'svedSmert'->>'nomerZapis' AS death_az_number, - child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (ch.death_date IS NOT NULL) AS is_dead, - (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.citizen ctz - JOIN child ch ON ctz.recruit_id = ch.recruit_id; - Y - - - 528 - 320 - - - - Group by - GroupBy - - N - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - minors_count - is_minor - SUM - - - has_minor_child - is_minor - MAX - - - has_dead_child - is_dead - MAX - - - Y - - - recruit_id - - - N - grp - - - 736 - 224 - - Select values SelectValues @@ -440,6 +372,74 @@ FROM ervu_dashboard.citizen ctz 176 + + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + WITH child AS ( + SELECT + ri.recruit_id, + ch AS child_json, + 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 + FROM ervu_dashboard.recruits_info ri + JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id + CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch + WHERE + '${ID_F4}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' +) +SELECT + ctz.recruit_id::uuid AS recruit_id, + child_json->>'id' AS child_external_id, + NULLIF(child_json->>'idERN', '') AS child_id_ern, + CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END AS kinship_type, + child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, + child_json->'svedFLBS'->'fio'->>'imya' AS first_name, + child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + CONCAT_WS(' ', + child_json->'svedFLBS'->'fio'->>'familiya', + child_json->'svedFLBS'->'fio'->>'imya', + child_json->'svedFLBS'->'fio'->>'otchestvo' + ) AS full_name, + ch.birth_date, + ch.death_date, + child_json->'svedSmert'->>'nomerZapis' AS death_az_number, + child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (ch.death_date IS NOT NULL) AS is_dead, + (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.citizen ctz + JOIN child ch ON ctz.recruit_id = ch.recruit_id; + Y + + + 528 + 320 + + Update Update @@ -453,7 +453,7 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard - N + Y 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 2341f74..c7ea154 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 @@ -133,6 +133,51 @@ DO UPDATE SET 224 + + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count + is_minor + SUM + + + has_minor_child + is_minor + MAX + + + has_dead_child + is_dead + MAX + + + Y + + + recruit_id + + + N + grp + + + 784 + 272 + + Insert / update InsertUpdate @@ -227,119 +272,6 @@ DO UPDATE SET 368 - - Table input - TableInput - - N - - 1 - - none - - - ervu-dashboard - N - 0 - WITH child AS ( - SELECT - ri.recruit_id, - ch AS child_json, - 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 - FROM ervu_dashboard.recruits_info ri - JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id - CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch - WHERE - '${ID_F5}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -SELECT - ctz.recruit_id::uuid AS recruit_id, - child_json->>'id' AS child_external_id, - NULLIF(child_json->>'idERN', '') AS child_id_ern, - CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int - WHEN 1 THEN 3 - WHEN 2 THEN 4 - END AS kinship_type, - child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, - child_json->'svedFLBS'->'fio'->>'imya' AS first_name, - child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, - CONCAT_WS(' ', - child_json->'svedFLBS'->'fio'->>'familiya', - child_json->'svedFLBS'->'fio'->>'imya', - child_json->'svedFLBS'->'fio'->>'otchestvo' - ) AS full_name, - ch.birth_date, - ch.death_date, - child_json->'svedSmert'->>'nomerZapis' AS death_az_number, - child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (ch.death_date IS NOT NULL) AS is_dead, - (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.citizen ctz - JOIN child ch ON ctz.recruit_id = ch.recruit_id; - Y - - - 560 - 368 - - - - Group by - GroupBy - - N - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - minors_count - is_minor - SUM - - - has_minor_child - is_minor - MAX - - - has_dead_child - is_dead - MAX - - - Y - - - recruit_id - - - N - grp - - - 784 - 272 - - Select values SelectValues @@ -440,6 +372,74 @@ FROM ervu_dashboard.citizen ctz 224 + + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + WITH child AS ( + SELECT + ri.recruit_id, + ch AS child_json, + 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 + FROM ervu_dashboard.recruits_info ri + JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id + CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch + WHERE + '${ID_F5}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' +) +SELECT + ctz.recruit_id::uuid AS recruit_id, + child_json->>'id' AS child_external_id, + NULLIF(child_json->>'idERN', '') AS child_id_ern, + CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END AS kinship_type, + child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, + child_json->'svedFLBS'->'fio'->>'imya' AS first_name, + child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + CONCAT_WS(' ', + child_json->'svedFLBS'->'fio'->>'familiya', + child_json->'svedFLBS'->'fio'->>'imya', + child_json->'svedFLBS'->'fio'->>'otchestvo' + ) AS full_name, + ch.birth_date, + ch.death_date, + child_json->'svedSmert'->>'nomerZapis' AS death_az_number, + child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (ch.death_date IS NOT NULL) AS is_dead, + (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.citizen ctz + JOIN child ch ON ctz.recruit_id = ch.recruit_id; + Y + + + 560 + 368 + + Update Update @@ -453,7 +453,7 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard - N + Y 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 index dec223c..de2cf48 100644 --- 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 @@ -46,6 +46,33 @@ Y + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 960 + 208 + + Execute SQL script ExecSql @@ -118,6 +145,36 @@ DO UPDATE SET 224 + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 848 + 256 + + Insert / update InsertUpdate @@ -250,63 +307,6 @@ FROM ervu_dashboard.citizen r 352 - - Add constants - Constant - - Y - - 1 - - none - - - - - -1 - is_guardian - true - -1 - N - Boolean - - - - - 960 - 208 - - - - Group by - GroupBy - - Y - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - N - - - recruit_id - - - N - grp - - - 848 - 256 - - Update Update @@ -320,12 +320,14 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard - N + Y + = recruit_id recruit_id + ervu_dashboard citizen
@@ -335,7 +337,7 @@ FROM ervu_dashboard.citizen r
N - N + Y 1056 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 index 61ef508..a233548 100644 --- 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 @@ -395,12 +395,14 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard - N + Y + = recruit_id recruit_id + ervu_dashboard citizen
@@ -410,7 +412,7 @@ FROM ervu_dashboard.citizen r
N - N + Y 848 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 index 7aa40fd..a0721fc 100644 --- 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 @@ -46,6 +46,33 @@ Y + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 864 + 160 + + Execute SQL script ExecSql @@ -118,6 +145,36 @@ DO UPDATE SET 144
+ + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 752 + 208 + + Insert / update InsertUpdate @@ -250,63 +307,6 @@ FROM ervu_dashboard.citizen r 288 - - Add constants - Constant - - Y - - 1 - - none - - - - - -1 - is_guardian - true - -1 - N - Boolean - - - - - 864 - 160 - - - - Group by - GroupBy - - Y - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - N - - - recruit_id - - - N - grp - - - 752 - 208 - - Update Update @@ -320,12 +320,14 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard - N + Y + = recruit_id recruit_id + ervu_dashboard citizen
@@ -335,7 +337,7 @@ FROM ervu_dashboard.citizen r
N - N + Y 960 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 index 7d861be..8b6ce6e 100644 --- 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 @@ -46,6 +46,33 @@ Y + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 992 + 208 + + Execute SQL script ExecSql @@ -118,6 +145,36 @@ DO UPDATE SET 192
+ + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 880 + 256 + + Insert / update InsertUpdate @@ -250,63 +307,6 @@ FROM ervu_dashboard.citizen r 352 - - Add constants - Constant - - Y - - 1 - - none - - - - - -1 - is_guardian - true - -1 - N - Boolean - - - - - 992 - 208 - - - - Group by - GroupBy - - Y - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - N - - - recruit_id - - - N - grp - - - 880 - 256 - - Update Update @@ -320,12 +320,14 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard - N + Y + = recruit_id recruit_id + ervu_dashboard citizen
@@ -335,7 +337,7 @@ FROM ervu_dashboard.citizen r
N - N + Y 1088 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 index 5b09d48..77e77bf 100644 --- 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 @@ -46,6 +46,33 @@ Y + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 832 + 192 + + Execute SQL script ExecSql @@ -118,6 +145,36 @@ DO UPDATE SET 176
+ + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 720 + 240 + + Insert / update InsertUpdate @@ -250,63 +307,6 @@ FROM ervu_dashboard.citizen r 320 - - Add constants - Constant - - Y - - 1 - - none - - - - - -1 - is_guardian - true - -1 - N - Boolean - - - - - 832 - 192 - - - - Group by - GroupBy - - Y - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - N - - - recruit_id - - - N - grp - - - 720 - 240 - - Update Update @@ -320,12 +320,14 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard - N + Y + = recruit_id recruit_id + ervu_dashboard citizen
@@ -335,7 +337,7 @@ FROM ervu_dashboard.citizen r
N - N + Y 928 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 index e0cef83..07c35eb 100644 --- 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 @@ -46,6 +46,33 @@ Y + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 864 + 240 + + Execute SQL script ExecSql @@ -118,6 +145,36 @@ DO UPDATE SET 240
+ + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 752 + 288 + + Insert / update InsertUpdate @@ -250,63 +307,6 @@ FROM ervu_dashboard.citizen r 368 - - Add constants - Constant - - Y - - 1 - - none - - - - - -1 - is_guardian - true - -1 - N - Boolean - - - - - 864 - 240 - - - - Group by - GroupBy - - Y - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - N - - - recruit_id - - - N - grp - - - 752 - 288 - - Update Update @@ -320,12 +320,14 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard - N + Y + = recruit_id recruit_id + ervu_dashboard citizen
@@ -335,7 +337,7 @@ FROM ervu_dashboard.citizen r
N - N + Y 960 From 6c9812193043d53070519c35415f0fcaf2f66b18 Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Wed, 30 Jul 2025 13:25:22 +0300 Subject: [PATCH 02/34] ERVU-504: fixes --- .../citizen_tables/child/delta_child.hpl | 65 +++++++------- .../child/parallel/child_flow1.hpl | 85 +++++++++---------- .../child/parallel/child_flow2.hpl | 85 +++++++++---------- .../child/parallel/child_flow3.hpl | 85 +++++++++---------- .../child/parallel/child_flow4.hpl | 85 +++++++++---------- .../child/parallel/child_flow5.hpl | 85 +++++++++---------- .../delta_citizen_guardianship.hpl | 25 ++---- .../parallel/citizen_guardianship_flow1.hpl | 24 ++---- .../parallel/citizen_guardianship_flow2.hpl | 24 ++---- .../parallel/citizen_guardianship_flow3.hpl | 24 ++---- .../parallel/citizen_guardianship_flow4.hpl | 24 ++---- .../parallel/citizen_guardianship_flow5.hpl | 24 ++---- .../citizen_spouse/delta_citizen_spouse.hpl | 81 ++++++++---------- .../parallel/citizen_spouse_flow1.hpl | 78 +++++++---------- .../parallel/citizen_spouse_flow2.hpl | 78 +++++++---------- .../parallel/citizen_spouse_flow3.hpl | 78 +++++++---------- .../parallel/citizen_spouse_flow4.hpl | 78 +++++++---------- .../parallel/citizen_spouse_flow5.hpl | 78 +++++++---------- 18 files changed, 477 insertions(+), 629 deletions(-) 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 6883e72..6eb97b0 100644 --- a/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl @@ -386,55 +386,50 @@ DO UPDATE SET 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_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'->'svedDeti'->'rebenok') = 'array' -) -SELECT - r.recruit_id::uuid AS recruit_id, + SELECT + ri.recruit_id::uuid AS recruit_id, ch->>'id' AS child_external_id, NULLIF(ch->>'idERN', '') AS child_id_ern, CASE NULLIF(ch->>'rodstvSvyazReb', '')::int WHEN 1 THEN 3 WHEN 2 THEN 4 - ELSE NULL END 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, - + dates.birth_date, + dates.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; + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + --'${ID_F1}' != '' + --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' + '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND r.update_date >= '${M_R_UP_DATE}'::timestamp + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y @@ -457,13 +452,11 @@ JOIN child ON r.recruit_id = child.recruit_id; 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 41a73d2..d327ee5 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 @@ -483,53 +483,50 @@ DO UPDATE SET ervu-dashboard N 0 - WITH child AS ( - SELECT - ri.recruit_id, - ch AS child_json, - 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 - FROM ervu_dashboard.recruits_info ri - JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id - CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch - WHERE - '${ID_F1}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -SELECT - ctz.recruit_id::uuid AS recruit_id, - child_json->>'id' AS child_external_id, - NULLIF(child_json->>'idERN', '') AS child_id_ern, - CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int WHEN 1 THEN 3 WHEN 2 THEN 4 - END AS kinship_type, - child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, - child_json->'svedFLBS'->'fio'->>'imya' AS first_name, - child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + END 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(' ', - child_json->'svedFLBS'->'fio'->>'familiya', - child_json->'svedFLBS'->'fio'->>'imya', - child_json->'svedFLBS'->'fio'->>'otchestvo' + ch->'svedFLBS'->'fio'->>'familiya', + ch->'svedFLBS'->'fio'->>'imya', + ch->'svedFLBS'->'fio'->>'otchestvo' ) AS full_name, - ch.birth_date, - ch.death_date, - child_json->'svedSmert'->>'nomerZapis' AS death_az_number, - child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (ch.death_date IS NOT NULL) AS is_dead, - (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.citizen ctz - JOIN child ch ON ctz.recruit_id = ch.recruit_id; + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${ID_F1}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y @@ -551,13 +548,11 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 c9d6126..ebc4697 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 @@ -386,53 +386,50 @@ DO UPDATE SET ervu-dashboard N 0 - WITH child AS ( - SELECT - ri.recruit_id, - ch AS child_json, - 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 - FROM ervu_dashboard.recruits_info ri - JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id - CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch - WHERE - '${ID_F2}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -SELECT - ctz.recruit_id::uuid AS recruit_id, - child_json->>'id' AS child_external_id, - NULLIF(child_json->>'idERN', '') AS child_id_ern, - CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int WHEN 1 THEN 3 WHEN 2 THEN 4 - END AS kinship_type, - child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, - child_json->'svedFLBS'->'fio'->>'imya' AS first_name, - child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + END 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(' ', - child_json->'svedFLBS'->'fio'->>'familiya', - child_json->'svedFLBS'->'fio'->>'imya', - child_json->'svedFLBS'->'fio'->>'otchestvo' + ch->'svedFLBS'->'fio'->>'familiya', + ch->'svedFLBS'->'fio'->>'imya', + ch->'svedFLBS'->'fio'->>'otchestvo' ) AS full_name, - ch.birth_date, - ch.death_date, - child_json->'svedSmert'->>'nomerZapis' AS death_az_number, - child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (ch.death_date IS NOT NULL) AS is_dead, - (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.citizen ctz - JOIN child ch ON ctz.recruit_id = ch.recruit_id; + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${ID_F2}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y @@ -454,13 +451,11 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 eb0de50..b918861 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 @@ -386,53 +386,50 @@ DO UPDATE SET ervu-dashboard N 0 - WITH child AS ( - SELECT - ri.recruit_id, - ch AS child_json, - 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 - FROM ervu_dashboard.recruits_info ri - JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id - CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch - WHERE - '${ID_F3}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -SELECT - ctz.recruit_id::uuid AS recruit_id, - child_json->>'id' AS child_external_id, - NULLIF(child_json->>'idERN', '') AS child_id_ern, - CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int WHEN 1 THEN 3 WHEN 2 THEN 4 - END AS kinship_type, - child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, - child_json->'svedFLBS'->'fio'->>'imya' AS first_name, - child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + END 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(' ', - child_json->'svedFLBS'->'fio'->>'familiya', - child_json->'svedFLBS'->'fio'->>'imya', - child_json->'svedFLBS'->'fio'->>'otchestvo' + ch->'svedFLBS'->'fio'->>'familiya', + ch->'svedFLBS'->'fio'->>'imya', + ch->'svedFLBS'->'fio'->>'otchestvo' ) AS full_name, - ch.birth_date, - ch.death_date, - child_json->'svedSmert'->>'nomerZapis' AS death_az_number, - child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (ch.death_date IS NOT NULL) AS is_dead, - (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.citizen ctz - JOIN child ch ON ctz.recruit_id = ch.recruit_id; + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${ID_F3}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y @@ -454,13 +451,11 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 4b64f5f..db7d3f7 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 @@ -386,53 +386,50 @@ DO UPDATE SET ervu-dashboard N 0 - WITH child AS ( - SELECT - ri.recruit_id, - ch AS child_json, - 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 - FROM ervu_dashboard.recruits_info ri - JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id - CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch - WHERE - '${ID_F4}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -SELECT - ctz.recruit_id::uuid AS recruit_id, - child_json->>'id' AS child_external_id, - NULLIF(child_json->>'idERN', '') AS child_id_ern, - CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int WHEN 1 THEN 3 WHEN 2 THEN 4 - END AS kinship_type, - child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, - child_json->'svedFLBS'->'fio'->>'imya' AS first_name, - child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + END 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(' ', - child_json->'svedFLBS'->'fio'->>'familiya', - child_json->'svedFLBS'->'fio'->>'imya', - child_json->'svedFLBS'->'fio'->>'otchestvo' + ch->'svedFLBS'->'fio'->>'familiya', + ch->'svedFLBS'->'fio'->>'imya', + ch->'svedFLBS'->'fio'->>'otchestvo' ) AS full_name, - ch.birth_date, - ch.death_date, - child_json->'svedSmert'->>'nomerZapis' AS death_az_number, - child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (ch.death_date IS NOT NULL) AS is_dead, - (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.citizen ctz - JOIN child ch ON ctz.recruit_id = ch.recruit_id; + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${ID_F4}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y @@ -454,13 +451,11 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 c7ea154..427f0c7 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 @@ -386,53 +386,50 @@ DO UPDATE SET ervu-dashboard N 0 - WITH child AS ( - SELECT - ri.recruit_id, - ch AS child_json, - 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 - FROM ervu_dashboard.recruits_info ri - JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id - CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch - WHERE - '${ID_F5}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -SELECT - ctz.recruit_id::uuid AS recruit_id, - child_json->>'id' AS child_external_id, - NULLIF(child_json->>'idERN', '') AS child_id_ern, - CASE NULLIF(child_json->>'rodstvSvyazReb', '')::int + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int WHEN 1 THEN 3 WHEN 2 THEN 4 - END AS kinship_type, - child_json->'svedFLBS'->'fio'->>'familiya' AS last_name, - child_json->'svedFLBS'->'fio'->>'imya' AS first_name, - child_json->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + END 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(' ', - child_json->'svedFLBS'->'fio'->>'familiya', - child_json->'svedFLBS'->'fio'->>'imya', - child_json->'svedFLBS'->'fio'->>'otchestvo' + ch->'svedFLBS'->'fio'->>'familiya', + ch->'svedFLBS'->'fio'->>'imya', + ch->'svedFLBS'->'fio'->>'otchestvo' ) AS full_name, - ch.birth_date, - ch.death_date, - child_json->'svedSmert'->>'nomerZapis' AS death_az_number, - child_json->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (ch.death_date IS NOT NULL) AS is_dead, - (ch.death_date IS NULL AND ch.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.citizen ctz - JOIN child ch ON ctz.recruit_id = ch.recruit_id; + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${ID_F5}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y @@ -454,13 +451,11 @@ FROM ervu_dashboard.citizen ctz 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 index de2cf48..dbe0bf9 100644 --- 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 @@ -268,19 +268,7 @@ DO UPDATE SET 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 + SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, NULLIF(ch->>'idERN', '') AS guardian_id_ern, @@ -299,7 +287,14 @@ SELECT ) AS birth_date, ch->>'snils' AS snils FROM ervu_dashboard.citizen r - JOIN person ON r.recruit_id = person.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + '${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 + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; Y @@ -321,13 +316,11 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 index a233548..f41ddc7 100644 --- 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 @@ -343,19 +343,7 @@ DO UPDATE SET 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 + SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, NULLIF(ch->>'idERN', '') AS guardian_id_ern, @@ -374,7 +362,13 @@ SELECT ) AS birth_date, ch->>'snils' AS snils FROM ervu_dashboard.citizen r - JOIN person ON r.recruit_id = person.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + '${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 jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; Y @@ -396,13 +390,11 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 index a0721fc..f1e3d1c 100644 --- 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 @@ -268,19 +268,7 @@ DO UPDATE SET 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 + SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, NULLIF(ch->>'idERN', '') AS guardian_id_ern, @@ -299,7 +287,13 @@ SELECT ) AS birth_date, ch->>'snils' AS snils FROM ervu_dashboard.citizen r - JOIN person ON r.recruit_id = person.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + '${ID_F2}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; Y @@ -321,13 +315,11 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 index 8b6ce6e..8f99ec3 100644 --- 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 @@ -268,19 +268,7 @@ DO UPDATE SET 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 + SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, NULLIF(ch->>'idERN', '') AS guardian_id_ern, @@ -299,7 +287,13 @@ SELECT ) AS birth_date, ch->>'snils' AS snils FROM ervu_dashboard.citizen r - JOIN person ON r.recruit_id = person.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + '${ID_F3}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; Y @@ -321,13 +315,11 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 index 77e77bf..11335b4 100644 --- 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 @@ -268,19 +268,7 @@ DO UPDATE SET 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 + SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, NULLIF(ch->>'idERN', '') AS guardian_id_ern, @@ -299,7 +287,13 @@ SELECT ) AS birth_date, ch->>'snils' AS snils FROM ervu_dashboard.citizen r - JOIN person ON r.recruit_id = person.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + '${ID_F4}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; Y @@ -321,13 +315,11 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 index 07c35eb..505f657 100644 --- 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 @@ -268,19 +268,7 @@ DO UPDATE SET 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 + SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, NULLIF(ch->>'idERN', '') AS guardian_id_ern, @@ -299,7 +287,13 @@ SELECT ) AS birth_date, ch->>'snils' AS snils FROM ervu_dashboard.citizen r - JOIN person ON r.recruit_id = person.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + '${ID_F5}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; Y @@ -321,13 +315,11 @@ FROM ervu_dashboard.citizen r 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
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 index 661306e..c000182 100644 --- 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 @@ -256,59 +256,46 @@ DO UPDATE SET 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 + SELECT r.recruit_id, - supr.spouse_external_id, - supr.spouse_id_ern, - NULLIF(supr.supr->>'rodstvSvyazSuprug', '')::int 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, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, CONCAT_WS(' ', - supr.supr->'svedFLBS'->'fio'->>'familiya', - supr.supr->'svedFLBS'->'fio'->>'imya', - supr.supr->'svedFLBS'->'fio'->>'otchestvo' + supr->'svedFLBS'->'fio'->>'familiya', + supr->'svedFLBS'->'fio'->>'imya', + 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 + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(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 + (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded FROM ervu_dashboard.citizen r - JOIN suprug supr ON r.recruit_id = supr.recruit_id; - +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) +WHERE + --'${ID_F1}' != '' + --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' + '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND r.update_date >= '${M_R_UP_DATE}'::timestamp; Y 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 index 6cd847f..7de69cd 100644 --- 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 @@ -331,57 +331,45 @@ DO UPDATE SET 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 + SELECT r.recruit_id, - supr.spouse_external_id, - supr.spouse_id_ern, - NULLIF(supr.supr->>'rodstvSvyazSuprug', '')::int 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, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, CONCAT_WS(' ', - supr.supr->'svedFLBS'->'fio'->>'familiya', - supr.supr->'svedFLBS'->'fio'->>'imya', - supr.supr->'svedFLBS'->'fio'->>'otchestvo' + supr->'svedFLBS'->'fio'->>'familiya', + supr->'svedFLBS'->'fio'->>'imya', + 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 + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(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 + (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded FROM ervu_dashboard.citizen r - JOIN suprug supr ON r.recruit_id = supr.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) +WHERE + '${ID_F1}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; 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 index 3c7d7d9..7d8150e 100644 --- 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 @@ -256,57 +256,45 @@ DO UPDATE SET 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 + SELECT r.recruit_id, - supr.spouse_external_id, - supr.spouse_id_ern, - NULLIF(supr.supr->>'rodstvSvyazSuprug', '')::int 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, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, CONCAT_WS(' ', - supr.supr->'svedFLBS'->'fio'->>'familiya', - supr.supr->'svedFLBS'->'fio'->>'imya', - supr.supr->'svedFLBS'->'fio'->>'otchestvo' + supr->'svedFLBS'->'fio'->>'familiya', + supr->'svedFLBS'->'fio'->>'imya', + 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 + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(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 + (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded FROM ervu_dashboard.citizen r - JOIN suprug supr ON r.recruit_id = supr.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) +WHERE + '${ID_F2}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; Y 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 index 8d381af..51a6b3d 100644 --- 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 @@ -256,57 +256,45 @@ DO UPDATE SET 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 + SELECT r.recruit_id, - supr.spouse_external_id, - supr.spouse_id_ern, - NULLIF(supr.supr->>'rodstvSvyazSuprug', '')::int 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, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, CONCAT_WS(' ', - supr.supr->'svedFLBS'->'fio'->>'familiya', - supr.supr->'svedFLBS'->'fio'->>'imya', - supr.supr->'svedFLBS'->'fio'->>'otchestvo' + supr->'svedFLBS'->'fio'->>'familiya', + supr->'svedFLBS'->'fio'->>'imya', + 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 + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(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 + (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded FROM ervu_dashboard.citizen r - JOIN suprug supr ON r.recruit_id = supr.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) +WHERE + '${ID_F3}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; Y 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 index 431012f..9e40571 100644 --- 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 @@ -256,57 +256,45 @@ DO UPDATE SET 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 + SELECT r.recruit_id, - supr.spouse_external_id, - supr.spouse_id_ern, - NULLIF(supr.supr->>'rodstvSvyazSuprug', '')::int 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, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, CONCAT_WS(' ', - supr.supr->'svedFLBS'->'fio'->>'familiya', - supr.supr->'svedFLBS'->'fio'->>'imya', - supr.supr->'svedFLBS'->'fio'->>'otchestvo' + supr->'svedFLBS'->'fio'->>'familiya', + supr->'svedFLBS'->'fio'->>'imya', + 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 + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(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 + (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded FROM ervu_dashboard.citizen r - JOIN suprug supr ON r.recruit_id = supr.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) +WHERE + '${ID_F4}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; Y 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 index 0ca9dd2..0f3a748 100644 --- 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 @@ -256,57 +256,45 @@ DO UPDATE SET 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 + SELECT r.recruit_id, - supr.spouse_external_id, - supr.spouse_id_ern, - NULLIF(supr.supr->>'rodstvSvyazSuprug', '')::int 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, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, CONCAT_WS(' ', - supr.supr->'svedFLBS'->'fio'->>'familiya', - supr.supr->'svedFLBS'->'fio'->>'imya', - supr.supr->'svedFLBS'->'fio'->>'otchestvo' + supr->'svedFLBS'->'fio'->>'familiya', + supr->'svedFLBS'->'fio'->>'imya', + 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 + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(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 + (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded FROM ervu_dashboard.citizen r - JOIN suprug supr ON r.recruit_id = supr.recruit_id; +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) +WHERE + '${ID_F5}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; Y From eada8cb3a4ba80eb3b942c8d733b01641d2f62f3 Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Wed, 30 Jul 2025 14:01:51 +0300 Subject: [PATCH 03/34] ERVU-504: fixes --- .../citizen_guardianship/delta_citizen_guardianship.hpl | 4 ++-- .../checkpoints/state_citizen_spouse_delta.json | 2 +- .../checkpoints/state_citizen_spouse_flow1.json | 2 +- .../checkpoints/state_citizen_spouse_flow2.json | 2 +- .../checkpoints/state_citizen_spouse_flow3.json | 2 +- .../checkpoints/state_citizen_spouse_flow4.json | 2 +- .../checkpoints/state_citizen_spouse_flow5.json | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) 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 index dbe0bf9..b3c9385 100644 --- 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 @@ -290,9 +290,9 @@ FROM ervu_dashboard.citizen r JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch WHERE - '${ID_F1}' != '' -- Проверка на пустую строку + --'${ID_F1}' != '' -- Проверка на пустую строку --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' - AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date AND r.update_date >= '${M_R_UP_DATE}'::timestamp AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array';
Y 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 index 7e8643f..8c841ea 100644 --- 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 @@ -1,6 +1,6 @@ { "status": "SUCCESS", "pipeline": "delta_citizen_spouse", - "max_create_date": "2025/04/08 20:21:38.528691000", + "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_spouse/checkpoints/state_citizen_spouse_flow1.json b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json index f58187b..2162550 100644 --- 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 @@ -1,4 +1,4 @@ { - "status": "NEW", + "status": "SUCCESS", "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 index 8288406..943630e 100644 --- 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 @@ -1,4 +1,4 @@ { - "status": "NEW", + "status": "SUCCESS", "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 index 18b8e64..e7fb9ad 100644 --- 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 @@ -1,4 +1,4 @@ { - "status": "NEW", + "status": "SUCCESS", "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 index e75285d..38ad6be 100644 --- 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 @@ -1,4 +1,4 @@ { - "status": "NEW", + "status": "SUCCESS", "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 index 60a93bc..a28f63b 100644 --- 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 @@ -1,4 +1,4 @@ { - "status": "NEW", + "status": "SUCCESS", "pipeline": "citizen_spouse_flow5" } \ No newline at end of file From a5396a12a0748dd3f4b5f063eac2d345bafd421e Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Wed, 6 Aug 2025 15:55:30 +0300 Subject: [PATCH 04/34] =?UTF-8?q?ERVU-504:=20=D0=9F=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=B2=D1=81=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=B4=D0=B5=D1=82=D1=8F=D0=BC=20=D0=B2=20mappings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../citizen_tables/child/delta_child.hpl | 348 +++++++++++-- .../citizen_tables/child/job_child.hwf | 70 ++- .../child/parallel/child_flow.hpl | 482 +++++++++--------- .../child/parallel/child_flow1.hpl | 229 --------- .../child/parallel/child_flow2.hpl | 142 ------ .../child/parallel/child_flow3.hpl | 142 ------ .../child/parallel/child_flow4.hpl | 142 ------ .../child/parallel/child_flow5.hpl | 142 ------ 8 files changed, 589 insertions(+), 1108 deletions(-) rename mappings_new/info_recruits/citizen_tables/child/parallel/child_flow2.hpl => mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl (82%) delete mode 100644 mappings/info_recruits/citizen_tables/child/parallel/child_flow1.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/parallel/child_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/parallel/child_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/parallel/child_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/parallel/child_flow5.hpl diff --git a/mappings/info_recruits/citizen_tables/child/delta_child.hpl b/mappings/info_recruits/citizen_tables/child/delta_child.hpl index c367eaf..7a7c590 100644 --- a/mappings/info_recruits/citizen_tables/child/delta_child.hpl +++ b/mappings/info_recruits/citizen_tables/child/delta_child.hpl @@ -20,12 +20,281 @@ + + Group by + Select values + Y + + + Select values + Update + Y + + + Table input + Group by + Y + Table input Insert / update Y + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END 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, + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + --'${ID_F1}' != '' + --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' + '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND r.update_date >= '${M_R_UP_DATE}'::timestamp + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + + Y + + + 624 + 352 + + + + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count + is_minor + SUM + + + has_minor_child + is_minor + MAX + + + has_dead_child + is_dead + MAX + + + Y + + + recruit_id + + + N + grp + + + 800 + 272 + + + + Select values + SelectValues + + Y + + 1 + + none + + + + + has_dead_child + + + has_minor_child + + + minors_count + + + recruit_id + + N + + has_dead_child + has_dead_child + Boolean + -2 + -2 + + false + + + false + + + + + + + + has_minor_child + has_minor_child + Boolean + -2 + -2 + + false + + + false + + + + + + + + minors_count + minors_count + Integer + -2 + -2 + + false + + + false + + + + + + + + recruit_id + recruit_id + String + -2 + -2 + + false + + + false + + + + + + + + + + 912 + 224 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + minors_count + minors_count + + + has_minor_child + has_minor_child + + + has_dead_child + has_dead_child + +
+ N + Y + + + 1024 + 192 + +
Insert / update InsertUpdate @@ -45,6 +314,11 @@ recruit_id recruit_id
+ + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -82,58 +356,36 @@ 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 - 1168 - 352 - -
- - 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_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 - AND ri.updated_at >= '${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 - Y - - - 624 + 1088 352 diff --git a/mappings/info_recruits/citizen_tables/child/job_child.hwf b/mappings/info_recruits/citizen_tables/child/job_child.hwf index d7842b2..a6450ce 100644 --- a/mappings/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings/info_recruits/citizen_tables/child/job_child.hwf @@ -104,12 +104,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow1.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F1 + RECRUITMENT_ID IDM_FLOW1 + Y @@ -134,12 +137,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow2.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F2 + RECRUITMENT_ID IDM_FLOW2 + Y @@ -164,12 +170,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow3.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F3 + RECRUITMENT_ID IDM_FLOW3 + Y @@ -194,12 +203,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow4.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F4 + RECRUITMENT_ID IDM_FLOW4 + Y @@ -224,12 +236,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow5.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F5 + RECRUITMENT_ID IDM_FLOW5 + Y @@ -374,12 +389,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow1.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F1 + RECRUITMENT_ID IDM_FLOW1 + Y @@ -404,12 +422,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow2.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F2 + RECRUITMENT_ID IDM_FLOW2 + Y @@ -434,12 +455,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow3.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F3 + RECRUITMENT_ID IDM_FLOW3 + Y @@ -464,12 +488,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow4.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F4 + RECRUITMENT_ID IDM_FLOW4 + Y @@ -494,12 +521,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow5.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + + Basic - ID_F5 + RECRUITMENT_ID IDM_FLOW5 + Y diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow2.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl similarity index 82% rename from mappings_new/info_recruits/citizen_tables/child/parallel/child_flow2.hpl rename to mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl index ebc4697..49f74bf 100644 --- a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow2.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl @@ -1,12 +1,13 @@ - child_flow2 + child_flow1 Y Normal + 0 N @@ -22,13 +23,13 @@ Table input - Insert / update + Select values 4 2 N - Table input - Execute SQL script - Y + Select values 4 2 + Get variables + N Group by @@ -45,10 +46,15 @@ Group by Y + + Table input + Insert / update + Y + - Execute SQL script - ExecSql + Get variables + GetVariable Y @@ -57,80 +63,121 @@ none - - - recruit_id - - - child_external_id - - - child_id_ern - - - kinship_type - - - last_name - - - first_name - - - middle_name - - - full_name - - - birth_date - - - death_date - - - death_az_number - - - birth_az_number - - - ervu-dashboard - Y - N - N - Y - N - INSERT INTO ervu_dashboard.citizen_child ( - recruit_id, - child_external_id, - child_id_ern, - kinship_type, - last_name, - first_name, - middle_name, - full_name, - birth_date, - death_date, - death_az_number, - birth_az_number -) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) -ON CONFLICT (recruit_id, child_external_id) -DO UPDATE SET - child_id_ern = EXCLUDED.child_id_ern, - kinship_type = EXCLUDED.kinship_type, - last_name = EXCLUDED.last_name, - first_name = EXCLUDED.first_name, - middle_name = EXCLUDED.middle_name, - full_name = EXCLUDED.full_name, - birth_date = EXCLUDED.birth_date, - death_date = EXCLUDED.death_date, - death_az_number = EXCLUDED.death_az_number, - birth_az_number = EXCLUDED.birth_az_number; + + + -1 + recruitment_id + -1 + none + String + ID_F1 + + - 656 - 96 + 976 + 400 + + + + 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 + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END 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, + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${RECRUITMENT_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y + + + 448 + 288 @@ -174,102 +221,8 @@ DO UPDATE SET grp - 704 - 208 - - - - 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 - - - 1088 - 288 + 592 + 192
@@ -368,73 +321,8 @@ DO UPDATE SET - 800 - 160 - - - - Table input - TableInput - - N - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ri.recruit_id::uuid AS recruit_id, - ch->>'id' AS child_external_id, - NULLIF(ch->>'idERN', '') AS child_id_ern, - CASE NULLIF(ch->>'rodstvSvyazReb', '')::int - WHEN 1 THEN 3 - WHEN 2 THEN 4 - END 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, - dates.birth_date, - dates.death_date, - ch->'svedSmert'->>'nomerZapis' AS death_az_number, - ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (dates.death_date IS NOT NULL) AS is_dead, - (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.recruits_info ri -JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id -CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch -CROSS JOIN LATERAL ( - SELECT - 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 -) AS dates -WHERE - '${ID_F2}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; - - Y - - - 560 - 288 + 720 + 144 @@ -476,11 +364,119 @@ WHERE Y - 912 + 816 112 + + 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 + + + 928 + 288 + +
+ + Select values 4 2 + Get variables + Y + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow1.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow1.hpl deleted file mode 100644 index 527cc57..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow1.hpl +++ /dev/null @@ -1,229 +0,0 @@ - - - - child_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 - - 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 - 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 child as -(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') 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'->'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 - - - 448 - 288 - - - - - Select values 4 2 - Get variables - Y - - - - - - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow2.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow2.hpl deleted file mode 100644 index 4ae2357..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow2.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - child_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 - - 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 - - - 1088 - 288 - -
- - 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_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'->'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 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow3.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow3.hpl deleted file mode 100644 index 1ccf803..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow3.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - child_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 - - 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 - - - 1216 - 352 - -
- - 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_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'->'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 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow4.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow4.hpl deleted file mode 100644 index 626f607..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow4.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - child_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 - - 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 - - - 1072 - 320 - -
- - 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_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'->'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 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow5.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow5.hpl deleted file mode 100644 index f76ea69..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow5.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - child_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 - - 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 - - - 1040 - 368 - -
- - 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_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'->'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 - - - - - -
From cb3393a6f810a54b1a12742b0827cdaceecf5ac9 Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Wed, 6 Aug 2025 16:06:27 +0300 Subject: [PATCH 05/34] =?UTF-8?q?ERVU-504:=20=D0=9F=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=B2=D1=81=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=BE=D0=BF=D0=B5=D0=BA=D1=83=D0=BD=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=D0=BC=20=D0=B2=20mappings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../delta_citizen_guardianship.hpl | 226 +++++++++++--- .../job_citizen_guardianship.hwf | 77 +++-- ...low1.hpl => citizen_guardianship_flow.hpl} | 286 +++++++++++++----- .../parallel/citizen_guardianship_flow2.hpl | 141 --------- .../parallel/citizen_guardianship_flow3.hpl | 141 --------- .../parallel/citizen_guardianship_flow4.hpl | 141 --------- .../parallel/citizen_guardianship_flow5.hpl | 141 --------- 7 files changed, 458 insertions(+), 695 deletions(-) rename mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/{citizen_guardianship_flow1.hpl => citizen_guardianship_flow.hpl} (56%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl index d8ed97e..3844d18 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl @@ -20,12 +20,167 @@ + + Add constants + Update + Y + + + Group by + Add constants + Y + + + Table input + Group by + Y + Table input Insert / update Y + + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.recruit_id AS recruit_id, + ch->>'id' AS guardianship_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 ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + --'${ID_F1}' != '' -- Проверка на пустую строку + --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' + '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND r.update_date >= '${M_R_UP_DATE}'::timestamp + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; + Y + + + 816 + 352 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 928 + 160 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 816 + 208 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 1024 + 112 + +
Insert / update InsertUpdate @@ -45,6 +200,11 @@ recruit_id recruit_id + + = + guardianship_external_id + guardianship_external_id + ervu_dashboard citizen_guardianship
@@ -52,6 +212,21 @@ recruit_id N + + first_name + first_name + Y + + + last_name + last_name + Y + + + middle_name + middle_name + Y + birth_date birth_date @@ -62,6 +237,16 @@ full_name Y + + guardian_id_ern + guardian_id_ern + Y + + + guardianship_external_id + guardianship_external_id + N + snils snils @@ -75,47 +260,6 @@ 352
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - with person as -(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') 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 - AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp -where jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array') -select - r.recruit_id AS recruit_id, - concat_ws(' ', ch->'fioOpek'->>'familiya', - ch->'fioOpek'->>'imya', - ch->'fioOpek'->>'otchestvo') full_name, - make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date, - ch->>'snils' snils -from ervu_dashboard.citizen r -join person on r.recruit_id = person.recruit_id - Y - - - 624 - 352 - - diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf index 3e49ea5..18ab950 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf @@ -78,12 +78,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F1 + RECRUITMENT_ID IDM_FLOW1 + Y @@ -108,12 +111,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F2 + RECRUITMENT_ID IDM_FLOW2 + Y @@ -138,12 +144,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F3 + RECRUITMENT_ID IDM_FLOW3 + Y @@ -168,12 +177,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F4 + RECRUITMENT_ID IDM_FLOW4 + Y @@ -198,12 +210,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F5 + RECRUITMENT_ID IDM_FLOW5 + Y @@ -780,12 +795,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F1 + RECRUITMENT_ID IDM_FLOW1 + Y @@ -810,12 +828,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F2 + RECRUITMENT_ID IDM_FLOW2 + Y @@ -840,12 +861,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F3 + RECRUITMENT_ID IDM_FLOW3 + Y @@ -870,12 +894,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F4 + RECRUITMENT_ID IDM_FLOW4 + Y @@ -900,12 +927,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + + Basic - ID_F5 + RECRUITMENT_ID IDM_FLOW5 + Y @@ -1804,6 +1834,13 @@ N N + + Start + check_if_job_citizen_guardianship_exists.hpl + Y + Y + Y + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl index 5db084f..64142ef 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl @@ -34,8 +34,8 @@ Segoe UI 9 26 - 560 - 208 + 368 + 32 сведения о лице опекаемом или находящемся на попечении 349 @@ -51,6 +51,21 @@ Get variables N + + Add constants + Update + Y + + + Group by + Add constants + Y + + + Table input + Group by + Y + Table input Insert / update @@ -84,55 +99,6 @@ 400 - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_guardianship
- - recruit_id - recruit_id - N - - - birth_date - birth_date - Y - - - full_name - full_name - Y - - - snils - snils - Y - -
- N - - - 960 - 288 - -
Select values 4 2 SelectValues @@ -184,25 +150,32 @@ ervu-dashboard N 0 - with person as -(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') 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, - concat_ws(' ', ch->'fioOpek'->>'familiya', - ch->'fioOpek'->>'imya', - ch->'fioOpek'->>'otchestvo') full_name, - make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date, - ch->>'snils' snils -from ervu_dashboard.citizen r -join person on r.recruit_id = person.recruit_id + SELECT + r.recruit_id AS recruit_id, + ch->>'id' AS guardianship_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 ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + '${RECRUITMENT_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; Y @@ -210,6 +183,179 @@ join person on r.recruit_id = person.recruit_id 288 + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 752 + 128 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 640 + 176 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 848 + 80 + +
+ + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + + = + guardianship_external_id + guardianship_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 + + + guardianship_external_id + guardianship_external_id + N + + + snils + snils + Y + +
+ N + + + 912 + 288 + +
Select values 4 2 diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl deleted file mode 100644 index ecb257f..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl +++ /dev/null @@ -1,141 +0,0 @@ - - - - citizen_guardianship_flow2 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 26 - 656 - 208 - сведения о лице опекаемом или находящемся на попечении - 349 - - - - - Table input - Insert / update 2 - Y - - - - Insert / update 2 - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_guardianship
- - recruit_id - recruit_id - N - - - birth_date - birth_date - Y - - - full_name - full_name - Y - - - snils - snils - Y - -
- N - - - 1056 - 288 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - with person as -(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') 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, - concat_ws(' ', ch->'fioOpek'->>'familiya', - ch->'fioOpek'->>'imya', - ch->'fioOpek'->>'otchestvo') full_name, - make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date, - ch->>'snils' snils -from ervu_dashboard.citizen r -join person on r.recruit_id = person.recruit_id - Y - - - 560 - 288 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl deleted file mode 100644 index 7e5f328..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl +++ /dev/null @@ -1,141 +0,0 @@ - - - - citizen_guardianship_flow3 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 26 - 800 - 256 - сведения о лице опекаемом или находящемся на попечении - 349 - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_guardianship
- - recruit_id - recruit_id - N - - - birth_date - birth_date - Y - - - full_name - full_name - Y - - - 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') 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, - concat_ws(' ', ch->'fioOpek'->>'familiya', - ch->'fioOpek'->>'imya', - ch->'fioOpek'->>'otchestvo') full_name, - make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date, - ch->>'snils' snils -from ervu_dashboard.citizen r -join person on r.recruit_id = person.recruit_id - Y - - - 672 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl deleted file mode 100644 index 9c52b48..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl +++ /dev/null @@ -1,141 +0,0 @@ - - - - citizen_guardianship_flow4 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 26 - 640 - 240 - сведения о лице опекаемом или находящемся на попечении - 349 - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_guardianship
- - recruit_id - recruit_id - N - - - birth_date - birth_date - Y - - - full_name - full_name - Y - - - snils - snils - Y - -
- N - - - 1088 - 320 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - with person as -(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') 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, - concat_ws(' ', ch->'fioOpek'->>'familiya', - ch->'fioOpek'->>'imya', - ch->'fioOpek'->>'otchestvo') full_name, - make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date, - ch->>'snils' snils -from ervu_dashboard.citizen r -join person on r.recruit_id = person.recruit_id - Y - - - 528 - 320 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl deleted file mode 100644 index a26e744..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl +++ /dev/null @@ -1,141 +0,0 @@ - - - - citizen_guardianship_flow5 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 26 - 704 - 256 - сведения о лице опекаемом или находящемся на попечении - 349 - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_guardianship
- - recruit_id - recruit_id - N - - - birth_date - birth_date - Y - - - full_name - full_name - Y - - - snils - snils - Y - -
- N - - - 1024 - 368 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - with person as -(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') 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, - concat_ws(' ', ch->'fioOpek'->>'familiya', - ch->'fioOpek'->>'imya', - ch->'fioOpek'->>'otchestvo') full_name, - make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date, - ch->>'snils' snils -from ervu_dashboard.citizen r -join person on r.recruit_id = person.recruit_id - Y - - - 560 - 368 - - - - - -
From 712c1db585ff24e2b91a9e450709a09331dfecd8 Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Wed, 6 Aug 2025 16:22:07 +0300 Subject: [PATCH 06/34] =?UTF-8?q?ERVU-504:=20=D0=9F=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=B2=D1=81=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=B6=D0=B5=D0=BD=D0=B0=D0=BC=20=D0=B8=20=D0=BC=D1=83?= =?UTF-8?q?=D0=B6=D1=8C=D1=8F=D0=BC=20=D0=B2=20mappings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../citizen/parallel/citizen_flow1.hpl | 7 +- .../citizen/parallel/citizen_flow2.hpl | 7 +- .../citizen/parallel/citizen_flow3.hpl | 7 +- .../citizen/parallel/citizen_flow4.hpl | 7 +- .../citizen/parallel/citizen_flow5.hpl | 7 +- .../citizen/parallel/delta_citizen_flow1.hpl | 10 +- .../citizen/parallel/delta_citizen_flow2.hpl | 10 +- .../citizen/parallel/delta_citizen_flow3.hpl | 10 +- .../citizen/parallel/delta_citizen_flow4.hpl | 10 +- .../citizen/parallel/delta_citizen_flow5.hpl | 10 +- .../citizen_spouse/delta_citizen_spouse.hpl | 131 +++++++------ .../citizen_spouse/job_citizen_spouse.hwf | 68 +++++-- ...ouse_flow1.hpl => citizen_spouse_flow.hpl} | 156 ++++++++------- .../parallel/citizen_spouse_flow2.hpl | 180 ------------------ .../parallel/citizen_spouse_flow3.hpl | 180 ------------------ .../parallel/citizen_spouse_flow4.hpl | 180 ------------------ .../parallel/citizen_spouse_flow5.hpl | 180 ------------------ 17 files changed, 283 insertions(+), 877 deletions(-) rename mappings/info_recruits/citizen_tables/citizen_spouse/parallel/{citizen_spouse_flow1.hpl => citizen_spouse_flow.hpl} (69%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl index 7f19e37..4f91816 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl @@ -236,6 +236,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -335,7 +340,7 @@ SELECT r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl index 4326e40..a90a146 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl @@ -193,6 +193,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -255,7 +260,7 @@ SELECT r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl index cafff2b..07babc6 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl @@ -193,6 +193,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -255,7 +260,7 @@ SELECT r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl index fb42956..70c5aa7 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl @@ -193,6 +193,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -255,7 +260,7 @@ SELECT r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl index 9b1237a..96681a8 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl @@ -193,6 +193,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -255,7 +260,7 @@ SELECT r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow1.hpl index cf2529f..34449d8 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow1.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow1.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -192,6 +193,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -255,10 +261,10 @@ SELECT --r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, + --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, r.system_create_date AS recruit_create_date, r.system_update_date AS update_date, CASE diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow2.hpl index 9ce6d7a..e602059 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow2.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow2.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -192,6 +193,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -255,10 +261,10 @@ SELECT --r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, + --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, r.system_create_date AS recruit_create_date, r.system_update_date AS update_date, CASE diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow3.hpl index 4759817..39d5cb9 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow3.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow3.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -192,6 +193,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -255,10 +261,10 @@ SELECT --r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, + --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, r.system_create_date AS recruit_create_date, r.system_update_date AS update_date, CASE diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow4.hpl index d209638..e7bd42e 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow4.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow4.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -192,6 +193,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -255,10 +261,10 @@ SELECT --r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, + --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, r.system_create_date AS recruit_create_date, r.system_update_date AS update_date, CASE diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow5.hpl index d3c3287..566d2fc 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow5.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow5.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -192,6 +193,11 @@ id_ern Y + + marital_status + marital_status + Y + N @@ -255,10 +261,10 @@ SELECT --r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, + --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, r.system_create_date AS recruit_create_date, r.system_update_date AS update_date, CASE diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl index ee470cb..63d79e2 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl @@ -40,50 +40,46 @@ ervu-dashboard N 0 - WITH suprug AS ( - SELECT - supr.supri AS supr, - 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, - 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 - AND ri.updated_at >= '${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 AS recruit_id, - supr->>'rodstvSvyazSuprugNaim' AS kinship_type, - CONCAT_WS(' ', + SELECT + r.recruit_id, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + CONCAT_WS(' ', supr->'svedFLBS'->'fio'->>'familiya', supr->'svedFLBS'->'fio'->>'imya', supr->'svedFLBS'->'fio'->>'otchestvo' ) AS full_name, MAKE_DATE( - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den', '')::int ) AS birth_date, (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, - supr->'svedSmert'->>'nomerZapis' AS death_az_number, - marriage_az_number, - marriage_date::date, - divorce_az_number, - divorce_date::date, - information_excluded + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded FROM ervu_dashboard.citizen r -JOIN suprug ON r.recruit_id = suprug.recruit_id +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) +WHERE + --'${ID_F1}' != '' + --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' + '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND r.update_date >= '${M_R_UP_DATE}'::timestamp; Y @@ -110,6 +106,11 @@ JOIN suprug ON r.recruit_id = suprug.recruit_id recruit_id recruit_id + + = + spouse_external_id + spouse_external_id + ervu_dashboard citizen_spouse
@@ -117,29 +118,49 @@ JOIN suprug ON r.recruit_id = suprug.recruit_id recruit_id N - - kinship_type - kinship_type - Y - - - full_name - full_name - Y - birth_date birth_date Y + + death_az_number + death_az_number + Y + death_date death_date Y - death_az_number - death_az_number + 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 @@ -153,18 +174,18 @@ JOIN suprug ON r.recruit_id = suprug.recruit_id Y - divorce_az_number - divorce_az_number + middle_name + middle_name Y - divorce_date - divorce_date - Y + spouse_external_id + spouse_external_id + N - information_excluded - information_excluded + spouse_id_ern + spouse_id_ern Y diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf b/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf index c3c8681..0b66a28 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf @@ -104,12 +104,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic - ID_F1 + RECRUITMENT_ID IDM_FLOW1 + Y @@ -134,12 +137,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic - ID_F2 + RECRUITMENT_ID IDM_FLOW2 + Y @@ -164,12 +170,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic - ID_F3 + RECRUITMENT_ID IDM_FLOW3 + Y @@ -194,12 +203,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic - ID_F4 + RECRUITMENT_ID IDM_FLOW4 + Y @@ -224,12 +236,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic - ID_F5 + RECRUITMENT_ID IDM_FLOW5 + Y @@ -884,12 +899,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic ID_F1 IDM_FLOW1 + Y @@ -914,12 +932,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic - ID_F2 + RECRUITMENT_ID IDM_FLOW2 + Y @@ -944,12 +965,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic - ID_F3 + RECRUITMENT_ID IDM_FLOW3 + Y @@ -974,12 +998,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic - ID_F4 + RECRUITMENT_ID IDM_FLOW4 + Y @@ -1004,12 +1031,15 @@ N N Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + + Basic - ID_F5 + RECRUITMENT_ID IDM_FLOW5 + Y diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl similarity index 69% rename from mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl rename to mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl index 39782d4..56dfa09 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl @@ -1,7 +1,7 @@ - citizen_spouse_flow1 + citizen_spouse_flow Y @@ -21,11 +21,6 @@ - - Table input - Select values 4 2 - N - Select values 4 2 Get variables @@ -33,9 +28,14 @@ Table input - Insert / update + Insert / update Y + + Table input + Select values 4 2 + N + Get variables @@ -65,7 +65,7 @@
- Insert / update + Insert / update InsertUpdate Y @@ -82,7 +82,11 @@ = recruit_id recruit_id - + + + = + spouse_external_id + spouse_external_id ervu_dashboard citizen_spouse
@@ -91,29 +95,49 @@ recruit_id N - - kinship_type - kinship_type - Y - - - full_name - full_name - Y - birth_date birth_date Y + + death_az_number + death_az_number + Y + death_date death_date Y - death_az_number - death_az_number + 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 @@ -127,26 +151,26 @@ Y - divorce_az_number - divorce_az_number + middle_name + middle_name Y - divorce_date - divorce_date - Y + spouse_external_id + spouse_external_id + N - information_excluded - information_excluded + spouse_id_ern + spouse_id_ern Y N - 944 - 288 + 976 + 272
@@ -190,7 +214,7 @@ Table input TableInput - Y + N 1 @@ -200,54 +224,50 @@ ervu-dashboard N 0 - WITH suprug AS ( - SELECT - supr.supri AS supr, - 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, - 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 - 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 AS recruit_id, - supr->>'rodstvSvyazSuprugNaim' AS kinship_type, - CONCAT_WS(' ', + SELECT + r.recruit_id, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + CONCAT_WS(' ', supr->'svedFLBS'->'fio'->>'familiya', supr->'svedFLBS'->'fio'->>'imya', supr->'svedFLBS'->'fio'->>'otchestvo' ) AS full_name, MAKE_DATE( - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den', '')::int ) AS birth_date, (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, - supr->'svedSmert'->>'nomerZapis' AS death_az_number, - marriage_az_number, - marriage_date::date, - divorce_az_number, - divorce_date::date, - information_excluded + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded FROM ervu_dashboard.citizen r -JOIN suprug ON r.recruit_id = suprug.recruit_id +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) +WHERE + '${RECRUITMENT_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; Y - 448 - 288 + 480 + 272 diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl deleted file mode 100644 index 712f5ee..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - 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 - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_spouse
- - recruit_id - recruit_id - N - - - kinship_type - kinship_type - Y - - - full_name - full_name - Y - - - birth_date - birth_date - Y - - - death_date - death_date - Y - - - death_az_number - death_az_number - Y - - - marriage_az_number - marriage_az_number - Y - - - marriage_date - marriage_date - Y - - - divorce_az_number - divorce_az_number - Y - - - divorce_date - divorce_date - Y - - - information_excluded - information_excluded - Y - -
- N - - - 1280 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH suprug AS ( - SELECT - supr.supri AS supr, - 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, - 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 - 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 AS recruit_id, - supr->>'rodstvSvyazSuprugNaim' AS kinship_type, - CONCAT_WS(' ', - supr->'svedFLBS'->'fio'->>'familiya', - supr->'svedFLBS'->'fio'->>'imya', - supr->'svedFLBS'->'fio'->>'otchestvo' - ) AS full_name, - MAKE_DATE( - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int - ) AS birth_date, - (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, - 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 ON r.recruit_id = suprug.recruit_id - Y - - - 784 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl deleted file mode 100644 index bcb2772..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - 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 - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_spouse
- - recruit_id - recruit_id - N - - - kinship_type - kinship_type - Y - - - full_name - full_name - Y - - - birth_date - birth_date - Y - - - death_date - death_date - Y - - - death_az_number - death_az_number - Y - - - marriage_az_number - marriage_az_number - Y - - - marriage_date - marriage_date - Y - - - divorce_az_number - divorce_az_number - Y - - - divorce_date - divorce_date - Y - - - information_excluded - information_excluded - Y - -
- N - - - 1152 - 336 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH suprug AS ( - SELECT - supr.supri AS supr, - 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, - 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 - 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 AS recruit_id, - supr->>'rodstvSvyazSuprugNaim' AS kinship_type, - CONCAT_WS(' ', - supr->'svedFLBS'->'fio'->>'familiya', - supr->'svedFLBS'->'fio'->>'imya', - supr->'svedFLBS'->'fio'->>'otchestvo' - ) AS full_name, - MAKE_DATE( - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int - ) AS birth_date, - (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, - 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 ON r.recruit_id = suprug.recruit_id - Y - - - 656 - 336 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl deleted file mode 100644 index 31e629e..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - 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 - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_spouse
- - recruit_id - recruit_id - N - - - kinship_type - kinship_type - Y - - - full_name - full_name - Y - - - birth_date - birth_date - Y - - - death_date - death_date - Y - - - death_az_number - death_az_number - Y - - - marriage_az_number - marriage_az_number - Y - - - marriage_date - marriage_date - Y - - - divorce_az_number - divorce_az_number - Y - - - divorce_date - divorce_date - Y - - - information_excluded - information_excluded - Y - -
- N - - - 1184 - 384 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH suprug AS ( - SELECT - supr.supri AS supr, - 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, - 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 - 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 AS recruit_id, - supr->>'rodstvSvyazSuprugNaim' AS kinship_type, - CONCAT_WS(' ', - supr->'svedFLBS'->'fio'->>'familiya', - supr->'svedFLBS'->'fio'->>'imya', - supr->'svedFLBS'->'fio'->>'otchestvo' - ) AS full_name, - MAKE_DATE( - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int - ) AS birth_date, - (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, - 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 ON r.recruit_id = suprug.recruit_id - Y - - - 688 - 384 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl deleted file mode 100644 index 18f686f..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - 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 - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_spouse
- - recruit_id - recruit_id - N - - - kinship_type - kinship_type - Y - - - full_name - full_name - Y - - - birth_date - birth_date - Y - - - death_date - death_date - Y - - - death_az_number - death_az_number - Y - - - marriage_az_number - marriage_az_number - Y - - - marriage_date - marriage_date - Y - - - divorce_az_number - divorce_az_number - Y - - - divorce_date - divorce_date - Y - - - information_excluded - information_excluded - Y - -
- N - - - 1152 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH suprug AS ( - SELECT - supr.supri AS supr, - 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, - 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 - 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 AS recruit_id, - supr->>'rodstvSvyazSuprugNaim' AS kinship_type, - CONCAT_WS(' ', - supr->'svedFLBS'->'fio'->>'familiya', - supr->'svedFLBS'->'fio'->>'imya', - supr->'svedFLBS'->'fio'->>'otchestvo' - ) AS full_name, - MAKE_DATE( - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int - ) AS birth_date, - (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, - 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 ON r.recruit_id = suprug.recruit_id - Y - - - 656 - 352 - - - - - -
From 024594b740e0172569841d55d9bee5e8c3daeea8 Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Wed, 6 Aug 2025 17:03:57 +0300 Subject: [PATCH 07/34] =?UTF-8?q?ERVU-504:=20=D1=81=D0=BE=D1=85=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D1=8E=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=B5=D0=B1?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../citizen_tables/child/delta_child.hpl | 320 +++++++++--------- .../citizen_tables/child/job_child.hwf | 33 +- 2 files changed, 163 insertions(+), 190 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/child/delta_child.hpl b/mappings/info_recruits/citizen_tables/child/delta_child.hpl index 7a7c590..7650b78 100644 --- a/mappings/info_recruits/citizen_tables/child/delta_child.hpl +++ b/mappings/info_recruits/citizen_tables/child/delta_child.hpl @@ -41,72 +41,6 @@ Y
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ri.recruit_id::uuid AS recruit_id, - ch->>'id' AS child_external_id, - NULLIF(ch->>'idERN', '') AS child_id_ern, - CASE NULLIF(ch->>'rodstvSvyazReb', '')::int - WHEN 1 THEN 3 - WHEN 2 THEN 4 - END 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, - dates.birth_date, - dates.death_date, - ch->'svedSmert'->>'nomerZapis' AS death_az_number, - ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (dates.death_date IS NOT NULL) AS is_dead, - (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.recruits_info ri -JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id -CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch -CROSS JOIN LATERAL ( - SELECT - 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 -) AS dates -WHERE - --'${ID_F1}' != '' - --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' - '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND r.update_date >= '${M_R_UP_DATE}'::timestamp - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; - - Y - - - 624 - 352 - - Group by GroupBy @@ -152,6 +86,100 @@ WHERE 272 + + 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 + + + 1088 + 352 + +
Select values SelectValues @@ -252,6 +280,72 @@ WHERE 224 + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END 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, + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + --'${ID_F1}' != '' + --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' + '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND c.update_date >= '${M_R_UP_DATE}'::timestamp + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + + Y + + + 624 + 352 + + Update Update @@ -295,100 +389,6 @@ WHERE 192 - - 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 - - - 1088 - 352 - -
diff --git a/mappings/info_recruits/citizen_tables/child/job_child.hwf b/mappings/info_recruits/citizen_tables/child/job_child.hwf index a6450ce..d2cfa2a 100644 --- a/mappings/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings/info_recruits/citizen_tables/child/job_child.hwf @@ -105,14 +105,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW1 - Y @@ -138,14 +135,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW2 - Y @@ -171,14 +165,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW3 - Y @@ -204,14 +195,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW4 - Y @@ -237,14 +225,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW5 - Y @@ -390,14 +375,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW1 - Y @@ -423,14 +405,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW2 - Y @@ -456,14 +435,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW3 - Y @@ -489,14 +465,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW4 - Y @@ -522,14 +495,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW5 - Y @@ -555,10 +525,13 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/delta_child.hpl + + Basic M_R_UP_DATE + ${M_R_UP_DATE} Y From 61ccebb25ae4a9e9dc40db96efb3decc71265981 Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Wed, 6 Aug 2025 17:15:28 +0300 Subject: [PATCH 08/34] =?UTF-8?q?ERVU-504:=20=D1=81=D0=BE=D1=85=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D1=8E=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=B5=D0=B1?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../child/branching_child_delta.hpl | 224 ++++++++++++++ .../citizen_tables/child/job_child.hwf | 280 ++++++++++++++---- 2 files changed, 441 insertions(+), 63 deletions(-) create mode 100644 mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl diff --git a/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl b/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl new file mode 100644 index 0000000..d7492fe --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl @@ -0,0 +1,224 @@ + + + + branching_child_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 14:40:44.856 + - + 2025/06/03 14:40:44.856 + + + + + + JSON input state_job_citizen.json + Set variables + N + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + JSON input state_job_citizen.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 + + + + + + + + + + + + 864 + 528 + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + + pipeline + PIPE + PARENT_WORKFLOW + + + + status + STATUS + PARENT_WORKFLOW + + + Y + + + 1104 + 368 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + COALESCE(job_name, 'job_citizen_delta') AS PIPELINE, + COALESCE(status, 'ERROR') AS STATUS, + current_timestamp::timestamp as record_created +FROM ( + select + CASE + WHEN status = 'PROCESSING' THEN 'ERROR' + ELSE status + END AS status, + job_name + from public.etl_checkpoints + where job_name = 'job_child_delta' + + UNION ALL + + SELECT NULL, NULL + WHERE NOT EXISTS ( + SELECT 1 + FROM public.etl_checkpoints + WHERE job_name = 'job_child_delta' + ) +) t + N + + + 864 + 368 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Basic + Y + N + 0 + ${PIPE} +${STATUS} + + + pipeline + + + status + + + + + 1328 + 368 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/child/job_child.hwf b/mappings/info_recruits/citizen_tables/child/job_child.hwf index d2cfa2a..e0aac3a 100644 --- a/mappings/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings/info_recruits/citizen_tables/child/job_child.hwf @@ -525,13 +525,10 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/delta_child.hpl - - Basic M_R_UP_DATE - ${M_R_UP_DATE} Y @@ -542,8 +539,8 @@ N Y N - 2640 - 1792 + 2544 + 2176 @@ -552,8 +549,8 @@ SUCCESS N - 3216 - 1792 + 3120 + 2160 @@ -562,8 +559,8 @@ SUCCESS N - 3216 - 1872 + 3120 + 2240 @@ -1240,34 +1237,8 @@ N Y N - 2112 - 1280 - - - - change_status_to_processing_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2096 - 1792 + 2384 + 1440 @@ -1292,8 +1263,8 @@ N Y N - 2992 - 1792 + 2896 + 2160 @@ -1318,8 +1289,156 @@ N Y N - 2992 - 1872 + 2896 + 2240 + + + + change_status_to_processing.hpl (2) + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl + Basic + + Y + + N + local + N + N + Y + N + 2368 + 576 + + + + change_status_to_processing_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 2336 + 2480 + + + + recruitment_rows_five_flow_child.hpl (2) + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_child.hpl + Basic + + + CR_DATE + CREATE_DATE + + Y + + N + local + N + N + Y + Y + 2336 + 2176 + + + + delta_citizen success + + SUCCESS + + N + 1984 + 1600 + + + + branching_child_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/branching_child_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 1840 + 2176 + + + + Simple delta_child WHERE ERROR + + SIMPLE_EVAL + + ERROR + string + true + equal + equal + N + variable + STATUS + N + 2048 + 2176 + + + + delta_child success 2 + + SUCCESS + + N + 2048 + 1984 @@ -1758,27 +1877,6 @@ N N - - Simple child WHERE ERROR - change_status_to_processing.hpl 2 - Y - Y - N - - - change_status_to_processing.hpl 2 - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - Simple child WHERE SUCCESS - change_status_to_processing_delta.hpl - Y - Y - N - delta_child.hpl change_status_delta_child_success.hpl @@ -1808,12 +1906,68 @@ N - change_status_to_processing_delta.hpl + recruitment_rows_five_flow_child.hpl + change_status_to_processing.hpl (2) + Y + Y + N + + + Simple child WHERE ERROR + recruitment_rows_five_flow_if_error.hpl + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + change_status_to_processing.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_child.hpl (2) delta_child.hpl Y Y N + + recruitment_rows_five_flow_child.hpl (2) + change_status_to_processing_delta.hpl + Y + Y + N + + + Simple delta_child WHERE ERROR + delta_child success 2 + Y + N + N + + + Simple child WHERE SUCCESS + branching_child_delta.hpl + Y + Y + N + + + branching_child_delta.hpl + Simple delta_child WHERE ERROR + Y + Y + N + + + Simple delta_child WHERE ERROR + recruitment_rows_five_flow_child.hpl (2) + Y + Y + N + From b6d134a54774c5430e0608615ad54fced6339732 Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Thu, 7 Aug 2025 00:07:17 +0300 Subject: [PATCH 09/34] =?UTF-8?q?ERVU-504:=20=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D0=B4=D0=B5=D1=82=D0=B5?= =?UTF-8?q?=D0=B9=20=D0=B2=20mappings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../child/branching_child_delta.hpl | 84 +- .../change_status_delta_child_flow1_error.hpl | 102 +++ ...hange_status_delta_child_flow1_success.hpl | 102 +++ .../change_status_delta_child_flow2_error.hpl | 102 +++ ...hange_status_delta_child_flow2_success.hpl | 102 +++ .../change_status_delta_child_flow3_error.hpl | 102 +++ ...hange_status_delta_child_flow3_success.hpl | 102 +++ .../change_status_delta_child_flow4_error.hpl | 102 +++ ...hange_status_delta_child_flow4_success.hpl | 102 +++ .../change_status_delta_child_flow5_error.hpl | 102 +++ ...hange_status_delta_child_flow5_success.hpl | 102 +++ .../checkpoint_job_child_delta.hpl | 126 +++ .../citizen_tables/child/job_child.hwf | 857 ++++++++++++++---- .../child/parallel/delta_child_flow.hpl | 395 ++++++++ 14 files changed, 2239 insertions(+), 243 deletions(-) create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl diff --git a/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl b/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl index d7492fe..0772a1e 100644 --- a/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl +++ b/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl @@ -20,11 +20,6 @@ - - JSON input state_job_citizen.json - Set variables - N - Set variables Write to log @@ -36,81 +31,6 @@ Y - - JSON input state_job_citizen.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 - - - - - - - - - - - - 864 - 528 - - Set variables SetVariable @@ -124,13 +44,11 @@ - pipeline PIPE PARENT_WORKFLOW - status STATUS PARENT_WORKFLOW @@ -158,7 +76,7 @@ N 0 SELECT - COALESCE(job_name, 'job_citizen_delta') AS PIPELINE, + COALESCE(job_name, 'job_child_delta') AS PIPELINE, COALESCE(status, 'ERROR') AS STATUS, current_timestamp::timestamp as record_created FROM ( diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl new file mode 100644 index 0000000..46deda3 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow1_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow1' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl new file mode 100644 index 0000000..e75ff73 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow1_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow1' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl new file mode 100644 index 0000000..b85340b --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow2_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow2' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl new file mode 100644 index 0000000..6aab4f9 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow2_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow2' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl new file mode 100644 index 0000000..15eccb7 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow3_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow3' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl new file mode 100644 index 0000000..fc295bf --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow3_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow3' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl new file mode 100644 index 0000000..6395e93 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow4_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow4' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl new file mode 100644 index 0000000..d1fd438 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow4_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow4' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl new file mode 100644 index 0000000..6dc2e50 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow5_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow5' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl new file mode 100644 index 0000000..e1512ce --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_child_flow5_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_child_flow5' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl new file mode 100644 index 0000000..a87375b --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl @@ -0,0 +1,126 @@ + + + + checkpoint_job_child_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 14:19:02.590 + - + 2025/06/03 14:19:02.590 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1072 + 240 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH status_check AS ( + SELECT + bool_or(status = 'ERROR' AND job_name IN ( + 'delta_child_flow1', + 'delta_child_flow2', + 'delta_child_flow3', + 'delta_child_flow4', + 'delta_child_flow5' + )) AS has_error, + count(*) FILTER ( + WHERE status = 'SUCCESS' AND job_name IN ( + 'delta_child_flow1', + 'delta_child_flow2', + 'delta_child_flow3', + 'delta_child_flow4', + 'delta_child_flow5' + ) + ) = 5 AS all_success + FROM public.etl_checkpoints +) +SELECT + 'job_child_delta' as job_name, + CASE + WHEN has_error THEN 'ERROR' + WHEN all_success THEN 'SUCCESS' + ELSE 'ERROR' + END AS status, + current_timestamp AS record_created +FROM status_check; + N + + + 704 + 240 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/job_child.hwf b/mappings/info_recruits/citizen_tables/child/job_child.hwf index e0aac3a..f2479a9 100644 --- a/mappings/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings/info_recruits/citizen_tables/child/job_child.hwf @@ -250,12 +250,12 @@ N N - 2336 + 2352 208 - Success new citizen + Success new child SUCCESS @@ -304,8 +304,8 @@ variable STATUS N - 1840 - 1792 + 1584 + 1760 @@ -359,8 +359,8 @@ N N - 2288 - 1040 + 2384 + 1072 @@ -513,56 +513,6 @@ 1600 - - delta_child.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/delta_child.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - Y - - N - local - N - N - Y - N - 2544 - 2176 - - - - Success delta_citizen - - SUCCESS - - N - 3120 - 2160 - - - - error delta_citizen - - SUCCESS - - N - 3120 - 2240 - - check_if_job_child_exists.hpl @@ -920,7 +870,7 @@ - Success new citizen 2 + Success new child 2 SUCCESS @@ -1241,58 +1191,6 @@ 1440 - - change_status_delta_child_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2896 - 2160 - - - - change_status_delta_child_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2896 - 2240 - - change_status_to_processing.hpl (2) @@ -1315,7 +1213,7 @@ N Y N - 2368 + 2352 576 @@ -1331,8 +1229,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing_delta.hpl - - Basic Y @@ -1377,16 +1273,6 @@ 2176 - - delta_citizen success - - SUCCESS - - N - 1984 - 1600 - - branching_child_delta.hpl @@ -1409,7 +1295,7 @@ N Y N - 1840 + 1744 2176 @@ -1441,6 +1327,503 @@ 1984 + + delta_child_flow.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl + + + Basic + + + M_R_UP_DATE + + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW1 + + + Y + + N + local + N + N + Y + N + 2592 + 1856 + + + + Abort workflow 3 + + ABORT + + N + N + 2336 + 1888 + + + + change_status_delta_child_flow1_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 1840 + + + + change_status_delta_child_flow1_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 1920 + + + + change_status_delta_child_flow2_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 2000 + + + + change_status_delta_child_flow2_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 2080 + + + + change_status_delta_child_flow3_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 2160 + + + + change_status_delta_child_flow3_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 2240 + + + + change_status_delta_child_flow4_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 2320 + + + + change_status_delta_child_flow4_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 2400 + + + + change_status_delta_child_flow5_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 2480 + + + + change_status_delta_child_flow5_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2848 + 2560 + + + + checkpoint_job_child_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 3296 + 2192 + + + + child_delta success + + SUCCESS + + N + 3536 + 2192 + + + + delta_child_flow.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl + + + Basic + + + M_R_UP_DATE + + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW2 + + + Y + + N + local + N + N + Y + N + 2592 + 2016 + + + + delta_child_flow.hpl 3 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl + + + Basic + + + M_R_UP_DATE + + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW3 + + + Y + + N + local + N + N + Y + N + 2592 + 2176 + + + + delta_child_flow.hpl 4 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl + + + Basic + + + M_R_UP_DATE + + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW4 + + + Y + + N + local + N + N + Y + N + 2592 + 2352 + + + + delta_child_flow.hpl 5 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl + + + Basic + + + M_R_UP_DATE + + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW5 + + + Y + + N + local + N + N + Y + N + 2592 + 2528 + + @@ -1711,7 +2094,7 @@ checkpoint_job_child.hpl - Success new citizen + Success new child Y Y N @@ -1788,7 +2171,7 @@ checkpoint_job_child.hpl 2 - Success new citizen 2 + Success new child 2 Y Y N @@ -1877,34 +2260,6 @@ N N - - delta_child.hpl - change_status_delta_child_success.hpl - Y - Y - N - - - change_status_delta_child_success.hpl - Success delta_citizen - Y - Y - N - - - delta_child.hpl - change_status_delta_child_error.hpl - Y - N - N - - - change_status_delta_child_error.hpl - error delta_citizen - Y - Y - N - recruitment_rows_five_flow_child.hpl change_status_to_processing.hpl (2) @@ -1926,13 +2281,6 @@ Y N - - recruitment_rows_five_flow_child.hpl (2) - delta_child.hpl - Y - Y - N - recruitment_rows_five_flow_child.hpl (2) change_status_to_processing_delta.hpl @@ -1968,6 +2316,195 @@ Y N + + recruitment_rows_five_flow_child.hpl (2) + delta_child_flow.hpl + Y + Y + N + + + recruitment_rows_five_flow_child.hpl (2) + Abort workflow 3 + Y + N + N + + + delta_child_flow.hpl + change_status_delta_child_flow1_success.hpl + Y + Y + N + + + delta_child_flow.hpl + change_status_delta_child_flow1_error.hpl + Y + N + N + + + checkpoint_job_child_delta.hpl + child_delta success + Y + Y + N + + + change_status_delta_child_flow1_success.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + change_status_delta_child_flow1_error.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + change_status_delta_child_flow2_success.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + change_status_delta_child_flow2_error.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + change_status_delta_child_flow3_success.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + change_status_delta_child_flow3_error.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + change_status_delta_child_flow4_success.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + change_status_delta_child_flow4_error.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + change_status_delta_child_flow5_success.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + change_status_delta_child_flow5_error.hpl + checkpoint_job_child_delta.hpl + Y + N + Y + + + recruitment_rows_five_flow_child.hpl (2) + delta_child_flow.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_child.hpl (2) + delta_child_flow.hpl 3 + Y + Y + N + + + recruitment_rows_five_flow_child.hpl (2) + delta_child_flow.hpl 4 + Y + Y + N + + + recruitment_rows_five_flow_child.hpl (2) + delta_child_flow.hpl 5 + Y + Y + N + + + delta_child_flow.hpl 2 + change_status_delta_child_flow2_success.hpl + Y + Y + N + + + delta_child_flow.hpl 2 + change_status_delta_child_flow2_error.hpl + Y + N + N + + + delta_child_flow.hpl 3 + change_status_delta_child_flow3_success.hpl + Y + Y + N + + + delta_child_flow.hpl 3 + change_status_delta_child_flow3_error.hpl + Y + N + N + + + delta_child_flow.hpl 4 + change_status_delta_child_flow4_success.hpl + Y + Y + N + + + delta_child_flow.hpl 4 + change_status_delta_child_flow4_error.hpl + Y + N + N + + + delta_child_flow.hpl 5 + change_status_delta_child_flow5_success.hpl + Y + Y + N + + + delta_child_flow.hpl 5 + change_status_delta_child_flow5_error.hpl + Y + N + N + diff --git a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl b/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl new file mode 100644 index 0000000..0f4eb99 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl @@ -0,0 +1,395 @@ + + + + delta_child_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 16:10:48.509 + - + 2025/06/03 16:10:48.509 + + + + + + Group by + Select values + Y + + + Select values + Update + Y + + + Table input + Group by + Y + + + Table input + Insert / update + Y + + + + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count + is_minor + SUM + + + has_minor_child + is_minor + MAX + + + has_dead_child + is_dead + MAX + + + Y + + + recruit_id + + + N + grp + + + 800 + 272 + + + + 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 + + + 1088 + 352 + +
+ + Select values + SelectValues + + Y + + 1 + + none + + + + + has_dead_child + + + has_minor_child + + + minors_count + + + recruit_id + + N + + has_dead_child + has_dead_child + Boolean + -2 + -2 + + false + + + false + + + + + + + + has_minor_child + has_minor_child + Boolean + -2 + -2 + + false + + + false + + + + + + + + minors_count + minors_count + Integer + -2 + -2 + + false + + + false + + + + + + + + recruit_id + recruit_id + String + -2 + -2 + + false + + + false + + + + + + + + + + 912 + 224 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END 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, + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + (dates.death_date IS NOT NULL) AS is_dead, + (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND '${RECRUITMENT_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' + AND c.update_date >= '${M_R_UP_DATE}'::timestamp + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + + Y + + + 624 + 352 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + minors_count + minors_count + + + has_minor_child + has_minor_child + + + has_dead_child + has_dead_child + +
+ N + Y + + + 1024 + 192 + +
+ + + +
From bbdcce7cb80f0987d9bc2ad417293260b4e24c4c Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Thu, 7 Aug 2025 09:33:01 +0300 Subject: [PATCH 10/34] =?UTF-8?q?ERVU-504:=20=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D0=BF=D0=B5=D0=BA?= =?UTF-8?q?=D1=83=D0=BD=D1=87=D0=B8=D0=BA=D0=BE=D0=B2=20=20=D0=B2=20mappin?= =?UTF-8?q?gs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../citizen_tables/child/delta_child.hpl | 395 ------ .../citizen_tables/child/job_child.hwf | 73 +- .../branching_citizen_guardianship_delta.hpl | 142 ++ ...elta_citizen_guardianship_flow1_error.hpl} | 12 +- ...ta_citizen_guardianship_flow1_success.hpl} | 12 +- ...elta_citizen_guardianship_flow2_error.hpl} | 12 +- ...ta_citizen_guardianship_flow2_success.hpl} | 12 +- ...delta_citizen_guardianship_flow3_error.hpl | 102 ++ ...lta_citizen_guardianship_flow3_success.hpl | 102 ++ ...delta_citizen_guardianship_flow4_error.hpl | 102 ++ ...lta_citizen_guardianship_flow4_success.hpl | 102 ++ ...delta_citizen_guardianship_flow5_error.hpl | 102 ++ ...lta_citizen_guardianship_flow5_success.hpl | 102 ++ .../change_status_to_processing_delta.hpl | 2 +- .../checkpoint_job_citizen_guardianship.hpl | 743 ----------- ...ckpoint_job_citizen_guardianship_delta.hpl | 126 ++ .../job_citizen_guardianship.hwf | 1172 +++++++++++++---- .../delta_citizen_guardianship_flow.hpl} | 168 +-- .../recruitment_rows_five_flow_if_error.hpl | 2 +- 19 files changed, 1890 insertions(+), 1593 deletions(-) delete mode 100644 mappings/info_recruits/citizen_tables/child/delta_child.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl rename mappings/info_recruits/citizen_tables/{child/checkpoints/change_status_delta_child_error.hpl => citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl} (92%) rename mappings/info_recruits/citizen_tables/{child/checkpoints/change_status_delta_child_success.hpl => citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl} (92%) rename mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/{change_status_delta_citizen_guardianship_error.hpl => change_status_delta_citizen_guardianship_flow2_error.hpl} (91%) rename mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/{change_status_delta_citizen_guardianship_success.hpl => change_status_delta_citizen_guardianship_flow2_success.hpl} (90%) create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl rename mappings/info_recruits/citizen_tables/citizen_guardianship/{delta_citizen_guardianship.hpl => parallel/delta_citizen_guardianship_flow.hpl} (95%) diff --git a/mappings/info_recruits/citizen_tables/child/delta_child.hpl b/mappings/info_recruits/citizen_tables/child/delta_child.hpl deleted file mode 100644 index 7650b78..0000000 --- a/mappings/info_recruits/citizen_tables/child/delta_child.hpl +++ /dev/null @@ -1,395 +0,0 @@ - - - - delta_child - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 16:10:48.509 - - - 2025/06/03 16:10:48.509 - - - - - - Group by - Select values - Y - - - Select values - Update - Y - - - Table input - Group by - Y - - - Table input - Insert / update - Y - - - - Group by - GroupBy - - N - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - minors_count - is_minor - SUM - - - has_minor_child - is_minor - MAX - - - has_dead_child - is_dead - MAX - - - Y - - - recruit_id - - - N - grp - - - 800 - 272 - - - - 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 - - - 1088 - 352 - -
- - Select values - SelectValues - - Y - - 1 - - none - - - - - has_dead_child - - - has_minor_child - - - minors_count - - - recruit_id - - N - - has_dead_child - has_dead_child - Boolean - -2 - -2 - - false - - - false - - - - - - - - has_minor_child - has_minor_child - Boolean - -2 - -2 - - false - - - false - - - - - - - - minors_count - minors_count - Integer - -2 - -2 - - false - - - false - - - - - - - - recruit_id - recruit_id - String - -2 - -2 - - false - - - false - - - - - - - - - - 912 - 224 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ri.recruit_id::uuid AS recruit_id, - ch->>'id' AS child_external_id, - NULLIF(ch->>'idERN', '') AS child_id_ern, - CASE NULLIF(ch->>'rodstvSvyazReb', '')::int - WHEN 1 THEN 3 - WHEN 2 THEN 4 - END 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, - dates.birth_date, - dates.death_date, - ch->'svedSmert'->>'nomerZapis' AS death_az_number, - ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (dates.death_date IS NOT NULL) AS is_dead, - (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.recruits_info ri -JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id -CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch -CROSS JOIN LATERAL ( - SELECT - 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 -) AS dates -WHERE - --'${ID_F1}' != '' - --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' - '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND c.update_date >= '${M_R_UP_DATE}'::timestamp - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; - - Y - - - 624 - 352 - - - - Update - Update - - Y - - 1 - - none - - - 100 - ervu-dashboard - Y - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen
- - minors_count - minors_count - - - has_minor_child - has_minor_child - - - has_dead_child - has_dead_child - -
- N - Y - - - 1024 - 192 - -
- - - -
diff --git a/mappings/info_recruits/citizen_tables/child/job_child.hwf b/mappings/info_recruits/citizen_tables/child/job_child.hwf index f2479a9..fea527f 100644 --- a/mappings/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings/info_recruits/citizen_tables/child/job_child.hwf @@ -557,32 +557,6 @@ 400 - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 1136 - 400 - - change_status_child_flow1_success.hpl @@ -1192,7 +1166,7 @@ - change_status_to_processing.hpl (2) + change_status_to_processing.hpl PIPELINE @@ -1203,6 +1177,8 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl + + Basic Y @@ -1339,19 +1315,15 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - - Basic M_R_UP_DATE - ${M_R_UP_DATE} RECRUITMENT_ID IDM_FLOW1 - Y @@ -1684,19 +1656,15 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - - Basic M_R_UP_DATE - ${M_R_UP_DATE} RECRUITMENT_ID IDM_FLOW2 - Y @@ -1722,19 +1690,15 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - - Basic M_R_UP_DATE - ${M_R_UP_DATE} RECRUITMENT_ID IDM_FLOW3 - Y @@ -1760,19 +1724,15 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - - Basic M_R_UP_DATE - ${M_R_UP_DATE} RECRUITMENT_ID IDM_FLOW4 - Y @@ -1798,19 +1758,15 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - - Basic M_R_UP_DATE - ${M_R_UP_DATE} RECRUITMENT_ID IDM_FLOW5 - Y @@ -1938,20 +1894,6 @@ Y N - - Simple job_child_exists check NEW - change_status_to_processing.hpl - Y - Y - N - - - change_status_to_processing.hpl - recruitment_rows_five_flow_child.hpl - Y - Y - N - child_flow1.hpl change_status_child_flow1_success.hpl @@ -2262,7 +2204,7 @@ recruitment_rows_five_flow_child.hpl - change_status_to_processing.hpl (2) + change_status_to_processing.hpl Y Y N @@ -2505,6 +2447,13 @@ N N + + Simple job_child_exists check NEW + recruitment_rows_five_flow_child.hpl + Y + Y + N + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl new file mode 100644 index 0000000..7df04b6 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl @@ -0,0 +1,142 @@ + + + + branching_citizen_guardianship_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 14:40:44.856 + - + 2025/06/03 14:40:44.856 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + pipeline + PIPE + PARENT_WORKFLOW + + + status + STATUS + PARENT_WORKFLOW + + + Y + + + 1104 + 368 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + COALESCE(job_name, 'job_citizen_guardianship_delta') AS PIPELINE, + COALESCE(status, 'ERROR') AS STATUS, + current_timestamp::timestamp as record_created +FROM ( + select + CASE + WHEN status = 'PROCESSING' THEN 'ERROR' + ELSE status + END AS status, + job_name + from public.etl_checkpoints + where job_name = 'job_citizen_guardianship_delta' + + UNION ALL + + SELECT NULL, NULL + WHERE NOT EXISTS ( + SELECT 1 + FROM public.etl_checkpoints + WHERE job_name = 'job_citizen_guardianship_delta' + ) +) t + N + + + 864 + 368 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Basic + Y + N + 0 + ${PIPE} +${STATUS} + + + pipeline + + + status + + + + + 1328 + 368 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl similarity index 92% rename from mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_error.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl index cc3d677..7aff57b 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl @@ -1,7 +1,7 @@ - change_status_delta_child_error + change_status_delta_citizen_guardianship_flow1_error Y @@ -85,17 +85,9 @@ N 0 SELECT - 'delta_child' as job_name, + 'delta_citizen_guardianship_flow1' as job_name, 'ERROR' as status, current_timestamp as record_created - -union all - - SELECT - 'job_child' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl similarity index 92% rename from mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_success.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl index 081660e..4afa8d1 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_success.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl @@ -1,7 +1,7 @@ - change_status_delta_child_success + change_status_delta_citizen_guardianship_flow1_success Y @@ -85,17 +85,9 @@ N 0 SELECT - 'delta_child' as job_name, + 'delta_citizen_guardianship_flow1' as job_name, 'SUCCESS' as status, current_timestamp as record_created - -union all - - SELECT - 'job_child' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_error.hpl similarity index 91% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_error.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_error.hpl index 62e0d8a..5bc6b96 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_error.hpl @@ -1,7 +1,7 @@ - change_status_delta_citizen_guardianship_error + change_status_delta_citizen_guardianship_flow2_error Y @@ -85,17 +85,9 @@ N 0 SELECT - 'delta_citizen_guardianship' as job_name, + 'delta_citizen_guardianship_flow2' as job_name, 'ERROR' as status, current_timestamp as record_created - -union all - - SELECT - 'job_citizen_guardianship' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_success.hpl similarity index 90% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_success.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_success.hpl index 5628f74..1b5a4e1 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_success.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_success.hpl @@ -1,7 +1,7 @@ - change_status_delta_citizen_guardianship_success + change_status_delta_citizen_guardianship_flow2_success Y @@ -85,17 +85,9 @@ N 0 SELECT - 'delta_citizen_guardianship' as job_name, + 'delta_citizen_guardianship_flow2' as job_name, 'SUCCESS' as status, current_timestamp as record_created - -union all - - SELECT - 'job_citizen_guardianship' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl new file mode 100644 index 0000000..a1831cc --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_guardianship_flow3_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_guardianship_flow3' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl new file mode 100644 index 0000000..db90c73 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_guardianship_flow3_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_guardianship_flow3' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl new file mode 100644 index 0000000..73127c8 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_guardianship_flow4_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_guardianship_flow4' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl new file mode 100644 index 0000000..c6c862a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_guardianship_flow4_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_guardianship_flow4' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl new file mode 100644 index 0000000..e264351 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_guardianship_flow5_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_guardianship_flow5' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl new file mode 100644 index 0000000..892635d --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_guardianship_flow5_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_guardianship_flow5' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl index 8be76b7..4e81e10 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl @@ -86,7 +86,7 @@ 0 SELECT 'PROCESSING' AS status, - 'delta_child' AS job_name, + 'delta_citizen_guardianship' AS job_name, current_timestamp AS record_created --FROM public.etl_checkpoints N diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl index 0413a04..13e0012 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl @@ -20,755 +20,12 @@ - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - Table input Insert / update 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 - child_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 - child_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 - child_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 - child_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 - child_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_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 336 - 592 - - Insert / update InsertUpdate diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl new file mode 100644 index 0000000..58756f6 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl @@ -0,0 +1,126 @@ + + + + checkpoint_job_citizen_guardianship_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 14:19:02.590 + - + 2025/06/03 14:19:02.590 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1072 + 240 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH status_check AS ( + SELECT + bool_or(status = 'ERROR' AND job_name IN ( + 'delta_citizen_guardianship_flow1', + 'delta_citizen_guardianship_flow2', + 'delta_citizen_guardianship_flow3', + 'delta_citizen_guardianship_flow4', + 'delta_citizen_guardianship_flow5' + )) AS has_error, + count(*) FILTER ( + WHERE status = 'SUCCESS' AND job_name IN ( + 'delta_citizen_guardianship_flow1', + 'delta_citizen_guardianship_flow2', + 'delta_citizen_guardianship_flow3', + 'delta_citizen_guardianship_flow4', + 'delta_citizen_guardianship_flow5' + ) + ) = 5 AS all_success + FROM public.etl_checkpoints +) +SELECT + 'job_citizen_guardianship_delta' as job_name, + CASE + WHEN has_error THEN 'ERROR' + WHEN all_success THEN 'SUCCESS' + ELSE 'ERROR' + END AS status, + current_timestamp AS record_created +FROM status_check; + N + + + 704 + 240 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf index 18ab950..656c879 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf @@ -79,14 +79,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW1 - Y @@ -112,14 +109,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW2 - Y @@ -145,14 +139,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW3 - Y @@ -178,14 +169,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW4 - Y @@ -211,14 +199,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW5 - Y @@ -239,8 +224,8 @@ N N - 2368 - 208 + 2384 + 224
@@ -306,25 +291,7 @@ - Simple child WHERE SUCCESS - - SIMPLE_EVAL - - SUCCESS - string - true - equal - equal - N - variable - STATUS - N - 1888 - 1792 - - - - Simple child WHERE ERROR + Simple citizen_guardianship WHERE ERROR SIMPLE_EVAL @@ -337,7 +304,7 @@ variable STATUS N - 1840 + 1920 1280 @@ -352,7 +319,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl Basic Y @@ -378,56 +345,6 @@ 1040 - - 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 - 2704 - 1792 - - - - Success delta_citizen - - SUCCESS - - N - 3328 - 1792 - - - - error delta_citizen - - SUCCESS - - N - 3328 - 1872 - - check_if_job_citizen_guardianship_exists.hpl @@ -472,32 +389,6 @@ 400 - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 1424 - 400 - - change_status_citizen_guardianship_flow1_success.hpl @@ -520,8 +411,8 @@ N Y N - 3024 - 80 + 3120 + 96 @@ -546,8 +437,8 @@ N Y N - 3024 - 160 + 3120 + 176 @@ -572,8 +463,8 @@ N Y N - 3024 - 240 + 3120 + 256 @@ -598,8 +489,8 @@ N Y N - 3024 - 320 + 3120 + 336 @@ -624,8 +515,8 @@ N Y N - 3024 - 400 + 3120 + 416 @@ -650,8 +541,8 @@ N Y N - 3024 - 480 + 3120 + 496 @@ -676,8 +567,8 @@ N Y N - 3024 - 560 + 3120 + 576 @@ -702,8 +593,8 @@ N Y N - 3024 - 640 + 3120 + 656 @@ -728,8 +619,8 @@ N Y N - 3024 - 720 + 3120 + 736 @@ -754,8 +645,8 @@ N Y N - 3024 - 800 + 3120 + 816 @@ -796,14 +687,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW1 - Y @@ -829,14 +717,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW2 - Y @@ -862,14 +747,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW3 - Y @@ -895,14 +777,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW4 - Y @@ -928,14 +807,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW5 - Y @@ -1007,7 +883,7 @@ N Y N - 3024 + 3120 960 @@ -1033,7 +909,7 @@ N Y N - 3024 + 3120 1040 @@ -1059,7 +935,7 @@ N Y N - 3024 + 3120 1120 @@ -1085,7 +961,7 @@ N Y N - 3024 + 3120 1200 @@ -1111,7 +987,7 @@ N Y N - 3024 + 3120 1280 @@ -1137,7 +1013,7 @@ N Y N - 3024 + 3120 1360 @@ -1163,7 +1039,7 @@ N Y N - 3024 + 3120 1440 @@ -1189,7 +1065,7 @@ N Y N - 3024 + 3120 1520 @@ -1215,7 +1091,7 @@ N Y N - 3024 + 3120 1600 @@ -1241,34 +1117,26 @@ N Y N - 3024 + 3120 1680 - change_status_to_processing.hpl 2 + Simple citizen_guardianship WHERE SUCCESS - PIPELINE + SIMPLE_EVAL - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y + SUCCESS + string + true + equal + equal + N + variable + STATUS N - 2096 - 1280 + 1584 + 1792 @@ -1293,12 +1161,12 @@ N Y N - 2160 - 1792 + 2512 + 2528 - change_status_delta_citizen_guardianship_success.hpl + recruitment_rows_five_flow_citizen_guardianship.hpl (2) PIPELINE @@ -1308,7 +1176,37 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_success.hpl + ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl + Basic + + + CR_DATE + CREATE_DATE + + Y + + N + local + N + N + Y + Y + 2512 + 2224 + + + + branching_citizen_guardianship_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl Basic Y @@ -1319,12 +1217,85 @@ N Y N - 3024 - 1792 + 1584 + 2224 - change_status_delta_citizen_guardianship_error.hpl + Simple delta_citizen_guardianship WHERE ERROR + + SIMPLE_EVAL + + ERROR + string + true + equal + equal + N + variable + STATUS + N + 2096 + 2224 + + + + delta_citizen_guardianship success 2 + + SUCCESS + + N + 2096 + 2032 + + + + delta_citizen_guardianship_flow.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW1 + + Y + + N + local + N + N + Y + N + 3056 + 1936 + + + + Abort workflow 3 + + ABORT + + N + N + 2512 + 1936 + + + + change_status_delta_citizen_guardianship_flow1_success.hpl PIPELINE @@ -1334,7 +1305,9 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl + + Basic Y @@ -1345,8 +1318,468 @@ N Y N - 3024 - 1872 + 3408 + 1920 + + + + change_status_delta_citizen_guardianship_flow1_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3408 + 2000 + + + + change_status_delta_citizen_guardianship_flow2_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 3408 + 2080 + + + + change_status_delta_citizen_guardianship_flow2_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3408 + 2160 + + + + change_status_delta_citizen_guardianship_flow3_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 3408 + 2240 + + + + change_status_delta_citizen_guardianship_flow3_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3408 + 2320 + + + + change_status_delta_citizen_guardianship_flow4_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 3408 + 2400 + + + + change_status_delta_citizen_guardianship_flow4_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3408 + 2480 + + + + change_status_delta_citizen_guardianship_flow5_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 3408 + 2560 + + + + change_status_delta_citizen_guardianship_flow5_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3408 + 2640 + + + + checkpoint_job_citizen_guardianship_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 3760 + 2272 + + + + citizen_guardianship_delta success + + SUCCESS + + N + 4176 + 2272 + + + + delta_citizen_guardianship_flow.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW2 + + Y + + N + local + N + N + Y + N + 3056 + 2096 + + + + delta_citizen_guardianship_flow.hpl 3 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW3 + + Y + + N + local + N + N + Y + N + 3056 + 2256 + + + + delta_citizen_guardianship_flow.hpl 4 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW4 + + Y + + N + local + N + N + Y + N + 3056 + 2432 + + + + delta_citizen_guardianship_flow.hpl 5 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW5 + + Y + + N + local + N + N + Y + N + 3056 + 2608 + + + + change_status_to_processing.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl + Basic + + Y + + N + local + N + N + Y + N + 2384 + 560 + + + + change_status_to_processing.hpl 2 + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl + Basic + + Y + + N + local + N + N + Y + N + 2384 + 1440 @@ -1393,13 +1826,6 @@ N N - - branching_citizen_guardianship.hpl - Simple child WHERE SUCCESS - Y - N - Y - recruitment_rows_five_flow_if_error.hpl Abort workflow 2 @@ -1414,20 +1840,6 @@ Y N - - Simple job_citizen_guardianship_exists check NEW - change_status_to_processing.hpl - Y - Y - N - - - change_status_to_processing.hpl - recruitment_rows_five_flow_citizen_guardianship.hpl - Y - Y - N - citizen_guardianship_flow1.hpl change_status_citizen_guardianship_flow1_success.hpl @@ -1771,69 +2183,13 @@ Y N - - change_status_to_processing.hpl 2 - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - Simple child WHERE ERROR - change_status_to_processing.hpl 2 - Y - Y - N - branching_citizen_guardianship.hpl - Simple child WHERE ERROR + Simple citizen_guardianship WHERE ERROR Y N Y - - Simple child WHERE SUCCESS - change_status_to_processing_delta.hpl - Y - Y - N - - - delta_citizen_guardianship.hpl - change_status_delta_citizen_guardianship_success.hpl - Y - Y - N - - - change_status_delta_citizen_guardianship_success.hpl - Success delta_citizen - Y - Y - N - - - change_status_delta_citizen_guardianship_error.hpl - error delta_citizen - Y - Y - N - - - change_status_to_processing_delta.hpl - delta_citizen_guardianship.hpl - Y - Y - N - - - delta_citizen_guardianship.hpl - change_status_delta_citizen_guardianship_error.hpl - Y - N - N - Start check_if_job_citizen_guardianship_exists.hpl @@ -1841,8 +2197,290 @@ Y Y + + Simple citizen_guardianship WHERE SUCCESS + branching_citizen_guardianship_delta.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl (2) + change_status_to_processing_delta.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl (2) + delta_citizen_guardianship_flow.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl (2) + Abort workflow 3 + Y + N + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl (2) + delta_citizen_guardianship_flow.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl (2) + delta_citizen_guardianship_flow.hpl 3 + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl (2) + delta_citizen_guardianship_flow.hpl 4 + Y + Y + N + + + recruitment_rows_five_flow_citizen_guardianship.hpl (2) + delta_citizen_guardianship_flow.hpl 5 + Y + Y + N + + + branching_citizen_guardianship_delta.hpl + Simple delta_citizen_guardianship WHERE ERROR + Y + Y + N + + + Simple delta_citizen_guardianship WHERE ERROR + recruitment_rows_five_flow_citizen_guardianship.hpl (2) + Y + Y + N + + + Simple delta_citizen_guardianship WHERE ERROR + delta_citizen_guardianship success 2 + Y + N + N + + + delta_citizen_guardianship_flow.hpl + change_status_delta_citizen_guardianship_flow1_success.hpl + Y + Y + N + + + delta_citizen_guardianship_flow.hpl + change_status_delta_citizen_guardianship_flow1_error.hpl + Y + N + N + + + change_status_delta_citizen_guardianship_flow1_success.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + change_status_delta_citizen_guardianship_flow1_error.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + change_status_delta_citizen_guardianship_flow2_success.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + change_status_delta_citizen_guardianship_flow2_error.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + change_status_delta_citizen_guardianship_flow3_success.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + change_status_delta_citizen_guardianship_flow3_error.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + change_status_delta_citizen_guardianship_flow4_success.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + change_status_delta_citizen_guardianship_flow4_error.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + change_status_delta_citizen_guardianship_flow5_success.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + change_status_delta_citizen_guardianship_flow5_error.hpl + checkpoint_job_citizen_guardianship_delta.hpl + Y + N + Y + + + checkpoint_job_citizen_guardianship_delta.hpl + citizen_guardianship_delta success + Y + Y + N + + + delta_citizen_guardianship_flow.hpl 2 + change_status_delta_citizen_guardianship_flow2_success.hpl + Y + Y + N + + + delta_citizen_guardianship_flow.hpl 2 + change_status_delta_citizen_guardianship_flow2_error.hpl + Y + N + N + + + delta_citizen_guardianship_flow.hpl 3 + change_status_delta_citizen_guardianship_flow3_success.hpl + Y + Y + N + + + delta_citizen_guardianship_flow.hpl 3 + change_status_delta_citizen_guardianship_flow3_error.hpl + Y + N + N + + + delta_citizen_guardianship_flow.hpl 4 + change_status_delta_citizen_guardianship_flow4_success.hpl + Y + Y + N + + + delta_citizen_guardianship_flow.hpl 4 + change_status_delta_citizen_guardianship_flow4_error.hpl + Y + N + N + + + delta_citizen_guardianship_flow.hpl 5 + change_status_delta_citizen_guardianship_flow5_success.hpl + Y + Y + N + + + delta_citizen_guardianship_flow.hpl 5 + change_status_delta_citizen_guardianship_flow5_error.hpl + Y + N + N + + + branching_citizen_guardianship.hpl + Simple citizen_guardianship WHERE SUCCESS + Y + N + Y + + + recruitment_rows_five_flow_citizen_guardianship.hpl + change_status_to_processing.hpl + Y + Y + N + + + Simple job_citizen_guardianship_exists check NEW + recruitment_rows_five_flow_citizen_guardianship.hpl + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + change_status_to_processing.hpl 2 + Y + Y + N + + + Simple citizen_guardianship WHERE ERROR + recruitment_rows_five_flow_if_error.hpl + Y + Y + N + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 72 + 656 + 144 + 0001-01-01 00:00:00 + +3001-01-01 00:00:00 + + 114 + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl similarity index 95% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl index 3844d18..9ed539d 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl @@ -1,7 +1,7 @@ - delta_citizen_guardianship + delta_citizen_guardianship_flow Y @@ -41,54 +41,6 @@ Y - - Table input - TableInput - - N - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - r.recruit_id AS recruit_id, - ch->>'id' AS guardianship_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 ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id -CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch -WHERE - --'${ID_F1}' != '' -- Проверка на пустую строку - --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' - '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date - AND r.update_date >= '${M_R_UP_DATE}'::timestamp - AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; - Y - - - 816 - 352 - - Add constants Constant @@ -146,41 +98,6 @@ WHERE 208 - - Update - Update - - Y - - 1 - - none - - - 100 - ervu-dashboard - Y - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen
- - is_guardian - is_guardian - -
- N - Y - - - 1024 - 112 - -
Insert / update InsertUpdate @@ -260,6 +177,89 @@ WHERE 352 + + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.recruit_id AS recruit_id, + ch->>'id' AS guardianship_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 ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + r.update_date >= '${M_R_UP_DATE}'::timestamp + AND'${RECRUITMENT_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; + Y + + + 816 + 352 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 1024 + 112 + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl index e5f247b..dc89572 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl @@ -82,7 +82,7 @@ flow_ranges AS ( 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_child ch on ch.recruit_id = cit.recruit_id + join ervu_dashboard.citizen_guardianship cg on cg.recruit_id = cit.recruit_id ), flow_data AS ( From 8034a929321b0ff780e34c77d1d5972a7bfbaa1b Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Thu, 7 Aug 2025 10:23:52 +0300 Subject: [PATCH 11/34] =?UTF-8?q?ERVU-504:=20=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D1=81=D1=83=D0=BF=D1=80?= =?UTF-8?q?=D1=83=D0=B3=D0=B0=D0=BC=20=D0=B2=20mappings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkpoints/checkpoint_job_child.hpl | 743 ---------- .../citizen_tables/child/job_child.hwf | 6 +- .../branching_citizen_spouse_delta.hpl | 142 ++ ...atus_delta_citizen_spouse_flow1_error.hpl} | 12 +- ...us_delta_citizen_spouse_flow1_success.hpl} | 12 +- ...tatus_delta_citizen_spouse_flow2_error.hpl | 102 ++ ...tus_delta_citizen_spouse_flow2_success.hpl | 102 ++ ...tatus_delta_citizen_spouse_flow3_error.hpl | 102 ++ ...tus_delta_citizen_spouse_flow3_success.hpl | 102 ++ ...tatus_delta_citizen_spouse_flow4_error.hpl | 102 ++ ...tus_delta_citizen_spouse_flow4_success.hpl | 102 ++ ...tatus_delta_citizen_spouse_flow5_error.hpl | 102 ++ ...tus_delta_citizen_spouse_flow5_success.hpl | 102 ++ .../checkpoint_job_citizen_spouse.hpl | 743 ---------- .../checkpoint_job_citizen_spouse_delta.hpl | 126 ++ .../checkpoints/xxjob_create_files_child.hwf | 235 ---- .../citizen_spouse/job_citizen_spouse.hwf | 1226 +++++++++++++---- .../delta_citizen_spouse_flow.hpl} | 124 +- 18 files changed, 2072 insertions(+), 2113 deletions(-) create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl rename mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/{change_status_delta_citizen_spouse_error.hpl => change_status_delta_citizen_spouse_flow1_error.hpl} (91%) rename mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/{change_status_delta_citizen_spouse_success.hpl => change_status_delta_citizen_spouse_flow1_success.hpl} (91%) create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/xxjob_create_files_child.hwf rename mappings/info_recruits/citizen_tables/citizen_spouse/{delta_citizen_spouse.hpl => parallel/delta_citizen_spouse_flow.hpl} (95%) diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl index 06568da..a078efc 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl @@ -20,380 +20,12 @@ - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - Table input Insert / update Y - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - Insert / update InsertUpdate @@ -438,381 +70,6 @@ 208 - - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - Table input TableInput diff --git a/mappings/info_recruits/citizen_tables/child/job_child.hwf b/mappings/info_recruits/citizen_tables/child/job_child.hwf index fea527f..aeb5a57 100644 --- a/mappings/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings/info_recruits/citizen_tables/child/job_child.hwf @@ -304,8 +304,8 @@ variable STATUS N - 1584 - 1760 + 1600 + 1808 @@ -1177,8 +1177,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl - - Basic Y diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl new file mode 100644 index 0000000..ee1d676 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl @@ -0,0 +1,142 @@ + + + + branching_citizen_spouse_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 14:40:44.856 + - + 2025/06/03 14:40:44.856 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + pipeline + PIPE + PARENT_WORKFLOW + + + status + STATUS + PARENT_WORKFLOW + + + Y + + + 1104 + 368 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + COALESCE(job_name, 'job_citizen_spouse_delta') AS PIPELINE, + COALESCE(status, 'ERROR') AS STATUS, + current_timestamp::timestamp as record_created +FROM ( + select + CASE + WHEN status = 'PROCESSING' THEN 'ERROR' + ELSE status + END AS status, + job_name + from public.etl_checkpoints + where job_name = 'job_citizen_spouse_delta' + + UNION ALL + + SELECT NULL, NULL + WHERE NOT EXISTS ( + SELECT 1 + FROM public.etl_checkpoints + WHERE job_name = 'job_citizen_spouse_delta' + ) +) t + N + + + 864 + 368 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Basic + Y + N + 0 + ${PIPE} +${STATUS} + + + pipeline + + + status + + + + + 1328 + 368 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_error.hpl similarity index 91% rename from mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_error.hpl rename to mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_error.hpl index dcc34fb..cc1a8ca 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_error.hpl @@ -1,7 +1,7 @@ - change_status_delta_citizen_spouse_error + change_status_delta_citizen_spouse_flow1_error Y @@ -85,17 +85,9 @@ N 0 SELECT - 'delta_citizen_spouse' as job_name, + 'delta_citizen_spouse_flow1' as job_name, 'ERROR' as status, current_timestamp as record_created - -union all - - SELECT - 'job_citizen_spouse' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_success.hpl similarity index 91% rename from mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_success.hpl rename to mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_success.hpl index d704ea8..5dbd661 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_success.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_success.hpl @@ -1,7 +1,7 @@ - change_status_delta_citizen_spouse_success + change_status_delta_citizen_spouse_flow1_success Y @@ -85,17 +85,9 @@ N 0 SELECT - 'delta_citizen_spouse' as job_name, + 'delta_citizen_spouse_flow1' as job_name, 'SUCCESS' as status, current_timestamp as record_created - -union all - - SELECT - 'job_citizen_spouse' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl new file mode 100644 index 0000000..490474a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_spouse_flow2_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_spouse_flow2' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl new file mode 100644 index 0000000..862e079 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_spouse_flow2_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_spouse_flow2' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl new file mode 100644 index 0000000..7948962 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_spouse_flow3_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_spouse_flow3' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl new file mode 100644 index 0000000..28f7afa --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_spouse_flow3_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_spouse_flow3' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl new file mode 100644 index 0000000..71a9f0e --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_spouse_flow4_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_spouse_flow4' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl new file mode 100644 index 0000000..78f8473 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_spouse_flow4_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_spouse_flow4' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl new file mode 100644 index 0000000..6f30a52 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_spouse_flow5_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_spouse_flow5' as job_name, + 'ERROR' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl new file mode 100644 index 0000000..117d5b6 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl @@ -0,0 +1,102 @@ + + + + change_status_delta_citizen_spouse_flow5_success + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/16 12:20:06.191 + - + 2025/06/16 12:20:06.191 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1152 + 304 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + 'delta_citizen_spouse_flow5' as job_name, + 'SUCCESS' as status, + current_timestamp as record_created + + N + + + 784 + 304 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl index ed32b9f..8745bcd 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl @@ -20,380 +20,12 @@ - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - Table input Insert / update Y - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - Insert / update InsertUpdate @@ -438,381 +70,6 @@ 208 - - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - Table input TableInput diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl new file mode 100644 index 0000000..4451c30 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl @@ -0,0 +1,126 @@ + + + + checkpoint_job_citizen_spouse_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 14:19:02.590 + - + 2025/06/03 14:19:02.590 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + job_name + job_name + + public + etl_checkpoints
+ + job_name + job_name + N + + + record_created + record_created + Y + + + status + status + Y + +
+ N + + + 1072 + 240 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH status_check AS ( + SELECT + bool_or(status = 'ERROR' AND job_name IN ( + 'delta_citizen_spouse_flow1', + 'delta_citizen_spouse_flow2', + 'delta_citizen_spouse_flow3', + 'delta_citizen_spouse_flow4', + 'delta_citizen_spouse_flow5' + )) AS has_error, + count(*) FILTER ( + WHERE status = 'SUCCESS' AND job_name IN ( + 'delta_citizen_spouse_flow1', + 'delta_citizen_spouse_flow2', + 'delta_citizen_spouse_flow3', + 'delta_citizen_spouse_flow4', + 'delta_citizen_spouse_flow5' + ) + ) = 5 AS all_success + FROM public.etl_checkpoints +) +SELECT + 'job_citizen_spouse_delta' as job_name, + CASE + WHEN has_error THEN 'ERROR' + WHEN all_success THEN 'SUCCESS' + ELSE 'ERROR' + END AS status, + current_timestamp AS record_created +FROM status_check; + N + + + 704 + 240 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/xxjob_create_files_child.hwf b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/xxjob_create_files_child.hwf deleted file mode 100644 index b31ca9f..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/xxjob_create_files_child.hwf +++ /dev/null @@ -1,235 +0,0 @@ - - - job_create_files_child - 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_child_flow2_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow2" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json - N - 848 - 416 - - - - state_child_flow1_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow1" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json - N - 848 - 336 - - - - state_child_flow3_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow3" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json - N - 848 - 496 - - - - state_child_flow4_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow4" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json - N - 848 - 576 - - - - state_child_flow5_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow5" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - N - 848 - 656 - - - - Success - - SUCCESS - - N - 1120 - 496 - - - - Delete file state_job_child - - DELETE_FILE - - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json - N - 848 - 256 - - - - - - Start - state_child_flow3_new - Y - Y - Y - - - Start - state_child_flow2_new - Y - Y - Y - - - Start - state_child_flow1_new - Y - Y - Y - - - Start - state_child_flow4_new - Y - Y - Y - - - Start - state_child_flow5_new - Y - Y - Y - - - state_child_flow5_new - Success - Y - Y - N - - - state_child_flow4_new - Success - Y - Y - N - - - state_child_flow3_new - Success - Y - Y - N - - - state_child_flow2_new - Success - Y - Y - N - - - state_child_flow1_new - Success - Y - Y - N - - - Start - Delete file state_job_child - Y - Y - Y - - - Delete file state_job_child - Success - Y - Y - N - - - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf b/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf index 0b66a28..0401391 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf @@ -105,14 +105,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW1 - Y @@ -138,14 +135,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW2 - Y @@ -171,14 +165,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW3 - Y @@ -204,14 +195,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW4 - Y @@ -237,14 +225,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW5 - Y @@ -265,7 +250,7 @@ N N - 2336 + 2352 208
@@ -305,24 +290,6 @@ 1280 - - Simple citizen_spouse WHERE SUCCESS - - SIMPLE_EVAL - - SUCCESS - string - true - equal - equal - N - variable - STATUS - N - 1840 - 1792 - - Simple citizen_spouse WHERE ERROR @@ -374,58 +341,8 @@ N N - 2288 - 1040 - - - - 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 - 2640 - 1792 - - - - Success delta_citizen - - SUCCESS - - N - 3280 - 1792 - - - - error delta_citizen - - SUCCESS - - N - 3280 - 1872 + 2384 + 1056 @@ -472,32 +389,6 @@ 400 - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 1264 - 400 - - change_status_citizen_spouse_flow1_success.hpl @@ -784,110 +675,6 @@ 432 - - change_status_to_processing.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2112 - 1280 - - - - change_status_to_processing_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2144 - 1792 - - - - change_status_delta_citizen_spouse_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1792 - - - - change_status_delta_citizen_spouse_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1872 - - citizen_spouse_flow1.hpl 2 @@ -905,7 +692,7 @@ Basic - ID_F1 + RECRUITMENT_ID IDM_FLOW1 @@ -933,14 +720,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW2 - Y @@ -966,14 +750,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW3 - Y @@ -999,14 +780,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW4 - Y @@ -1032,14 +810,11 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - Basic RECRUITMENT_ID IDM_FLOW5 - Y @@ -1349,6 +1124,663 @@ 1312 + + Simple citizen_spouse WHERE SUCCESS + + SIMPLE_EVAL + + SUCCESS + string + true + equal + equal + N + variable + STATUS + N + 1584 + 1824 + + + + change_status_to_processing_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 2560 + 2496 + + + + recruitment_rows_five_flow_citizen_spouse.hpl (2) + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl + Basic + + + CR_DATE + CREATE_DATE + + Y + + N + local + N + N + Y + Y + 2560 + 2192 + + + + branching_citizen_spouse_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 1584 + 2192 + + + + Simple delta_citizen_spouse WHERE ERROR + + SIMPLE_EVAL + + ERROR + string + true + equal + equal + N + variable + STATUS + N + 2048 + 2192 + + + + delta_citizen_spouse success 2 + + SUCCESS + + N + 2048 + 2000 + + + + delta_citizen_spouse_flow.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW1 + + Y + + N + local + N + N + Y + N + 3104 + 1872 + + + + Abort workflow 3 + + ABORT + + N + N + 2560 + 1904 + + + + change_status_delta_citizen_spouse_flow1_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 1856 + + + + change_status_delta_citizen_spouse_flow1_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 1936 + + + + change_status_delta_citizen_spouse_flow2_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 2016 + + + + change_status_delta_citizen_spouse_flow2_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 2096 + + + + change_status_delta_citizen_spouse_flow3_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 2176 + + + + change_status_delta_citizen_spouse_flow3_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 2256 + + + + change_status_delta_citizen_spouse_flow4_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 2336 + + + + change_status_delta_citizen_spouse_flow4_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 2416 + + + + change_status_delta_citizen_spouse_flow5_success.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 2496 + + + + change_status_delta_citizen_spouse_flow5_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 3440 + 2576 + + + + checkpoint_job_citizen_spouse_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 3808 + 2208 + + + + citizen_spouse_delta success + + SUCCESS + + N + 4048 + 2208 + + + + delta_citizen_spouse_flow.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW2 + + Y + + N + local + N + N + Y + N + 3104 + 2032 + + + + delta_citizen_spouse_flow.hpl 3 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW3 + + Y + + N + local + N + N + Y + N + 3104 + 2192 + + + + delta_citizen_spouse_flow.hpl 4 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW4 + + Y + + N + local + N + N + Y + N + 3104 + 2368 + + + + delta_citizen_spouse_flow.hpl 5 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + + RECRUITMENT_ID + IDM_FLOW5 + + Y + + N + local + N + N + Y + N + 3104 + 2544 + + + + change_status_to_processing.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl + Basic + + Y + + N + local + N + N + Y + N + 2352 + 560 + + + + change_status_to_processing.hpl 2 + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl + Basic + + Y + + N + local + N + N + Y + N + 2384 + 1504 + + @@ -1400,13 +1832,6 @@ N Y - - branching_citizen_spouse.hpl - Simple citizen_spouse WHERE SUCCESS - Y - N - Y - recruitment_rows_five_flow_if_error.hpl Abort workflow 2 @@ -1428,20 +1853,6 @@ Y N - - Simple job_citizen_spouse_exists check NEW - change_status_to_processing.hpl - Y - Y - N - - - change_status_to_processing.hpl - recruitment_rows_five_flow_citizen_spouse.hpl - Y - Y - N - citizen_spouse_flow1.hpl change_status_citizen_spouse_flow1_success.hpl @@ -1603,62 +2014,6 @@ N N - - Simple citizen_spouse WHERE ERROR - change_status_to_processing.hpl (2) - Y - Y - N - - - change_status_to_processing.hpl (2) - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - Simple citizen_spouse WHERE SUCCESS - change_status_to_processing_delta.hpl - Y - Y - N - - - delta_citizen_spouse.hpl - change_status_delta_citizen_spouse_success.hpl - Y - Y - N - - - change_status_delta_citizen_spouse_success.hpl - Success delta_citizen - Y - Y - N - - - delta_citizen_spouse.hpl - change_status_delta_citizen_spouse_error.hpl - Y - N - N - - - change_status_delta_citizen_spouse_error.hpl - error delta_citizen - Y - Y - N - - - change_status_to_processing_delta.hpl - delta_citizen_spouse.hpl - Y - Y - N - citizen_spouse_flow1.hpl 2 change_status_citizen_spouse_flow1_success.hpl 2 @@ -1841,6 +2196,265 @@ Y N + + Simple job_citizen_spouse_exists check NEW + recruitment_rows_five_flow_citizen_spouse.hpl + Y + Y + N + + + Simple citizen_spouse WHERE ERROR + recruitment_rows_five_flow_if_error.hpl + Y + Y + N + + + Simple citizen_spouse WHERE SUCCESS + branching_citizen_spouse_delta.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl (2) + change_status_to_processing_delta.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl (2) + delta_citizen_spouse_flow.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl (2) + Abort workflow 3 + Y + N + N + + + recruitment_rows_five_flow_citizen_spouse.hpl (2) + delta_citizen_spouse_flow.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl (2) + delta_citizen_spouse_flow.hpl 3 + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl (2) + delta_citizen_spouse_flow.hpl 4 + Y + Y + N + + + recruitment_rows_five_flow_citizen_spouse.hpl (2) + delta_citizen_spouse_flow.hpl 5 + Y + Y + N + + + branching_citizen_spouse_delta.hpl + Simple delta_citizen_spouse WHERE ERROR + Y + Y + N + + + Simple delta_citizen_spouse WHERE ERROR + recruitment_rows_five_flow_citizen_spouse.hpl (2) + Y + Y + N + + + Simple delta_citizen_spouse WHERE ERROR + delta_citizen_spouse success 2 + Y + N + N + + + delta_citizen_spouse_flow.hpl + change_status_delta_citizen_spouse_flow1_success.hpl + Y + Y + N + + + delta_citizen_spouse_flow.hpl + change_status_delta_citizen_spouse_flow1_error.hpl + Y + N + N + + + change_status_delta_citizen_spouse_flow1_success.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + change_status_delta_citizen_spouse_flow1_error.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + change_status_delta_citizen_spouse_flow2_success.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + change_status_delta_citizen_spouse_flow2_error.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + change_status_delta_citizen_spouse_flow3_success.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + change_status_delta_citizen_spouse_flow3_error.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + change_status_delta_citizen_spouse_flow4_success.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + change_status_delta_citizen_spouse_flow4_error.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + change_status_delta_citizen_spouse_flow5_success.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + change_status_delta_citizen_spouse_flow5_error.hpl + checkpoint_job_citizen_spouse_delta.hpl + Y + N + Y + + + checkpoint_job_citizen_spouse_delta.hpl + citizen_spouse_delta success + Y + Y + N + + + delta_citizen_spouse_flow.hpl 2 + change_status_delta_citizen_spouse_flow2_success.hpl + Y + Y + N + + + delta_citizen_spouse_flow.hpl 2 + change_status_delta_citizen_spouse_flow2_error.hpl + Y + N + N + + + delta_citizen_spouse_flow.hpl 3 + change_status_delta_citizen_spouse_flow3_success.hpl + Y + Y + N + + + delta_citizen_spouse_flow.hpl 3 + change_status_delta_citizen_spouse_flow3_error.hpl + Y + N + N + + + delta_citizen_spouse_flow.hpl 4 + change_status_delta_citizen_spouse_flow4_success.hpl + Y + Y + N + + + delta_citizen_spouse_flow.hpl 4 + change_status_delta_citizen_spouse_flow4_error.hpl + Y + N + N + + + delta_citizen_spouse_flow.hpl 5 + change_status_delta_citizen_spouse_flow5_success.hpl + Y + Y + N + + + delta_citizen_spouse_flow.hpl 5 + change_status_delta_citizen_spouse_flow5_error.hpl + Y + N + N + + + branching_citizen_spouse.hpl + Simple citizen_spouse WHERE SUCCESS + Y + N + Y + + + recruitment_rows_five_flow_citizen_spouse.hpl + change_status_to_processing.hpl + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + change_status_to_processing.hpl 2 + Y + Y + N + diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl similarity index 95% rename from mappings/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl rename to mappings/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl index 63d79e2..5f8d28a 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl @@ -1,7 +1,7 @@ - delta_citizen_spouse + delta_citizen_spouse_flow Y @@ -26,67 +26,6 @@ Y - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - r.recruit_id, - supr->>'id' AS spouse_external_id, - NULLIF(supr->>'idERN', '') AS spouse_id_ern, - NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, - supr->'svedFLBS'->'fio'->>'familiya' AS last_name, - supr->'svedFLBS'->'fio'->>'imya' AS first_name, - supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, - CONCAT_WS(' ', - supr->'svedFLBS'->'fio'->>'familiya', - supr->'svedFLBS'->'fio'->>'imya', - supr->'svedFLBS'->'fio'->>'otchestvo' - ) AS full_name, - MAKE_DATE( - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, - NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den', '')::int - ) AS birth_date, - (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, - supr->'svedSmert'->>'nomerZapis' AS death_az_number, - ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, - (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, - ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, - (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, - CASE - WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true - ELSE false - END AS information_excluded -FROM ervu_dashboard.citizen r -JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id -CROSS JOIN LATERAL ( - SELECT supri - FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri - WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' -) AS supr(supr) -WHERE - --'${ID_F1}' != '' - --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}' - '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date - AND r.update_date >= '${M_R_UP_DATE}'::timestamp; - Y - - - 624 - 352 - - Insert / update InsertUpdate @@ -196,6 +135,67 @@ WHERE 352 + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.recruit_id, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + CONCAT_WS(' ', + supr->'svedFLBS'->'fio'->>'familiya', + supr->'svedFLBS'->'fio'->>'imya', + supr->'svedFLBS'->'fio'->>'otchestvo' + ) AS full_name, + MAKE_DATE( + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den', '')::int + ) AS birth_date, + (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded +FROM ervu_dashboard.citizen r +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) +WHERE + r.update_date >= '${M_R_UP_DATE}'::timestamp + AND '${RECRUITMENT_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' + AND'${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; + Y + + + 624 + 352 + + From ed196d7e3f34a1b8cb8f829cfd432b46e84f217b Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Thu, 7 Aug 2025 14:05:13 +0300 Subject: [PATCH 12/34] =?UTF-8?q?ERVU-504:=20=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment_rows_five_flow_if_error.hpl | 170 +++++------------- .../recruitment_rows_five_flow_if_error.hpl | 168 +++++------------ .../recruitment_rows_five_flow_if_error.hpl | 168 +++++------------ 3 files changed, 139 insertions(+), 367 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl index e5f247b..e2f9809 100644 --- a/mappings/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl +++ b/mappings/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl @@ -57,7 +57,17 @@ ervu-dashboard N 0 - WITH ordered AS ( + WITH +fr_check AS ( + SELECT + last_recruitment_id AS recruitment_id, + recruitment_created_date, + status, + job_name + FROM public.etl_checkpoints + WHERE status = 'ERROR' AND job_name IN ('child_flow1', 'child_flow2', 'child_flow3', 'child_flow4', 'child_flow5') +), +ordered AS ( SELECT idm_id, created_at, @@ -68,132 +78,46 @@ splitted AS ( SELECT *, CEIL(total_rows / 5.0) AS part_size, - FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num + FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num, + ((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position FROM ordered ), -flow_ranges AS ( - SELECT - flow_num, - MIN(created_at) AS min_date, - MAX(created_at) AS max_date +pivoted AS ( + SELECT + position, + MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow1') THEN created_at END) AS cr_flow1, + MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow1') THEN idm_id::text END) AS idm_flow1, + MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow2') THEN created_at END) AS cr_flow2, + MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow2') THEN idm_id::text END) AS idm_flow2, + MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow3') THEN created_at END) AS cr_flow3, + MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow3') THEN idm_id::text END) AS idm_flow3, + MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow4') THEN created_at END) AS cr_flow4, + MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow4') THEN idm_id::text END) AS idm_flow4, + MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow5') THEN created_at END) AS cr_flow5, + MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow5') THEN idm_id::text END) AS idm_flow5 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_child ch on ch.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 + GROUP BY position ), 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 + SELECT + position, + 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 + WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) + OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) + OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) + OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) + OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) + order by position ), idm1 as ( select @@ -247,7 +171,7 @@ FULL OUTER JOIN 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 +limit 3 N diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl index dc89572..ae9ccf8 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl @@ -57,7 +57,17 @@ ervu-dashboard N 0 - WITH ordered AS ( + WITH +fr_check AS ( + SELECT + last_recruitment_id AS recruitment_id, + recruitment_created_date, + status, + job_name + FROM public.etl_checkpoints + WHERE status = 'ERROR' AND job_name IN ('citizen_guardianship_flow1', 'citizen_guardianship_flow2', 'citizen_guardianship_flow3', 'citizen_guardianship_flow4', 'citizen_guardianship_flow5') +), +ordered AS ( SELECT idm_id, created_at, @@ -68,132 +78,46 @@ splitted AS ( SELECT *, CEIL(total_rows / 5.0) AS part_size, - FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num + FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num, + ((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position FROM ordered ), -flow_ranges AS ( - SELECT - flow_num, - MIN(created_at) AS min_date, - MAX(created_at) AS max_date +pivoted AS ( + SELECT + position, + MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow1') THEN created_at END) AS cr_flow1, + MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow1') THEN idm_id::text END) AS idm_flow1, + MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow2') THEN created_at END) AS cr_flow2, + MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow2') THEN idm_id::text END) AS idm_flow2, + MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow3') THEN created_at END) AS cr_flow3, + MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow3') THEN idm_id::text END) AS idm_flow3, + MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow4') THEN created_at END) AS cr_flow4, + MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow4') THEN idm_id::text END) AS idm_flow4, + MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow5') THEN created_at END) AS cr_flow5, + MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow5') THEN idm_id::text END) AS idm_flow5 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 + GROUP BY position ), 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 + SELECT + position, + 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 + WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) + OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) + OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) + OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) + OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) + order by position ), idm1 as ( select diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl index 95a193c..f9d21f7 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl @@ -57,7 +57,17 @@ ervu-dashboard N 0 - WITH ordered AS ( + WITH +fr_check AS ( + SELECT + last_recruitment_id AS recruitment_id, + recruitment_created_date, + status, + job_name + FROM public.etl_checkpoints + WHERE status = 'ERROR' AND job_name IN ('citizen_spouse_flow1', 'citizen_spouse_flow2', 'citizen_spouse_flow3', 'citizen_spouse_flow4', 'citizen_spouse_flow5') +), +ordered AS ( SELECT idm_id, created_at, @@ -68,132 +78,46 @@ splitted AS ( SELECT *, CEIL(total_rows / 5.0) AS part_size, - FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num + FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num, + ((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position FROM ordered ), -flow_ranges AS ( - SELECT - flow_num, - MIN(created_at) AS min_date, - MAX(created_at) AS max_date +pivoted AS ( + SELECT + position, + MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow1') THEN created_at END) AS cr_flow1, + MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow1') THEN idm_id::text END) AS idm_flow1, + MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow2') THEN created_at END) AS cr_flow2, + MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow2') THEN idm_id::text END) AS idm_flow2, + MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow3') THEN created_at END) AS cr_flow3, + MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow3') THEN idm_id::text END) AS idm_flow3, + MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow4') THEN created_at END) AS cr_flow4, + MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow4') THEN idm_id::text END) AS idm_flow4, + MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow5') THEN created_at END) AS cr_flow5, + MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow5') THEN idm_id::text END) AS idm_flow5 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 ch on ch.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 + GROUP BY position ), 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 + SELECT + position, + 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 + WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) + OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) + OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) + OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) + OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) + order by position ), idm1 as ( select From b300814a2de316dee59ca90b17b64531cd38ab66 Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Fri, 8 Aug 2025 14:29:08 +0300 Subject: [PATCH 13/34] =?UTF-8?q?ERVU-504:=20=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../child/parallel/child_flow.hpl | 466 ++++++++---------- .../child/parallel/delta_child_flow.hpl | 262 ++++------ .../parallel/citizen_guardianship_flow.hpl | 300 ++++++----- 3 files changed, 458 insertions(+), 570 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl index 49f74bf..7250cac 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl @@ -1,7 +1,7 @@ - child_flow1 + child_flow Y @@ -32,12 +32,17 @@ N - Group by - Select values + Table input + Insert / update Y - Select values + Group by + User defined Java expression + Y + + + User defined Java expression Update Y @@ -46,11 +51,6 @@ Group by Y - - Table input - Insert / update - Y - Get variables @@ -79,107 +79,6 @@ 400
- - 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 - SELECT - ri.recruit_id::uuid AS recruit_id, - ch->>'id' AS child_external_id, - NULLIF(ch->>'idERN', '') AS child_id_ern, - CASE NULLIF(ch->>'rodstvSvyazReb', '')::int - WHEN 1 THEN 3 - WHEN 2 THEN 4 - END 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, - dates.birth_date, - dates.death_date, - ch->'svedSmert'->>'nomerZapis' AS death_az_number, - ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (dates.death_date IS NOT NULL) AS is_dead, - (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor -FROM ervu_dashboard.recruits_info ri -JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id -CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch -CROSS JOIN LATERAL ( - SELECT - 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 -) AS dates -WHERE - '${RECRUITMENT_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; - Y - - - 448 - 288 - - Group by GroupBy @@ -196,22 +95,22 @@ WHERE ${java.io.tmpdir} - minors_count + minors_count_raw is_minor SUM - has_minor_child + has_minor_child_raw is_minor MAX - has_dead_child + has_dead_child_raw is_dead MAX - Y + N recruit_id @@ -221,151 +120,8 @@ WHERE grp - 592 - 192 - - - - Select values - SelectValues - - Y - - 1 - - none - - - - - has_dead_child - - - has_minor_child - - - minors_count - - - recruit_id - - N - - has_dead_child - has_dead_child - Boolean - -2 - -2 - - false - - - false - - - - - - - - has_minor_child - has_minor_child - Boolean - -2 - -2 - - false - - - false - - - - - - - - minors_count - minors_count - Integer - -2 - -2 - - false - - - false - - - - - - - - recruit_id - recruit_id - String - -2 - -2 - - false - - - false - - - - - - - - - - 720 - 144 - - - - Update - Update - - Y - - 1 - - none - - - 100 - ervu-dashboard - Y - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen
- - minors_count - minors_count - - - has_minor_child - has_minor_child - - - has_dead_child - has_dead_child - -
- N - Y - - - 816 - 112 + 640 + 176
@@ -386,13 +142,11 @@ WHERE = recruit_id recruit_id - = child_external_id child_external_id - ervu_dashboard citizen_child
@@ -464,6 +218,196 @@ WHERE 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 + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END 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, + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + CASE WHEN dates.death_date IS NOT NULL THEN 1 ELSE 0 END AS is_dead, + CASE + WHEN dates.death_date IS NOT NULL THEN 0 -- умершие не могут быть несовершеннолетними + WHEN dates.birth_date IS NULL THEN 0 -- если дата рождения неизвестна, считаем взрослым + WHEN dates.birth_date > CURRENT_DATE - INTERVAL '18 years' THEN 1 + ELSE 0 + END AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${RECRUITMENT_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y + + + 448 + 288 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + minors_count + minors_count + + + has_minor_child + has_minor_child + + + has_dead_child + has_dead_child + +
+ N + Y + + + 976 + 32 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + minors_count + minors_count_raw == 1 ? "1" : minors_count_raw == 2 ? "2" : minors_count_raw >= 3 ? "3 и более" : "0" + String + 10 + -1 + + + + has_minor_child + has_minor_child_raw == 1 + Boolean + -1 + -1 + + + + has_dead_child + has_dead_child_raw == 1 + Boolean + -1 + -1 + + + + + 816 + 96 + + Select values 4 2 diff --git a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl b/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl index 0f4eb99..e6ad075 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl @@ -21,12 +21,17 @@
- Group by - Select values + Table input + Insert / update Y - Select values + Group by + User defined Java expression + Y + + + User defined Java expression Update Y @@ -35,57 +40,7 @@ Group by Y - - Table input - Insert / update - Y - - - Group by - GroupBy - - N - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - minors_count - is_minor - SUM - - - has_minor_child - is_minor - MAX - - - has_dead_child - is_dead - MAX - - - Y - - - recruit_id - - - N - grp - - - 800 - 272 - - Insert / update InsertUpdate @@ -180,111 +135,11 @@ 352 - - Select values - SelectValues - - Y - - 1 - - none - - - - - has_dead_child - - - has_minor_child - - - minors_count - - - recruit_id - - N - - has_dead_child - has_dead_child - Boolean - -2 - -2 - - false - - - false - - - - - - - - has_minor_child - has_minor_child - Boolean - -2 - -2 - - false - - - false - - - - - - - - minors_count - minors_count - Integer - -2 - -2 - - false - - - false - - - - - - - - recruit_id - recruit_id - String - -2 - -2 - - false - - - false - - - - - - - - - - 912 - 224 - - Table input TableInput - Y + N 1 @@ -314,8 +169,13 @@ dates.death_date, ch->'svedSmert'->>'nomerZapis' AS death_az_number, ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, - (dates.death_date IS NOT NULL) AS is_dead, - (dates.death_date IS NULL AND dates.birth_date > CURRENT_DATE - INTERVAL '18 years') AS is_minor + CASE WHEN dates.death_date IS NOT NULL THEN 1 ELSE 0 END AS is_dead, + CASE + WHEN dates.death_date IS NOT NULL THEN 0 -- умершие не могут быть несовершеннолетними + WHEN dates.birth_date IS NULL THEN 0 -- если дата рождения неизвестна, считаем взрослым + WHEN dates.birth_date > CURRENT_DATE - INTERVAL '18 years' THEN 1 + ELSE 0 + END AS is_minor FROM ervu_dashboard.recruits_info ri JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch @@ -346,6 +206,51 @@ WHERE 352 + + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count_raw + is_minor + SUM + + + has_minor_child_raw + is_minor + MAX + + + has_dead_child_raw + is_dead + MAX + + + N + + + recruit_id + + + N + grp + + + 784 + 256 + + Update Update @@ -385,8 +290,49 @@ WHERE Y - 1024 - 192 + 1104 + 80 + + + + User defined Java expression + Janino + + Y + + 1 + + none + + + + minors_count + minors_count_raw == 1 ? "1" : minors_count_raw == 2 ? "2" : minors_count_raw >= 3 ? "3 и более" : "0" + String + 10 + -1 + + + + has_minor_child + has_minor_child_raw == 1 + Boolean + -1 + -1 + + + + has_dead_child + has_dead_child_raw == 1 + Boolean + -1 + -1 + + + + + 944 + 160 diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl index 64142ef..7d81b54 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl @@ -1,7 +1,7 @@ - citizen_guardianship_flow1 + citizen_guardianship_flow Y @@ -63,126 +63,15 @@ Table input - Group by + Insert / update Y Table input - Insert / update + Group by Y - - Get variables - GetVariable - - Y - - 1 - - none - - - - - -1 - recruitment_id - -1 - none - String - ID_F1 - - - - - 976 - 400 - - - - 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 - SELECT - r.recruit_id AS recruit_id, - ch->>'id' AS guardianship_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 ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id -CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch -WHERE - '${RECRUITMENT_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' - AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date - AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; - Y - - - 448 - 288 - - Add constants Constant @@ -210,6 +99,33 @@ WHERE 128 + + Get variables + GetVariable + + Y + + 1 + + none + + + + + -1 + recruitment_id + -1 + none + String + ID_F1 + + + + + 976 + 400 + + Group by GroupBy @@ -240,41 +156,6 @@ WHERE 176 - - Update - Update - - Y - - 1 - - none - - - 100 - ervu-dashboard - Y - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen
- - is_guardian - is_guardian - -
- N - Y - - - 848 - 80 - -
Insert / update InsertUpdate @@ -293,13 +174,11 @@ WHERE = recruit_id recruit_id - = guardianship_external_id guardianship_external_id - ervu_dashboard citizen_guardianship
@@ -356,6 +235,125 @@ WHERE 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 + SELECT + r.recruit_id AS recruit_id, + ch->>'id' AS guardianship_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 ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + '${RECRUITMENT_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; + Y + + + 448 + 288 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 848 + 80 + +
Select values 4 2 From d2096427fe81eaf5df9eb41e9d8b710e259f7332 Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Tue, 12 Aug 2025 16:54:35 +0300 Subject: [PATCH 14/34] =?UTF-8?q?ERVU-504:=20=D0=9D=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=B0=D1=80=D1=85=D0=B8=D1=82=D0=B5=D0=BA=D1=82=D1=83?= =?UTF-8?q?=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=B5=D0=BC=D1=8C?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../citizen_tables/child/branching_child.hpl | 124 - .../child/branching_child_delta.hpl | 142 - ...or.hpl => check_if_need_to_repeat_job.hpl} | 68 +- .../change_status_child_flow1_error.hpl | 250 -- .../change_status_child_flow1_success.hpl | 250 -- .../change_status_child_flow2_error.hpl | 254 -- .../change_status_child_flow2_success.hpl | 254 -- .../change_status_child_flow3_error.hpl | 255 -- .../change_status_child_flow3_success.hpl | 255 -- .../change_status_child_flow4_error.hpl | 256 -- .../change_status_child_flow4_success.hpl | 256 -- .../change_status_child_flow5_error.hpl | 256 -- .../change_status_child_flow5_success.hpl | 256 -- .../change_status_delta_child_flow1_error.hpl | 110 - ...hange_status_delta_child_flow1_success.hpl | 102 - ...hange_status_delta_child_flow2_success.hpl | 102 - ...hange_status_delta_child_flow3_success.hpl | 102 - ...hange_status_delta_child_flow4_success.hpl | 102 - .../change_status_delta_child_flow5_error.hpl | 102 - ...hange_status_delta_child_flow5_success.hpl | 102 - .../change_status_to_processing.hpl | 142 - .../change_status_to_processing_delta.hpl | 142 - ...ists.hpl => check_if_child_job_exists.hpl} | 67 +- .../checkpoints/checkpoint_child_error.hpl | 273 -- .../checkpoints/checkpoint_job_child.hpl | 126 - .../checkpoint_job_child_delta.hpl | 126 - .../checkpoints/job_create_files_child.hwf | 235 -- .../citizen_tables/child/job_child.hwf | 2361 +--------------- .../child/parallel/child_flow.hpl | 361 +-- ...ta_child_flow.hpl => child_flow_delta.hpl} | 264 +- .../child/parallel/child_flow_repeat.hpl | 480 ++++ .../child/parallel/delta_child_flow2.hpl | 143 - .../child/parallel/delta_child_flow3.hpl | 143 - .../child/parallel/delta_child_flow4.hpl | 143 - .../child/parallel/delta_child_flow5.hpl | 143 - .../child/recruitment_five_flow_delta.hpl | 360 +++ .../child/recruitment_five_flow_on_error.hpl | 360 +++ .../recruitment_rows_five_flow_if_error.hpl | 185 -- .../child/recruitments_five_flow.hpl | 356 +++ .../branching_citizen_guardianship.hpl | 124 - .../branching_citizen_guardianship_delta.hpl | 142 - .../check_if_need_to_repeat_job.hpl} | 68 +- ...tatus_citizen_guardianship_flow1_error.hpl | 250 -- ...tus_citizen_guardianship_flow1_success.hpl | 250 -- ...tatus_citizen_guardianship_flow2_error.hpl | 254 -- ...tus_citizen_guardianship_flow2_success.hpl | 254 -- ...tatus_citizen_guardianship_flow3_error.hpl | 255 -- ...tus_citizen_guardianship_flow3_success.hpl | 255 -- ...tatus_citizen_guardianship_flow4_error.hpl | 256 -- ...tus_citizen_guardianship_flow4_success.hpl | 256 -- ...tatus_citizen_guardianship_flow5_error.hpl | 256 -- ...tus_citizen_guardianship_flow5_success.hpl | 256 -- ...delta_citizen_guardianship_flow1_error.hpl | 102 - ...lta_citizen_guardianship_flow1_success.hpl | 102 - ...delta_citizen_guardianship_flow2_error.hpl | 102 - ...lta_citizen_guardianship_flow2_success.hpl | 102 - ...delta_citizen_guardianship_flow3_error.hpl | 102 - ...lta_citizen_guardianship_flow3_success.hpl | 102 - ...delta_citizen_guardianship_flow4_error.hpl | 102 - ...lta_citizen_guardianship_flow4_success.hpl | 102 - ...delta_citizen_guardianship_flow5_error.hpl | 102 - ...lta_citizen_guardianship_flow5_success.hpl | 102 - .../change_status_to_processing.hpl | 142 - .../change_status_to_processing_delta.hpl | 102 - ...ck_if_citizen_guardianship_job_exists.hpl} | 67 +- .../checkpoint_citizen_guardianship_error.hpl | 273 -- .../checkpoint_job_citizen_guardianship.hpl | 126 - ...ckpoint_job_citizen_guardianship_delta.hpl | 126 - .../job_create_files_citizen_guardianship.hwf | 235 -- .../job_citizen_guardianship.hwf | 2486 ----------------- .../citizen_guardianship/job_guardianship.hwf | 271 ++ .../parallel/citizen_guardianship_flow.hpl | 373 +-- ...pl => citizen_guardianship_flow_delta.hpl} | 170 +- .../citizen_guardianship_flow_repeat.hpl | 407 +++ .../recruitment_five_flow_delta.hpl | 360 +++ .../recruitment_five_flow_on_error.hpl | 360 +++ .../recruitment_rows_five_flow_if_error.hpl | 185 -- .../recruitments_five_flow.hpl | 356 +++ .../branching_citizen_spouse.hpl | 124 - .../branching_citizen_spouse_delta.hpl | 142 - .../check_if_need_to_repeat_job.hpl} | 68 +- ...ange_status_citizen_spouse_flow1_error.hpl | 250 -- ...ge_status_citizen_spouse_flow1_success.hpl | 250 -- ...ange_status_citizen_spouse_flow2_error.hpl | 254 -- ...ge_status_citizen_spouse_flow2_success.hpl | 254 -- ...ange_status_citizen_spouse_flow3_error.hpl | 255 -- ...ge_status_citizen_spouse_flow3_success.hpl | 255 -- ...ange_status_citizen_spouse_flow4_error.hpl | 256 -- ...ge_status_citizen_spouse_flow4_success.hpl | 256 -- ...ange_status_citizen_spouse_flow5_error.hpl | 256 -- ...ge_status_citizen_spouse_flow5_success.hpl | 256 -- ...tatus_delta_citizen_spouse_flow1_error.hpl | 102 - ...tus_delta_citizen_spouse_flow1_success.hpl | 102 - ...tatus_delta_citizen_spouse_flow2_error.hpl | 102 - ...tus_delta_citizen_spouse_flow2_success.hpl | 102 - ...tatus_delta_citizen_spouse_flow3_error.hpl | 102 - ...tus_delta_citizen_spouse_flow3_success.hpl | 102 - ...tatus_delta_citizen_spouse_flow4_error.hpl | 102 - ...tus_delta_citizen_spouse_flow4_success.hpl | 102 - ...tatus_delta_citizen_spouse_flow5_error.hpl | 102 - ...tus_delta_citizen_spouse_flow5_success.hpl | 102 - .../change_status_to_processing.hpl | 142 - .../change_status_to_processing_delta.hpl | 102 - .../check_if_citizen_spouse_job_exists.hpl} | 67 +- .../checkpoint_citizen_spouse_error.hpl | 273 -- .../checkpoint_job_citizen_spouse.hpl | 126 - .../checkpoint_job_citizen_spouse_delta.hpl | 126 - .../citizen_spouse/job_citizen_spouse.hwf | 2485 ---------------- .../citizen_spouse/job_spouse.hwf | 271 ++ .../parallel/citizen_spouse_flow.hpl | 363 +-- ...flow.hpl => citizen_spouse_flow_delta.hpl} | 239 +- .../parallel/citizen_spouse_flow_repeat.hpl | 348 +++ .../recruitment_five_flow_delta.hpl | 360 +++ .../recruitment_five_flow_on_error.hpl | 360 +++ .../recruitment_rows_five_flow_if_error.hpl | 185 -- .../citizen_spouse/recruitments_five_flow.hpl | 356 +++ 116 files changed, 6341 insertions(+), 23301 deletions(-) delete mode 100644 mappings/info_recruits/citizen_tables/child/branching_child.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl rename mappings/info_recruits/citizen_tables/child/{checkpoints/change_status_delta_child_flow3_error.hpl => check_if_need_to_repeat_job.hpl} (56%) delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing_delta.hpl rename mappings/info_recruits/citizen_tables/child/checkpoints/{check_if_job_child_exists.hpl => check_if_child_job_exists.hpl} (70%) delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_child_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/checkpoints/job_create_files_child.hwf rename mappings/info_recruits/citizen_tables/child/parallel/{delta_child_flow.hpl => child_flow_delta.hpl} (69%) create mode 100644 mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow5.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/child/recruitments_five_flow.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl rename mappings/info_recruits/citizen_tables/{child/checkpoints/change_status_delta_child_flow4_error.hpl => citizen_guardianship/check_if_need_to_repeat_job.hpl} (56%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl rename mappings/info_recruits/citizen_tables/{citizen_spouse/checkpoints/check_if_job_citizen_spouse_exists.hpl => citizen_guardianship/checkpoints/check_if_citizen_guardianship_job_exists.hpl} (69%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf rename mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/{delta_citizen_guardianship_flow.hpl => citizen_guardianship_flow_delta.hpl} (63%) create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_on_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_guardianship/recruitments_five_flow.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl rename mappings/info_recruits/citizen_tables/{child/checkpoints/change_status_delta_child_flow2_error.hpl => citizen_spouse/check_if_need_to_repeat_job.hpl} (56%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing_delta.hpl rename mappings/info_recruits/citizen_tables/{citizen_guardianship/checkpoints/check_if_job_citizen_guardianship_exists.hpl => citizen_spouse/checkpoints/check_if_citizen_spouse_job_exists.hpl} (69%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/job_spouse.hwf rename mappings/info_recruits/citizen_tables/citizen_spouse/parallel/{delta_citizen_spouse_flow.hpl => citizen_spouse_flow_delta.hpl} (60%) create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_on_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl diff --git a/mappings/info_recruits/citizen_tables/child/branching_child.hpl b/mappings/info_recruits/citizen_tables/child/branching_child.hpl deleted file mode 100644 index d25a7a0..0000000 --- a/mappings/info_recruits/citizen_tables/child/branching_child.hpl +++ /dev/null @@ -1,124 +0,0 @@ - - - - branching_child - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_child' - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl b/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl deleted file mode 100644 index 0772a1e..0000000 --- a/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - branching_child_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:40:44.856 - - - 2025/06/03 14:40:44.856 - - - - - - Set variables - Write to log - N - - - Table input - Set variables - Y - - - - Set variables - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1104 - 368 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - COALESCE(job_name, 'job_child_delta') AS PIPELINE, - COALESCE(status, 'ERROR') AS STATUS, - current_timestamp::timestamp as record_created -FROM ( - select - CASE - WHEN status = 'PROCESSING' THEN 'ERROR' - ELSE status - END AS status, - job_name - from public.etl_checkpoints - where job_name = 'job_child_delta' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_child_delta' - ) -) t - N - - - 864 - 368 - - - - Write to log - WriteToLog - - Y - - 1 - - none - - - Basic - Y - N - 0 - ${PIPE} -${STATUS} - - - pipeline - - - status - - - - - 1328 - 368 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl b/mappings/info_recruits/citizen_tables/child/check_if_need_to_repeat_job.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl rename to mappings/info_recruits/citizen_tables/child/check_if_need_to_repeat_job.hpl index 15eccb7..440d53c 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl +++ b/mappings/info_recruits/citizen_tables/child/check_if_need_to_repeat_job.hpl @@ -1,7 +1,7 @@ - change_status_delta_child_flow3_error + check_if_need_to_repeat_job Y @@ -13,22 +13,22 @@ 1000 100 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 Table input - Insert / update + Set variables Y - Insert / update - InsertUpdate + Set variables + SetVariable Y @@ -37,37 +37,18 @@ none - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y - 1152 - 304 + 624 + 288
@@ -84,16 +65,19 @@ ervu-dashboard N 0 - SELECT - 'delta_child_flow3' as job_name, - 'ERROR' as status, - current_timestamp as record_created - + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'child_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; N - 784 - 304 + 336 + 288 diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_error.hpl deleted file mode 100644 index 7678021..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_child_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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 - '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_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_success.hpl deleted file mode 100644 index 4339f92..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_child_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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 - 'child_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_error.hpl deleted file mode 100644 index 9f51e25..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_child_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - '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_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_success.hpl deleted file mode 100644 index ab2f474..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_child_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'child_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_error.hpl deleted file mode 100644 index 23987c6..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_child_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - '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_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_success.hpl deleted file mode 100644 index 5732590..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_child_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'child_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_error.hpl deleted file mode 100644 index 95b5598..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_child_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - '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_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_success.hpl deleted file mode 100644 index 8878838..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_child_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'child_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_error.hpl deleted file mode 100644 index cd555b8..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_child_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - '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 - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_success.hpl deleted file mode 100644 index 83181a2..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_child_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_child ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'child_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl deleted file mode 100644 index 0532c16..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - -<<<<<<<< HEAD:mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl - change_status_delta_child_flow1_error -======== - change_status_delta_citizen_liability_fz53_flow2_error ->>>>>>>> origin/develop:mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT -<<<<<<<< HEAD:mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl - 'delta_child_flow1' as job_name, -======== - 'delta_citizen_liability_fz53_flow2' as job_name, ->>>>>>>> origin/develop:mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl deleted file mode 100644 index e75ff73..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_child_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_child_flow1' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl deleted file mode 100644 index 6aab4f9..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_child_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_child_flow2' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl deleted file mode 100644 index fc295bf..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_child_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_child_flow3' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl deleted file mode 100644 index d1fd438..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_child_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_child_flow4' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl deleted file mode 100644 index 6dc2e50..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_child_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_child_flow5' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl deleted file mode 100644 index e1512ce..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_child_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_child_flow5' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index 3b69421..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - change_status_to_processing - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/11 16:14:31.162 - - - 2025/06/11 16:14:31.162 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 784 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'job_child' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing_delta.hpl deleted file mode 100644 index 64b8f84..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing_delta.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - change_status_to_processing_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 13:42:26.494 - - - 2025/06/16 13:42:26.494 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1248 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'delta_child' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_delta_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_delta_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_delta_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_delta_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'child_delta_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 832 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/check_if_job_child_exists.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/check_if_child_job_exists.hpl similarity index 70% rename from mappings/info_recruits/citizen_tables/child/checkpoints/check_if_job_child_exists.hpl rename to mappings/info_recruits/citizen_tables/child/checkpoints/check_if_child_job_exists.hpl index a2bc69c..de6f58a 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/check_if_job_child_exists.hpl +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/check_if_child_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_child_exists + check_if_child_job_exists Y @@ -13,23 +13,23 @@ 1000 100 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - Table input - Set variables - Y - Set variables Write to log N + + Table input + Set variables + Y + Set variables @@ -44,21 +44,16 @@ - job_name - PIPE - PARENT_WORKFLOW - - - status - STATUS + job_executed_flag + JOB_EXECUTED_FLAG PARENT_WORKFLOW Y - 688 - 352 + 672 + 336 @@ -75,29 +70,17 @@ ervu-dashboard N 0 - SELECT - COALESCE(job_name, 'job_child') AS job_name, - COALESCE(status, 'NEW') AS status, - current_timestamp::timestamp as record_created -FROM ( - SELECT job_name, status - FROM public.etl_checkpoints - WHERE job_name = 'job_child' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_child' - ) -) t + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'child_job' + limit 1 + ) AS job_executed_flag; N - 400 - 352 + 384 + 336 @@ -111,17 +94,17 @@ FROM ( none + Basic Y - - N 0 - Basic ${STATUS} + + - 960 - 240 + 944 + 224 diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_child_error.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_child_error.hpl deleted file mode 100644 index 0f593da..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_child_error.hpl +++ /dev/null @@ -1,273 +0,0 @@ - - - - checkpoint_child_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_child ch on ch.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/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl deleted file mode 100644 index a078efc..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl +++ /dev/null @@ -1,126 +0,0 @@ - - - - checkpoint_job_child - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'child_flow1', - 'child_flow2', - 'child_flow3', - 'child_flow4', - 'child_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'child_flow1', - 'child_flow2', - 'child_flow3', - 'child_flow4', - 'child_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_child' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl deleted file mode 100644 index a87375b..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl +++ /dev/null @@ -1,126 +0,0 @@ - - - - checkpoint_job_child_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1072 - 240 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'delta_child_flow1', - 'delta_child_flow2', - 'delta_child_flow3', - 'delta_child_flow4', - 'delta_child_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'delta_child_flow1', - 'delta_child_flow2', - 'delta_child_flow3', - 'delta_child_flow4', - 'delta_child_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_child_delta' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 704 - 240 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/job_create_files_child.hwf b/mappings/info_recruits/citizen_tables/child/checkpoints/job_create_files_child.hwf deleted file mode 100644 index b31ca9f..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/job_create_files_child.hwf +++ /dev/null @@ -1,235 +0,0 @@ - - - job_create_files_child - 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_child_flow2_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow2" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json - N - 848 - 416 - - - - state_child_flow1_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow1" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json - N - 848 - 336 - - - - state_child_flow3_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow3" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json - N - 848 - 496 - - - - state_child_flow4_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow4" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json - N - 848 - 576 - - - - state_child_flow5_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow5" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - N - 848 - 656 - - - - Success - - SUCCESS - - N - 1120 - 496 - - - - Delete file state_job_child - - DELETE_FILE - - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json - N - 848 - 256 - - - - - - Start - state_child_flow3_new - Y - Y - Y - - - Start - state_child_flow2_new - Y - Y - Y - - - Start - state_child_flow1_new - Y - Y - Y - - - Start - state_child_flow4_new - Y - Y - Y - - - Start - state_child_flow5_new - Y - Y - Y - - - state_child_flow5_new - Success - Y - Y - N - - - state_child_flow4_new - Success - Y - Y - N - - - state_child_flow3_new - Success - Y - Y - N - - - state_child_flow2_new - Success - Y - Y - N - - - state_child_flow1_new - Success - Y - Y - N - - - Start - Delete file state_job_child - Y - Y - Y - - - Delete file state_job_child - Success - Y - Y - N - - - - - - diff --git a/mappings/info_recruits/citizen_tables/child/job_child.hwf b/mappings/info_recruits/citizen_tables/child/job_child.hwf index aeb5a57..2df098f 100644 --- a/mappings/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings/info_recruits/citizen_tables/child/job_child.hwf @@ -37,235 +37,12 @@ 0 1 N - 368 - 400 - - - - checkpoint_job_child.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl - Basic - - Y - - N - local - N - N - Y - N - 1136 - 1280 - - - - recruitment_rows_five_flow_child.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_child.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2352 - 400 - - - - child_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 80 - - - - child_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 240 - - - - child_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 400 - - - - child_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 560 - - - - child_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 720 - - - - Abort workflow - - ABORT - - N - N - 2352 + 416 208 - Success new child - - SUCCESS - - N - 3728 - 432 - - - - branching_child.hpl + check_if_child_job_exists.hpl PIPELINE @@ -275,7 +52,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/branching_child.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/check_if_child_job_exists.hpl Basic Y @@ -286,48 +63,29 @@ N Y N - 1584 - 1280 + 608 + 208 - Simple child WHERE SUCCESS + child_job_exists_check SIMPLE_EVAL - SUCCESS - string - true + boolean + false equal equal N variable - STATUS + JOB_EXECUTED_FLAG N - 1600 - 1808 + 880 + 208 - Simple child WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 1840 - 1280 - - - - recruitment_rows_five_flow_if_error.hpl + recruitments_five_flow.hpl PIPELINE @@ -337,7 +95,9 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruitments_five_flow.hpl + + Basic Y @@ -348,173 +108,12 @@ N Y Y - 2384 - 1280 + 1120 + 208 - Abort workflow 2 - - ABORT - - N - N - 2384 - 1072 - - - - child_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 960 - - - - child_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 1120 - - - - child_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 1280 - - - - child_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 1440 - - - - child_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 1600 - - - - check_if_job_child_exists.hpl + recruitment_five_flow_on_error.hpl PIPELINE @@ -524,7 +123,9 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/check_if_job_child_exists.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl + + Basic Y @@ -535,30 +136,57 @@ N Y N - 544 - 400 + 1120 + 512 - Simple job_child_exists check NEW + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/child/check_if_need_to_repeat_job.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 880 + 368 + + + + Simple evaluation SIMPLE_EVAL - NEW - string + boolean true equal equal N variable - STATUS + NEED_TO_REPEAT_JOB N - 784 - 400 + 880 + 512 - change_status_child_flow1_success.hpl + recruitment_five_flow_delta.hpl PIPELINE @@ -568,7 +196,9 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_success.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruitment_five_flow_delta.hpl + + Basic Y @@ -579,1904 +209,63 @@ N Y N - 2992 - 80 - - - - change_status_child_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 160 - - - - change_status_child_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 240 - - - - change_status_child_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 320 - - - - change_status_child_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 400 - - - - change_status_child_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 480 - - - - change_status_child_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 560 - - - - change_status_child_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 640 - - - - change_status_child_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 720 - - - - change_status_child_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 800 - - - - checkpoint_job_child.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl - Basic - - Y - - N - local - N - N - Y - N - 3456 - 432 - - - - Success new child 2 - - SUCCESS - - N - 3728 - 1312 - - - - change_status_child_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 960 - - - - change_status_child_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1040 - - - - change_status_child_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1120 - - - - change_status_child_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1200 - - - - change_status_child_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1280 - - - - change_status_child_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1360 - - - - change_status_child_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1440 - - - - change_status_child_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1520 - - - - change_status_child_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1600 - - - - change_status_child_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_child_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1680 - - - - checkpoint_job_child.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl - Basic - - Y - - N - local - N - N - Y - N - 3456 - 1312 - - - - change_status_to_processing.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2384 - 1440 - - - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2352 - 576 - - - - change_status_to_processing_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2336 - 2480 - - - - recruitment_rows_five_flow_child.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_child.hpl - Basic - - - CR_DATE - CREATE_DATE - - Y - - N - local - N - N - Y - Y - 2336 - 2176 - - - - branching_child_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/branching_child_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 1744 - 2176 - - - - Simple delta_child WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 2048 - 2176 - - - - delta_child success 2 - - SUCCESS - - N - 2048 - 1984 - - - - delta_child_flow.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW1 - - Y - - N - local - N - N - Y - N - 2592 - 1856 - - - - Abort workflow 3 - - ABORT - - N - N - 2336 - 1888 - - - - change_status_delta_child_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 1840 - - - - change_status_delta_child_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 1920 - - - - change_status_delta_child_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 2000 - - - - change_status_delta_child_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 2080 - - - - change_status_delta_child_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 2160 - - - - change_status_delta_child_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 2240 - - - - change_status_delta_child_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 2320 - - - - change_status_delta_child_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 2400 - - - - change_status_delta_child_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 2480 - - - - change_status_delta_child_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 2560 - - - - checkpoint_job_child_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 3296 - 2192 - - - - child_delta success - - SUCCESS - - N - 3536 - 2192 - - - - delta_child_flow.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW2 - - Y - - N - local - N - N - Y - N - 2592 - 2016 - - - - delta_child_flow.hpl 3 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW3 - - Y - - N - local - N - N - Y - N - 2592 - 2176 - - - - delta_child_flow.hpl 4 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW4 - - Y - - N - local - N - N - Y - N - 2592 - 2352 - - - - delta_child_flow.hpl 5 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW5 - - Y - - N - local - N - N - Y - N - 2592 - 2528 + 880 + 704 - - recruitment_rows_five_flow_child.hpl - child_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl - child_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl - child_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl - child_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl - child_flow5.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl - Abort workflow - Y - N - N - - - branching_child.hpl - Simple child WHERE ERROR - Y - N - Y - - - branching_child.hpl - Simple child WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - - - recruitment_rows_five_flow_if_error.hpl - child_flow3.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - child_flow2.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - child_flow1.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - child_flow4.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - child_flow5.hpl 2 - Y - Y - N - Start - check_if_job_child_exists.hpl + check_if_child_job_exists.hpl Y Y Y - check_if_job_child_exists.hpl - Simple job_child_exists check NEW + check_if_child_job_exists.hpl + child_job_exists_check Y Y N - child_flow1.hpl - change_status_child_flow1_success.hpl + child_job_exists_check + recruitments_five_flow.hpl Y Y N - child_flow1.hpl - change_status_child_flow1_error.hpl + child_job_exists_check + check_if_need_to_repeat_job.hpl Y N N - child_flow2.hpl - change_status_child_flow2_success.hpl + check_if_need_to_repeat_job.hpl + Simple evaluation Y Y N - child_flow2.hpl - change_status_child_flow2_error.hpl - Y - N - N - - - child_flow3.hpl - change_status_child_flow3_success.hpl + Simple evaluation + recruitment_five_flow_on_error.hpl Y Y N - child_flow3.hpl - change_status_child_flow3_error.hpl + Simple evaluation + recruitment_five_flow_delta.hpl Y N N - - child_flow4.hpl - change_status_child_flow4_success.hpl - Y - Y - N - - - child_flow4.hpl - change_status_child_flow4_error.hpl - Y - N - N - - - child_flow5.hpl - change_status_child_flow5_success.hpl - Y - Y - N - - - child_flow5.hpl - change_status_child_flow5_error.hpl - Y - N - N - - - change_status_child_flow5_error.hpl - checkpoint_job_child.hpl - Y - N - Y - - - change_status_child_flow5_success.hpl - checkpoint_job_child.hpl - Y - N - Y - - - change_status_child_flow4_error.hpl - checkpoint_job_child.hpl - Y - N - Y - - - change_status_child_flow4_success.hpl - checkpoint_job_child.hpl - Y - N - Y - - - change_status_child_flow3_error.hpl - checkpoint_job_child.hpl - Y - N - Y - - - change_status_child_flow3_success.hpl - checkpoint_job_child.hpl - Y - N - Y - - - change_status_child_flow2_error.hpl - checkpoint_job_child.hpl - Y - N - Y - - - change_status_child_flow2_success.hpl - checkpoint_job_child.hpl - Y - N - Y - - - change_status_child_flow1_error.hpl - checkpoint_job_child.hpl - Y - N - Y - - - change_status_child_flow1_success.hpl - checkpoint_job_child.hpl - Y - N - Y - - - checkpoint_job_child.hpl - Success new child - Y - Y - N - - - change_status_child_flow1_success.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - change_status_child_flow1_error.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - change_status_child_flow2_success.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - change_status_child_flow2_error.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - change_status_child_flow3_success.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - change_status_child_flow3_error.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - change_status_child_flow4_success.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - change_status_child_flow4_error.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - change_status_child_flow5_success.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - change_status_child_flow5_error.hpl 2 - checkpoint_job_child.hpl 2 - Y - N - Y - - - checkpoint_job_child.hpl 2 - Success new child 2 - Y - Y - N - - - child_flow1.hpl 2 - change_status_child_flow1_success.hpl 2 - Y - Y - N - - - child_flow1.hpl 2 - change_status_child_flow1_error.hpl 2 - Y - N - N - - - child_flow2.hpl 2 - change_status_child_flow2_success.hpl 2 - Y - Y - N - - - child_flow2.hpl 2 - change_status_child_flow2_error.hpl 2 - Y - N - N - - - child_flow3.hpl 2 - change_status_child_flow3_success.hpl 2 - Y - Y - N - - - child_flow3.hpl 2 - change_status_child_flow3_error.hpl 2 - Y - N - N - - - child_flow4.hpl 2 - change_status_child_flow4_success.hpl 2 - Y - Y - N - - - child_flow4.hpl 2 - change_status_child_flow4_error.hpl 2 - Y - N - N - - - child_flow5.hpl 2 - change_status_child_flow5_success.hpl 2 - Y - Y - N - - - child_flow5.hpl 2 - change_status_child_flow5_error.hpl 2 - Y - N - N - - - checkpoint_job_child.hpl (2) - branching_child.hpl - Y - N - Y - - - Simple job_child_exists check NEW - checkpoint_job_child.hpl (2) - Y - N - N - - - recruitment_rows_five_flow_child.hpl - change_status_to_processing.hpl - Y - Y - N - - - Simple child WHERE ERROR - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - change_status_to_processing.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_child.hpl (2) - change_status_to_processing_delta.hpl - Y - Y - N - - - Simple delta_child WHERE ERROR - delta_child success 2 - Y - N - N - - - Simple child WHERE SUCCESS - branching_child_delta.hpl - Y - Y - N - - - branching_child_delta.hpl - Simple delta_child WHERE ERROR - Y - Y - N - - - Simple delta_child WHERE ERROR - recruitment_rows_five_flow_child.hpl (2) - Y - Y - N - - - recruitment_rows_five_flow_child.hpl (2) - delta_child_flow.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl (2) - Abort workflow 3 - Y - N - N - - - delta_child_flow.hpl - change_status_delta_child_flow1_success.hpl - Y - Y - N - - - delta_child_flow.hpl - change_status_delta_child_flow1_error.hpl - Y - N - N - - - checkpoint_job_child_delta.hpl - child_delta success - Y - Y - N - - - change_status_delta_child_flow1_success.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - change_status_delta_child_flow1_error.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - change_status_delta_child_flow2_success.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - change_status_delta_child_flow2_error.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - change_status_delta_child_flow3_success.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - change_status_delta_child_flow3_error.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - change_status_delta_child_flow4_success.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - change_status_delta_child_flow4_error.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - change_status_delta_child_flow5_success.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - change_status_delta_child_flow5_error.hpl - checkpoint_job_child_delta.hpl - Y - N - Y - - - recruitment_rows_five_flow_child.hpl (2) - delta_child_flow.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_child.hpl (2) - delta_child_flow.hpl 3 - Y - Y - N - - - recruitment_rows_five_flow_child.hpl (2) - delta_child_flow.hpl 4 - Y - Y - N - - - recruitment_rows_five_flow_child.hpl (2) - delta_child_flow.hpl 5 - Y - Y - N - - - delta_child_flow.hpl 2 - change_status_delta_child_flow2_success.hpl - Y - Y - N - - - delta_child_flow.hpl 2 - change_status_delta_child_flow2_error.hpl - Y - N - N - - - delta_child_flow.hpl 3 - change_status_delta_child_flow3_success.hpl - Y - Y - N - - - delta_child_flow.hpl 3 - change_status_delta_child_flow3_error.hpl - Y - N - N - - - delta_child_flow.hpl 4 - change_status_delta_child_flow4_success.hpl - Y - Y - N - - - delta_child_flow.hpl 4 - change_status_delta_child_flow4_error.hpl - Y - N - N - - - delta_child_flow.hpl 5 - change_status_delta_child_flow5_success.hpl - Y - Y - N - - - delta_child_flow.hpl 5 - change_status_delta_child_flow5_error.hpl - Y - N - N - - - Simple job_child_exists check NEW - recruitment_rows_five_flow_child.hpl - Y - Y - N - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 72 - 1088 - 176 - 0001-01-01 00:00:00 - -3001-01-01 00:00:00 - - 114 - diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl index 7250cac..d1a2877 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl @@ -7,33 +7,37 @@ Normal - 0 N 1000 100 - - 2025/05/21 14:05:02.260 + 2025/08/05 14:31:22.799 - - 2025/05/21 14:05:02.260 + 2025/08/05 14:31:22.799
Table input - Select values 4 2 - N + Table output + Y - Select values 4 2 - Get variables - N + Table output + Change job status on success + Y - Table input - Insert / update + Create job execution record + Table input + Y + + + Table output + Change job status on error Y @@ -47,14 +51,14 @@ Y - Table input + Table output Group by Y - Get variables - GetVariable + Change job status on error + ExecSql Y @@ -63,20 +67,88 @@ none - - - -1 - recruitment_id - -1 - none - String - ID_F1 - - + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + - 976 - 400 + 992 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 992 + 320 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 @@ -120,141 +192,10 @@ grp - 640 + 688 176 - - 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 - - - 928 - 288 - -
- - Select values 4 2 - SelectValues - - Y - - 1 - - none - - - - N - - ID_F1 - ID_F1 - String - -2 - -2 - - false - - - false - - - - - - - - - - 720 - 400 - - Table input TableInput @@ -268,7 +209,6 @@ ervu-dashboard N - 0 SELECT ri.recruit_id::uuid AS recruit_id, ch->>'id' AS child_external_id, @@ -313,15 +253,96 @@ CROSS JOIN LATERAL ( ) AS death_date ) AS dates WHERE - '${RECRUITMENT_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' - AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y - 448 - 288 + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + child_external_id + child_external_id + + + child_id_ern + child_id_ern + + + kinship_type + kinship_type + + + last_name + last_name + + + first_name + first_name + + + middle_name + middle_name + + + full_name + full_name + + + birth_date + birth_date + + + death_date + death_date + + + death_az_number + death_az_number + + + birth_az_number + birth_az_number + + + N + N + N + N + Y + N + ervu_dashboard + Y + citizen_child
+ N + Y + N + Y + + + 720 + 320
@@ -363,8 +384,8 @@ WHERE Y - 976 - 32 + 912 + 0 @@ -405,18 +426,18 @@ WHERE 816 - 96 + 80 - Select values 4 2 - Get variables + Table output + Change job status on error Y - + error_description - + error_code diff --git a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl similarity index 69% rename from mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl rename to mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl index e6ad075..14baba4 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl @@ -1,7 +1,7 @@ - delta_child_flow + child_flow_delta Y @@ -13,16 +13,16 @@ 1000 100 - - 2025/06/03 16:10:48.509 + 2025/08/11 13:22:56.048 - - 2025/06/03 16:10:48.509 + 2025/08/11 13:22:56.048 - Table input - Insert / update + Create job execution record + Table input Y @@ -35,15 +35,30 @@ Update Y + + Insert / update + Change job status on error + Y + + + Insert / update + Change job status on success + Y + Table input + Insert / update + Y + + + Insert / update Group by Y - Insert / update - InsertUpdate + Change job status on error + ExecSql Y @@ -52,6 +67,152 @@ none + + + error_description + + + error_code + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1040 + 416 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1040 + 224 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count_raw + is_minor + SUM + + + has_minor_child_raw + is_minor + MAX + + + has_dead_child_raw + is_dead + MAX + + + N + + + recruit_id + + + N + grp + + + 624 + 112 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + 100 ervu-dashboard @@ -59,11 +220,13 @@ = recruit_id recruit_id + = child_external_id child_external_id + ervu_dashboard citizen_child
@@ -131,8 +294,8 @@ N - 1088 - 352 + 768 + 224
@@ -148,8 +311,7 @@ ervu-dashboard N - 0 - SELECT + SELECT ri.recruit_id::uuid AS recruit_id, ch->>'id' AS child_external_id, NULLIF(ch->>'idERN', '') AS child_id_ern, @@ -173,7 +335,7 @@ CASE WHEN dates.death_date IS NOT NULL THEN 0 -- умершие не могут быть несовершеннолетними WHEN dates.birth_date IS NULL THEN 0 -- если дата рождения неизвестна, считаем взрослым - WHEN dates.birth_date > CURRENT_DATE - INTERVAL '18 years' THEN 1 + WHEN dates.birth_date > CURRENT_DATE - INTERVAL '18 years' THEN 1 ELSE 0 END AS is_minor FROM ervu_dashboard.recruits_info ri @@ -193,62 +355,14 @@ CROSS JOIN LATERAL ( ) AS death_date ) AS dates WHERE - '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date - AND '${RECRUITMENT_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' - AND c.update_date >= '${M_R_UP_DATE}'::timestamp - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; - + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y - 624 - 352 - - - - Group by - GroupBy - - N - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - minors_count_raw - is_minor - SUM - - - has_minor_child_raw - is_minor - MAX - - - has_dead_child_raw - is_dead - MAX - - - N - - - recruit_id - - - N - grp - - - 784 - 256 + 544 + 224 @@ -290,8 +404,8 @@ WHERE Y - 1104 - 80 + 960 + 0 @@ -331,11 +445,23 @@ WHERE - 944 - 160 + 688 + 16 + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl new file mode 100644 index 0000000..c7ab59f --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl @@ -0,0 +1,480 @@ + + + + child_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Group by + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Table input + Insert / update + Y + + + Insert / update + Change job status on success + Y + + + Insert / update + Change job status on error + Y + + + Insert / update + Group by + Y + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + error_code + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + + 976 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 976 + 208 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + 272 + 208 + + + + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count_raw + is_minor + SUM + + + has_minor_child_raw + is_minor + MAX + + + has_dead_child_raw + is_dead + MAX + + + N + + + recruit_id + + + N + grp + + + 576 + 112 + + + + Insert / update + InsertUpdate + + N + + 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 + + + 704 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END 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, + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + CASE WHEN dates.death_date IS NOT NULL THEN 1 ELSE 0 END AS is_dead, + CASE + WHEN dates.death_date IS NOT NULL THEN 0 -- умершие не могут быть несовершеннолетними + WHEN dates.birth_date IS NULL THEN 0 -- если дата рождения неизвестна, считаем взрослым + WHEN dates.birth_date > CURRENT_DATE - INTERVAL '18 years' THEN 1 + ELSE 0 + END AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y + + + 480 + 208 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + minors_count + minors_count + + + has_minor_child + has_minor_child + + + has_dead_child + has_dead_child + +
+ N + Y + + + 976 + 0 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + minors_count + minors_count_raw == 1 ? "1" : minors_count_raw == 2 ? "2" : minors_count_raw >= 3 ? "3 и более" : "0" + String + 10 + -1 + + + + has_minor_child + has_minor_child_raw == 1 + Boolean + -1 + -1 + + + + has_dead_child + has_dead_child_raw == 1 + Boolean + -1 + -1 + + + + + 672 + 0 + + + + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow2.hpl b/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow2.hpl deleted file mode 100644 index c108637..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow2.hpl +++ /dev/null @@ -1,143 +0,0 @@ - - - - delta_child_flow2 - 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 - - 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 - - - 1168 - 352 - -
- - 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_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 - AND ri.updated_at >= '${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 - Y - - - 624 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow3.hpl b/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow3.hpl deleted file mode 100644 index 7908b8e..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow3.hpl +++ /dev/null @@ -1,143 +0,0 @@ - - - - delta_child_flow3 - 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 - - 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 - - - 1168 - 352 - -
- - 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_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 - AND ri.updated_at >= '${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 - Y - - - 624 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow4.hpl b/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow4.hpl deleted file mode 100644 index 32b4002..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow4.hpl +++ /dev/null @@ -1,143 +0,0 @@ - - - - delta_child_flow4 - 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 - - 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 - - - 1168 - 352 - -
- - 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_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 - AND ri.updated_at >= '${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 - Y - - - 624 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow5.hpl b/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow5.hpl deleted file mode 100644 index 1a55d69..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow5.hpl +++ /dev/null @@ -1,143 +0,0 @@ - - - - delta_child_flow5 - 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 - - 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 - - - 1168 - 352 - -
- - 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_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 - AND ri.updated_at >= '${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 - Y - - - 624 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..71e650a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + child_flow_delta.hpl + Y + + + Table input + child_flow_delta.hpl 2 + Y + + + Table input + child_flow_delta.hpl 3 + Y + + + Table input + child_flow_delta.hpl 4 + Y + + + Table input + child_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'child_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + child_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 128 + + + + child_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + child_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + child_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + child_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..5f0b1c6 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + child_flow_repeat.hpl + Y + + + Table input + child_flow_repeat.hpl 3 + Y + + + Table input + child_flow_repeat.hpl 2 + Y + + + Table input + child_flow_repeat.hpl 4 + Y + + + Table input + child_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'child_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + child_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 208 + + + + child_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 288 + + + + child_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 368 + + + + child_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 448 + + + + child_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl deleted file mode 100644 index e2f9809..0000000 --- a/mappings/info_recruits/citizen_tables/child/recruitment_rows_five_flow_if_error.hpl +++ /dev/null @@ -1,185 +0,0 @@ - - - - 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 -fr_check AS ( - SELECT - last_recruitment_id AS recruitment_id, - recruitment_created_date, - status, - job_name - FROM public.etl_checkpoints - WHERE status = 'ERROR' AND job_name IN ('child_flow1', 'child_flow2', 'child_flow3', 'child_flow4', 'child_flow5') -), -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 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow1') THEN created_at END) AS cr_flow1, - MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow1') THEN idm_id::text END) AS idm_flow1, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow2') THEN created_at END) AS cr_flow2, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow2') THEN idm_id::text END) AS idm_flow2, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow3') THEN created_at END) AS cr_flow3, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow3') THEN idm_id::text END) AS idm_flow3, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow4') THEN created_at END) AS cr_flow4, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow4') THEN idm_id::text END) AS idm_flow4, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow5') THEN created_at END) AS cr_flow5, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'child_flow5') THEN idm_id::text END) AS idm_flow5 - FROM splitted - GROUP BY position -), -remains as ( - SELECT - position, - 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 - WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) - OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) - OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) - OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) - OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) - order by position -), -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 3 - N - - - 512 - 288 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/child/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/child/recruitments_five_flow.hpl new file mode 100644 index 0000000..069932a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/recruitments_five_flow.hpl @@ -0,0 +1,356 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + child_flow.hpl + Y + + + Get all recruitments ordered by created_date + child_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + child_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + child_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + child_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 432 + 304 + + + + child_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + child_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + child_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + child_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + child_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + child_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl deleted file mode 100644 index 06f8364..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl +++ /dev/null @@ -1,124 +0,0 @@ - - - - branching_citizen_guardianship - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1040 - 416 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_citizen_guardianship' - N - - - 800 - 416 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1264 - 416 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl deleted file mode 100644 index 7df04b6..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - branching_citizen_guardianship_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:40:44.856 - - - 2025/06/03 14:40:44.856 - - - - - - Set variables - Write to log - N - - - Table input - Set variables - Y - - - - Set variables - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1104 - 368 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - COALESCE(job_name, 'job_citizen_guardianship_delta') AS PIPELINE, - COALESCE(status, 'ERROR') AS STATUS, - current_timestamp::timestamp as record_created -FROM ( - select - CASE - WHEN status = 'PROCESSING' THEN 'ERROR' - ELSE status - END AS status, - job_name - from public.etl_checkpoints - where job_name = 'job_citizen_guardianship_delta' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_guardianship_delta' - ) -) t - N - - - 864 - 368 - - - - Write to log - WriteToLog - - Y - - 1 - - none - - - Basic - Y - N - 0 - ${PIPE} -${STATUS} - - - pipeline - - - status - - - - - 1328 - 368 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/check_if_need_to_repeat_job.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/check_if_need_to_repeat_job.hpl index 6395e93..b3fff70 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/check_if_need_to_repeat_job.hpl @@ -1,7 +1,7 @@ - change_status_delta_child_flow4_error + check_if_need_to_repeat_job Y @@ -13,22 +13,22 @@ 1000 100 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 Table input - Insert / update + Set variables Y - Insert / update - InsertUpdate + Set variables + SetVariable Y @@ -37,37 +37,18 @@ none - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y - 1152 - 304 + 624 + 288
@@ -84,16 +65,19 @@ ervu-dashboard N 0 - SELECT - 'delta_child_flow4' as job_name, - 'ERROR' as status, - current_timestamp as record_created - + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_guardianship_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; N - 784 - 304 + 336 + 288 diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_error.hpl deleted file mode 100644 index e6a5f14..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_guardianship_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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 - 'citizen_guardianship_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_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_success.hpl deleted file mode 100644 index 571a7cf..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_guardianship_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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 - 'citizen_guardianship_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_error.hpl deleted file mode 100644 index 7b836c5..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_guardianship_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_guardianship_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_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_success.hpl deleted file mode 100644 index 5ce643b..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_guardianship_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_guardianship_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_error.hpl deleted file mode 100644 index 4046d93..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_guardianship_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_guardianship_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_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_success.hpl deleted file mode 100644 index ba9817b..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_guardianship_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_guardianship_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_error.hpl deleted file mode 100644 index 09bc827..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_guardianship_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_guardianship_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_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_success.hpl deleted file mode 100644 index 4d21654..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_guardianship_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_guardianship_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_error.hpl deleted file mode 100644 index 88fd368..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_guardianship_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_guardianship_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 - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_success.hpl deleted file mode 100644 index 0807eed..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_guardianship_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_guardianship_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl deleted file mode 100644 index 7aff57b..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow1' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl deleted file mode 100644 index 4afa8d1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow1' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_error.hpl deleted file mode 100644 index 5bc6b96..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow2' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_success.hpl deleted file mode 100644 index 1b5a4e1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow2' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl deleted file mode 100644 index a1831cc..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow3' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl deleted file mode 100644 index db90c73..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow3' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl deleted file mode 100644 index 73127c8..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow4' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl deleted file mode 100644 index c6c862a..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow4' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl deleted file mode 100644 index e264351..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow5' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl deleted file mode 100644 index 892635d..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_guardianship_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_guardianship_flow5' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index 68d82dc..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - change_status_to_processing - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/11 16:14:31.162 - - - 2025/06/11 16:14:31.162 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 784 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'job_citizen_guardianship' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_guardianship_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_guardianship_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_guardianship_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_guardianship_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_guardianship_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl deleted file mode 100644 index 4e81e10..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_to_processing_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 13:42:26.494 - - - 2025/06/16 13:42:26.494 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1248 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'delta_citizen_guardianship' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 832 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_job_citizen_spouse_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_citizen_guardianship_job_exists.hpl similarity index 69% rename from mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_job_citizen_spouse_exists.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_citizen_guardianship_job_exists.hpl index d1c2864..8ff4ff0 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_job_citizen_spouse_exists.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_citizen_guardianship_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_citizen_spouse_exists + check_if_citizen_guardianship_job_exists Y @@ -13,23 +13,23 @@ 1000 100 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - Table input - Set variables - Y - Set variables Write to log N + + Table input + Set variables + Y + Set variables @@ -44,21 +44,16 @@ - job_name - PIPE - PARENT_WORKFLOW - - - status - STATUS + job_executed_flag + JOB_EXECUTED_FLAG PARENT_WORKFLOW Y - 688 - 352 + 672 + 336 @@ -75,29 +70,17 @@ ervu-dashboard N 0 - SELECT - COALESCE(job_name, 'job_citizen_spouse') AS job_name, - COALESCE(status, 'NEW') AS status, - current_timestamp::timestamp as record_created -FROM ( - SELECT job_name, status - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_spouse' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_spouse' - ) -) t + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'citizen_guardianship_job' + limit 1 + ) AS job_executed_flag; N - 400 - 352 + 384 + 336 @@ -111,17 +94,17 @@ FROM ( none + Basic Y - - N 0 - Basic ${STATUS} + + - 960 - 240 + 944 + 224 diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl deleted file mode 100644 index a1db818..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl +++ /dev/null @@ -1,273 +0,0 @@ - - - - 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_child ch on ch.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/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl deleted file mode 100644 index 13e0012..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl +++ /dev/null @@ -1,126 +0,0 @@ - - - - checkpoint_job_citizen_guardianship - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1312 - 272 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'citizen_guardianship_flow1', - 'citizen_guardianship_flow2', - 'citizen_guardianship_flow3', - 'citizen_guardianship_flow4', - 'citizen_guardianship_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'citizen_guardianship_flow1', - 'citizen_guardianship_flow2', - 'citizen_guardianship_flow3', - 'citizen_guardianship_flow4', - 'citizen_guardianship_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_citizen_guardianship' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 944 - 272 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl deleted file mode 100644 index 58756f6..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl +++ /dev/null @@ -1,126 +0,0 @@ - - - - checkpoint_job_citizen_guardianship_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1072 - 240 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'delta_citizen_guardianship_flow1', - 'delta_citizen_guardianship_flow2', - 'delta_citizen_guardianship_flow3', - 'delta_citizen_guardianship_flow4', - 'delta_citizen_guardianship_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'delta_citizen_guardianship_flow1', - 'delta_citizen_guardianship_flow2', - 'delta_citizen_guardianship_flow3', - 'delta_citizen_guardianship_flow4', - 'delta_citizen_guardianship_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_citizen_guardianship_delta' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 704 - 240 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf deleted file mode 100644 index 1a90995..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf +++ /dev/null @@ -1,235 +0,0 @@ - - - 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_child_flow2_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow2" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json - N - 848 - 416 - - - - state_child_flow1_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow1" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json - N - 848 - 336 - - - - state_child_flow3_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow3" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json - N - 848 - 496 - - - - state_child_flow4_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow4" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json - N - 848 - 576 - - - - state_child_flow5_new - - WRITE_TO_FILE - - N - { - "status": "NEW", - "pipeline": "child_flow5" -} - N - UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - N - 848 - 656 - - - - Success - - SUCCESS - - N - 1120 - 496 - - - - Delete file state_job_child - - DELETE_FILE - - N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json - N - 848 - 256 - - - - - - Start - state_child_flow3_new - Y - Y - Y - - - Start - state_child_flow2_new - Y - Y - Y - - - Start - state_child_flow1_new - Y - Y - Y - - - Start - state_child_flow4_new - Y - Y - Y - - - Start - state_child_flow5_new - Y - Y - Y - - - state_child_flow5_new - Success - Y - Y - N - - - state_child_flow4_new - Success - Y - Y - N - - - state_child_flow3_new - Success - Y - Y - N - - - state_child_flow2_new - Success - Y - Y - N - - - state_child_flow1_new - Success - Y - Y - N - - - Start - Delete file state_job_child - Y - Y - Y - - - Delete file state_job_child - Success - Y - Y - N - - - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf deleted file mode 100644 index 656c879..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf +++ /dev/null @@ -1,2486 +0,0 @@ - - - job_citizen_guardianship - Y - - - - 0 - - - 2025/06/05 14:27:15.055 - - - 2025/06/05 14:27:15.055 - - - M_R_CR_DATE - 3001-01-01 00:00:00 - - - - M_R_UP_DATE - - - - - - - Start - - SPECIAL - - 1 - 12 - 60 - 0 - 0 - N - 0 - 1 - N - 416 - 400 - - - - 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 - 2384 - 400 - - - - citizen_guardianship_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2704 - 80 - - - - citizen_guardianship_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2704 - 240 - - - - citizen_guardianship_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2704 - 400 - - - - citizen_guardianship_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2704 - 560 - - - - citizen_guardianship_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2704 - 720 - - - - Abort workflow - - ABORT - - N - N - 2384 - 224 - - - - 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 - 3424 - 416 - - - - Success new citizen - - SUCCESS - - N - 3872 - 416 - - - - 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 ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 1920 - 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 - - - - check_if_job_citizen_guardianship_exists.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_job_citizen_guardianship_exists.hpl - Basic - - Y - - N - local - N - N - Y - N - 656 - 400 - - - - Simple job_citizen_guardianship_exists check NEW - - SIMPLE_EVAL - - NEW - string - true - equal - equal - N - variable - STATUS - N - 1008 - 400 - - - - change_status_citizen_guardianship_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 96 - - - - change_status_citizen_guardianship_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 176 - - - - change_status_citizen_guardianship_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 256 - - - - change_status_citizen_guardianship_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 336 - - - - change_status_citizen_guardianship_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 416 - - - - change_status_citizen_guardianship_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 496 - - - - change_status_citizen_guardianship_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 576 - - - - change_status_citizen_guardianship_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 656 - - - - change_status_citizen_guardianship_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 736 - - - - change_status_citizen_guardianship_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 816 - - - - 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 - 1296 - 1280 - - - - citizen_guardianship_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2704 - 960 - - - - citizen_guardianship_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2704 - 1120 - - - - citizen_guardianship_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2704 - 1280 - - - - citizen_guardianship_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2704 - 1440 - - - - citizen_guardianship_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2704 - 1600 - - - - checkpoint_job_citizen_guardianship.hpl 3 - - 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 - 3424 - 1296 - - - - Success new citizen 2 - - SUCCESS - - N - 3728 - 1296 - - - - change_status_citizen_guardianship_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 960 - - - - change_status_citizen_guardianship_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 1040 - - - - change_status_citizen_guardianship_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 1120 - - - - change_status_citizen_guardianship_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 1200 - - - - change_status_citizen_guardianship_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 1280 - - - - change_status_citizen_guardianship_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 1360 - - - - change_status_citizen_guardianship_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 1440 - - - - change_status_citizen_guardianship_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 1520 - - - - change_status_citizen_guardianship_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 1600 - - - - change_status_citizen_guardianship_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_citizen_guardianship_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3120 - 1680 - - - - Simple citizen_guardianship WHERE SUCCESS - - SIMPLE_EVAL - - SUCCESS - string - true - equal - equal - N - variable - STATUS - N - 1584 - 1792 - - - - change_status_to_processing_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2512 - 2528 - - - - recruitment_rows_five_flow_citizen_guardianship.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl - Basic - - - CR_DATE - CREATE_DATE - - Y - - N - local - N - N - Y - Y - 2512 - 2224 - - - - branching_citizen_guardianship_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 1584 - 2224 - - - - Simple delta_citizen_guardianship WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 2096 - 2224 - - - - delta_citizen_guardianship success 2 - - SUCCESS - - N - 2096 - 2032 - - - - delta_citizen_guardianship_flow.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW1 - - Y - - N - local - N - N - Y - N - 3056 - 1936 - - - - Abort workflow 3 - - ABORT - - N - N - 2512 - 1936 - - - - change_status_delta_citizen_guardianship_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_success.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 3408 - 1920 - - - - change_status_delta_citizen_guardianship_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3408 - 2000 - - - - change_status_delta_citizen_guardianship_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3408 - 2080 - - - - change_status_delta_citizen_guardianship_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3408 - 2160 - - - - change_status_delta_citizen_guardianship_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3408 - 2240 - - - - change_status_delta_citizen_guardianship_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3408 - 2320 - - - - change_status_delta_citizen_guardianship_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3408 - 2400 - - - - change_status_delta_citizen_guardianship_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3408 - 2480 - - - - change_status_delta_citizen_guardianship_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3408 - 2560 - - - - change_status_delta_citizen_guardianship_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3408 - 2640 - - - - checkpoint_job_citizen_guardianship_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship_delta.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 3760 - 2272 - - - - citizen_guardianship_delta success - - SUCCESS - - N - 4176 - 2272 - - - - delta_citizen_guardianship_flow.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW2 - - Y - - N - local - N - N - Y - N - 3056 - 2096 - - - - delta_citizen_guardianship_flow.hpl 3 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW3 - - Y - - N - local - N - N - Y - N - 3056 - 2256 - - - - delta_citizen_guardianship_flow.hpl 4 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW4 - - Y - - N - local - N - N - Y - N - 3056 - 2432 - - - - delta_citizen_guardianship_flow.hpl 5 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW5 - - Y - - N - local - N - N - Y - N - 3056 - 2608 - - - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2384 - 560 - - - - change_status_to_processing.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2384 - 1440 - - - - - - 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 - - - recruitment_rows_five_flow_citizen_guardianship.hpl - Abort workflow - Y - N - N - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - - - check_if_job_citizen_guardianship_exists.hpl - Simple job_citizen_guardianship_exists check NEW - Y - Y - N - - - citizen_guardianship_flow1.hpl - change_status_citizen_guardianship_flow1_success.hpl - Y - Y - N - - - citizen_guardianship_flow1.hpl - change_status_citizen_guardianship_flow1_error.hpl - Y - N - N - - - citizen_guardianship_flow2.hpl - change_status_citizen_guardianship_flow2_success.hpl - Y - Y - N - - - citizen_guardianship_flow2.hpl - change_status_citizen_guardianship_flow2_error.hpl - Y - N - N - - - citizen_guardianship_flow3.hpl - change_status_citizen_guardianship_flow3_success.hpl - Y - Y - N - - - citizen_guardianship_flow3.hpl - change_status_citizen_guardianship_flow3_error.hpl - Y - N - N - - - citizen_guardianship_flow4.hpl - change_status_citizen_guardianship_flow4_success.hpl - Y - Y - N - - - citizen_guardianship_flow4.hpl - change_status_citizen_guardianship_flow4_error.hpl - Y - N - N - - - citizen_guardianship_flow5.hpl - change_status_citizen_guardianship_flow5_success.hpl - Y - Y - N - - - citizen_guardianship_flow5.hpl - change_status_citizen_guardianship_flow5_error.hpl - Y - N - N - - - change_status_citizen_guardianship_flow1_success.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - change_status_citizen_guardianship_flow1_error.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - change_status_citizen_guardianship_flow2_success.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - change_status_citizen_guardianship_flow2_error.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - change_status_citizen_guardianship_flow3_success.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - change_status_citizen_guardianship_flow3_error.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - change_status_citizen_guardianship_flow4_success.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - change_status_citizen_guardianship_flow4_error.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - change_status_citizen_guardianship_flow5_success.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - change_status_citizen_guardianship_flow5_error.hpl - checkpoint_job_citizen_guardianship.hpl - Y - N - Y - - - checkpoint_job_citizen_guardianship.hpl - Success new citizen - Y - Y - N - - - Simple job_citizen_guardianship_exists check NEW - checkpoint_job_citizen_guardianship.hpl 2 - Y - N - N - - - checkpoint_job_citizen_guardianship.hpl 2 - branching_citizen_guardianship.hpl - Y - Y - N - - - citizen_guardianship_flow1.hpl 2 - change_status_citizen_guardianship_flow1_success.hpl 2 - Y - Y - N - - - citizen_guardianship_flow1.hpl 2 - change_status_citizen_guardianship_flow1_error.hpl 2 - Y - N - N - - - citizen_guardianship_flow2.hpl 2 - change_status_citizen_guardianship_flow2_success.hpl 2 - Y - Y - N - - - citizen_guardianship_flow2.hpl 2 - change_status_citizen_guardianship_flow2_error.hpl 2 - Y - N - N - - - citizen_guardianship_flow3.hpl 2 - change_status_citizen_guardianship_flow3_success.hpl 2 - Y - Y - N - - - citizen_guardianship_flow3.hpl 2 - change_status_citizen_guardianship_flow3_error.hpl 2 - Y - N - N - - - citizen_guardianship_flow4.hpl 2 - change_status_citizen_guardianship_flow4_success.hpl 2 - Y - Y - N - - - citizen_guardianship_flow4.hpl 2 - change_status_citizen_guardianship_flow4_error.hpl 2 - Y - N - N - - - citizen_guardianship_flow5.hpl 2 - change_status_citizen_guardianship_flow5_success.hpl 2 - Y - Y - N - - - citizen_guardianship_flow5.hpl 2 - change_status_citizen_guardianship_flow5_error.hpl 2 - Y - N - N - - - checkpoint_job_citizen_guardianship.hpl 3 - Success new citizen 2 - Y - Y - N - - - change_status_citizen_guardianship_flow1_success.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - change_status_citizen_guardianship_flow1_error.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - change_status_citizen_guardianship_flow2_success.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - change_status_citizen_guardianship_flow2_error.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - change_status_citizen_guardianship_flow3_success.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - change_status_citizen_guardianship_flow3_error.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - change_status_citizen_guardianship_flow4_success.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - change_status_citizen_guardianship_flow4_error.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - change_status_citizen_guardianship_flow5_success.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - change_status_citizen_guardianship_flow5_error.hpl 2 - checkpoint_job_citizen_guardianship.hpl 3 - Y - N - Y - - - 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 - - - branching_citizen_guardianship.hpl - Simple citizen_guardianship WHERE ERROR - Y - N - Y - - - Start - check_if_job_citizen_guardianship_exists.hpl - Y - Y - Y - - - Simple citizen_guardianship WHERE SUCCESS - branching_citizen_guardianship_delta.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_guardianship.hpl (2) - change_status_to_processing_delta.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_guardianship.hpl (2) - delta_citizen_guardianship_flow.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_guardianship.hpl (2) - Abort workflow 3 - Y - N - N - - - recruitment_rows_five_flow_citizen_guardianship.hpl (2) - delta_citizen_guardianship_flow.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_citizen_guardianship.hpl (2) - delta_citizen_guardianship_flow.hpl 3 - Y - Y - N - - - recruitment_rows_five_flow_citizen_guardianship.hpl (2) - delta_citizen_guardianship_flow.hpl 4 - Y - Y - N - - - recruitment_rows_five_flow_citizen_guardianship.hpl (2) - delta_citizen_guardianship_flow.hpl 5 - Y - Y - N - - - branching_citizen_guardianship_delta.hpl - Simple delta_citizen_guardianship WHERE ERROR - Y - Y - N - - - Simple delta_citizen_guardianship WHERE ERROR - recruitment_rows_five_flow_citizen_guardianship.hpl (2) - Y - Y - N - - - Simple delta_citizen_guardianship WHERE ERROR - delta_citizen_guardianship success 2 - Y - N - N - - - delta_citizen_guardianship_flow.hpl - change_status_delta_citizen_guardianship_flow1_success.hpl - Y - Y - N - - - delta_citizen_guardianship_flow.hpl - change_status_delta_citizen_guardianship_flow1_error.hpl - Y - N - N - - - change_status_delta_citizen_guardianship_flow1_success.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - change_status_delta_citizen_guardianship_flow1_error.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - change_status_delta_citizen_guardianship_flow2_success.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - change_status_delta_citizen_guardianship_flow2_error.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - change_status_delta_citizen_guardianship_flow3_success.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - change_status_delta_citizen_guardianship_flow3_error.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - change_status_delta_citizen_guardianship_flow4_success.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - change_status_delta_citizen_guardianship_flow4_error.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - change_status_delta_citizen_guardianship_flow5_success.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - change_status_delta_citizen_guardianship_flow5_error.hpl - checkpoint_job_citizen_guardianship_delta.hpl - Y - N - Y - - - checkpoint_job_citizen_guardianship_delta.hpl - citizen_guardianship_delta success - Y - Y - N - - - delta_citizen_guardianship_flow.hpl 2 - change_status_delta_citizen_guardianship_flow2_success.hpl - Y - Y - N - - - delta_citizen_guardianship_flow.hpl 2 - change_status_delta_citizen_guardianship_flow2_error.hpl - Y - N - N - - - delta_citizen_guardianship_flow.hpl 3 - change_status_delta_citizen_guardianship_flow3_success.hpl - Y - Y - N - - - delta_citizen_guardianship_flow.hpl 3 - change_status_delta_citizen_guardianship_flow3_error.hpl - Y - N - N - - - delta_citizen_guardianship_flow.hpl 4 - change_status_delta_citizen_guardianship_flow4_success.hpl - Y - Y - N - - - delta_citizen_guardianship_flow.hpl 4 - change_status_delta_citizen_guardianship_flow4_error.hpl - Y - N - N - - - delta_citizen_guardianship_flow.hpl 5 - change_status_delta_citizen_guardianship_flow5_success.hpl - Y - Y - N - - - delta_citizen_guardianship_flow.hpl 5 - change_status_delta_citizen_guardianship_flow5_error.hpl - Y - N - N - - - branching_citizen_guardianship.hpl - Simple citizen_guardianship WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_citizen_guardianship.hpl - change_status_to_processing.hpl - Y - Y - N - - - Simple job_citizen_guardianship_exists check NEW - recruitment_rows_five_flow_citizen_guardianship.hpl - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - change_status_to_processing.hpl 2 - Y - Y - N - - - Simple citizen_guardianship WHERE ERROR - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 72 - 656 - 144 - 0001-01-01 00:00:00 - -3001-01-01 00:00:00 - - 114 - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf new file mode 100644 index 0000000..73624d2 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf @@ -0,0 +1,271 @@ + + + job_citizen_guardianship + Y + + + + 0 + - + 2025/06/05 14:27:15.055 + - + 2025/06/05 14:27:15.055 + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 416 + 208 + + + + check_if_citizen_guardianship_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_citizen_guardianship_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 608 + 208 + + + + citizen_guardianship_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 880 + 208 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruitments_five_flow.hpl + + + Basic + + Y + + N + local + N + N + Y + Y + 1120 + 208 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_on_error.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 1120 + 512 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/check_if_need_to_repeat_job.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 880 + 368 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 880 + 512 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 880 + 704 + + + + + + Start + check_if_citizen_guardianship_job_exists.hpl + Y + Y + Y + + + check_if_citizen_guardianship_job_exists.hpl + citizen_guardianship_job_exists_check + Y + Y + N + + + citizen_guardianship_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + citizen_guardianship_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl index 7d81b54..6786c4d 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl @@ -7,49 +7,38 @@ Normal - 0 N 1000 100 - - 2025/05/21 14:05:02.260 + 2025/08/05 14:31:22.799 - - 2025/05/21 14:05:02.260 + 2025/08/05 14:31:22.799 - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 26 - 368 - 32 - сведения о лице опекаемом или находящемся на попечении - 349 - Table input - Select values 4 2 - N + Table output + Y - Select values 4 2 - Get variables - N + Table output + Change job status on success + Y + + + Create job execution record + Table input + Y + + + Table output + Change job status on error + Y Add constants @@ -62,12 +51,7 @@ Y - Table input - Insert / update - Y - - - Table input + Table output Group by Y @@ -95,13 +79,13 @@
- 752 - 128 + 608 + 0
- Get variables - GetVariable + Change job status on error + ExecSql Y @@ -110,27 +94,99 @@ none - - - -1 - recruitment_id - -1 - none - String - ID_F1 - - + + + error_description + + + ervu-dashboard + + Y + + N + + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + - 976 - 400 + 992 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 992 + 320 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 Group by GroupBy - Y + N 1 @@ -152,124 +208,8 @@ grp - 640 - 176 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - = - guardianship_external_id - guardianship_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 - - - guardianship_external_id - guardianship_external_id - N - - - snils - snils - Y - -
- N - - - 912 - 288 - -
- - Select values 4 2 - SelectValues - - Y - - 1 - - none - - - - N - - ID_F1 - ID_F1 - String - -2 - -2 - - false - - - false - - - - - - - - - - 720 - 400 + 496 + 0 @@ -285,7 +225,6 @@ ervu-dashboard N - 0 SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, @@ -308,15 +247,87 @@ FROM ervu_dashboard.citizen r JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch WHERE - '${RECRUITMENT_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' - AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; Y - 448 - 288 + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + guardianship_external_id + guardianship_external_id + + + guardian_id_ern + guardian_id_ern + + + last_name + last_name + + + first_name + first_name + + + middle_name + middle_name + + + full_name + full_name + + + birth_date + birth_date + + + snils + snils + + + N + N + N + N + + Y + + N + ervu_dashboard + Y + citizen_guardianship
+ + N + Y + N + Y + + + 720 + 320
@@ -350,19 +361,19 @@ WHERE Y - 848 - 80 + 704 + 0 - Select values 4 2 - Get variables + Table output + Change job status on error Y - + error_description - + error_code diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl similarity index 63% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl index 9ed539d..e5d5f9f 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/delta_citizen_guardianship_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl @@ -1,7 +1,7 @@ - delta_citizen_guardianship_flow + citizen_guardianship_flow_delta Y @@ -13,13 +13,18 @@ 1000 100 - - 2025/06/03 16:10:48.509 + 2025/08/11 13:22:56.048 - - 2025/06/03 16:10:48.509 + 2025/08/11 13:22:56.048 + + Create job execution record + Table input + Y + Add constants Update @@ -31,8 +36,13 @@ Y - Table input - Group by + Insert / update + Change job status on error + Y + + + Insert / update + Change job status on success Y @@ -40,6 +50,11 @@ Insert / update Y + + Insert / update + Group by + Y + Add constants @@ -64,15 +79,117 @@ - 928 - 160 + 960 + 64 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + error_code + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + + 976 + 416 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 976 + 224 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 Group by GroupBy - Y + N 1 @@ -94,15 +211,15 @@ grp - 816 - 208 + 848 + 112 Insert / update InsertUpdate - Y + N 1 @@ -173,8 +290,8 @@ N - 1072 - 352 + 704 + 224 @@ -190,7 +307,6 @@ ervu-dashboard N - 0 SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, @@ -213,16 +329,14 @@ FROM ervu_dashboard.citizen r JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch WHERE - r.update_date >= '${M_R_UP_DATE}'::timestamp - AND'${RECRUITMENT_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' - AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; Y - 816 - 352 + 544 + 224 @@ -256,11 +370,23 @@ WHERE Y - 1024 - 112 + 1056 + 32 + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl new file mode 100644 index 0000000..ca7293b --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl @@ -0,0 +1,407 @@ + + + + citizen_guardianship_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Insert / update + Y + + + Insert / update + Change job status on success + Y + + + Insert / update + Change job status on error + Y + + + Add constants + Update + Y + + + Group by + Add constants + Y + + + Group by + Table input + Y + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 960 + 48 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + error_code + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + + 976 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 976 + 208 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + 272 + 208 + + + + Group by + GroupBy + + N + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 848 + 96 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + guardianship_external_id + guardianship_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 + + + guardianship_external_id + guardianship_external_id + N + + + snils + snils + Y + +
+ N + + + 704 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + + SELECT + r.recruit_id AS recruit_id, + ch->>'id' AS guardianship_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 ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch +WHERE + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; + Y + + + 480 + 208 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 1056 + 16 + +
+ + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..034d7b5 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + citizen_guardianship_flow_delta.hpl + Y + + + Table input + citizen_guardianship_flow_delta.hpl 2 + Y + + + Table input + citizen_guardianship_flow_delta.hpl 3 + Y + + + Table input + citizen_guardianship_flow_delta.hpl 4 + Y + + + Table input + citizen_guardianship_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_guardianship_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + citizen_guardianship_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 128 + + + + citizen_guardianship_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + citizen_guardianship_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + citizen_guardianship_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + citizen_guardianship_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..fba8aa1 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + citizen_guardianship_flow_repeat.hpl + Y + + + Table input + citizen_guardianship_flow_repeat.hpl 3 + Y + + + Table input + citizen_guardianship_flow_repeat.hpl 2 + Y + + + Table input + citizen_guardianship_flow_repeat.hpl 4 + Y + + + Table input + citizen_guardianship_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_guardianship_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + citizen_guardianship_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 208 + + + + citizen_guardianship_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 288 + + + + citizen_guardianship_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 368 + + + + citizen_guardianship_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 448 + + + + citizen_guardianship_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl deleted file mode 100644 index ae9ccf8..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl +++ /dev/null @@ -1,185 +0,0 @@ - - - - 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 -fr_check AS ( - SELECT - last_recruitment_id AS recruitment_id, - recruitment_created_date, - status, - job_name - FROM public.etl_checkpoints - WHERE status = 'ERROR' AND job_name IN ('citizen_guardianship_flow1', 'citizen_guardianship_flow2', 'citizen_guardianship_flow3', 'citizen_guardianship_flow4', 'citizen_guardianship_flow5') -), -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 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow1') THEN created_at END) AS cr_flow1, - MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow1') THEN idm_id::text END) AS idm_flow1, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow2') THEN created_at END) AS cr_flow2, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow2') THEN idm_id::text END) AS idm_flow2, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow3') THEN created_at END) AS cr_flow3, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow3') THEN idm_id::text END) AS idm_flow3, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow4') THEN created_at END) AS cr_flow4, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow4') THEN idm_id::text END) AS idm_flow4, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow5') THEN created_at END) AS cr_flow5, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_guardianship_flow5') THEN idm_id::text END) AS idm_flow5 - FROM splitted - GROUP BY position -), -remains as ( - SELECT - position, - 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 - WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) - OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) - OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) - OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) - OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) - order by position -), -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/info_recruits/citizen_tables/citizen_guardianship/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitments_five_flow.hpl new file mode 100644 index 0000000..5bc8d05 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitments_five_flow.hpl @@ -0,0 +1,356 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + citizen_guardianship_flow.hpl + Y + + + Get all recruitments ordered by created_date + citizen_guardianship_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + citizen_guardianship_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + citizen_guardianship_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + citizen_guardianship_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 432 + 304 + + + + citizen_guardianship_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + citizen_guardianship_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + citizen_guardianship_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + citizen_guardianship_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + citizen_guardianship_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_guardianship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl deleted file mode 100644 index a4251dd..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl +++ /dev/null @@ -1,124 +0,0 @@ - - - - branching_citizen_spouse - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_citizen_spouse' - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl deleted file mode 100644 index ee1d676..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - branching_citizen_spouse_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:40:44.856 - - - 2025/06/03 14:40:44.856 - - - - - - Set variables - Write to log - N - - - Table input - Set variables - Y - - - - Set variables - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1104 - 368 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - COALESCE(job_name, 'job_citizen_spouse_delta') AS PIPELINE, - COALESCE(status, 'ERROR') AS STATUS, - current_timestamp::timestamp as record_created -FROM ( - select - CASE - WHEN status = 'PROCESSING' THEN 'ERROR' - ELSE status - END AS status, - job_name - from public.etl_checkpoints - where job_name = 'job_citizen_spouse_delta' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_spouse_delta' - ) -) t - N - - - 864 - 368 - - - - Write to log - WriteToLog - - Y - - 1 - - none - - - Basic - Y - N - 0 - ${PIPE} -${STATUS} - - - pipeline - - - status - - - - - 1328 - 368 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/check_if_need_to_repeat_job.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl rename to mappings/info_recruits/citizen_tables/citizen_spouse/check_if_need_to_repeat_job.hpl index b85340b..b3fff70 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/check_if_need_to_repeat_job.hpl @@ -1,7 +1,7 @@ - change_status_delta_child_flow2_error + check_if_need_to_repeat_job Y @@ -13,22 +13,22 @@ 1000 100 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 Table input - Insert / update + Set variables Y - Insert / update - InsertUpdate + Set variables + SetVariable Y @@ -37,37 +37,18 @@ none - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y - 1152 - 304 + 624 + 288
@@ -84,16 +65,19 @@ ervu-dashboard N 0 - SELECT - 'delta_child_flow2' as job_name, - 'ERROR' as status, - current_timestamp as record_created - + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_guardianship_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; N - 784 - 304 + 336 + 288 diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_error.hpl deleted file mode 100644 index dc19556..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_spouse_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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 - '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_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_success.hpl deleted file mode 100644 index 645816b..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_spouse_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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 - 'citizen_spouse_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_error.hpl deleted file mode 100644 index 8380623..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_spouse_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - '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_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_success.hpl deleted file mode 100644 index baa3bbb..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_spouse_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_spouse_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_error.hpl deleted file mode 100644 index 495f0f1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_spouse_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - '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_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_success.hpl deleted file mode 100644 index e399fd1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_spouse_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_spouse_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_error.hpl deleted file mode 100644 index 5deb8d0..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_spouse_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - '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_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_success.hpl deleted file mode 100644 index f8024a0..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_spouse_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_spouse_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_error.hpl deleted file mode 100644 index 32fcfb9..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_spouse_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - '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 - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_success.hpl deleted file mode 100644 index 1bf12a5..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_spouse_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_spouse_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_error.hpl deleted file mode 100644 index cc1a8ca..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow1' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_success.hpl deleted file mode 100644 index 5dbd661..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow1' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl deleted file mode 100644 index 490474a..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow2' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl deleted file mode 100644 index 862e079..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow2' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl deleted file mode 100644 index 7948962..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow3' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl deleted file mode 100644 index 28f7afa..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow3' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl deleted file mode 100644 index 71a9f0e..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow4' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl deleted file mode 100644 index 78f8473..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow4' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl deleted file mode 100644 index 6f30a52..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow5' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl deleted file mode 100644 index 117d5b6..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_spouse_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_spouse_flow5' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index 3ad2861..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - change_status_to_processing - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/11 16:14:31.162 - - - 2025/06/11 16:14:31.162 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 784 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'job_citizen_spouse' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_spouse_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_spouse_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_spouse_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_spouse_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_spouse_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing_delta.hpl deleted file mode 100644 index 3619918..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing_delta.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_to_processing_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 13:42:26.494 - - - 2025/06/16 13:42:26.494 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1248 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'delta_citizen_spouse' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 832 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_job_citizen_guardianship_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_citizen_spouse_job_exists.hpl similarity index 69% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_job_citizen_guardianship_exists.hpl rename to mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_citizen_spouse_job_exists.hpl index 64a9b1d..a62f9ed 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_job_citizen_guardianship_exists.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_citizen_spouse_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_citizen_guardianship_exists + check_if_citizen_spouse_job_exists Y @@ -13,23 +13,23 @@ 1000 100 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - Table input - Set variables - Y - Set variables Write to log N + + Table input + Set variables + Y + Set variables @@ -44,21 +44,16 @@ - job_name - PIPE - PARENT_WORKFLOW - - - status - STATUS + job_executed_flag + JOB_EXECUTED_FLAG PARENT_WORKFLOW Y - 688 - 352 + 672 + 336 @@ -75,29 +70,17 @@ ervu-dashboard N 0 - SELECT - COALESCE(job_name, 'job_citizen_guardianship') AS job_name, - COALESCE(status, 'NEW') AS status, - current_timestamp::timestamp as record_created -FROM ( - SELECT job_name, status - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_guardianship' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_guardianship' - ) -) t + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'citizen_spouse_job' + limit 1 + ) AS job_executed_flag; N - 400 - 352 + 384 + 336 @@ -111,17 +94,17 @@ FROM ( none + Basic Y - - N 0 - Basic ${STATUS} + + - 960 - 240 + 944 + 224 diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl deleted file mode 100644 index 11ad83c..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl +++ /dev/null @@ -1,273 +0,0 @@ - - - - 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_child ch on ch.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/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl deleted file mode 100644 index 8745bcd..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl +++ /dev/null @@ -1,126 +0,0 @@ - - - - checkpoint_job_citizen_spouse - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'citizen_spouse_flow1', - 'citizen_spouse_flow2', - 'citizen_spouse_flow3', - 'citizen_spouse_flow4', - 'citizen_spouse_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'citizen_spouse_flow1', - 'citizen_spouse_flow2', - 'citizen_spouse_flow3', - 'citizen_spouse_flow4', - 'citizen_spouse_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_citizen_spouse' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl deleted file mode 100644 index 4451c30..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl +++ /dev/null @@ -1,126 +0,0 @@ - - - - checkpoint_job_citizen_spouse_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1072 - 240 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'delta_citizen_spouse_flow1', - 'delta_citizen_spouse_flow2', - 'delta_citizen_spouse_flow3', - 'delta_citizen_spouse_flow4', - 'delta_citizen_spouse_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'delta_citizen_spouse_flow1', - 'delta_citizen_spouse_flow2', - 'delta_citizen_spouse_flow3', - 'delta_citizen_spouse_flow4', - 'delta_citizen_spouse_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_citizen_spouse_delta' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 704 - 240 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf b/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf deleted file mode 100644 index 0401391..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf +++ /dev/null @@ -1,2485 +0,0 @@ - - - job_citizen_spouse - Y - - - - 0 - - - 2025/06/05 14:27:15.055 - - - 2025/06/05 14:27:15.055 - - - M_R_CR_DATE - 3001-01-01 00:00:00 - - - - M_R_UP_DATE - - - - - - - Start - - SPECIAL - - 1 - 12 - 60 - 0 - 0 - N - 0 - 1 - N - 368 - 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 - 2352 - 400 - - - - citizen_spouse_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 80 - - - - citizen_spouse_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 240 - - - - citizen_spouse_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 400 - - - - citizen_spouse_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 560 - - - - citizen_spouse_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 720 - - - - Abort workflow - - ABORT - - N - N - 2352 - 208 - - - - Success new citizen - - SUCCESS - - N - 3728 - 432 - - - - 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 ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 1840 - 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 - 2384 - 1056 - - - - check_if_job_citizen_spouse_exists.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_job_citizen_spouse_exists.hpl - Basic - - Y - - N - local - N - N - Y - N - 576 - 400 - - - - Simple job_citizen_spouse_exists check NEW - - SIMPLE_EVAL - - NEW - string - true - equal - equal - N - variable - STATUS - N - 896 - 400 - - - - change_status_citizen_spouse_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 80 - - - - change_status_citizen_spouse_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 160 - - - - change_status_citizen_spouse_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 240 - - - - change_status_citizen_spouse_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 320 - - - - change_status_citizen_spouse_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 400 - - - - change_status_citizen_spouse_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 480 - - - - change_status_citizen_spouse_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 560 - - - - change_status_citizen_spouse_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 640 - - - - change_status_citizen_spouse_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 720 - - - - change_status_citizen_spouse_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 800 - - - - 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 - 3456 - 432 - - - - citizen_spouse_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - - - Basic - - - RECRUITMENT_ID - IDM_FLOW1 - - - Y - - Y - local - N - N - Y - N - 2672 - 960 - - - - citizen_spouse_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 1120 - - - - citizen_spouse_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 1280 - - - - citizen_spouse_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 1440 - - - - citizen_spouse_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl - Basic - - - RECRUITMENT_ID - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 1600 - - - - Success new citizen 2 - - SUCCESS - - N - 3728 - 1312 - - - - change_status_citizen_spouse_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 960 - - - - change_status_citizen_spouse_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1040 - - - - change_status_citizen_spouse_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1120 - - - - change_status_citizen_spouse_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1200 - - - - change_status_citizen_spouse_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1280 - - - - change_status_citizen_spouse_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1360 - - - - change_status_citizen_spouse_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1440 - - - - change_status_citizen_spouse_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1520 - - - - change_status_citizen_spouse_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1600 - - - - change_status_citizen_spouse_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_citizen_spouse_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1680 - - - - 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 - 3456 - 1312 - - - - Simple citizen_spouse WHERE SUCCESS - - SIMPLE_EVAL - - SUCCESS - string - true - equal - equal - N - variable - STATUS - N - 1584 - 1824 - - - - change_status_to_processing_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2560 - 2496 - - - - recruitment_rows_five_flow_citizen_spouse.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl - Basic - - - CR_DATE - CREATE_DATE - - Y - - N - local - N - N - Y - Y - 2560 - 2192 - - - - branching_citizen_spouse_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 1584 - 2192 - - - - Simple delta_citizen_spouse WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 2048 - 2192 - - - - delta_citizen_spouse success 2 - - SUCCESS - - N - 2048 - 2000 - - - - delta_citizen_spouse_flow.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW1 - - Y - - N - local - N - N - Y - N - 3104 - 1872 - - - - Abort workflow 3 - - ABORT - - N - N - 2560 - 1904 - - - - change_status_delta_citizen_spouse_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 1856 - - - - change_status_delta_citizen_spouse_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 1936 - - - - change_status_delta_citizen_spouse_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2016 - - - - change_status_delta_citizen_spouse_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2096 - - - - change_status_delta_citizen_spouse_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2176 - - - - change_status_delta_citizen_spouse_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2256 - - - - change_status_delta_citizen_spouse_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2336 - - - - change_status_delta_citizen_spouse_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2416 - - - - change_status_delta_citizen_spouse_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2496 - - - - change_status_delta_citizen_spouse_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2576 - - - - checkpoint_job_citizen_spouse_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 3808 - 2208 - - - - citizen_spouse_delta success - - SUCCESS - - N - 4048 - 2208 - - - - delta_citizen_spouse_flow.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW2 - - Y - - N - local - N - N - Y - N - 3104 - 2032 - - - - delta_citizen_spouse_flow.hpl 3 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW3 - - Y - - N - local - N - N - Y - N - 3104 - 2192 - - - - delta_citizen_spouse_flow.hpl 4 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW4 - - Y - - N - local - N - N - Y - N - 3104 - 2368 - - - - delta_citizen_spouse_flow.hpl 5 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - RECRUITMENT_ID - IDM_FLOW5 - - Y - - N - local - N - N - Y - N - 3104 - 2544 - - - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2352 - 560 - - - - change_status_to_processing.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2384 - 1504 - - - - - - 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 - - - recruitment_rows_five_flow_citizen_spouse.hpl - Abort workflow - Y - N - N - - - branching_citizen_spouse.hpl - Simple citizen_spouse WHERE ERROR - Y - N - Y - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - - - Start - check_if_job_citizen_spouse_exists.hpl - Y - Y - Y - - - check_if_job_citizen_spouse_exists.hpl - Simple job_citizen_spouse_exists check NEW - Y - Y - N - - - citizen_spouse_flow1.hpl - change_status_citizen_spouse_flow1_success.hpl - Y - Y - N - - - citizen_spouse_flow1.hpl - change_status_citizen_spouse_flow1_error.hpl - Y - N - N - - - citizen_spouse_flow2.hpl - change_status_citizen_spouse_flow2_success.hpl - Y - Y - N - - - citizen_spouse_flow2.hpl - change_status_citizen_spouse_flow2_error.hpl - Y - N - N - - - citizen_spouse_flow3.hpl - change_status_citizen_spouse_flow3_success.hpl - Y - Y - N - - - citizen_spouse_flow3.hpl - change_status_citizen_spouse_flow3_error.hpl - Y - N - N - - - citizen_spouse_flow4.hpl - change_status_citizen_spouse_flow4_success.hpl - Y - Y - N - - - citizen_spouse_flow4.hpl - change_status_citizen_spouse_flow4_error.hpl - Y - N - N - - - citizen_spouse_flow5.hpl - change_status_citizen_spouse_flow5_success.hpl - Y - Y - N - - - citizen_spouse_flow5.hpl - change_status_citizen_spouse_flow5_error.hpl - Y - N - N - - - change_status_citizen_spouse_flow5_error.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - change_status_citizen_spouse_flow5_success.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - change_status_citizen_spouse_flow4_error.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - change_status_citizen_spouse_flow4_success.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - change_status_citizen_spouse_flow3_error.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - change_status_citizen_spouse_flow3_success.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - change_status_citizen_spouse_flow2_error.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - change_status_citizen_spouse_flow2_success.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - change_status_citizen_spouse_flow1_error.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - change_status_citizen_spouse_flow1_success.hpl - checkpoint_job_citizen_spouse.hpl - Y - N - Y - - - checkpoint_job_citizen_spouse.hpl - Success new citizen - Y - Y - N - - - checkpoint_job_citizen_spouse.hpl (2) - branching_citizen_spouse.hpl - Y - N - Y - - - Simple job_citizen_spouse_exists check NEW - checkpoint_job_citizen_spouse.hpl (2) - Y - N - N - - - citizen_spouse_flow1.hpl 2 - change_status_citizen_spouse_flow1_success.hpl 2 - Y - Y - N - - - citizen_spouse_flow1.hpl 2 - change_status_citizen_spouse_flow1_error.hpl 2 - Y - N - N - - - citizen_spouse_flow2.hpl 2 - change_status_citizen_spouse_flow2_success.hpl 2 - Y - Y - N - - - citizen_spouse_flow2.hpl 2 - change_status_citizen_spouse_flow2_error.hpl 2 - Y - N - N - - - citizen_spouse_flow3.hpl 2 - change_status_citizen_spouse_flow3_success.hpl 2 - Y - Y - N - - - citizen_spouse_flow3.hpl 2 - change_status_citizen_spouse_flow3_error.hpl 2 - Y - N - N - - - citizen_spouse_flow4.hpl 2 - change_status_citizen_spouse_flow4_success.hpl 2 - Y - Y - N - - - citizen_spouse_flow4.hpl 2 - change_status_citizen_spouse_flow4_error.hpl 2 - Y - N - N - - - citizen_spouse_flow5.hpl 2 - change_status_citizen_spouse_flow5_success.hpl 2 - Y - Y - N - - - citizen_spouse_flow5.hpl 2 - change_status_citizen_spouse_flow5_error.hpl 2 - Y - N - N - - - change_status_citizen_spouse_flow1_success.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - change_status_citizen_spouse_flow1_error.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - change_status_citizen_spouse_flow2_success.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - change_status_citizen_spouse_flow2_error.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - change_status_citizen_spouse_flow3_success.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - change_status_citizen_spouse_flow3_error.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - change_status_citizen_spouse_flow4_success.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - change_status_citizen_spouse_flow4_error.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - change_status_citizen_spouse_flow5_success.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - change_status_citizen_spouse_flow5_error.hpl 2 - checkpoint_job_citizen_spouse.hpl 2 - Y - N - Y - - - checkpoint_job_citizen_spouse.hpl 2 - Success new citizen 2 - Y - Y - 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 - - - Simple job_citizen_spouse_exists check NEW - recruitment_rows_five_flow_citizen_spouse.hpl - Y - Y - N - - - Simple citizen_spouse WHERE ERROR - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - Simple citizen_spouse WHERE SUCCESS - branching_citizen_spouse_delta.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_spouse.hpl (2) - change_status_to_processing_delta.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_spouse.hpl (2) - delta_citizen_spouse_flow.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_spouse.hpl (2) - Abort workflow 3 - Y - N - N - - - recruitment_rows_five_flow_citizen_spouse.hpl (2) - delta_citizen_spouse_flow.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_citizen_spouse.hpl (2) - delta_citizen_spouse_flow.hpl 3 - Y - Y - N - - - recruitment_rows_five_flow_citizen_spouse.hpl (2) - delta_citizen_spouse_flow.hpl 4 - Y - Y - N - - - recruitment_rows_five_flow_citizen_spouse.hpl (2) - delta_citizen_spouse_flow.hpl 5 - Y - Y - N - - - branching_citizen_spouse_delta.hpl - Simple delta_citizen_spouse WHERE ERROR - Y - Y - N - - - Simple delta_citizen_spouse WHERE ERROR - recruitment_rows_five_flow_citizen_spouse.hpl (2) - Y - Y - N - - - Simple delta_citizen_spouse WHERE ERROR - delta_citizen_spouse success 2 - Y - N - N - - - delta_citizen_spouse_flow.hpl - change_status_delta_citizen_spouse_flow1_success.hpl - Y - Y - N - - - delta_citizen_spouse_flow.hpl - change_status_delta_citizen_spouse_flow1_error.hpl - Y - N - N - - - change_status_delta_citizen_spouse_flow1_success.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - change_status_delta_citizen_spouse_flow1_error.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - change_status_delta_citizen_spouse_flow2_success.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - change_status_delta_citizen_spouse_flow2_error.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - change_status_delta_citizen_spouse_flow3_success.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - change_status_delta_citizen_spouse_flow3_error.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - change_status_delta_citizen_spouse_flow4_success.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - change_status_delta_citizen_spouse_flow4_error.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - change_status_delta_citizen_spouse_flow5_success.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - change_status_delta_citizen_spouse_flow5_error.hpl - checkpoint_job_citizen_spouse_delta.hpl - Y - N - Y - - - checkpoint_job_citizen_spouse_delta.hpl - citizen_spouse_delta success - Y - Y - N - - - delta_citizen_spouse_flow.hpl 2 - change_status_delta_citizen_spouse_flow2_success.hpl - Y - Y - N - - - delta_citizen_spouse_flow.hpl 2 - change_status_delta_citizen_spouse_flow2_error.hpl - Y - N - N - - - delta_citizen_spouse_flow.hpl 3 - change_status_delta_citizen_spouse_flow3_success.hpl - Y - Y - N - - - delta_citizen_spouse_flow.hpl 3 - change_status_delta_citizen_spouse_flow3_error.hpl - Y - N - N - - - delta_citizen_spouse_flow.hpl 4 - change_status_delta_citizen_spouse_flow4_success.hpl - Y - Y - N - - - delta_citizen_spouse_flow.hpl 4 - change_status_delta_citizen_spouse_flow4_error.hpl - Y - N - N - - - delta_citizen_spouse_flow.hpl 5 - change_status_delta_citizen_spouse_flow5_success.hpl - Y - Y - N - - - delta_citizen_spouse_flow.hpl 5 - change_status_delta_citizen_spouse_flow5_error.hpl - Y - N - N - - - branching_citizen_spouse.hpl - Simple citizen_spouse WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_citizen_spouse.hpl - change_status_to_processing.hpl - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - change_status_to_processing.hpl 2 - Y - Y - N - - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 72 - 1088 - 176 - 0001-01-01 00:00:00 - -3001-01-01 00:00:00 - - 114 - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/job_spouse.hwf b/mappings/info_recruits/citizen_tables/citizen_spouse/job_spouse.hwf new file mode 100644 index 0000000..52a8cd1 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/job_spouse.hwf @@ -0,0 +1,271 @@ + + + job_citizen_spouse + Y + + + + 0 + - + 2025/06/05 14:27:15.055 + - + 2025/06/05 14:27:15.055 + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 416 + 208 + + + + check_if_citizen_spouse_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_citizen_spouse_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 608 + 208 + + + + citizen_spouse_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 880 + 208 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl + + + Basic + + Y + + N + local + N + N + Y + Y + 1120 + 208 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_on_error.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 1120 + 512 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/check_if_need_to_repeat_job.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 880 + 368 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 880 + 512 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 880 + 704 + + + + + + Start + check_if_citizen_spouse_job_exists.hpl + Y + Y + Y + + + check_if_citizen_spouse_job_exists.hpl + citizen_spouse_job_exists_check + Y + Y + N + + + citizen_spouse_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + citizen_spouse_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl index 56dfa09..b52b734 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl @@ -7,39 +7,43 @@ Normal - 0 N 1000 100 - - 2025/05/21 14:05:02.260 + 2025/08/05 14:31:22.799 - - 2025/05/21 14:05:02.260 + 2025/08/05 14:31:22.799 - - Select values 4 2 - Get variables - N - Table input - Insert / update + Table output Y - Table input - Select values 4 2 - N + Table output + Change job status on success + Y + + + Create job execution record + Table input + Y + + + Table output + Change job status on error + Y - Get variables - GetVariable + Change job status on error + ExecSql Y @@ -48,134 +52,33 @@ none - - - -1 - recruitment_id - -1 - none - String - ID_F1 - - - - - 976 - 400 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 + + + error_description + + 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 + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + - 976 - 272 + 992 + 512
- Select values 4 2 - SelectValues + Change job status on success + ExecSql Y @@ -184,30 +87,53 @@ none - - N - - ID_F1 - ID_F1 - String - -2 - -2 - - false - - - false - - - - - - - + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + - 720 - 400 + 992 + 320 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 @@ -223,7 +149,7 @@ ervu-dashboard N - 0 + SELECT r.recruit_id, supr->>'id' AS spouse_external_id, @@ -260,25 +186,126 @@ CROSS JOIN LATERAL ( WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' ) AS supr(supr) WHERE - '${RECRUITMENT_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' - AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'; + Y - 480 - 272 + 496 + 320 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + spouse_external_id + spouse_external_id + + + spouse_id_ern + spouse_id_ern + + + kinship_type + kinship_type + + + last_name + last_name + + + first_name + first_name + + + middle_name + middle_name + + + full_name + full_name + + + birth_date + birth_date + + + death_date + death_date + + + death_az_number + death_az_number + + + marriage_az_number + marriage_az_number + + + marriage_date + marriage_date + + + divorce_az_number + divorce_az_number + + + divorce_date + divorce_date + + + information_excluded + information_excluded + + + N + N + N + N + + Y + + N + ervu_dashboard + Y + citizen_spouse
+ + N + Y + N + Y + + + 720 + 320
- Select values 4 2 - Get variables + Table output + Change job status on error Y - + error_description - + error_code diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl similarity index 60% rename from mappings/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl rename to mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl index 5f8d28a..43fcefd 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/delta_citizen_spouse_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl @@ -1,7 +1,7 @@ - delta_citizen_spouse_flow + citizen_spouse_flow_delta Y @@ -13,24 +13,141 @@ 1000 100 - - 2025/06/03 16:10:48.509 + 2025/08/11 13:22:56.048 - - 2025/06/03 16:10:48.509 + 2025/08/11 13:22:56.048 + + Create job execution record + Table input + Y + + + Insert / update + Change job status on error + Y + + + Insert / update + Change job status on success + Y + Table input Insert / update Y + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + error_code + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + + 976 + 416 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 976 + 224 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + Insert / update InsertUpdate - Y + N 1 @@ -44,11 +161,13 @@ = recruit_id recruit_id + = spouse_external_id spouse_external_id + ervu_dashboard citizen_spouse
@@ -58,38 +177,13 @@ N - birth_date - birth_date - Y + spouse_external_id + spouse_external_id + N - 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 + spouse_id_ern + spouse_id_ern Y @@ -102,6 +196,36 @@ last_name Y + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + full_name + full_name + Y + + + birth_date + birth_date + Y + + + death_date + death_date + Y + + + death_az_number + death_az_number + Y + marriage_az_number marriage_az_number @@ -113,33 +237,33 @@ Y - middle_name - middle_name + divorce_az_number + divorce_az_number Y - spouse_external_id - spouse_external_id - N + divorce_date + divorce_date + Y - spouse_id_ern - spouse_id_ern + information_excluded + information_excluded Y N - 1024 - 352 + 736 + 224
Table input TableInput - Y + N 1 @@ -148,7 +272,7 @@ ervu-dashboard N - 0 + SELECT r.recruit_id, supr->>'id' AS spouse_external_id, @@ -184,19 +308,30 @@ CROSS JOIN LATERAL ( FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' ) AS supr(supr) -WHERE - r.update_date >= '${M_R_UP_DATE}'::timestamp - AND '${RECRUITMENT_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}' - AND'${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; +WHERE + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'; + Y - 624 - 352 + 544 + 224 + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl new file mode 100644 index 0000000..de73f72 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl @@ -0,0 +1,348 @@ + + + + citizen_spouse_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Insert / update + Y + + + Insert / update + Change job status on success + Y + + + Insert / update + Change job status on error + Y + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + error_code + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + + 976 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 976 + 208 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + 272 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + + = + spouse_external_id + spouse_external_id + + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + full_name + full_name + Y + + + birth_date + birth_date + Y + + + death_date + death_date + Y + + + death_az_number + death_az_number + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + divorce_az_number + divorce_az_number + Y + + + divorce_date + divorce_date + Y + + + information_excluded + information_excluded + Y + +
+ N + + + 704 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + + SELECT + r.recruit_id, + supr->>'id' AS spouse_external_id, + NULLIF(supr->>'idERN', '') AS spouse_id_ern, + NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, + supr->'svedFLBS'->'fio'->>'familiya' AS last_name, + supr->'svedFLBS'->'fio'->>'imya' AS first_name, + supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name, + CONCAT_WS(' ', + supr->'svedFLBS'->'fio'->>'familiya', + supr->'svedFLBS'->'fio'->>'imya', + supr->'svedFLBS'->'fio'->>'otchestvo' + ) AS full_name, + MAKE_DATE( + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz', '')::int, + NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den', '')::int + ) AS birth_date, + (supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date, + supr->'svedSmert'->>'nomerZapis' AS death_az_number, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date, + ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number, + (ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date, + CASE + WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true + ELSE false + END AS information_excluded +FROM ervu_dashboard.citizen r +JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +CROSS JOIN LATERAL ( + SELECT supri + FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri + WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' +) AS supr(supr) + + Y + + + 480 + 208 + + + + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..b93cfb4 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + citizen_spouse_flow_delta.hpl + Y + + + Table input + citizen_spouse_flow_delta.hpl 2 + Y + + + Table input + citizen_spouse_flow_delta.hpl 3 + Y + + + Table input + citizen_spouse_flow_delta.hpl 4 + Y + + + Table input + citizen_spouse_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_spouse_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + citizen_spouse_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 128 + + + + citizen_spouse_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + citizen_spouse_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + citizen_spouse_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + citizen_spouse_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..e97ff56 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + citizen_spouse_flow_repeat.hpl + Y + + + Table input + citizen_spouse_flow_repeat.hpl 3 + Y + + + Table input + citizen_spouse_flow_repeat.hpl 2 + Y + + + Table input + citizen_spouse_flow_repeat.hpl 4 + Y + + + Table input + citizen_spouse_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_spouse_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + citizen_spouse_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 208 + + + + citizen_spouse_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 288 + + + + citizen_spouse_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 368 + + + + citizen_spouse_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 448 + + + + citizen_spouse_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl deleted file mode 100644 index f9d21f7..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl +++ /dev/null @@ -1,185 +0,0 @@ - - - - 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 -fr_check AS ( - SELECT - last_recruitment_id AS recruitment_id, - recruitment_created_date, - status, - job_name - FROM public.etl_checkpoints - WHERE status = 'ERROR' AND job_name IN ('citizen_spouse_flow1', 'citizen_spouse_flow2', 'citizen_spouse_flow3', 'citizen_spouse_flow4', 'citizen_spouse_flow5') -), -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 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow1') THEN created_at END) AS cr_flow1, - MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow1') THEN idm_id::text END) AS idm_flow1, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow2') THEN created_at END) AS cr_flow2, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow2') THEN idm_id::text END) AS idm_flow2, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow3') THEN created_at END) AS cr_flow3, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow3') THEN idm_id::text END) AS idm_flow3, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow4') THEN created_at END) AS cr_flow4, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow4') THEN idm_id::text END) AS idm_flow4, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow5') THEN created_at END) AS cr_flow5, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_spouse_flow5') THEN idm_id::text END) AS idm_flow5 - FROM splitted - GROUP BY position -), -remains as ( - SELECT - position, - 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 - WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) - OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) - OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) - OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) - OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) - order by position -), -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/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl new file mode 100644 index 0000000..e8188e7 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl @@ -0,0 +1,356 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + citizen_spouse_flow.hpl + Y + + + Get all recruitments ordered by created_date + citizen_spouse_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + citizen_spouse_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + citizen_spouse_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + citizen_spouse_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 432 + 304 + + + + citizen_spouse_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + citizen_spouse_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + citizen_spouse_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + citizen_spouse_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + citizen_spouse_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_spouse_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 464 + + + + + + From fa8d92de9a2c0468c7219684dcc011fa1c217927 Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Wed, 13 Aug 2025 16:38:40 +0300 Subject: [PATCH 15/34] ERVU-504: save --- .../citizen_tables/child/job_child.hwf | 8 - .../child/parallel/child_flow.hpl | 125 ++++-- .../child/parallel/child_flow_delta.hpl | 133 ++++--- .../child/parallel/child_flow_repeat.hpl | 276 ++++++------- .../child/recruitment_five_flow_on_error.hpl | 2 +- .../child/recruitments_five_flow.hpl | 22 +- .../parallel/citizen_guardianship_flow.hpl | 364 ++++++++++++++++-- .../citizen_guardianship_flow_delta.hpl | 65 ++-- .../citizen_guardianship_flow_repeat.hpl | 114 +++--- .../parallel/citizen_spouse_flow.hpl | 6 +- .../parallel/citizen_spouse_flow_delta.hpl | 27 +- .../parallel/citizen_spouse_flow_repeat.hpl | 16 +- .../recruitment_five_flow_delta.hpl | 2 +- .../recruitment_five_flow_on_error.hpl | 2 +- .../citizen_spouse/recruitments_five_flow.hpl | 2 +- 15 files changed, 794 insertions(+), 370 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/child/job_child.hwf b/mappings/info_recruits/citizen_tables/child/job_child.hwf index 2df098f..997b5e5 100644 --- a/mappings/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings/info_recruits/citizen_tables/child/job_child.hwf @@ -96,8 +96,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruitments_five_flow.hpl - - Basic Y @@ -124,8 +122,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl - - Basic Y @@ -152,8 +148,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/check_if_need_to_repeat_job.hpl - - Basic Y @@ -197,8 +191,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruitment_five_flow_delta.hpl - - Basic Y diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl index d1a2877..1aa645f 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl @@ -21,43 +21,73 @@
- Table input + Create job execution record + Table input + Y + + + Table input Table output Y - Table output - Change job status on success + Group by 2 + User defined Java expression 2 Y - Create job execution record - Table input + Update 2 + Change job status on success + Y + + + User defined Java expression 2 + Update 2 Y Table output - Change job status on error + Change job status on error Y - Group by - User defined Java expression - Y - - - User defined Java expression - Update + Update 2 + Change job status on error Y Table output - Group by + Group by 2 + Y + + + Change job status on error + Abort Y - Change job status on error + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1232 + 800 + + + + Change job status on error ExecSql Y @@ -87,12 +117,12 @@ and recruitment_id = '${IDM_ID}'; - 992 - 512 + 1040 + 800 - Change job status on success + Change job status on success ExecSql Y @@ -111,19 +141,20 @@ and recruitment_id = '${IDM_ID}'; N N UPDATE etl.job_execution -SET status = 'SUCCESS' +SET status = 'SUCCESS', + error_description = null WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 992 - 320 + 1344 + 480 - Create job execution record + Create job execution record ExecSql Y @@ -148,14 +179,14 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); 288 - 320 + 800 - Group by + Group by 2 GroupBy - N + Y 1 @@ -192,15 +223,15 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); grp - 688 - 176 + 704 + 480 - Table input + Table input TableInput - N + Y 1 @@ -253,14 +284,14 @@ CROSS JOIN LATERAL ( ) AS death_date ) AS dates WHERE - '${IDM_ID}' != '' + '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y 496 - 320 + 800 @@ -334,19 +365,19 @@ WHERE N ervu_dashboard Y - citizen_child
+ citizen_childss
N Y N Y - 720 - 320 + 704 + 800
- Update + Update 2 Update Y @@ -384,12 +415,12 @@ WHERE Y - 912 - 0 + 1040 + 480 - User defined Java expression + User defined Java expression 2 Janino Y @@ -425,14 +456,26 @@ WHERE - 816 - 80 + 880 + 480 Table output - Change job status on error + Change job status on error + Y + + error_description + + error_code + + + + + + Update 2 + Change job status on error Y error_description diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl index 14baba4..7359c83 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl @@ -20,44 +20,49 @@ - - Create job execution record - Table input - Y - Group by User defined Java expression Y - User defined Java expression - Update + Insert / update + Change job status on error Y - Insert / update - Change job status on error - Y - - - Insert / update - Change job status on success - Y - - - Table input - Insert / update - Y - - - Insert / update + Insert / update Group by Y + + Table input 2 + Insert / update + Y + + + Update + Change job status on error + Y + + + Update + Change job status on success + Y + + + User defined Java expression + Update + Y + + + Create job execution record + Table input 2 + Y + - Change job status on error + Change job status on error ExecSql Y @@ -71,31 +76,32 @@ error_description - - error_code - ervu-dashboard + Y + N + Y - Y + N N UPDATE etl.job_execution -SET status = 'ERROR', +SET status = 'DELTA_ERROR', error_description = ? WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; + - 1040 - 416 + 1376 + 224 - Change job status on success + Change job status on success ExecSql Y @@ -108,21 +114,25 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard + Y + N + Y N N UPDATE etl.job_execution -SET status = 'SUCCESS' +SET status = 'DELTA_SUCCESS', + error_description = null WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - + and recruitment_id = '${IDM_ID}'; + - 1040 - 224 + 1744 + 0 @@ -147,8 +157,7 @@ and recruitment_id = '${IDM_ID}'; UPDATE etl.job_execution SET status = 'DELTA_PROCESSING', - execution_datetime = DEFAULT, - error_description = NULL + execution_datetime = DEFAULT where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; @@ -161,7 +170,7 @@ and recruitment_id = '${IDM_ID}'; Group by GroupBy - N + Y 1 @@ -198,15 +207,15 @@ and recruitment_id = '${IDM_ID}'; grp - 624 - 112 + 784 + 0 - Insert / update + Insert / update InsertUpdate - N + Y 1 @@ -220,13 +229,11 @@ and recruitment_id = '${IDM_ID}'; = recruit_id recruit_id - = child_external_id child_external_id - ervu_dashboard citizen_child
@@ -294,15 +301,15 @@ and recruitment_id = '${IDM_ID}'; N - 768 + 784 224
- Table input + Table input 2 TableInput - N + Y 1 @@ -355,18 +362,18 @@ CROSS JOIN LATERAL ( ) AS death_date ) AS dates WHERE - '${IDM_ID}' != '' + '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y - 544 + 496 224 - Update + Update Update Y @@ -404,7 +411,7 @@ WHERE Y - 960 + 1376 0 @@ -445,14 +452,26 @@ WHERE - 688 - 16 + 976 + 0 - Insert / update - Change job status on error + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + Update + Change job status on error Y error_description diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl index c7ab59f..3685fd0 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl @@ -20,11 +20,6 @@ - - Create job execution record - Table input - Y - Group by User defined Java expression @@ -36,28 +31,38 @@ Y - Table input - Insert / update + Create job execution record 2 + Table input 2 Y - Insert / update + Update Change job status on success Y - Insert / update - Change job status on error + Update + Change job status on error 2 Y - Insert / update + Table input 2 + Insert / update + Y + + + Insert / update + Change job status on error 2 + Y + + + Insert / update Group by Y - Change job status on error + Change job status on error 2 ExecSql Y @@ -71,13 +76,13 @@ error_description - - error_code - ervu-dashboard + Y + N + Y Y N @@ -87,12 +92,12 @@ SET status = 'ERROR', WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - + 976 - 400 + 432 @@ -115,19 +120,20 @@ and recruitment_id = '${IDM_ID}'; N N UPDATE etl.job_execution -SET status = 'SUCCESS' +SET status = 'SUCCESS', +error_description = null WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 976 - 208 + 1200 + 0 - Create job execution record + Create job execution record 2 ExecSql Y @@ -165,11 +171,11 @@ ON CONFLICT (job_name, recruitment_id) DO UPDATE SET status = 'PROCESSING', execution_datetime = DEFAULT, - error_description = NULL + error_description = NULL; - 272 - 208 + 0 + 432 @@ -213,109 +219,15 @@ DO UPDATE SET grp - 576 - 112 + 512 + 176 - Insert / update - InsertUpdate - - N - - 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 - - - 704 - 208 - -
- - Table input + Table input 2 TableInput - N + Y 1 @@ -368,14 +280,12 @@ CROSS JOIN LATERAL ( ) AS death_date ) AS dates WHERE - '${IDM_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y - 480 - 208 + 288 + 432 @@ -462,10 +372,106 @@ WHERE 0 + + Insert / update + InsertUpdate + + N + + 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 + + + 512 + 432 + +
- Insert / update - Change job status on error + Update + Change job status on error 2 Y error_description @@ -475,6 +481,18 @@ WHERE + + Insert / update + Change job status on error 2 + Y + + + + + + + + diff --git a/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl index 5f0b1c6..d9d0f7a 100644 --- a/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl +++ b/mappings/info_recruits/citizen_tables/child/recruitment_five_flow_on_error.hpl @@ -59,7 +59,7 @@ ervu-dashboard N - 0 + SELECT r.idm_id as recruitment_id FROM ervu_dashboard.recruitment r diff --git a/mappings/info_recruits/citizen_tables/child/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/child/recruitments_five_flow.hpl index 069932a..57195c7 100644 --- a/mappings/info_recruits/citizen_tables/child/recruitments_five_flow.hpl +++ b/mappings/info_recruits/citizen_tables/child/recruitments_five_flow.hpl @@ -59,7 +59,7 @@ ervu-dashboard N - 0 + SELECT idm_id AS recruitment FROM ervu_dashboard.recruitment; @@ -101,7 +101,7 @@ FROM ervu_dashboard.recruitment; Y
- + Change job status on success ExecutionTime ExecutionResult ExecutionNrErrors @@ -116,7 +116,7 @@ FROM ervu_dashboard.recruitment; ExecutionExitStatus ExecutionLogText ExecutionLogChannelId - + Change job status on success FileName @@ -157,7 +157,7 @@ FROM ervu_dashboard.recruitment; Y
- + Change job status on success 2 ExecutionTime ExecutionResult ExecutionNrErrors @@ -172,7 +172,7 @@ FROM ervu_dashboard.recruitment; ExecutionExitStatus ExecutionLogText ExecutionLogChannelId - + Change job status on success 2 FileName @@ -213,7 +213,7 @@ FROM ervu_dashboard.recruitment; Y - + Change job status on success 4 ExecutionTime ExecutionResult ExecutionNrErrors @@ -228,7 +228,7 @@ FROM ervu_dashboard.recruitment; ExecutionExitStatus ExecutionLogText ExecutionLogChannelId - + Change job status on success 3 FileName @@ -269,7 +269,7 @@ FROM ervu_dashboard.recruitment; Y - + Change job status on success 4 ExecutionTime ExecutionResult ExecutionNrErrors @@ -284,7 +284,7 @@ FROM ervu_dashboard.recruitment; ExecutionExitStatus ExecutionLogText ExecutionLogChannelId - + Change job status on success 4 FileName @@ -325,7 +325,7 @@ FROM ervu_dashboard.recruitment; Y - + Change job status on success 5 ExecutionTime ExecutionResult ExecutionNrErrors @@ -340,7 +340,7 @@ FROM ervu_dashboard.recruitment; ExecutionExitStatus ExecutionLogText ExecutionLogChannelId - + Change job status on success 5 FileName diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl index 6786c4d..b12c5a0 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl @@ -25,11 +25,6 @@ Table output Y - - Table output - Change job status on success - Y - Create job execution record Table input @@ -40,21 +35,31 @@ Change job status on error Y - - Add constants - Update - Y - Group by Add constants Y + + Add constants + Update + Y + + + Update + Change job status on success 2 + Y + Table output Group by Y + + Update + Change job status on error + Y + Add constants @@ -79,7 +84,7 @@ - 608 + 1088 0 @@ -100,11 +105,8 @@ ervu-dashboard - Y - N - Y Y N @@ -115,15 +117,49 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 992 - 512 + 1280 + 320 - Change job status on success + Change job status on error 2 + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1120 + 976 + + + + Change job status on success 2 ExecSql Y @@ -149,8 +185,8 @@ and recruitment_id = '${IDM_ID}'; - 992 - 320 + 1584 + 0 @@ -182,11 +218,40 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); 320 + + Create job execution record 2 + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 368 + 976 + + Group by GroupBy - N + Y 1 @@ -208,7 +273,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); grp - 496 + 720 0 @@ -216,7 +281,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); Table input TableInput - N + Y 1 @@ -257,11 +322,111 @@ WHERE 320 + + Table input 2 + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 10 + WITH trud_info AS (SELECT ri.info, + ri.recruit_id::uuid, + + CASE + WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL + WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' THEN + ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 + END AS trud_deyat, + + CASE + WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL + WHEN + jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb') = + 'array' THEN + ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb' -> 0 + END AS parental_leave_info, + + COALESCE( + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat', + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' + ) AS employer, + + CASE + WHEN ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' IS NULL THEN NULL + WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP') = 'array' + THEN + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 + ELSE + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' + END AS reg_ip, + + COALESCE( + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD', + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' + ) AS self_employment + + FROM ervu_dashboard.recruits_info ri + +) +SELECT ti.recruit_id::uuid, + (ti.trud_deyat ->> 'dataMeropr')::date AS personnel_event_date, + ti.trud_deyat ->> 'naimTipKadrMeropr' AS personnel_event_type, + (ti.trud_deyat ->> 'prAktMestRab' = '1') AS current_workplace, + ti.trud_deyat ->> 'trudFunkcziya' AS position, + ti.trud_deyat -> 'svedOrg' ->> 'naimOrg' AS employer_name, + ti.employer -> 'svedYUL' ->> 'kpp' AS employer_kpp, + CASE + WHEN ti.employer->'svedYUL' IS NOT NULL THEN 'Юридическое лицо' + WHEN ti.employer->'svedIP' IS NOT NULL THEN 'Индивидуальный предприниматель' + END AS employer_category, + COALESCE( + ti.employer -> 'svedYUL' ->> 'innyul', + ti.employer -> 'svedIP' ->> 'innyfl' + ) AS employer_inn, + ti.employer -> 'svedYUL' -> 'svedOPK' ->> 'region' AS employer_address, + COALESCE( + ti.employer -> 'svedIP' ->> 'ogrnip', + ti.employer -> 'svedYUL' -> 'extend' ->> 'ogrn' + ) AS employer_ogrnip, + ti.employer -> 'extend' ->> 'tipPodrazdRabotodat' AS employer_unit_type, + ti.employer -> 'extend' ->> 'adresPodrazdRabotodat' AS employer_unit_address, + (ti.parental_leave_info ->> 'dataNachUhodReb')::date AS parental_leave_start_date, + (ti.parental_leave_info ->> 'dataKonUhodReb')::date AS parental_leave_end_date, + ( + (ti.parental_leave_info ->> 'dataNachUhodReb')::date <= current_date AND + ( + (ti.parental_leave_info ->> 'dataKonUhodReb') IS NULL OR + (ti.parental_leave_info ->> 'dataKonUhodReb')::date > current_date + ) + ) AS parental_leave_active, + (ti.reg_ip ->> 'dataRegIP')::date AS reg_ip_date, + (ti.reg_ip ->> 'dataINNNed')::date AS dereg_ip_date, + ti.reg_ip ->> 'ogrnip' AS ogrnip_ip, + ti.reg_ip IS NOT NULL AS active_ip, + ti.self_employment ->> 'dataUchNPD' AS reg_self_employment_date, + ti.self_employment ->> 'dataSnUchNPD' AS dereg_self_employment_date, + ti.self_employment IS NOT NULL AS active_self_employment +FROM trud_info ti; + + Y + + + 576 + 976 + + Table output TableOutput - N + Y 1 @@ -312,14 +477,11 @@ WHERE N N N - Y - N ervu_dashboard Y citizen_guardianship
- N Y N @@ -330,6 +492,128 @@ WHERE 320
+ + Table output 2 + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + personnel_event_date + personnel_event_date + + + personnel_event_type + personnel_event_type + + + position + position + + + employer_name + employer_name + + + employer_kpp + employer_kpp + + + employer_category + employer_category + + + employer_inn + employer_inn + + + employer_address + employer_address + + + employer_ogrnip + employer_ogrnip + + + employer_unit_type + employer_unit_type + + + employer_unit_address + employer_unit_address + + + parental_leave_start_date + parental_leave_start_date + + + parental_leave_end_date + parental_leave_end_date + + + parental_leave_active + parental_leave_active + + + reg_ip_date + reg_ip_date + + + dereg_ip_date + dereg_ip_date + + + ogrnip_ip + ogrnip_ip + + + active_ip + active_ip + + + reg_self_employment_date + reg_self_employment_date + + + dereg_self_employment_date + dereg_self_employment_date + + + active_self_employment + active_self_employment + + + N + N + N + N + Y + N + ervu_dashboard + Y + citizen_work_activity
+ N + Y + N + Y + + + 800 + 976 + +
Update Update @@ -361,7 +645,7 @@ WHERE Y - 704 + 1280 0 @@ -378,6 +662,30 @@ WHERE + + Table output 2 + Change job status on error 2 + Y + + error_description + + error_code + + + + + + Update + Change job status on error + Y + + error_description + + error_code + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl index e5d5f9f..3f159cf 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl @@ -40,11 +40,6 @@ Change job status on error Y - - Insert / update - Change job status on success - Y - Table input Insert / update @@ -55,6 +50,16 @@ Group by Y + + Update + Change job status on success + Y + + + Update + Change job status on error + Y + Add constants @@ -79,8 +84,8 @@ - 960 - 64 + 848 + 0 @@ -109,17 +114,16 @@ Y N UPDATE etl.job_execution -SET status = 'ERROR', +SET status = 'DELTA_ERROR', error_description = ? WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 976 - 416 + 992 + 224 @@ -142,15 +146,15 @@ and recruitment_id = '${IDM_ID}'; N N UPDATE etl.job_execution -SET status = 'SUCCESS' +SET status = 'DELTA_SUCCESS', + error_description = null WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - + and recruitment_id = '${IDM_ID}'; - 976 - 224 + 1168 + 0 @@ -175,8 +179,7 @@ and recruitment_id = '${IDM_ID}'; UPDATE etl.job_execution SET status = 'DELTA_PROCESSING', - execution_datetime = DEFAULT, - error_description = NULL + execution_datetime = DEFAULT where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; @@ -189,7 +192,7 @@ and recruitment_id = '${IDM_ID}'; Group by GroupBy - N + Y 1 @@ -211,15 +214,15 @@ and recruitment_id = '${IDM_ID}'; grp - 848 - 112 + 704 + 0 Insert / update InsertUpdate - N + Y 1 @@ -298,7 +301,7 @@ and recruitment_id = '${IDM_ID}'; Table input TableInput - N + Y 1 @@ -370,8 +373,8 @@ WHERE Y - 1056 - 32 + 992 + 0 @@ -387,6 +390,18 @@ WHERE + + Update + Change job status on error + Y + + error_description + + error_code + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl index ca7293b..3b69733 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl @@ -30,11 +30,6 @@ Insert / update Y - - Insert / update - Change job status on success - Y - Insert / update Change job status on error @@ -51,8 +46,18 @@ Y - Group by - Table input + Update + Change job status on success + Y + + + Update + Change job status on error + Y + + + Insert / update + Group by Y @@ -118,38 +123,7 @@ and recruitment_id = '${IDM_ID}'; - 976 - 400 - - - - Change job status on success - ExecSql - - Y - - 1 - - none - - - - - ervu-dashboard - Y - N - Y - N - N - UPDATE etl.job_execution -SET status = 'SUCCESS' -WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - - - - - 976 + 1232 208 @@ -167,8 +141,11 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard + N + N + Y N N @@ -193,6 +170,7 @@ DO UPDATE SET status = 'PROCESSING', execution_datetime = DEFAULT, error_description = NULL + 272 @@ -203,7 +181,7 @@ DO UPDATE SET Group by GroupBy - N + Y 1 @@ -225,15 +203,15 @@ DO UPDATE SET grp - 848 - 96 + 704 + 48 Insert / update InsertUpdate - N + Y 1 @@ -312,7 +290,7 @@ DO UPDATE SET Table input TableInput - N + Y 1 @@ -321,7 +299,6 @@ DO UPDATE SET ervu-dashboard N - SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, @@ -385,8 +362,39 @@ WHERE Y - 1056 - 16 + 1232 + 48 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1456 + 48 @@ -402,6 +410,18 @@ WHERE + + Update + Change job status on error + Y + + error_description + + error_code + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl index b52b734..a7fe488 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl @@ -140,7 +140,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); Table input TableInput - N + Y 1 @@ -149,7 +149,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); ervu-dashboard N - SELECT r.recruit_id, supr->>'id' AS spouse_external_id, @@ -279,14 +278,11 @@ WHERE N N N - Y - N ervu_dashboard Y citizen_spouse
- N Y N diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl index 43fcefd..218a828 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl @@ -61,19 +61,22 @@ ervu-dashboard + Y + N + Y Y N UPDATE etl.job_execution -SET status = 'ERROR', +SET status = 'DELTA_ERROR', error_description = ? WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - + 976 @@ -94,17 +97,21 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard + Y + N + Y N N UPDATE etl.job_execution -SET status = 'SUCCESS' +SET status = 'DELTA_SUCCESS', + error_description = null WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - + and recruitment_id = '${IDM_ID}'; + 976 @@ -125,18 +132,21 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard + N + N + Y N N UPDATE etl.job_execution SET status = 'DELTA_PROCESSING', - execution_datetime = DEFAULT, - error_description = NULL + execution_datetime = DEFAULT where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; + 336 @@ -161,13 +171,11 @@ and recruitment_id = '${IDM_ID}';
= recruit_id recruit_id - = spouse_external_id spouse_external_id - ervu_dashboard citizen_spouse
@@ -272,7 +280,6 @@ and recruitment_id = '${IDM_ID}';
ervu-dashboard N - SELECT r.recruit_id, supr->>'id' AS spouse_external_id, diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl index de73f72..8a1296f 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl @@ -61,8 +61,11 @@ ervu-dashboard + Y + N + Y Y N @@ -72,8 +75,8 @@ SET status = 'ERROR', WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - + 976 @@ -94,17 +97,23 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard + Y + N + Y N N UPDATE etl.job_execution -SET status = 'SUCCESS' +SET status = 'SUCCESS', +error_description = null WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; + + 976 @@ -175,13 +184,11 @@ DO UPDATE SET = recruit_id recruit_id - = spouse_external_id spouse_external_id - ervu_dashboard citizen_spouse
@@ -286,7 +293,6 @@ DO UPDATE SET
ervu-dashboard N - SELECT r.recruit_id, supr->>'id' AS spouse_external_id, diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_delta.hpl index b93cfb4..a89ab4b 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_delta.hpl @@ -59,7 +59,7 @@ ervu-dashboard N - 0 + SELECT r.idm_id as recruitment_id FROM ervu_dashboard.recruitment r diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_on_error.hpl index e97ff56..b0ef287 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_on_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_five_flow_on_error.hpl @@ -59,7 +59,7 @@ ervu-dashboard N - 0 + SELECT r.idm_id as recruitment_id FROM ervu_dashboard.recruitment r diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl index e8188e7..6dccdb6 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl @@ -59,7 +59,7 @@ ervu-dashboard N - 0 + SELECT idm_id AS recruitment FROM ervu_dashboard.recruitment; From 346efdbd8a8995bf0d324328b52b2e8bb0d1f178 Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Thu, 14 Aug 2025 13:41:55 +0300 Subject: [PATCH 16/34] =?UTF-8?q?ERVU-504:=20=D0=BA=D1=80=D0=B0=D1=81?= =?UTF-8?q?=D0=BE=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../child/parallel/child_flow.hpl | 176 ++++++-- .../child/parallel/child_flow_delta.hpl | 169 ++++++-- .../child/parallel/child_flow_repeat.hpl | 383 ++++++++++++------ .../citizen_guardianship/job_guardianship.hwf | 17 +- .../parallel/citizen_guardianship_flow.hpl | 209 ++++++++-- .../citizen_guardianship_flow_delta.hpl | 146 ++++++- .../citizen_guardianship_flow_repeat.hpl | 213 +++++++--- .../parallel/citizen_spouse_flow.hpl | 153 ++++++- .../parallel/citizen_spouse_flow_delta.hpl | 140 ++++++- .../parallel/citizen_spouse_flow_repeat.hpl | 147 ++++++- 10 files changed, 1398 insertions(+), 355 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl index 1aa645f..5ddaae7 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl @@ -25,6 +25,41 @@ Table input Y + + User defined Java expression 2 + Update 2 + Y + + + Update 2 + Change job status on error + Y + + + Change job status on error + Abort + Y + + + Update 2 + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Update 2 + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + Table input Table output @@ -32,39 +67,24 @@ Group by 2 + Identify last row in a stream + Y + + + Identify last row in a stream User defined Java expression 2 Y - - Update 2 - Change job status on success - Y - - - User defined Java expression 2 - Update 2 - Y - Table output Change job status on error Y - - Update 2 - Change job status on error - Y - Table output Group by 2 Y - - Change job status on error - Abort - Y - Abort @@ -82,8 +102,8 @@ 0 - 1232 - 800 + 1216 + 1024 @@ -117,7 +137,7 @@ and recruitment_id = '${IDM_ID}'; - 1040 + 1216 800 @@ -149,8 +169,8 @@ and recruitment_id = '${IDM_ID}'; - 1344 - 480 + 1744 + 608 @@ -178,10 +198,63 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 288 + 112 800 + + Detect empty stream + DetectEmptyStream + + N + + 1 + + none + + + + + 1568 + 480 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1392 + 608 + + Group by 2 GroupBy @@ -201,16 +274,19 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); minors_count_raw is_minor SUM + has_minor_child_raw is_minor MAX + has_dead_child_raw is_dead MAX + N @@ -220,10 +296,29 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N + grp - 704 + 560 + 480 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 784 480 @@ -284,13 +379,14 @@ CROSS JOIN LATERAL ( ) AS death_date ) AS dates WHERE - '${IDM_ID}' != '' + '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND ri.recruit_id = '6eec41c4-1bd6-417e-a239-562b14b199c9' AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y - 496 + 304 800 @@ -365,14 +461,14 @@ WHERE N ervu_dashboard Y - citizen_childss
+ citizen_child
N Y N Y - 704 + 560 800 @@ -380,7 +476,7 @@ WHERE Update 2 Update - Y + N 1 @@ -415,7 +511,7 @@ WHERE Y - 1040 + 1216 480 @@ -456,11 +552,23 @@ WHERE - 880 + 1024 480 + + Create job execution record + Change job status on error + N + + + + + + + + Table output Change job status on error diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl index 7359c83..e4f1397 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl @@ -20,11 +20,6 @@ - - Group by - User defined Java expression - Y - Insert / update Change job status on error @@ -35,21 +30,11 @@ Group by Y - - Table input 2 - Insert / update - Y - Update Change job status on error Y - - Update - Change job status on success - Y - User defined Java expression Update @@ -60,7 +45,67 @@ Table input 2 Y + + Update + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Update + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + Table input 2 + Insert / update + Y + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 400 + + Change job status on error ExecSql @@ -78,11 +123,8 @@ ervu-dashboard - Y - N - Y N N @@ -93,7 +135,6 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 1376 @@ -114,11 +155,8 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard - Y - N - Y N N @@ -126,12 +164,12 @@ and recruitment_id = '${IDM_ID}'; SET status = 'DELTA_SUCCESS', error_description = null WHERE job_name = '${JOB_NAME}' - and recruitment_id = '${IDM_ID}'; + and recruitment_id = '${IDM_ID}' +and status = 'DELTA_PROCESSING'; - - 1744 + 1872 0 @@ -162,10 +200,63 @@ where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 336 + 288 224 + + Detect empty stream + DetectEmptyStream + + N + + 1 + + none + + + + + 1616 + 144 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1616 + 0 + + Group by GroupBy @@ -185,16 +276,19 @@ and recruitment_id = '${IDM_ID}'; minors_count_raw is_minor SUM + has_minor_child_raw is_minor MAX + has_dead_child_raw is_dead MAX + N @@ -204,6 +298,7 @@ and recruitment_id = '${IDM_ID}'; N + grp @@ -211,6 +306,24 @@ and recruitment_id = '${IDM_ID}'; 0 + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 1024 + 0 + + Insert / update InsertUpdate @@ -376,7 +489,7 @@ WHERE Update Update - Y + N 1 @@ -452,7 +565,7 @@ WHERE - 976 + 1232 0 diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl index 3685fd0..cd411f7 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl @@ -20,11 +20,6 @@ - - Group by - User defined Java expression - Y - User defined Java expression Update @@ -35,21 +30,11 @@ Table input 2 Y - - Update - Change job status on success - Y - Update Change job status on error 2 Y - - Table input 2 - Insert / update - Y - Insert / update Change job status on error 2 @@ -60,7 +45,67 @@ Group by Y + + Update + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Update + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error 2 + Abort + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + Table input 2 + Insert / update + Y + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 976 + 608 + + Change job status on error 2 ExecSql @@ -78,11 +123,8 @@ ervu-dashboard - Y - N - Y Y N @@ -93,7 +135,6 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 976 @@ -123,12 +164,13 @@ and recruitment_id = '${IDM_ID}'; SET status = 'SUCCESS', error_description = null WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; +and recruitment_id = '${IDM_ID}' +and status = 'PROCESSING'; - 1200 + 1440 0 @@ -178,6 +220,59 @@ DO UPDATE SET 432 + + Detect empty stream + DetectEmptyStream + + N + + 1 + + none + + + + + 1216 + 0 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1216 + 128 + + Group by GroupBy @@ -197,16 +292,19 @@ DO UPDATE SET minors_count_raw is_minor SUM + has_minor_child_raw is_minor MAX + has_dead_child_raw is_dead MAX + N @@ -216,11 +314,124 @@ DO UPDATE SET N + grp - 512 - 176 + 608 + 192 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 608 + 0 + + + + Insert / update + InsertUpdate + + N + + 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 + + + 608 + 432
@@ -284,7 +495,7 @@ WHERE Y - 288 + 272 432 @@ -292,7 +503,7 @@ WHERE Update Update - Y + N 1 @@ -368,119 +579,11 @@ WHERE - 672 + 800 0 - - Insert / update - InsertUpdate - - N - - 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 - - - 512 - 432 - -
- - Update - Change job status on error 2 - Y - - error_description - - error_code - - - - Insert / update Change job status on error 2 @@ -493,6 +596,18 @@ WHERE + + Update + Change job status on error 2 + Y + + error_description + + error_code + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf index 73624d2..a09271a 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf @@ -1,6 +1,6 @@ - job_citizen_guardianship + job_guardianship Y @@ -72,7 +72,12 @@ SIMPLE_EVAL + + boolean + + + false equal equal @@ -96,8 +101,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruitments_five_flow.hpl - - Basic Y @@ -108,7 +111,7 @@ N Y Y - 1120 + 1248 208 @@ -124,8 +127,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_on_error.hpl - - Basic Y @@ -152,8 +153,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/check_if_need_to_repeat_job.hpl - - Basic Y @@ -197,8 +196,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruitment_five_flow_delta.hpl - - Basic Y diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl index b12c5a0..ccc3efd 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl @@ -35,11 +35,6 @@ Change job status on error Y - - Group by - Add constants - Y - Add constants Update @@ -47,7 +42,7 @@ Update - Change job status on success 2 + Change job status on error Y @@ -55,9 +50,39 @@ Group by Y + + Change job status on error + Abort + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + Add constants + Y + Update - Change job status on error + Filter rows + Y + + + Filter rows + Change job status on success 2 + Y + + + Update + Detect empty stream + Y + + + Detect empty stream + Change job status on success 2 Y @@ -74,6 +99,10 @@
+ + + + -1 is_guardian true @@ -84,7 +113,7 @@ - 1088 + 1104 0 @@ -172,20 +201,25 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard + Y + N + Y N N UPDATE etl.job_execution SET status = 'SUCCESS' WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; +and recruitment_id = '${IDM_ID}' +and status = 'PROCESSING'; + - 1584 + 1840 0 @@ -247,36 +281,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); 976 - - Group by - GroupBy - - Y - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - N - - - recruit_id - - - N - grp - - - 720 - 0 - - Table input TableInput @@ -618,7 +622,7 @@ FROM trud_info ti; Update Update - Y + N 1 @@ -649,6 +653,129 @@ FROM trud_info ti; 0 + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + + grp + + + 720 + 0 + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + + 0 + + + 1280 + 544 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 912 + 0 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success 2 + + + 1520 + 0 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1536 + 160 + + Table output diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl index 3f159cf..d4b0fa4 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl @@ -30,11 +30,6 @@ Update Y - - Group by - Add constants - Y - Insert / update Change job status on error @@ -52,12 +47,42 @@ Update + Change job status on error + Y + + + Change job status on error + Abort + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + Add constants + Y + + + Update + Detect empty stream + Y + + + Detect empty stream Change job status on success Y Update - Change job status on error + Filter rows + Y + + + Filter rows + Change job status on success Y @@ -84,7 +109,7 @@ - 848 + 1024 0 @@ -122,7 +147,7 @@ and recruitment_id = '${IDM_ID}'; - 992 + 1200 224 @@ -140,8 +165,11 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard + Y + N + Y N N @@ -149,11 +177,13 @@ and recruitment_id = '${IDM_ID}'; SET status = 'DELTA_SUCCESS', error_description = null WHERE job_name = '${JOB_NAME}' - and recruitment_id = '${IDM_ID}'; + and recruitment_id = '${IDM_ID}' + and status = 'DELTA_PROCESSING'; + - 1168 + 1712 0 @@ -346,7 +376,7 @@ WHERE Update Update - Y + N 1 @@ -373,7 +403,99 @@ WHERE Y - 992 + 1200 + 0 + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + + 0 + + + 1200 + 480 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 864 + 0 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1456 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1456 0 diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl index 3b69733..9eab316 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl @@ -40,16 +40,6 @@ Update Y - - Group by - Add constants - Y - - - Update - Change job status on success - Y - Update Change job status on error @@ -60,7 +50,62 @@ Group by Y + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + Add constants + Y + + + Change job status on error + Abort + Y + + + Update + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Update + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1232 + 384 + + Add constants Constant @@ -84,7 +129,7 @@ - 960 + 1040 48 @@ -128,7 +173,7 @@ and recruitment_id = '${IDM_ID}'; - Create job execution record + Change job status on success ExecSql Y @@ -142,13 +187,46 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard - N + Y N Y N N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}' +and status = 'PROCESSING'; + + + + + + 1808 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N INSERT INTO etl.job_execution ( id, job_name, @@ -170,13 +248,65 @@ DO UPDATE SET status = 'PROCESSING', execution_datetime = DEFAULT, error_description = NULL - - 272 + 160 208 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1488 + 192 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1504 + 48 + + Group by GroupBy @@ -207,6 +337,24 @@ DO UPDATE SET 48 + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 896 + 48 + + Insert / update InsertUpdate @@ -327,7 +475,7 @@ WHERE Y - 480 + 416 208 @@ -335,7 +483,7 @@ WHERE Update Update - Y + N 1 @@ -366,37 +514,6 @@ WHERE 48 - - Change job status on success - ExecSql - - Y - - 1 - - none - - - - - ervu-dashboard - Y - N - Y - N - N - UPDATE etl.job_execution -SET status = 'SUCCESS' -WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - - - - - 1456 - 48 - - Insert / update diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl index a7fe488..22dc44d 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl @@ -20,16 +20,6 @@ - - Table input - Table output - Y - - - Table output - Change job status on success - Y - Create job execution record Table input @@ -40,7 +30,62 @@ Change job status on error Y + + Filter rows + Change job status on success + Y + + + Table output + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1136 + 528 + + Change job status on error ExecSql @@ -72,8 +117,8 @@ and recruitment_id = '${IDM_ID}'; - 992 - 512 + 720 + 528 @@ -98,13 +143,14 @@ and recruitment_id = '${IDM_ID}'; UPDATE etl.job_execution SET status = 'SUCCESS' WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; +and recruitment_id = '${IDM_ID}' +and status = 'PROCESSING'; - 992 - 320 + 1120 + 64 @@ -132,10 +178,63 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 288 + 80 320 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1120 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 720 + 64 + + Table input TableInput @@ -191,7 +290,7 @@ WHERE Y - 496 + 368 320 @@ -199,7 +298,7 @@ WHERE Table output TableOutput - Y + N 1 @@ -293,6 +392,24 @@ WHERE 320 + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 576 + 320 + + Table output diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl index 218a828..e969557 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl @@ -30,13 +30,38 @@ Change job status on error Y + + Change job status on error + Abort + Y + Insert / update + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Insert / update + Detect empty stream + Y + + + Detect empty stream Change job status on success Y Table input + Identify last row in a stream + Y + + + Identify last row in a stream Insert / update Y @@ -61,11 +86,8 @@ ervu-dashboard - Y - N - Y Y N @@ -76,11 +98,10 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 976 - 416 + 736 + 480 @@ -109,13 +130,14 @@ and recruitment_id = '${IDM_ID}'; SET status = 'DELTA_SUCCESS', error_description = null WHERE job_name = '${JOB_NAME}' - and recruitment_id = '${IDM_ID}'; + and recruitment_id = '${IDM_ID}' + and status = 'DELTA_PROCESSING'; - 976 - 224 + 1200 + 80 @@ -132,11 +154,8 @@ WHERE job_name = '${JOB_NAME}' ervu-dashboard - N - N - Y N N @@ -146,10 +165,9 @@ SET execution_datetime = DEFAULT where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 336 + 96 224 @@ -322,7 +340,99 @@ WHERE Y - 544 + 368 + 224 + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + + 0 + + + 976 + 480 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 736 + 80 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1200 + 224 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 576 224 diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl index 8a1296f..8a0d0fc 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl @@ -25,19 +25,44 @@ Table input Y + + Insert / update + Change job status on error + Y + + + Change job status on error + Abort + Y + + + Insert / update + Filter rows + Y + + + Filter rows + Change job status on success + Y + Table input + Identify last row in a stream + Y + + + Identify last row in a stream Insert / update Y Insert / update - Change job status on success + Detect empty stream Y - Insert / update - Change job status on error + Detect empty stream + Change job status on success Y @@ -61,11 +86,8 @@ ervu-dashboard - Y - N - Y Y N @@ -76,11 +98,10 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 976 - 400 + 704 + 576 @@ -109,15 +130,16 @@ and recruitment_id = '${IDM_ID}'; SET status = 'SUCCESS', error_description = null WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; +and recruitment_id = '${IDM_ID}' +and status = 'PROCESSING'; - 976 - 208 + 1136 + 64 @@ -162,7 +184,7 @@ DO UPDATE SET error_description = NULL - 272 + 112 208 @@ -293,6 +315,7 @@ DO UPDATE SET ervu-dashboard N + SELECT r.recruit_id, supr->>'id' AS spouse_external_id, @@ -328,11 +351,105 @@ CROSS JOIN LATERAL ( FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array' ) AS supr(supr) - +WHERE + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'; Y - 480 + 352 + 208 + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + + 0 + + + 1008 + 576 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 704 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 528 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1136 208 From d8f80f73bb12e0e0c3c1392f8ca2e4c10cbf0e5a Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Thu, 14 Aug 2025 13:43:36 +0300 Subject: [PATCH 17/34] =?UTF-8?q?ERVU-504:=20=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../citizen_spouse/check_if_need_to_repeat_job.hpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/check_if_need_to_repeat_job.hpl index b3fff70..d371924 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/check_if_need_to_repeat_job.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/check_if_need_to_repeat_job.hpl @@ -69,7 +69,7 @@ FROM ervu_dashboard.recruitment r LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id - and job_name = 'citizen_guardianship_job' + and job_name = 'citizen_spouse_job' where je.status is null or je.status in ('ERROR', 'PROCESSING') limit 1 ) as need_to_repeat_job; From 2834c3e2a109e170bbb1b3b584c1e02b200855ae Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Thu, 14 Aug 2025 14:53:17 +0300 Subject: [PATCH 18/34] =?UTF-8?q?ERVU-504:=20=D0=BF=D1=80=D0=B8=D0=B2?= =?UTF-8?q?=D0=B5=D0=BB=20=D0=BF=D0=BE=D0=B4=D0=BA=D0=B0=D1=87=D0=BA=D1=83?= =?UTF-8?q?=20=D0=B2=20citizen=20marital=5Fstatus=20=D0=B8=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=B2=D0=B5=D0=BB=20=D0=B5=D0=B5=20=D0=BA=20=D0=B8=D0=BD?= =?UTF-8?q?=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../citizen/parallel/citizen_flow.hpl | 14 +++++++++----- .../citizen/parallel/citizen_flow_delta.hpl | 8 +++++++- .../citizen/parallel/citizen_flow_repeat.hpl | 7 ++++++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow.hpl index 80cdd00..7ea9022 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow.hpl @@ -87,11 +87,8 @@ ervu-dashboard - Y - N - Y Y N @@ -102,7 +99,6 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 944 @@ -182,6 +178,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); ervu_person_registry N + /* with adresses as ( -- по одному ли адресу тут должно быть?? @@ -224,7 +221,7 @@ SELECT r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, @@ -383,16 +380,23 @@ ${LIMIT_FW} id_ern id_ern + + marital_status + marital_status + N N N N + Y + N ervu_dashboard Y citizen
+ N Y N diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_delta.hpl index c504f9f..b95a663 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_delta.hpl @@ -271,6 +271,11 @@ and recruitment_id = '${IDM_ID}'; id_ern Y + + marital_status + marital_status + Y + N @@ -292,6 +297,7 @@ and recruitment_id = '${IDM_ID}';
ervu_person_registry N + /* with adresses as ( -- по одному ли адресу тут должно быть?? @@ -334,7 +340,7 @@ SELECT r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_repeat.hpl index fb6a4fa..c61cd51 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_repeat.hpl @@ -172,6 +172,7 @@ DO UPDATE SET
ervu_person_registry N + /* with adresses as ( -- по одному ли адресу тут должно быть?? @@ -214,7 +215,7 @@ SELECT r.vu_current_info, r.military_registration_date AS date_registration, r.vu_unset_date AS date_deregistration, - --ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status, + NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, --ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, --ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date, @@ -373,6 +374,10 @@ ${LIMIT_FW} id_ern id_ern + + marital_status + marital_status + N N From 1dffb4a7ce71b1a4509fbd0e6ab26b010417b304 Mon Sep 17 00:00:00 2001 From: "adel.kalimullin" Date: Thu, 14 Aug 2025 17:06:57 +0300 Subject: [PATCH 19/34] =?UTF-8?q?ERVU-504:=20=D1=84=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../child/parallel/child_flow.hpl | 7 +- .../child/parallel/child_flow_delta.hpl | 7 +- .../child/parallel/child_flow_repeat.hpl | 10 +- .../parallel/citizen_guardianship_flow.hpl | 256 +++++++++--------- .../citizen_guardianship_flow_delta.hpl | 192 +++++++------ .../citizen_guardianship_flow_repeat.hpl | 8 +- .../parallel/citizen_spouse_flow.hpl | 40 +-- .../parallel/citizen_spouse_flow_delta.hpl | 192 +++++++------ .../parallel/citizen_spouse_flow_repeat.hpl | 190 +++++++------ 9 files changed, 441 insertions(+), 461 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl index 5ddaae7..891ec1f 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl @@ -274,19 +274,16 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); minors_count_raw is_minor SUM - has_minor_child_raw is_minor MAX - has_dead_child_raw is_dead MAX - N @@ -296,7 +293,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N - grp @@ -335,6 +331,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); ervu-dashboard N + SELECT ri.recruit_id::uuid AS recruit_id, ch->>'id' AS child_external_id, @@ -381,7 +378,7 @@ CROSS JOIN LATERAL ( WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - AND ri.recruit_id = '6eec41c4-1bd6-417e-a239-562b14b199c9' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl index e4f1397..8f02cbe 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl @@ -276,19 +276,16 @@ and recruitment_id = '${IDM_ID}'; minors_count_raw is_minor SUM - has_minor_child_raw is_minor MAX - has_dead_child_raw is_dead MAX - N @@ -298,7 +295,6 @@ and recruitment_id = '${IDM_ID}'; N - grp @@ -431,6 +427,7 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard N + SELECT ri.recruit_id::uuid AS recruit_id, ch->>'id' AS child_external_id, @@ -477,6 +474,8 @@ CROSS JOIN LATERAL ( WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND c.update_date >= '${M_R_UP_DATE}'::timestamp AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl index cd411f7..43fb893 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl @@ -292,19 +292,16 @@ DO UPDATE SET minors_count_raw is_minor SUM - has_minor_child_raw is_minor MAX - has_dead_child_raw is_dead MAX - N @@ -314,7 +311,6 @@ DO UPDATE SET N - grp @@ -447,6 +443,7 @@ DO UPDATE SET ervu-dashboard N + SELECT ri.recruit_id::uuid AS recruit_id, ch->>'id' AS child_external_id, @@ -491,7 +488,10 @@ CROSS JOIN LATERAL ( ) AS death_date ) AS dates WHERE - jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; Y diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl index ccc3efd..791d6c9 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl @@ -86,6 +86,26 @@ Y + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1280 + 544 + + Add constants Constant @@ -99,10 +119,6 @@ - - - - -1 is_guardian true @@ -201,11 +217,8 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard - Y - N - Y N N @@ -216,7 +229,6 @@ and recruitment_id = '${IDM_ID}' and status = 'PROCESSING'; - 1840 @@ -281,6 +293,107 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); 976 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1536 + 160 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success 2 + + + 1520 + 0 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 720 + 0 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 912 + 0 + + Table input TableInput @@ -294,6 +407,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); ervu-dashboard N + SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, @@ -318,7 +432,8 @@ CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSo WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; Y @@ -653,129 +768,6 @@ FROM trud_info ti; 0 - - Group by - GroupBy - - Y - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - N - - - recruit_id - - - N - - grp - - - 720 - 0 - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - - 0 - - - 1280 - 544 - - - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - last_row - - - 912 - 0 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - = - last_row - N - - - - N - -1 - constant - -1 - Y - Boolean - - - - Change job status on success 2 - - - 1520 - 0 - - - - Detect empty stream - DetectEmptyStream - - Y - - 1 - - none - - - - - 1536 - 160 - - Table output diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl index d4b0fa4..f2fcc5f 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl @@ -86,6 +86,26 @@ Y + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1200 + 480 + + Add constants Constant @@ -165,11 +185,8 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard - Y - N - Y N N @@ -180,7 +197,6 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}' and status = 'DELTA_PROCESSING'; - 1712 @@ -218,6 +234,59 @@ and recruitment_id = '${IDM_ID}'; 224 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1456 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1456 + 0 + + Group by GroupBy @@ -248,6 +317,24 @@ and recruitment_id = '${IDM_ID}'; 0 + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 864 + 0 + + Insert / update InsertUpdate @@ -340,6 +427,7 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard N + SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, @@ -364,7 +452,9 @@ CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSo WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND c.update_date >= '${M_R_UP_DATE}'::timestamp; Y @@ -407,98 +497,6 @@ WHERE 0 - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - - 0 - - - 1200 - 480 - - - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - last_row - - - 864 - 0 - - - - Detect empty stream - DetectEmptyStream - - Y - - 1 - - none - - - - - 1456 - 224 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - = - last_row - N - - - - N - -1 - constant - -1 - Y - Boolean - - - - Change job status on success - - - 1456 - 0 - - Insert / update diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl index 9eab316..557f2eb 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl @@ -186,11 +186,8 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard - Y - N - Y N N @@ -201,7 +198,6 @@ and recruitment_id = '${IDM_ID}' and status = 'PROCESSING'; - 1808 @@ -447,6 +443,7 @@ DO UPDATE SET ervu-dashboard N + SELECT r.recruit_id AS recruit_id, ch->>'id' AS guardianship_external_id, @@ -471,7 +468,8 @@ CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSo WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'; + AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; Y diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl index 22dc44d..6109296 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl @@ -235,6 +235,24 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); 64 + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 576 + 320 + + Table input TableInput @@ -248,6 +266,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); ervu-dashboard N + SELECT r.recruit_id, supr->>'id' AS spouse_external_id, @@ -285,7 +304,8 @@ CROSS JOIN LATERAL ( ) AS supr(supr) WHERE '${IDM_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'; + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; Y @@ -392,24 +412,6 @@ WHERE 320 - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - last_row - - - 576 - 320 - - Table output diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl index e969557..5a9c1c7 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl @@ -66,6 +66,26 @@ Y + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 976 + 480 + + Change job status on error ExecSql @@ -118,11 +138,8 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard - Y - N - Y N N @@ -133,7 +150,6 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}' and status = 'DELTA_PROCESSING'; - 1200 @@ -171,6 +187,77 @@ and recruitment_id = '${IDM_ID}'; 224 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1200 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 736 + 80 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 576 + 224 + + Insert / update InsertUpdate @@ -298,6 +385,7 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard N + SELECT r.recruit_id, supr->>'id' AS spouse_external_id, @@ -335,7 +423,9 @@ CROSS JOIN LATERAL ( ) AS supr(supr) WHERE '${IDM_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'; + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND c.update_date >= '${M_R_UP_DATE}'::timestamp; Y @@ -344,98 +434,6 @@ WHERE 224 - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - - 0 - - - 976 - 480 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - = - last_row - N - - - - N - -1 - constant - -1 - Y - Boolean - - - - Change job status on success - - - 736 - 80 - - - - Detect empty stream - DetectEmptyStream - - Y - - 1 - - none - - - - - 1200 - 224 - - - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - last_row - - - 576 - 224 - - Insert / update diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl index 8a0d0fc..36d9a02 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl @@ -66,6 +66,26 @@ Y + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1008 + 576 + + Change job status on error ExecSql @@ -118,11 +138,8 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard - Y - N - Y N N @@ -135,7 +152,6 @@ and status = 'PROCESSING'; - 1136 @@ -188,6 +204,77 @@ DO UPDATE SET 208 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1136 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 704 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 528 + 208 + + Insert / update InsertUpdate @@ -353,7 +440,8 @@ CROSS JOIN LATERAL ( ) AS supr(supr) WHERE '${IDM_ID}' != '' - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'; + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; Y @@ -361,98 +449,6 @@ WHERE 208 - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - - 0 - - - 1008 - 576 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - = - last_row - N - - - - N - -1 - constant - -1 - Y - Boolean - - - - Change job status on success - - - 704 - 64 - - - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - last_row - - - 528 - 208 - - - - Detect empty stream - DetectEmptyStream - - Y - - 1 - - none - - - - - 1136 - 208 - - Insert / update From 1214865018cd794824d2f9288775852c04864feb Mon Sep 17 00:00:00 2001 From: "r.gaztdinov" Date: Fri, 15 Aug 2025 09:29:48 +0300 Subject: [PATCH 20/34] ri fix --- .../recruitment_five_flow_on_error.hpl | 2 +- .../citizen/recruitments_five_flow.hpl | 106 ++++---- .../parallel/recruits_info_flow.hpl | 37 ++- .../parallel/recruits_info_flow_delta.hpl | 140 ++++++++-- .../parallel/recruits_info_flow_repeat.hpl | 239 ++++++++++++++++-- .../recruitment_five_flow_delta.hpl | 2 +- .../recruitment_five_flow_on_error.hpl | 2 +- .../recruits_info/recruitments_five_flow.hpl | 21 +- .../recruits_info/recruits_info_job.hwf | 5 + 9 files changed, 439 insertions(+), 115 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/citizen/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizen/recruitment_five_flow_on_error.hpl index ff128c3..4375dcd 100644 --- a/mappings/info_recruits/citizen_tables/citizen/recruitment_five_flow_on_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/recruitment_five_flow_on_error.hpl @@ -63,7 +63,7 @@ SELECT r.idm_id as recruitment_id FROM ervu_dashboard.recruitment r - LEFT JOIN public.job_execution je + LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id and job_name = 'citizen_job' where je.status is null or je.status in('ERROR', 'PROCESSING'); diff --git a/mappings/info_recruits/citizen_tables/citizen/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen/recruitments_five_flow.hpl index 9be90a8..bee8f5b 100644 --- a/mappings/info_recruits/citizen_tables/citizen/recruitments_five_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/recruitments_five_flow.hpl @@ -112,59 +112,6 @@ ${COMMENT}*/ 304 - - job_citizen_flow.hwf - WorkflowExecutor - - Y - - 1 - - none - - - local - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen/parallel/job_citizen_flow.hwf - 1 - - - - - IDM_ID - recruitment - - - - JOB_NAME - - citizen_job - - Y - - - ExecutionTime - ExecutionResult - ExecutionNrErrors - ExecutionLinesRead - ExecutionLinesWritten - ExecutionLinesInput - ExecutionLinesOutput - ExecutionLinesRejected - ExecutionLinesUpdated - ExecutionLinesDeleted - ExecutionFilesRetrieved - ExecutionExitStatus - ExecutionLogText - ExecutionLogChannelId - - - FileName - - - 736 - 144 - - citizen_flow.hpl PipelineExecutor @@ -445,6 +392,59 @@ ${COMMENT}*/ 928 + + job_citizen_flow.hwf + WorkflowExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen/parallel/job_citizen_flow.hwf + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + 736 + 144 + + job_citizen_flow.hwf 2 WorkflowExecutor diff --git a/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow.hpl b/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow.hpl index 87d8cea..18b9556 100644 --- a/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow.hpl +++ b/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow.hpl @@ -25,26 +25,11 @@ Table input Y - - Table output - Change job status on error - Y - - - Table output - Filter rows - Y - Filter rows Change job status on success Y - - Table output - Detect empty stream - Y - Detect empty stream Change job status on success @@ -65,6 +50,21 @@ Table output Y + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + Abort @@ -79,7 +79,6 @@ ABORT_WITH_ERROR Y - 0 @@ -249,7 +248,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); last_row - 736 + 752 320 @@ -257,7 +256,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); Table input TableInput - Y + N 1 @@ -297,7 +296,7 @@ ${LIMIT_FW} Table output TableOutput - Y + N 1 diff --git a/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_delta.hpl b/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_delta.hpl index 4475ed7..ba2390e 100644 --- a/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_delta.hpl +++ b/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_delta.hpl @@ -27,11 +27,31 @@ Table input + Identify last row in a stream + Y + + + Identify last row in a stream Insert / update Y Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows Change job status on success Y @@ -40,7 +60,32 @@ Change job status on error Y + + Change job status on error + Abort + Y + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + Change job status on error ExecSql @@ -56,9 +101,6 @@ error_description - - error_code - ervu-dashboard @@ -71,8 +113,7 @@ N UPDATE etl.job_execution SET status = 'DELTA_ERROR', - error_description = ?, - error_code = ? + error_description = ? WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; @@ -80,8 +121,8 @@ and recruitment_id = '${IDM_ID}'; - 1040 - 416 + 944 + 400 @@ -111,8 +152,8 @@ and recruitment_id = '${IDM_ID}'; - 1040 - 224 + 1248 + 64 @@ -138,8 +179,7 @@ and recruitment_id = '${IDM_ID}'; SET status = 'DELTA_PROCESSING', execution_datetime = DEFAULT, - error_description = NULL, - error_code = NULL + error_description = NULL where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; @@ -148,11 +188,82 @@ and recruitment_id = '${IDM_ID}'; 224 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + Insert / update InsertUpdate - Y + N 1 @@ -166,7 +277,6 @@ and recruitment_id = '${IDM_ID}'; = recruit_id recruit_id - ervu_dashboard recruits_info
@@ -219,7 +329,7 @@ and recruitment_id = '${IDM_ID}'; N - 784 + 944 224
@@ -227,7 +337,7 @@ and recruitment_id = '${IDM_ID}'; Table input TableInput - Y + N 1 diff --git a/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_repeat.hpl b/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_repeat.hpl index fe599e2..a1a0dda 100644 --- a/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_repeat.hpl +++ b/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_repeat.hpl @@ -27,20 +27,65 @@ Table input - Table output + Identify last row in a stream Y - Table output + Filter rows Change job status on success Y - Table output + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update Change job status on error Y + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + Change job status on error ExecSql @@ -56,9 +101,6 @@ error_description - - error_code - ervu-dashboard Y @@ -75,7 +117,7 @@ and recruitment_id = '${IDM_ID}'; - 976 + 960 400 @@ -106,8 +148,8 @@ and recruitment_id = '${IDM_ID}'; - 976 - 208 + 1440 + 48
@@ -135,7 +177,6 @@ and recruitment_id = '${IDM_ID}'; status, execution_datetime, error_description, - error_code, recruitment_id ) VALUES ( @@ -144,15 +185,14 @@ VALUES ( 'PROCESSING', DEFAULT, NULL, - NULL, '${IDM_ID}' ) ON CONFLICT (job_name, recruitment_id) DO UPDATE SET status = 'PROCESSING', execution_datetime = DEFAULT, - error_description = NULL, - error_code = NULL; + error_description = NULL + 272 @@ -160,8 +200,8 @@ DO UPDATE SET - Table input - TableInput + Detect empty stream + DetectEmptyStream Y @@ -170,9 +210,153 @@ DO UPDATE SET none + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + recruits_info
+ + recruit_id + recruit_id + N + + + created_at + created_at + Y + + + updated_at + updated_at + Y + + + info + info + Y + + + gir_import_data_version_id + gir_import_data_version_id + Y + + + current_recruitment_id + current_recruitment_id + Y + + + target_recruitment_id + target_recruitment_id + Y + + + full_name + full_name + Y + + + addresses + addresses + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + ervu_person_registry N - SELECT r.system_create_date AS created_at, r.system_update_date AS updated_at, @@ -204,7 +388,7 @@ ${LIMIT_FW} Table output TableOutput - Y + N 1 @@ -255,27 +439,24 @@ ${LIMIT_FW} N N N - Y - N ervu_dashboard Y recruits_info
- N Y N Y - 736 - 208 + 816 + 544
- Table output + Insert / update Change job status on error Y @@ -286,6 +467,18 @@ ${LIMIT_FW} + + Table output + Change job status on error + N + + + + + + + + diff --git a/mappings/info_recruits/raw_data/recruits_info/recruitment_five_flow_delta.hpl b/mappings/info_recruits/raw_data/recruits_info/recruitment_five_flow_delta.hpl index a839742..5dd9e93 100644 --- a/mappings/info_recruits/raw_data/recruits_info/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/raw_data/recruits_info/recruitment_five_flow_delta.hpl @@ -63,7 +63,7 @@ SELECT r.idm_id as recruitment_id FROM ervu_dashboard.recruitment r - LEFT JOIN public.job_execution je + LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id and job_name = 'recruits_info_job' where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); diff --git a/mappings/info_recruits/raw_data/recruits_info/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/raw_data/recruits_info/recruitment_five_flow_on_error.hpl index 21c9f3d..1f5fdb4 100644 --- a/mappings/info_recruits/raw_data/recruits_info/recruitment_five_flow_on_error.hpl +++ b/mappings/info_recruits/raw_data/recruits_info/recruitment_five_flow_on_error.hpl @@ -63,7 +63,7 @@ SELECT r.idm_id as recruitment_id FROM ervu_dashboard.recruitment r - LEFT JOIN public.job_execution je + LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id and job_name = 'recruits_info_job' where je.status is null or je.status in('ERROR', 'PROCESSING'); diff --git a/mappings/info_recruits/raw_data/recruits_info/recruitments_five_flow.hpl b/mappings/info_recruits/raw_data/recruits_info/recruitments_five_flow.hpl index 7826784..a378bca 100644 --- a/mappings/info_recruits/raw_data/recruits_info/recruitments_five_flow.hpl +++ b/mappings/info_recruits/raw_data/recruits_info/recruitments_five_flow.hpl @@ -62,8 +62,25 @@ 0 SELECT idm_id AS recruitment -FROM ervu_dashboard.recruitment; - N +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y 432 diff --git a/mappings/info_recruits/raw_data/recruits_info/recruits_info_job.hwf b/mappings/info_recruits/raw_data/recruits_info/recruits_info_job.hwf index d67afe8..650cb43 100644 --- a/mappings/info_recruits/raw_data/recruits_info/recruits_info_job.hwf +++ b/mappings/info_recruits/raw_data/recruits_info/recruits_info_job.hwf @@ -11,6 +11,11 @@ - 2025/08/05 12:45:28.561 + + COMMENT + + + LIMIT_FW ; From aee4854a8cdbda631f252ab7a828370d590eb519 Mon Sep 17 00:00:00 2001 From: "r.gaztdinov" Date: Mon, 18 Aug 2025 15:17:35 +0300 Subject: [PATCH 21/34] fz53 --- .../citizen/parallel/citizen_flow_delta.hpl | 147 +- .../citizen/parallel/citizen_flow_repeat.hpl | 307 +- ...hing_citizen_appealing_violations_fz53.hpl | 124 - ...itizen_appealing_violations_fz53_delta.hpl | 142 - ...ta.hpl => check_if_need_to_repeat_job.hpl} | 68 +- ..._appealing_violations_fz53_flow1_error.hpl | 250 -- ...ppealing_violations_fz53_flow1_success.hpl | 250 -- ..._appealing_violations_fz53_flow2_error.hpl | 254 -- ...ppealing_violations_fz53_flow2_success.hpl | 254 -- ..._appealing_violations_fz53_flow3_error.hpl | 255 -- ...ppealing_violations_fz53_flow3_success.hpl | 255 -- ..._appealing_violations_fz53_flow4_error.hpl | 256 -- ...ppealing_violations_fz53_flow4_success.hpl | 256 -- ..._appealing_violations_fz53_flow5_error.hpl | 256 -- ...ppealing_violations_fz53_flow5_success.hpl | 256 -- ..._appealing_violations_fz53_flow1_error.hpl | 101 - ...ppealing_violations_fz53_flow1_success.hpl | 101 - ..._appealing_violations_fz53_flow2_error.hpl | 102 - ...ppealing_violations_fz53_flow2_success.hpl | 101 - ..._appealing_violations_fz53_flow3_error.hpl | 101 - ...ppealing_violations_fz53_flow3_success.hpl | 101 - ..._appealing_violations_fz53_flow4_error.hpl | 101 - ...ppealing_violations_fz53_flow4_success.hpl | 101 - ..._appealing_violations_fz53_flow5_error.hpl | 101 - ...ppealing_violations_fz53_flow5_success.hpl | 101 - .../change_status_to_processing.hpl | 142 - ..._appealing_violations_fz53_job_exists.hpl} | 61 +- ...itizen_appealing_violations_fz53_error.hpl | 273 -- ..._job_citizen_appealing_violations_fz53.hpl | 869 ------ ...itizen_appealing_violations_fz53_delta.hpl | 869 ------ .../citizen_appealing_violations_fz53_job.hwf | 362 +++ .../job_citizen_appealing_violations_fz53.hwf | 2478 ---------------- ...citizen_appealing_violations_fz53_flow.hpl | 389 +++ ...itizen_appealing_violations_fz53_flow1.hpl | 161 -- ...itizen_appealing_violations_fz53_flow2.hpl | 158 -- ...itizen_appealing_violations_fz53_flow3.hpl | 158 -- ...itizen_appealing_violations_fz53_flow4.hpl | 158 -- ...itizen_appealing_violations_fz53_flow5.hpl | 158 -- ...n_appealing_violations_fz53_flow_delta.hpl | 402 +++ ..._appealing_violations_fz53_flow_repeat.hpl | 417 +++ ...itizen_appealing_violations_fz53_flow1.hpl | 158 -- ...itizen_appealing_violations_fz53_flow2.hpl | 158 -- ...itizen_appealing_violations_fz53_flow3.hpl | 158 -- ...itizen_appealing_violations_fz53_flow4.hpl | 158 -- ...itizen_appealing_violations_fz53_flow5.hpl | 158 -- .../recruitment_five_flow_delta.hpl | 360 +++ .../recruitment_five_flow_on_error.hpl | 360 +++ .../recruitment_rows_five_flow_if_error.hpl | 185 -- .../recruitments_five_flow.hpl | 373 +++ ...nching_citizen_criminal_liability_fz53.hpl | 124 - ..._citizen_criminal_liability_fz53_delta.hpl | 142 - .../check_if_need_to_repeat_job.hpl} | 68 +- ...en_criminal_liability_fz53_flow1_error.hpl | 250 -- ..._criminal_liability_fz53_flow1_success.hpl | 250 -- ...en_criminal_liability_fz53_flow2_error.hpl | 254 -- ..._criminal_liability_fz53_flow2_success.hpl | 254 -- ...en_criminal_liability_fz53_flow3_error.hpl | 255 -- ..._criminal_liability_fz53_flow3_success.hpl | 255 -- ...en_criminal_liability_fz53_flow4_error.hpl | 256 -- ..._criminal_liability_fz53_flow4_success.hpl | 256 -- ...en_criminal_liability_fz53_flow5_error.hpl | 256 -- ..._criminal_liability_fz53_flow5_success.hpl | 256 -- ...en_criminal_liability_fz53_flow1_error.hpl | 101 - ..._criminal_liability_fz53_flow1_success.hpl | 101 - ...en_criminal_liability_fz53_flow2_error.hpl | 102 - ..._criminal_liability_fz53_flow2_success.hpl | 101 - ...en_criminal_liability_fz53_flow3_error.hpl | 101 - ..._criminal_liability_fz53_flow3_success.hpl | 101 - ...en_criminal_liability_fz53_flow4_error.hpl | 101 - ..._criminal_liability_fz53_flow4_success.hpl | 101 - ...en_criminal_liability_fz53_flow5_error.hpl | 101 - ..._criminal_liability_fz53_flow5_success.hpl | 101 - .../change_status_to_processing.hpl | 142 - .../change_status_to_processing_delta.hpl | 102 - ...en_criminal_liability_fz53_job_exists.hpl} | 61 +- ..._citizen_criminal_liability_fz53_error.hpl | 273 -- ...nt_job_citizen_criminal_liability_fz53.hpl | 869 ------ ..._citizen_criminal_liability_fz53_delta.hpl | 869 ------ .../citizen_criminal_liability_fz53_job.hwf | 358 +++ .../job_citizen_criminal_liability_fz53.hwf | 2482 ---------------- .../citizen_criminal_liability_fz53_flow.hpl | 407 +++ .../citizen_criminal_liability_fz53_flow1.hpl | 183 -- .../citizen_criminal_liability_fz53_flow2.hpl | 180 -- .../citizen_criminal_liability_fz53_flow3.hpl | 180 -- .../citizen_criminal_liability_fz53_flow4.hpl | 180 -- .../citizen_criminal_liability_fz53_flow5.hpl | 180 -- ...zen_criminal_liability_fz53_flow_delta.hpl | 422 +++ ...en_criminal_liability_fz53_flow_repeat.hpl | 437 +++ ..._citizen_criminal_liability_fz53_flow1.hpl | 180 -- ..._citizen_criminal_liability_fz53_flow2.hpl | 180 -- ..._citizen_criminal_liability_fz53_flow3.hpl | 180 -- ..._citizen_criminal_liability_fz53_flow4.hpl | 180 -- ..._citizen_criminal_liability_fz53_flow5.hpl | 180 -- .../recruitment_five_flow_delta.hpl | 360 +++ .../recruitment_five_flow_on_error.hpl | 360 +++ .../recruitment_rows_five_flow_if_error.hpl | 185 -- .../recruitments_five_flow.hpl | 373 +++ .../branching_citizen_liability_fz53.hpl | 124 - ...branching_citizen_liability_fz53_delta.hpl | 142 - .../check_if_need_to_repeat_job.hpl} | 67 +- ...tus_citizen_liability_fz53_flow1_error.hpl | 250 -- ...s_citizen_liability_fz53_flow1_success.hpl | 250 -- ...tus_citizen_liability_fz53_flow2_error.hpl | 254 -- ...s_citizen_liability_fz53_flow2_success.hpl | 254 -- ...tus_citizen_liability_fz53_flow3_error.hpl | 255 -- ...s_citizen_liability_fz53_flow3_success.hpl | 255 -- ...tus_citizen_liability_fz53_flow4_error.hpl | 256 -- ...s_citizen_liability_fz53_flow4_success.hpl | 256 -- ...tus_citizen_liability_fz53_flow5_error.hpl | 256 -- ...s_citizen_liability_fz53_flow5_success.hpl | 256 -- ...lta_citizen_liability_fz53_flow1_error.hpl | 101 - ...a_citizen_liability_fz53_flow1_success.hpl | 101 - ...lta_citizen_liability_fz53_flow2_error.hpl | 102 - ...a_citizen_liability_fz53_flow2_success.hpl | 101 - ...lta_citizen_liability_fz53_flow3_error.hpl | 101 - ...a_citizen_liability_fz53_flow3_success.hpl | 101 - ...lta_citizen_liability_fz53_flow4_error.hpl | 101 - ...a_citizen_liability_fz53_flow4_success.hpl | 101 - ...lta_citizen_liability_fz53_flow5_error.hpl | 101 - ...a_citizen_liability_fz53_flow5_success.hpl | 101 - .../change_status_to_processing.hpl | 142 - .../change_status_to_processing_delta.hpl | 102 - ..._if_citizen_liability_fz53_job_exists.hpl} | 61 +- ...heckpoint_citizen_liability_fz53_error.hpl | 273 -- .../checkpoint_job_citizen_liability_fz53.hpl | 869 ------ ...point_job_citizen_liability_fz53_delta.hpl | 869 ------ .../citizen_liability_fz53_job.hwf | 358 +++ .../job_citizen_liability_fz53.hwf | 2480 ---------------- .../parallel/citizen_liability_fz53_flow.hpl | 425 +++ .../parallel/citizen_liability_fz53_flow1.hpl | 205 -- .../parallel/citizen_liability_fz53_flow2.hpl | 202 -- .../parallel/citizen_liability_fz53_flow3.hpl | 202 -- .../parallel/citizen_liability_fz53_flow4.hpl | 202 -- .../parallel/citizen_liability_fz53_flow5.hpl | 202 -- .../citizen_liability_fz53_flow_delta.hpl | 443 +++ .../citizen_liability_fz53_flow_repeat.hpl | 459 +++ .../delta_citizen_liability_fz53_flow1.hpl | 202 -- .../delta_citizen_liability_fz53_flow2.hpl | 202 -- .../delta_citizen_liability_fz53_flow3.hpl | 202 -- .../delta_citizen_liability_fz53_flow4.hpl | 202 -- .../delta_citizen_liability_fz53_flow5.hpl | 202 -- .../recruitment_five_flow_delta.hpl | 360 +++ .../recruitment_five_flow_on_error.hpl | 360 +++ .../recruitment_rows_five_flow_if_error.hpl | 185 -- .../recruitments_five_flow.hpl | 373 +++ .../snils_inn/branching_snils_inn.hpl | 124 - .../snils_inn/branching_snils_inn_delta.hpl | 142 - ...or.hpl => check_if_need_to_repeat_job.hpl} | 67 +- ...e_status_delta_snils_inn_flow1_success.hpl | 101 - ...nge_status_delta_snils_inn_flow2_error.hpl | 102 - ...e_status_delta_snils_inn_flow2_success.hpl | 101 - ...nge_status_delta_snils_inn_flow3_error.hpl | 101 - ...e_status_delta_snils_inn_flow3_success.hpl | 101 - ...e_status_delta_snils_inn_flow4_success.hpl | 101 - ...nge_status_delta_snils_inn_flow5_error.hpl | 101 - ...e_status_delta_snils_inn_flow5_success.hpl | 101 - .../change_status_snils_inn_flow1_error.hpl | 250 -- .../change_status_snils_inn_flow1_success.hpl | 250 -- .../change_status_snils_inn_flow2_error.hpl | 254 -- .../change_status_snils_inn_flow2_success.hpl | 254 -- .../change_status_snils_inn_flow3_error.hpl | 255 -- .../change_status_snils_inn_flow3_success.hpl | 255 -- .../change_status_snils_inn_flow4_error.hpl | 256 -- .../change_status_snils_inn_flow4_success.hpl | 256 -- .../change_status_snils_inn_flow5_error.hpl | 256 -- .../change_status_snils_inn_flow5_success.hpl | 256 -- .../change_status_to_processing.hpl | 142 - .../check_if_snils_inn_job_exists.hpl} | 61 +- .../checkpoints/checkpoint_job_snils_inn.hpl | 869 ------ .../checkpoint_job_snils_inn_delta.hpl | 869 ------ .../checkpoint_snils_inn_error.hpl | 273 -- .../snils_inn/job_snils_inn.hwf | 2516 ----------------- .../parallel/delta_snils_inn_flow1.hpl | 202 -- .../parallel/delta_snils_inn_flow2.hpl | 202 -- .../parallel/delta_snils_inn_flow3.hpl | 202 -- .../parallel/delta_snils_inn_flow4.hpl | 202 -- .../parallel/delta_snils_inn_flow5.hpl | 202 -- .../snils_inn/parallel/snils_inn_flow.hpl | 440 +++ .../snils_inn/parallel/snils_inn_flow1.hpl | 208 -- .../snils_inn/parallel/snils_inn_flow2.hpl | 201 -- .../snils_inn/parallel/snils_inn_flow3.hpl | 201 -- .../snils_inn/parallel/snils_inn_flow4.hpl | 201 -- .../snils_inn/parallel/snils_inn_flow5.hpl | 201 -- .../parallel/snils_inn_flow_delta.hpl | 445 +++ .../parallel/snils_inn_flow_repeat.hpl | 458 +++ .../snils_inn/recruitment_five_flow_delta.hpl | 360 +++ .../recruitment_five_flow_on_error.hpl | 360 +++ .../recruitment_rows_five_flow_if_error.hpl | 185 -- .../snils_inn/recruitments_five_flow.hpl | 373 +++ .../snils_inn/snils_inn_job.hwf | 366 +++ .../job_parallel_recruits_info_citizen.hwf | 2 +- .../parallel/recruits_info_flow_delta.hpl | 7 +- 192 files changed, 11568 insertions(+), 42386 deletions(-) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53_delta.hpl rename mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/{checkpoints/change_status_to_processing_delta.hpl => check_if_need_to_repeat_job.hpl} (56%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing.hpl rename mappings/info_recruits/citizen_tables/{snils_inn/checkpoints/check_if_job_snils_inn_exists.hpl => citizen_appealing_violations_fz53/checkpoints/check_if_citizen_appealing_violations_fz53_job_exists.hpl} (70%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_citizen_appealing_violations_fz53_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/citizen_appealing_violations_fz53_job.hwf delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/job_citizen_appealing_violations_fz53.hwf create mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow1.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow5.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow1.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow5.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_on_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_rows_five_flow_if_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitments_five_flow.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53_delta.hpl rename mappings/info_recruits/citizen_tables/{snils_inn/checkpoints/change_status_to_processing_delta.hpl => citizen_criminal_liability_fz53/check_if_need_to_repeat_job.hpl} (56%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing_delta.hpl rename mappings/info_recruits/citizen_tables/{citizen_liability_fz53/checkpoints/check_if_job_citizen_liability_fz53_exists.hpl => citizen_criminal_liability_fz53/checkpoints/check_if_citizen_criminal_liability_fz53_job_exists.hpl} (69%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_citizen_criminal_liability_fz53_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/citizen_criminal_liability_fz53_job.hwf delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/job_citizen_criminal_liability_fz53.hwf create mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow1.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow5.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow1.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow5.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_on_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_rows_five_flow_if_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitments_five_flow.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53_delta.hpl rename mappings/info_recruits/citizen_tables/{snils_inn/checkpoints/change_status_delta_snils_inn_flow4_error.hpl => citizen_liability_fz53/check_if_need_to_repeat_job.hpl} (56%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing_delta.hpl rename mappings/info_recruits/citizen_tables/{citizen_criminal_liability_fz53/checkpoints/check_if_job_citizen_criminal_liability_fz53_exists.hpl => citizen_liability_fz53/checkpoints/check_if_citizen_liability_fz53_job_exists.hpl} (68%) delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_citizen_liability_fz53_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/citizen_liability_fz53_job.hwf delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/job_citizen_liability_fz53.hwf create mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow1.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow5.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow1.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow5.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_on_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_rows_five_flow_if_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitments_five_flow.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/branching_snils_inn.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/branching_snils_inn_delta.hpl rename mappings/info_recruits/citizen_tables/snils_inn/{checkpoints/change_status_delta_snils_inn_flow1_error.hpl => check_if_need_to_repeat_job.hpl} (56%) delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_success.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing.hpl rename mappings/info_recruits/citizen_tables/{citizen_appealing_violations_fz53/checkpoints/check_if_job_citizen_appealing_violations_fz53_exists.hpl => snils_inn/checkpoints/check_if_snils_inn_job_exists.hpl} (68%) delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn_delta.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_snils_inn_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/job_snils_inn.hwf delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow1.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow5.hpl create mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow1.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow2.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow3.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow4.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow5.hpl create mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_on_error.hpl delete mode 100644 mappings/info_recruits/citizen_tables/snils_inn/recruitment_rows_five_flow_if_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/snils_inn/recruitments_five_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/snils_inn/snils_inn_job.hwf diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_delta.hpl index b95a663..85e6b57 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_delta.hpl @@ -27,11 +27,31 @@ Table input + Identify last row in a stream + Y + + + Identify last row in a stream Insert / update Y Insert / update + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Insert / update + Detect empty stream + Y + + + Detect empty stream Change job status on success Y @@ -40,7 +60,32 @@ Change job status on error Y + + Change job status on error + Abort + Y + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1056 + 384 + + Change job status on error ExecSql @@ -56,9 +101,6 @@ error_description - - error_code - ervu-dashboard Y @@ -68,16 +110,15 @@ N UPDATE etl.job_execution SET status = 'DELTA_ERROR', - error_description = ?, - error_code = ? + error_description = ? WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 1040 - 416 + 832 + 384 @@ -107,8 +148,8 @@ and recruitment_id = '${IDM_ID}'; - 1040 - 224 + 1056 + 80 @@ -134,13 +175,83 @@ and recruitment_id = '${IDM_ID}'; SET status = 'DELTA_PROCESSING', execution_datetime = DEFAULT, - error_description = NULL, - error_code = NULL + error_description = NULL where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 336 + 272 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1056 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 832 + 80 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 640 224 @@ -148,7 +259,7 @@ and recruitment_id = '${IDM_ID}'; Insert / update InsertUpdate - Y + N 1 @@ -162,7 +273,6 @@ and recruitment_id = '${IDM_ID}'; = recruit_id recruit_id - ervu_dashboard citizen
@@ -280,7 +390,7 @@ and recruitment_id = '${IDM_ID}'; N - 784 + 832 224 @@ -288,7 +398,7 @@ and recruitment_id = '${IDM_ID}'; Table input TableInput - Y + N 1 @@ -378,7 +488,8 @@ SELECT FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(current_recruitment_id, target_recruitment_id) = '${IDM_ID}' - AND '${M_R_CR_DATE}' >= r.system_create_date::timestamp + --AND '${M_R_CR_DATE}' >= r.system_create_date::timestamp + AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp LEFT JOIN ( SELECT ROW_NUMBER() OVER (PARTITION BY recruit_id ORDER BY created_at DESC) as rn, @@ -397,7 +508,7 @@ ${LIMIT_FW} Y - 544 + 464 224 diff --git a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_repeat.hpl index c61cd51..5bf8781 100644 --- a/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen/parallel/citizen_flow_repeat.hpl @@ -27,20 +27,65 @@ Table input - Table output + Identify last row in a stream Y - Table output + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Detect empty stream Change job status on success Y - Table output + Filter rows + Change job status on success + Y + + + Insert / update Change job status on error Y + + Change job status on error + Abort + Y + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1152 + 352 + + Change job status on error ExecSql @@ -56,13 +101,13 @@ error_description - - error_code - ervu-dashboard + Y + N + Y Y N @@ -73,10 +118,11 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; + - 976 - 400 + 896 + 352 @@ -106,8 +152,8 @@ and recruitment_id = '${IDM_ID}'; - 976 - 208 + 1216 + 96 @@ -135,7 +181,6 @@ and recruitment_id = '${IDM_ID}'; status, execution_datetime, error_description, - error_code, recruitment_id ) VALUES ( @@ -144,15 +189,13 @@ VALUES ( 'PROCESSING', DEFAULT, NULL, - NULL, '${IDM_ID}' ) ON CONFLICT (job_name, recruitment_id) DO UPDATE SET status = 'PROCESSING', execution_datetime = DEFAULT, - error_description = NULL, - error_code = NULL; + error_description = NULL 272 @@ -160,8 +203,8 @@ DO UPDATE SET - Table input - TableInput + Detect empty stream + DetectEmptyStream Y @@ -170,9 +213,218 @@ DO UPDATE SET none + + + 1216 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 896 + 96 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 688 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + recruit_id + recruit_id + N + + + system_pgs_status + system_pgs_status + Y + + + full_name + full_name + Y + + + last_name + last_name + Y + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + gender + gender + Y + + + birth_date + birth_date + Y + + + age + age + Y + + + birth_place + birth_place + Y + + + phone + phone + Y + + + email + email + Y + + + vu_current_info + vu_current_info + Y + + + date_registration + date_registration + Y + + + date_deregistration + date_deregistration + Y + + + marital_status + marital_status + Y + + + recruit_create_date + recruit_create_date + Y + + + update_date + update_date + Y + + + recruitment_id + recruitment_id + Y + + + target_recruitment_id + target_recruitment_id + Y + + + deferment_liberation + deferment_liberation + Y + + + id_ern + id_ern + Y + +
+ N + + + 896 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + ervu_person_registry N - /* with adresses as ( -- по одному ли адресу тут должно быть?? @@ -383,27 +635,24 @@ ${LIMIT_FW} N N N - Y - N ervu_dashboard Y citizen
- N Y N Y - 720 - 208 + 576 + 528
- Table output + Insert / update Change job status on error Y @@ -414,6 +663,18 @@ ${LIMIT_FW} + + Table output + Change job status on error + N + + + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53.hpl deleted file mode 100644 index 894af88..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53.hpl +++ /dev/null @@ -1,124 +0,0 @@ - - - - branching_citizen_appealing_violations_fz53 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_citizen_appealing_violations_fz53' - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53_delta.hpl deleted file mode 100644 index 35eb784..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53_delta.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - branching_citizen_appealing_violations_fz53_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - COALESCE(job_name, 'job_citizen_appealing_violations_fz53_delta') AS PIPELINE, - COALESCE(status, 'ERROR') AS STATUS, - current_timestamp::timestamp as record_created -FROM ( - select - CASE - WHEN status = 'PROCESSING' THEN 'ERROR' - ELSE status - END AS status, - job_name - from public.etl_checkpoints - where job_name = 'job_citizen_appealing_violations_fz53_delta' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_appealing_violations_fz53_delta' - ) -) t - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/check_if_need_to_repeat_job.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing_delta.hpl rename to mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/check_if_need_to_repeat_job.hpl index 6ace1f9..feafe81 100644 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/check_if_need_to_repeat_job.hpl @@ -1,7 +1,7 @@ - change_status_to_processing_delta + check_if_need_to_repeat_job Y @@ -13,22 +13,22 @@ 1000 100 - - 2025/06/16 13:42:26.494 + 2025/08/08 12:27:51.630 - - 2025/06/16 13:42:26.494 + 2025/08/08 12:27:51.630 Table input - Insert / update + Set variables Y - Insert / update - InsertUpdate + Set variables + SetVariable Y @@ -37,37 +37,18 @@ none
- 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y - 1248 - 352 + 624 + 288 @@ -84,16 +65,19 @@ ervu-dashboard N 0 - SELECT - 'PROCESSING' AS status, - 'delta_snils_inn' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_appealing_violations_fz53_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; N - 832 - 352 + 336 + 288 diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_error.hpl deleted file mode 100644 index 17b638f..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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 - 'citizen_appealing_violations_fz53_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_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_success.hpl deleted file mode 100644 index 7cca14e..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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 - 'citizen_appealing_violations_fz53_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_error.hpl deleted file mode 100644 index 20d3515..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_appealing_violations_fz53_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_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_success.hpl deleted file mode 100644 index 4c86e09..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_appealing_violations_fz53_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_error.hpl deleted file mode 100644 index eff6309..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_appealing_violations_fz53_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_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_success.hpl deleted file mode 100644 index dde1f6c..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_appealing_violations_fz53_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_error.hpl deleted file mode 100644 index b8ea516..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_appealing_violations_fz53_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_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_success.hpl deleted file mode 100644 index d615e08..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_appealing_violations_fz53_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_error.hpl deleted file mode 100644 index 25d529e..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_appealing_violations_fz53_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 - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_success.hpl deleted file mode 100644 index 64c33fa..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_appealing_violations_fz53_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_appealing_violations_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_appealing_violations_fz53_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_error.hpl deleted file mode 100644 index 57bec30..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow1' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_success.hpl deleted file mode 100644 index 5a31b60..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow1' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_error.hpl deleted file mode 100644 index 2bb7cb2..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow2' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_success.hpl deleted file mode 100644 index 02f1d71..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow2' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_error.hpl deleted file mode 100644 index bad8452..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow3' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_success.hpl deleted file mode 100644 index c52e330..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow3' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_error.hpl deleted file mode 100644 index e5b0f66..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow4' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_success.hpl deleted file mode 100644 index ed8c6b6..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow4' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_error.hpl deleted file mode 100644 index b368dc1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow5' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_success.hpl deleted file mode 100644 index 5f711e1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_appealing_violations_fz53_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow5' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index 6e63a1c..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - change_status_to_processing - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/11 16:14:31.162 - - - 2025/06/11 16:14:31.162 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 784 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'job_citizen_appealing_violations_fz53' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_appealing_violations_fz53_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_appealing_violations_fz53_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_appealing_violations_fz53_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_appealing_violations_fz53_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_appealing_violations_fz53_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/check_if_job_snils_inn_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/check_if_citizen_appealing_violations_fz53_job_exists.hpl similarity index 70% rename from mappings/info_recruits/citizen_tables/snils_inn/checkpoints/check_if_job_snils_inn_exists.hpl rename to mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/check_if_citizen_appealing_violations_fz53_job_exists.hpl index 8d7a204..374bbbf 100644 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/check_if_job_snils_inn_exists.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/check_if_citizen_appealing_violations_fz53_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_snils_inn_exists + check_if_citizen_appealing_violations_fz53_job_exists Y @@ -13,23 +13,23 @@ 1000 100 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - Table input - Set variables - Y - Set variables Write to log N + + Table input + Set variables + Y + Set variables @@ -44,21 +44,16 @@ - job_name - PIPE - PARENT_WORKFLOW - - - status - STATUS + job_executed_flag + JOB_EXECUTED_FLAG PARENT_WORKFLOW Y - 688 - 352 + 672 + 336 @@ -75,29 +70,17 @@ ervu-dashboard N 0 - SELECT - COALESCE(job_name, 'job_snils_inn') AS job_name, - COALESCE(status, 'NEW') AS status, - current_timestamp::timestamp as record_created -FROM ( - SELECT job_name, status - FROM public.etl_checkpoints - WHERE job_name = 'job_snils_inn' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_snils_inn' - ) -) t + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'citizen_appealing_violations_fz53_job' + limit 1 + ) AS job_executed_flag; N - 400 - 352 + 384 + 336 @@ -120,8 +103,8 @@ FROM ( ${STATUS} - 960 - 240 + 944 + 224 diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_citizen_appealing_violations_fz53_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_citizen_appealing_violations_fz53_error.hpl deleted file mode 100644 index c4c46a7..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_citizen_appealing_violations_fz53_error.hpl +++ /dev/null @@ -1,273 +0,0 @@ - - - - checkpoint_citizen_appealing_violations_fz53_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_child ch on ch.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/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53.hpl deleted file mode 100644 index 5483bad..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_citizen_appealing_violations_fz53 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - - - Table input - Insert / update - Y - - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'citizen_appealing_violations_fz53_flow1', - 'citizen_appealing_violations_fz53_flow2', - 'citizen_appealing_violations_fz53_flow3', - 'citizen_appealing_violations_fz53_flow4', - 'citizen_appealing_violations_fz53_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'citizen_appealing_violations_fz53_flow1', - 'citizen_appealing_violations_fz53_flow2', - 'citizen_appealing_violations_fz53_flow3', - 'citizen_appealing_violations_fz53_flow4', - 'citizen_appealing_violations_fz53_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_citizen_appealing_violations_fz53' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53_delta.hpl deleted file mode 100644 index 6c9fc6a..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53_delta.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_citizen_appealing_violations_fz53_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - - - Table input - Insert / update - Y - - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'delta_snils_inn_flow1', - 'delta_snils_inn_flow2', - 'delta_snils_inn_flow3', - 'delta_snils_inn_flow4', - 'delta_snils_inn_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'delta_snils_inn_flow1', - 'delta_snils_inn_flow2', - 'delta_snils_inn_flow3', - 'delta_snils_inn_flow4', - 'delta_snils_inn_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_snils_inn_delta' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/citizen_appealing_violations_fz53_job.hwf b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/citizen_appealing_violations_fz53_job.hwf new file mode 100644 index 0000000..fbff1c8 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/citizen_appealing_violations_fz53_job.hwf @@ -0,0 +1,362 @@ + + + citizen_appealing_violations_fz53_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 96 + 304 + + + + check_if_citizen_appealing_violations_fz53_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/check_if_citizen_appealing_violations_fz53_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + citizen_appealing_violations_fz53_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 832 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1296 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_on_error.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 1296 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 832 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 832 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 832 + 800 + + + + + + Start + check_if_citizen_appealing_violations_fz53_job_exists.hpl + Y + Y + Y + + + check_if_citizen_appealing_violations_fz53_job_exists.hpl + citizen_appealing_violations_fz53_job_exists_check + Y + Y + N + + + citizen_appealing_violations_fz53_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + citizen_appealing_violations_fz53_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 944 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 944 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 752 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + citizen_appealing_violations_fz53_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 206 + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/job_citizen_appealing_violations_fz53.hwf b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/job_citizen_appealing_violations_fz53.hwf deleted file mode 100644 index 7151cc4..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/job_citizen_appealing_violations_fz53.hwf +++ /dev/null @@ -1,2478 +0,0 @@ - - - job_citizen_appealing_violations_fz53 - Y - - - - 0 - - - 2025/06/05 14:27:15.055 - - - 2025/06/05 14:27:15.055 - - - M_R_CR_DATE - 3001-01-01 00:00:00 - - - - M_R_UP_DATE - - - - - - - Start - - SPECIAL - - 1 - 12 - 60 - 0 - 0 - N - 0 - 1 - N - 272 - 400 - - - - checkpoint_job_citizen_appealing_violations_fz53.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 1136 - 1280 - - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2832 - 400 - - - - citizen_appealing_violations_fz53_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 3344 - 80 - - - - citizen_appealing_violations_fz53_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 3344 - 240 - - - - citizen_appealing_violations_fz53_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 3344 - 400 - - - - citizen_appealing_violations_fz53_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 3344 - 560 - - - - citizen_appealing_violations_fz53_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 3344 - 720 - - - - Abort workflow - - ABORT - - N - N - 2816 - 208 - - - - Success new citizen_appealing_violations_fz53 - - SUCCESS - - N - 4720 - 432 - - - - branching_citizen_appealing_violations_fz53.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 1584 - 1280 - - - - Simple citizen_appealing_violations_fz53 WHERE SUCCESS - - SIMPLE_EVAL - - SUCCESS - string - true - equal - equal - N - variable - STATUS - N - 1696 - 1680 - - - - Simple citizen_appealing_violations_fz53 WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 2048 - 1280 - - - - recruitment_rows_five_flow_if_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_rows_five_flow_if_error.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2864 - 1280 - - - - Abort workflow 2 - - ABORT - - N - N - 2768 - 1040 - - - - delta_citizen_appealing_violations_fz53_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow1.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 3344 - 1792 - - - - check_if_job_citizen_appealing_violations_fz53_exists.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/check_if_job_citizen_appealing_violations_fz53_exists.hpl - Basic - - Y - - N - local - N - N - Y - N - 528 - 400 - - - - Simple job_citizen_appealing_violations_fz53_exists check NEW - - SIMPLE_EVAL - - NEW - string - true - equal - equal - N - variable - STATUS - N - 992 - 400 - - - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 560 - - - - change_status_citizen_appealing_violations_fz53_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 80 - - - - change_status_citizen_appealing_violations_fz53_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 160 - - - - change_status_citizen_appealing_violations_fz53_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 240 - - - - change_status_citizen_appealing_violations_fz53_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 320 - - - - change_status_citizen_appealing_violations_fz53_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 400 - - - - change_status_citizen_appealing_violations_fz53_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 480 - - - - change_status_citizen_appealing_violations_fz53_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 560 - - - - change_status_citizen_appealing_violations_fz53_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 640 - - - - change_status_citizen_appealing_violations_fz53_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 720 - - - - change_status_citizen_appealing_violations_fz53_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 800 - - - - checkpoint_job_citizen_appealing_violations_fz53.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 4320 - 432 - - - - change_status_to_processing.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2848 - 1424 - - - - change_status_to_processing_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2864 - 2304 - - - - change_status_delta_citizen_appealing_violations_fz53_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1792 - - - - change_status_delta_citizen_appealing_violations_fz53_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1872 - - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2832 - 2112 - - - - Abort workflow 2 2 - - ABORT - - N - N - 2816 - 1952 - - - - delta_citizen_appealing_violations_fz53_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow2.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 3344 - 1952 - - - - change_status_delta_citizen_appealing_violations_fz53_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1952 - - - - change_status_delta_citizen_appealing_violations_fz53_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 2032 - - - - delta_citizen_appealing_violations_fz53_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow3.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 3344 - 2112 - - - - change_status_delta_citizen_appealing_violations_fz53_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 2112 - - - - change_status_delta_citizen_appealing_violations_fz53_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 2192 - - - - delta_citizen_appealing_violations_fz53_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow4.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 3344 - 2272 - - - - change_status_delta_citizen_appealing_violations_fz53_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 2272 - - - - change_status_delta_citizen_appealing_violations_fz53_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 2352 - - - - delta_citizen_appealing_violations_fz53_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow5.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 3344 - 2432 - - - - change_status_delta_citizen_appealing_violations_fz53_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 2432 - - - - change_status_delta_citizen_appealing_violations_fz53_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_delta_citizen_appealing_violations_fz53_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 2512 - - - - branching_citizen_appealing_violations_fz53_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/branching_citizen_appealing_violations_fz53_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 1824 - 2112 - - - - Simple delta_citizen_appealing_violations_fz53 WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 2256 - 2112 - - - - delta_citizen_appealing_violations_fz53 success - - SUCCESS - - N - 2368 - 1904 - - - - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 4384 - 2112 - - - - Success delta_citizen_appealing_violations_fz53 - - SUCCESS - - N - 4784 - 2112 - - - - citizen_appealing_violations_fz53_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 3344 - 960 - - - - citizen_appealing_violations_fz53_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 3344 - 1120 - - - - citizen_appealing_violations_fz53_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 3344 - 1280 - - - - citizen_appealing_violations_fz53_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 3344 - 1440 - - - - citizen_appealing_violations_fz53_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 3344 - 1600 - - - - Success citizen_appealing_violations_fz53 after error - - SUCCESS - - N - 4720 - 1312 - - - - change_status_citizen_appealing_violations_fz53_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 960 - - - - change_status_citizen_appealing_violations_fz53_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1040 - - - - change_status_citizen_appealing_violations_fz53_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1120 - - - - change_status_citizen_appealing_violations_fz53_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1200 - - - - change_status_citizen_appealing_violations_fz53_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1280 - - - - change_status_citizen_appealing_violations_fz53_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1360 - - - - change_status_citizen_appealing_violations_fz53_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1440 - - - - change_status_citizen_appealing_violations_fz53_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1520 - - - - change_status_citizen_appealing_violations_fz53_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1600 - - - - change_status_citizen_appealing_violations_fz53_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/change_status_citizen_appealing_violations_fz53_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3856 - 1680 - - - - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/checkpoint_job_citizen_appealing_violations_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 4320 - 1312 - - - - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - citizen_appealing_violations_fz53_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - citizen_appealing_violations_fz53_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - citizen_appealing_violations_fz53_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - citizen_appealing_violations_fz53_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - citizen_appealing_violations_fz53_flow5.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - Abort workflow - Y - N - N - - - branching_citizen_appealing_violations_fz53.hpl - Simple citizen_appealing_violations_fz53 WHERE ERROR - Y - N - Y - - - branching_citizen_appealing_violations_fz53.hpl - Simple citizen_appealing_violations_fz53 WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - - - Start - check_if_job_citizen_appealing_violations_fz53_exists.hpl - Y - Y - Y - - - check_if_job_citizen_appealing_violations_fz53_exists.hpl - Simple job_citizen_appealing_violations_fz53_exists check NEW - Y - Y - N - - - citizen_appealing_violations_fz53_flow1.hpl - change_status_citizen_appealing_violations_fz53_flow1_success.hpl - Y - Y - N - - - citizen_appealing_violations_fz53_flow1.hpl - change_status_citizen_appealing_violations_fz53_flow1_error.hpl - Y - N - N - - - citizen_appealing_violations_fz53_flow2.hpl - change_status_citizen_appealing_violations_fz53_flow2_success.hpl - Y - Y - N - - - citizen_appealing_violations_fz53_flow2.hpl - change_status_citizen_appealing_violations_fz53_flow2_error.hpl - Y - N - N - - - citizen_appealing_violations_fz53_flow3.hpl - change_status_citizen_appealing_violations_fz53_flow3_success.hpl - Y - Y - N - - - citizen_appealing_violations_fz53_flow3.hpl - change_status_citizen_appealing_violations_fz53_flow3_error.hpl - Y - N - N - - - citizen_appealing_violations_fz53_flow4.hpl - change_status_citizen_appealing_violations_fz53_flow4_success.hpl - Y - Y - N - - - citizen_appealing_violations_fz53_flow4.hpl - change_status_citizen_appealing_violations_fz53_flow4_error.hpl - Y - N - N - - - citizen_appealing_violations_fz53_flow5.hpl - change_status_citizen_appealing_violations_fz53_flow5_success.hpl - Y - Y - N - - - citizen_appealing_violations_fz53_flow5.hpl - change_status_citizen_appealing_violations_fz53_flow5_error.hpl - Y - N - N - - - change_status_citizen_appealing_violations_fz53_flow5_error.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow5_success.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow4_error.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow4_success.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow3_error.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow3_success.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow2_error.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow2_success.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow1_error.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow1_success.hpl - checkpoint_job_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - checkpoint_job_citizen_appealing_violations_fz53.hpl - Success new citizen_appealing_violations_fz53 - Y - Y - N - - - checkpoint_job_citizen_appealing_violations_fz53.hpl (2) - branching_citizen_appealing_violations_fz53.hpl - Y - N - Y - - - Simple job_citizen_appealing_violations_fz53_exists check NEW - checkpoint_job_citizen_appealing_violations_fz53.hpl (2) - Y - N - N - - - delta_citizen_appealing_violations_fz53_flow1.hpl - change_status_delta_citizen_appealing_violations_fz53_flow1_success.hpl - Y - Y - N - - - delta_citizen_appealing_violations_fz53_flow1.hpl - change_status_delta_citizen_appealing_violations_fz53_flow1_error.hpl - Y - N - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - change_status_to_processing.hpl - Y - Y - N - - - Simple job_citizen_appealing_violations_fz53_exists check NEW - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - change_status_to_processing.hpl (2) - Y - Y - N - - - Simple citizen_appealing_violations_fz53 WHERE ERROR - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl (2) - delta_citizen_appealing_violations_fz53_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl (2) - change_status_to_processing_delta.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl (2) - Abort workflow 2 2 - Y - N - N - - - delta_citizen_appealing_violations_fz53_flow2.hpl - change_status_delta_citizen_appealing_violations_fz53_flow2_success.hpl - Y - Y - N - - - delta_citizen_appealing_violations_fz53_flow2.hpl - change_status_delta_citizen_appealing_violations_fz53_flow2_error.hpl - Y - N - N - - - delta_citizen_appealing_violations_fz53_flow3.hpl - change_status_delta_citizen_appealing_violations_fz53_flow3_success.hpl - Y - Y - N - - - delta_citizen_appealing_violations_fz53_flow3.hpl - change_status_delta_citizen_appealing_violations_fz53_flow3_error.hpl - Y - N - N - - - delta_citizen_appealing_violations_fz53_flow4.hpl - change_status_delta_citizen_appealing_violations_fz53_flow4_success.hpl - Y - Y - N - - - delta_citizen_appealing_violations_fz53_flow4.hpl - change_status_delta_citizen_appealing_violations_fz53_flow4_error.hpl - Y - N - N - - - delta_citizen_appealing_violations_fz53_flow5.hpl - change_status_delta_citizen_appealing_violations_fz53_flow5_success.hpl - Y - Y - N - - - delta_citizen_appealing_violations_fz53_flow5.hpl - change_status_delta_citizen_appealing_violations_fz53_flow5_error.hpl - Y - N - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl (2) - delta_citizen_appealing_violations_fz53_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl (2) - delta_citizen_appealing_violations_fz53_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl (2) - delta_citizen_appealing_violations_fz53_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl (2) - delta_citizen_appealing_violations_fz53_flow5.hpl - Y - Y - N - - - Simple citizen_appealing_violations_fz53 WHERE SUCCESS - branching_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - Simple delta_citizen_appealing_violations_fz53 WHERE ERROR - delta_citizen_appealing_violations_fz53 success - Y - N - N - - - branching_citizen_appealing_violations_fz53_delta.hpl - Simple delta_citizen_appealing_violations_fz53 WHERE ERROR - Y - Y - N - - - Simple delta_citizen_appealing_violations_fz53 WHERE ERROR - recruitment_rows_five_flow_citizen_appealing_violations_fz53.hpl (2) - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow1_success.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow3_success.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow2_error.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow2_success.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow1_error.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow3_error.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow4_success.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow4_error.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow5_success.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_appealing_violations_fz53_flow5_error.hpl - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Y - Y - N - - - checkpoint_job_citizen_appealing_violations_fz53_delta.hpl - Success delta_citizen_appealing_violations_fz53 - Y - Y - N - - - citizen_appealing_violations_fz53_flow1.hpl 2 - change_status_citizen_appealing_violations_fz53_flow1_success.hpl 2 - Y - Y - N - - - citizen_appealing_violations_fz53_flow1.hpl 2 - change_status_citizen_appealing_violations_fz53_flow1_error.hpl 2 - Y - N - N - - - citizen_appealing_violations_fz53_flow2.hpl 2 - change_status_citizen_appealing_violations_fz53_flow2_success.hpl 2 - Y - Y - N - - - citizen_appealing_violations_fz53_flow2.hpl 2 - change_status_citizen_appealing_violations_fz53_flow2_error.hpl 2 - Y - N - N - - - citizen_appealing_violations_fz53_flow3.hpl 2 - change_status_citizen_appealing_violations_fz53_flow3_success.hpl 2 - Y - Y - N - - - citizen_appealing_violations_fz53_flow3.hpl 2 - change_status_citizen_appealing_violations_fz53_flow3_error.hpl 2 - Y - N - N - - - citizen_appealing_violations_fz53_flow4.hpl 2 - change_status_citizen_appealing_violations_fz53_flow4_success.hpl 2 - Y - Y - N - - - citizen_appealing_violations_fz53_flow4.hpl 2 - change_status_citizen_appealing_violations_fz53_flow4_error.hpl 2 - Y - N - N - - - citizen_appealing_violations_fz53_flow5.hpl 2 - change_status_citizen_appealing_violations_fz53_flow5_success.hpl 2 - Y - Y - N - - - citizen_appealing_violations_fz53_flow5.hpl 2 - change_status_citizen_appealing_violations_fz53_flow5_error.hpl 2 - Y - N - N - - - change_status_citizen_appealing_violations_fz53_flow1_success.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow1_error.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow2_success.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow2_error.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow3_success.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow3_error.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow4_success.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow4_error.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow5_success.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_appealing_violations_fz53_flow5_error.hpl 2 - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Y - N - Y - - - checkpoint_job_citizen_appealing_violations_fz53.hpl 2 - Success citizen_appealing_violations_fz53 after error - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_appealing_violations_fz53_flow3.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_appealing_violations_fz53_flow2.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_appealing_violations_fz53_flow1.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_appealing_violations_fz53_flow4.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_appealing_violations_fz53_flow5.hpl 2 - Y - Y - N - - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 72 - 1088 - 176 - 0001-01-01 00:00:00 - -3001-01-01 00:00:00 - - 114 - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl new file mode 100644 index 0000000..53da516 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl @@ -0,0 +1,389 @@ + + + + citizen_appealing_violations_fz53_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 320 + + + + Table input + TableInput + + N + + 1 + + none + + + postgres.decision-document-service + N + + SELECT + ad.recruit_id, + ad.create_date, -- дата создания обжалования + ad.appeal_number AS number_appealed, -- номер обжалуемого решения + ad.appeal_date AS date_appealed, -- дата обжалуемого решения + ad.result_number AS case_number, -- номер принятого решения + ad.result_date AS decision_date, -- дата принятия решения + CASE + WHEN ad.result = '1' THEN 'Удовлетворена' + WHEN ad.result = '2' THEN 'Частично удовлетворена' + WHEN ad.result = '3' THEN 'Отказано в удовлетворении' + ELSE NULL + END AS result_appeal, -- код рассмотрения + ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение + ad.reason_for_add_entry AS grounds, -- основание для внесения записи + ad.hidden --has_appealing_violations_fz53 +FROM public.appeal_document_dto ad +JOIN public.recruit r ON r.id = ad.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= ad.created_at + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты +--WHERE hidden IS FALSE + +${LIMIT_FW} + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + create_date + create_date + + + number_appealed + number_appealed + + + date_appealed + date_appealed + + + case_number + case_number + + + decision_date + decision_date + + + result_appeal + result_appeal + + + name_commission + name_commission + + + grounds + grounds + + + hidden + hidden + + + N + N + N + N + Y + N + ervu_dashboard + Y + citizen_appealing_violations_fz53
+ N + Y + N + Y + + + 1024 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow1.hpl deleted file mode 100644 index d1ca18f..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow1.hpl +++ /dev/null @@ -1,161 +0,0 @@ - - - - citizen_appealing_violations_fz53_flow1 - Y - - - - Normal - 0 - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - - - Table input - Insert / update - Y - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F1}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F1}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 448 - 288 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - - = - create_date - create_date - - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 864 - 288 - -
- - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow2.hpl deleted file mode 100644 index 1b5d294..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow2.hpl +++ /dev/null @@ -1,158 +0,0 @@ - - - - citizen_appealing_violations_fz53_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 - - - = - create_date - create_date - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 928 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F2}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 512 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow3.hpl deleted file mode 100644 index 8ce8203..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow3.hpl +++ /dev/null @@ -1,158 +0,0 @@ - - - - citizen_appealing_violations_fz53_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 - - - = - create_date - create_date - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 992 - 400 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F3}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 576 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow4.hpl deleted file mode 100644 index 1446dc1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow4.hpl +++ /dev/null @@ -1,158 +0,0 @@ - - - - citizen_appealing_violations_fz53_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 - - - = - create_date - create_date - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 896 - 368 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F4}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 480 - 368 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow5.hpl deleted file mode 100644 index 5614a92..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow5.hpl +++ /dev/null @@ -1,158 +0,0 @@ - - - - citizen_appealing_violations_fz53_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 - - - = - create_date - create_date - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 1104 - 368 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F5}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 688 - 368 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl new file mode 100644 index 0000000..94e22da --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl @@ -0,0 +1,402 @@ + + + + citizen_appealing_violations_fz53_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 944 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1248 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + create_date + create_date + + ervu_dashboard + citizen_appealing_violations_fz53
+ + recruit_id + recruit_id + N + + + create_date + create_date + N + + + number_appealed + number_appealed + Y + + + date_appealed + date_appealed + Y + + + case_number + case_number + Y + + + decision_date + decision_date + Y + + + result_appeal + result_appeal + Y + + + name_commission + name_commission + Y + + + grounds + grounds + Y + + + hidden + hidden + Y + +
+ N + + + 944 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.decision-document-service + N + + SELECT + ad.recruit_id, + ad.create_date, -- дата создания обжалования + ad.appeal_number AS number_appealed, -- номер обжалуемого решения + ad.appeal_date AS date_appealed, -- дата обжалуемого решения + ad.result_number AS case_number, -- номер принятого решения + ad.result_date AS decision_date, -- дата принятия решения + CASE + WHEN ad.result = '1' THEN 'Удовлетворена' + WHEN ad.result = '2' THEN 'Частично удовлетворена' + WHEN ad.result = '3' THEN 'Отказано в удовлетворении' + ELSE NULL + END AS result_appeal, -- код рассмотрения + ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение + ad.reason_for_add_entry AS grounds, -- основание для внесения записи + ad.hidden --has_appealing_violations_fz53 +FROM public.appeal_document_dto ad +JOIN public.recruit r ON r.id = ad.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND ad.create_date >= '${M_R_UP_DATE}'::timestamp + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты +--WHERE hidden IS FALSE + +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl new file mode 100644 index 0000000..d48295e --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl @@ -0,0 +1,417 @@ + + + + citizen_appealing_violations_fz53_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 960 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + create_date + create_date + + ervu_dashboard + citizen_appealing_violations_fz53
+ + recruit_id + recruit_id + N + + + create_date + create_date + N + + + number_appealed + number_appealed + Y + + + date_appealed + date_appealed + Y + + + case_number + case_number + Y + + + decision_date + decision_date + Y + + + result_appeal + result_appeal + Y + + + name_commission + name_commission + Y + + + grounds + grounds + Y + + + hidden + hidden + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.decision-document-service + N + + SELECT + ad.recruit_id, + ad.create_date, -- дата создания обжалования + ad.appeal_number AS number_appealed, -- номер обжалуемого решения + ad.appeal_date AS date_appealed, -- дата обжалуемого решения + ad.result_number AS case_number, -- номер принятого решения + ad.result_date AS decision_date, -- дата принятия решения + CASE + WHEN ad.result = '1' THEN 'Удовлетворена' + WHEN ad.result = '2' THEN 'Частично удовлетворена' + WHEN ad.result = '3' THEN 'Отказано в удовлетворении' + ELSE NULL + END AS result_appeal, -- код рассмотрения + ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение + ad.reason_for_add_entry AS grounds, -- основание для внесения записи + ad.hidden --has_appealing_violations_fz53 +FROM public.appeal_document_dto ad +JOIN public.recruit r ON r.id = ad.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= ad.created_at + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты +--WHERE hidden IS FALSE + +${LIMIT_FW} + Y + + + 480 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow1.hpl deleted file mode 100644 index d065de7..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow1.hpl +++ /dev/null @@ -1,158 +0,0 @@ - - - - delta_citizen_appealing_violations_fz53_flow1 - 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 - - - = - create_date - create_date - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 976 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F1}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F1}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 560 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow2.hpl deleted file mode 100644 index 1c9afd1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow2.hpl +++ /dev/null @@ -1,158 +0,0 @@ - - - - delta_citizen_appealing_violations_fz53_flow2 - 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 - - - = - create_date - create_date - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 1056 - 336 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F2}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 640 - 336 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow3.hpl deleted file mode 100644 index 648df28..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow3.hpl +++ /dev/null @@ -1,158 +0,0 @@ - - - - delta_citizen_appealing_violations_fz53_flow3 - 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 - - - = - create_date - create_date - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 1120 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F3}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 704 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow4.hpl deleted file mode 100644 index 7eef578..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow4.hpl +++ /dev/null @@ -1,158 +0,0 @@ - - - - delta_citizen_appealing_violations_fz53_flow4 - 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 - - - = - create_date - create_date - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 1056 - 368 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F4}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 640 - 368 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow5.hpl deleted file mode 100644 index 950b9b0..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/delta_citizen_appealing_violations_fz53_flow5.hpl +++ /dev/null @@ -1,158 +0,0 @@ - - - - delta_citizen_appealing_violations_fz53_flow5 - 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 - - - = - create_date - create_date - - ervu_dashboard - citizen_appealing_violations_fz53
- - recruit_id - recruit_id - N - - - create_date - create_date - N - - - number_appealed - number_appealed - Y - - - date_appealed - date_appealed - Y - - - case_number - case_number - Y - - - decision_date - decision_date - Y - - - result_appeal - result_appeal - Y - - - name_commission - name_commission - Y - - - grounds - grounds - Y - - - hidden - hidden - Y - -
- N - - - 1008 - 320 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - ad.recruit_id, - ad.create_date, -- дата создания обжалования - ad.appeal_number AS number_appealed, -- номер обжалуемого решения - ad.appeal_date AS date_appealed, -- дата обжалуемого решения - ad.result_number AS case_number, -- номер принятого решения - ad.result_date AS decision_date, -- дата принятия решения - CASE - WHEN ad.result = '1' THEN 'Удовлетворена' - WHEN ad.result = '2' THEN 'Частично удовлетворена' - WHEN ad.result = '3' THEN 'Отказано в удовлетворении' - ELSE NULL - END AS result_appeal, -- код рассмотрения - ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение - ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 -FROM public.appeal_document_dto ad -JOIN public.recruit r ON r.id = ad.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F5}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты ---WHERE hidden IS FALSE - Y - - - 592 - 320 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..9a671d9 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + citizen_appealing_violations_fz53_flow_delta.hpl + Y + + + Table input + citizen_appealing_violations_fz53_flow_delta.hpl 2 + Y + + + Table input + citizen_appealing_violations_fz53_flow_delta.hpl 3 + Y + + + Table input + citizen_appealing_violations_fz53_flow_delta.hpl 4 + Y + + + Table input + citizen_appealing_violations_fz53_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_appealing_violations_fz53_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + citizen_appealing_violations_fz53_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 128 + + + + citizen_appealing_violations_fz53_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 208 + + + + citizen_appealing_violations_fz53_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 288 + + + + citizen_appealing_violations_fz53_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 368 + + + + citizen_appealing_violations_fz53_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..edb6fa2 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + citizen_appealing_violations_fz53_flow_repeat.hpl + Y + + + Table input + citizen_appealing_violations_fz53_flow_repeat.hpl 2 + Y + + + Table input + citizen_appealing_violations_fz53_flow_repeat.hpl 3 + Y + + + Table input + citizen_appealing_violations_fz53_flow_repeat.hpl 4 + Y + + + Table input + citizen_appealing_violations_fz53_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_appealing_violations_fz53_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + citizen_appealing_violations_fz53_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 208 + + + + citizen_appealing_violations_fz53_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 288 + + + + citizen_appealing_violations_fz53_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 368 + + + + citizen_appealing_violations_fz53_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 448 + + + + citizen_appealing_violations_fz53_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_rows_five_flow_if_error.hpl deleted file mode 100644 index 4b469b9..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitment_rows_five_flow_if_error.hpl +++ /dev/null @@ -1,185 +0,0 @@ - - - - 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 -fr_check AS ( - SELECT - last_recruitment_id AS recruitment_id, - recruitment_created_date, - status, - job_name - FROM public.etl_checkpoints - WHERE status = 'ERROR' AND job_name IN ('citizen_appealing_violations_fz53_flow1', 'citizen_appealing_violations_fz53_flow2', 'citizen_appealing_violations_fz53_flow3', 'citizen_appealing_violations_fz53_flow4', 'citizen_appealing_violations_fz53_flow5') -), -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 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow1') THEN created_at END) AS cr_flow1, - MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow1') THEN idm_id::text END) AS idm_flow1, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow2') THEN created_at END) AS cr_flow2, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow2') THEN idm_id::text END) AS idm_flow2, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow3') THEN created_at END) AS cr_flow3, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow3') THEN idm_id::text END) AS idm_flow3, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow4') THEN created_at END) AS cr_flow4, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow4') THEN idm_id::text END) AS idm_flow4, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow5') THEN created_at END) AS cr_flow5, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_appealing_violations_fz53_flow5') THEN idm_id::text END) AS idm_flow5 - FROM splitted - GROUP BY position -), -remains as ( - SELECT - position, - 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 - WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) - OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) - OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) - OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) - OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) - order by position -), -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/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitments_five_flow.hpl new file mode 100644 index 0000000..6efa85b --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + citizen_appealing_violations_fz53_flow.hpl + Y + + + Get all recruitments ordered by created_date + citizen_appealing_violations_fz53_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + citizen_appealing_violations_fz53_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + citizen_appealing_violations_fz53_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + citizen_appealing_violations_fz53_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + citizen_appealing_violations_fz53_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 784 + 144 + + + + citizen_appealing_violations_fz53_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 784 + 224 + + + + citizen_appealing_violations_fz53_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 784 + 304 + + + + citizen_appealing_violations_fz53_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 784 + 384 + + + + citizen_appealing_violations_fz53_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_appealing_violations_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 784 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53.hpl deleted file mode 100644 index e077078..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53.hpl +++ /dev/null @@ -1,124 +0,0 @@ - - - - branching_citizen_criminal_liability_fz53 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_citizen_criminal_liability_fz53' - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53_delta.hpl deleted file mode 100644 index 4402413..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53_delta.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - branching_citizen_criminal_liability_fz53_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - COALESCE(job_name, 'job_citizen_criminal_liability_fz53_delta') AS PIPELINE, - COALESCE(status, 'ERROR') AS STATUS, - current_timestamp::timestamp as record_created -FROM ( - select - CASE - WHEN status = 'PROCESSING' THEN 'ERROR' - ELSE status - END AS status, - job_name - from public.etl_checkpoints - where job_name = 'job_citizen_criminal_liability_fz53_delta' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_criminal_liability_fz53_delta' - ) -) t - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/check_if_need_to_repeat_job.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing_delta.hpl rename to mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/check_if_need_to_repeat_job.hpl index 6ace1f9..9698cd9 100644 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/check_if_need_to_repeat_job.hpl @@ -1,7 +1,7 @@ - change_status_to_processing_delta + check_if_need_to_repeat_job Y @@ -13,22 +13,22 @@ 1000 100 - - 2025/06/16 13:42:26.494 + 2025/08/08 12:27:51.630 - - 2025/06/16 13:42:26.494 + 2025/08/08 12:27:51.630 Table input - Insert / update + Set variables Y - Insert / update - InsertUpdate + Set variables + SetVariable Y @@ -37,37 +37,18 @@ none - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y - 1248 - 352 + 624 + 288
@@ -84,16 +65,19 @@ ervu-dashboard N 0 - SELECT - 'PROCESSING' AS status, - 'delta_snils_inn' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_criminal_liability_fz53_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; N - 832 - 352 + 336 + 288 diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_error.hpl deleted file mode 100644 index 4095df7..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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 - 'citizen_criminal_liability_fz53_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_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_success.hpl deleted file mode 100644 index 3ef1f41..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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 - 'citizen_criminal_liability_fz53_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_error.hpl deleted file mode 100644 index e729ca5..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_criminal_liability_fz53_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_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_success.hpl deleted file mode 100644 index 896e5f7..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_criminal_liability_fz53_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_error.hpl deleted file mode 100644 index 63d1db3..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_criminal_liability_fz53_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_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_success.hpl deleted file mode 100644 index cdaf266..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_criminal_liability_fz53_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_error.hpl deleted file mode 100644 index 0d74917..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_criminal_liability_fz53_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_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_success.hpl deleted file mode 100644 index 1c4519b..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_criminal_liability_fz53_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_error.hpl deleted file mode 100644 index bf0f099..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_criminal_liability_fz53_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 - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_success.hpl deleted file mode 100644 index c7e8c88..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_criminal_liability_fz53_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_criminal_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_criminal_liability_fz53_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_error.hpl deleted file mode 100644 index 748f1fd..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow1' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_success.hpl deleted file mode 100644 index 3985742..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow1' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_error.hpl deleted file mode 100644 index d3a3687..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow2' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_success.hpl deleted file mode 100644 index c729385..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow2' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_error.hpl deleted file mode 100644 index 0baf42b..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow3' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_success.hpl deleted file mode 100644 index 0cfddb3..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow3' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_error.hpl deleted file mode 100644 index edaee70..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow4' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_success.hpl deleted file mode 100644 index c3ad66d..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow4' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_error.hpl deleted file mode 100644 index db5a6de..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow5' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_success.hpl deleted file mode 100644 index e773802..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_criminal_liability_fz53_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_criminal_liability_fz53_flow5' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index e422b79..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - change_status_to_processing - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/11 16:14:31.162 - - - 2025/06/11 16:14:31.162 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 784 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'job_citizen_criminal_liability_fz53' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_criminal_liability_fz53_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_criminal_liability_fz53_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_criminal_liability_fz53_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_criminal_liability_fz53_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_criminal_liability_fz53_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing_delta.hpl deleted file mode 100644 index 9aea55f..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing_delta.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_to_processing_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 13:42:26.494 - - - 2025/06/16 13:42:26.494 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1248 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'delta_citizen_criminal_liability_fz53' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 832 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_job_citizen_liability_fz53_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_citizen_criminal_liability_fz53_job_exists.hpl similarity index 69% rename from mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_job_citizen_liability_fz53_exists.hpl rename to mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_citizen_criminal_liability_fz53_job_exists.hpl index e27b362..2ab9720 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_job_citizen_liability_fz53_exists.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_citizen_criminal_liability_fz53_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_citizen_liability_fz53_exists + check_if_citizen_criminal_liability_fz53_job_exists Y @@ -13,23 +13,23 @@ 1000 100 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - Table input - Set variables - Y - Set variables Write to log N + + Table input + Set variables + Y + Set variables @@ -44,21 +44,16 @@ - job_name - PIPE - PARENT_WORKFLOW - - - status - STATUS + job_executed_flag + JOB_EXECUTED_FLAG PARENT_WORKFLOW Y - 688 - 352 + 672 + 336 @@ -75,29 +70,17 @@ ervu-dashboard N 0 - SELECT - COALESCE(job_name, 'job_citizen_liability_fz53') AS job_name, - COALESCE(status, 'NEW') AS status, - current_timestamp::timestamp as record_created -FROM ( - SELECT job_name, status - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_liability_fz53' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_liability_fz53' - ) -) t + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'recruits_info_job' + limit 1 + ) AS job_executed_flag; N - 400 - 352 + 384 + 336 @@ -120,8 +103,8 @@ FROM ( ${STATUS} - 960 - 240 + 944 + 224 diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_citizen_criminal_liability_fz53_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_citizen_criminal_liability_fz53_error.hpl deleted file mode 100644 index 6dec012..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_citizen_criminal_liability_fz53_error.hpl +++ /dev/null @@ -1,273 +0,0 @@ - - - - checkpoint_citizen_criminal_liability_fz53_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_child ch on ch.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/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53.hpl deleted file mode 100644 index dd178f2..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_citizen_criminal_liability_fz53 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - - - Table input - Insert / update - Y - - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'citizen_criminal_liability_fz53_flow1', - 'citizen_criminal_liability_fz53_flow2', - 'citizen_criminal_liability_fz53_flow3', - 'citizen_criminal_liability_fz53_flow4', - 'citizen_criminal_liability_fz53_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'citizen_criminal_liability_fz53_flow1', - 'citizen_criminal_liability_fz53_flow2', - 'citizen_criminal_liability_fz53_flow3', - 'citizen_criminal_liability_fz53_flow4', - 'citizen_criminal_liability_fz53_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_citizen_criminal_liability_fz53' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53_delta.hpl deleted file mode 100644 index 658a967..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53_delta.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_citizen_criminal_liability_fz53_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - - - Table input - Insert / update - Y - - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'delta_citizen_criminal_liability_fz53_flow1', - 'delta_citizen_criminal_liability_fz53_flow2', - 'delta_citizen_criminal_liability_fz53_flow3', - 'delta_citizen_criminal_liability_fz53_flow4', - 'delta_citizen_criminal_liability_fz53_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'delta_citizen_criminal_liability_fz53_flow1', - 'delta_citizen_criminal_liability_fz53_flow2', - 'delta_citizen_criminal_liability_fz53_flow3', - 'delta_citizen_criminal_liability_fz53_flow4', - 'delta_citizen_criminal_liability_fz53_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_citizen_criminal_liability_fz53_delta' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/citizen_criminal_liability_fz53_job.hwf b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/citizen_criminal_liability_fz53_job.hwf new file mode 100644 index 0000000..e08a136 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/citizen_criminal_liability_fz53_job.hwf @@ -0,0 +1,358 @@ + + + citizen_criminal_liability_fz53_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 160 + 304 + + + + check_if_citizen_criminal_liability_fz53_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_citizen_criminal_liability_fz53_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + citizen_criminal_liability_fz53_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 784 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1104 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_on_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 1104 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 784 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 784 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 784 + 800 + + + + + + Start + check_if_citizen_criminal_liability_fz53_job_exists.hpl + Y + Y + Y + + + check_if_citizen_criminal_liability_fz53_job_exists.hpl + citizen_criminal_liability_fz53_job_exists_check + Y + Y + N + + + citizen_criminal_liability_fz53_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + citizen_criminal_liability_fz53_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 896 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 896 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 704 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + citizen_criminal_liability_fz53_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 184 + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/job_citizen_criminal_liability_fz53.hwf b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/job_citizen_criminal_liability_fz53.hwf deleted file mode 100644 index 05ee576..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/job_citizen_criminal_liability_fz53.hwf +++ /dev/null @@ -1,2482 +0,0 @@ - - - job_citizen_criminal_liability_fz53 - Y - - - - 0 - - - 2025/06/05 14:27:15.055 - - - 2025/06/05 14:27:15.055 - - - M_R_CR_DATE - 3001-01-01 00:00:00 - - - - M_R_UP_DATE - - - - - - - Start - - SPECIAL - - 1 - 12 - 60 - 0 - 0 - N - 0 - 1 - N - 96 - 400 - - - - checkpoint_job_citizen_criminal_liability_fz53.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 1136 - 1280 - - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2352 - 400 - - - - citizen_criminal_liability_fz53_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2736 - 80 - - - - citizen_criminal_liability_fz53_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2736 - 240 - - - - citizen_criminal_liability_fz53_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2736 - 400 - - - - citizen_criminal_liability_fz53_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2736 - 560 - - - - citizen_criminal_liability_fz53_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2736 - 720 - - - - Abort workflow - - ABORT - - N - N - 2336 - 208 - - - - Success new citizen_criminal_liability_fz53 - - SUCCESS - - N - 3920 - 432 - - - - branching_citizen_criminal_liability_fz53.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 1584 - 1280 - - - - Simple citizen_criminal_liability_fz53 WHERE SUCCESS - - SIMPLE_EVAL - - SUCCESS - string - true - equal - equal - N - variable - STATUS - N - 1632 - 1680 - - - - Simple citizen_criminal_liability_fz53 WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 1984 - 1280 - - - - recruitment_rows_five_flow_if_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/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 - - - - delta_citizen_criminal_liability_fz53_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow1.hpl - - - Basic - - - M_R_UP_DATE - - ${M_R_UP_DATE} - - - ID_F1 - IDM_FLOW1 - - - Y - - Y - local - N - N - Y - N - 2912 - 1792 - - - - check_if_job_citizen_criminal_liability_fz53_exists.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_job_citizen_criminal_liability_fz53_exists.hpl - Basic - - Y - - N - local - N - N - Y - N - 448 - 400 - - - - Simple job_citizen_criminal_liability_fz53_exists check NEW - - SIMPLE_EVAL - - NEW - string - true - equal - equal - N - variable - STATUS - N - 896 - 400 - - - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2368 - 560 - - - - change_status_citizen_criminal_liability_fz53_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 80 - - - - change_status_citizen_criminal_liability_fz53_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 160 - - - - change_status_citizen_criminal_liability_fz53_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 240 - - - - change_status_citizen_criminal_liability_fz53_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 320 - - - - change_status_citizen_criminal_liability_fz53_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 400 - - - - change_status_citizen_criminal_liability_fz53_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 480 - - - - change_status_citizen_criminal_liability_fz53_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 560 - - - - change_status_citizen_criminal_liability_fz53_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 640 - - - - change_status_citizen_criminal_liability_fz53_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 720 - - - - change_status_citizen_criminal_liability_fz53_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 800 - - - - checkpoint_job_citizen_criminal_liability_fz53.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 3600 - 432 - - - - change_status_to_processing.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2304 - 1440 - - - - change_status_to_processing_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2480 - 2304 - - - - change_status_delta_citizen_criminal_liability_fz53_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 1792 - - - - change_status_delta_citizen_criminal_liability_fz53_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 1872 - - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2480 - 2112 - - - - Abort workflow 2 2 - - ABORT - - N - N - 2432 - 1952 - - - - delta_citizen_criminal_liability_fz53_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow2.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2912 - 1952 - - - - change_status_delta_citizen_criminal_liability_fz53_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 1952 - - - - change_status_delta_citizen_criminal_liability_fz53_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 2032 - - - - delta_citizen_criminal_liability_fz53_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow3.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2912 - 2112 - - - - change_status_delta_citizen_criminal_liability_fz53_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 2112 - - - - change_status_delta_citizen_criminal_liability_fz53_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 2192 - - - - delta_citizen_criminal_liability_fz53_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow4.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2912 - 2272 - - - - change_status_delta_citizen_criminal_liability_fz53_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 2272 - - - - change_status_delta_citizen_criminal_liability_fz53_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 2352 - - - - delta_citizen_criminal_liability_fz53_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow5.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2912 - 2432 - - - - change_status_delta_citizen_criminal_liability_fz53_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 2432 - - - - change_status_delta_citizen_criminal_liability_fz53_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_delta_citizen_criminal_liability_fz53_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3344 - 2512 - - - - branching_citizen_criminal_liability_fz53_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/branching_citizen_criminal_liability_fz53_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 1632 - 2112 - - - - Simple delta_citizen_criminal_liability_fz53 WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 2032 - 2112 - - - - delta_citizen_criminal_liability_fz53 success - - SUCCESS - - N - 2160 - 1952 - - - - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 3792 - 2112 - - - - Success delta_citizen_criminal_liability_fz53 - - SUCCESS - - N - 4208 - 2112 - - - - citizen_criminal_liability_fz53_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2736 - 960 - - - - citizen_criminal_liability_fz53_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2736 - 1120 - - - - citizen_criminal_liability_fz53_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2736 - 1280 - - - - citizen_criminal_liability_fz53_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2736 - 1440 - - - - citizen_criminal_liability_fz53_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2736 - 1600 - - - - Success citizen_criminal_liability_fz53 after error - - SUCCESS - - N - 3968 - 1312 - - - - change_status_citizen_criminal_liability_fz53_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 960 - - - - change_status_citizen_criminal_liability_fz53_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 1040 - - - - change_status_citizen_criminal_liability_fz53_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 1120 - - - - change_status_citizen_criminal_liability_fz53_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 1200 - - - - change_status_citizen_criminal_liability_fz53_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 1280 - - - - change_status_citizen_criminal_liability_fz53_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 1360 - - - - change_status_citizen_criminal_liability_fz53_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 1440 - - - - change_status_citizen_criminal_liability_fz53_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 1520 - - - - change_status_citizen_criminal_liability_fz53_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 1600 - - - - change_status_citizen_criminal_liability_fz53_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/change_status_citizen_criminal_liability_fz53_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 3136 - 1680 - - - - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/checkpoint_job_citizen_criminal_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 3600 - 1312 - - - - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - citizen_criminal_liability_fz53_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - citizen_criminal_liability_fz53_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - citizen_criminal_liability_fz53_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - citizen_criminal_liability_fz53_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - citizen_criminal_liability_fz53_flow5.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - Abort workflow - Y - N - N - - - branching_citizen_criminal_liability_fz53.hpl - Simple citizen_criminal_liability_fz53 WHERE ERROR - Y - N - Y - - - branching_citizen_criminal_liability_fz53.hpl - Simple citizen_criminal_liability_fz53 WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - - - Start - check_if_job_citizen_criminal_liability_fz53_exists.hpl - Y - Y - Y - - - check_if_job_citizen_criminal_liability_fz53_exists.hpl - Simple job_citizen_criminal_liability_fz53_exists check NEW - Y - Y - N - - - citizen_criminal_liability_fz53_flow1.hpl - change_status_citizen_criminal_liability_fz53_flow1_success.hpl - Y - Y - N - - - citizen_criminal_liability_fz53_flow1.hpl - change_status_citizen_criminal_liability_fz53_flow1_error.hpl - Y - N - N - - - citizen_criminal_liability_fz53_flow2.hpl - change_status_citizen_criminal_liability_fz53_flow2_success.hpl - Y - Y - N - - - citizen_criminal_liability_fz53_flow2.hpl - change_status_citizen_criminal_liability_fz53_flow2_error.hpl - Y - N - N - - - citizen_criminal_liability_fz53_flow3.hpl - change_status_citizen_criminal_liability_fz53_flow3_success.hpl - Y - Y - N - - - citizen_criminal_liability_fz53_flow3.hpl - change_status_citizen_criminal_liability_fz53_flow3_error.hpl - Y - N - N - - - citizen_criminal_liability_fz53_flow4.hpl - change_status_citizen_criminal_liability_fz53_flow4_success.hpl - Y - Y - N - - - citizen_criminal_liability_fz53_flow4.hpl - change_status_citizen_criminal_liability_fz53_flow4_error.hpl - Y - N - N - - - citizen_criminal_liability_fz53_flow5.hpl - change_status_citizen_criminal_liability_fz53_flow5_success.hpl - Y - Y - N - - - citizen_criminal_liability_fz53_flow5.hpl - change_status_citizen_criminal_liability_fz53_flow5_error.hpl - Y - N - N - - - change_status_citizen_criminal_liability_fz53_flow5_error.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow5_success.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow4_error.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow4_success.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow3_error.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow3_success.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow2_error.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow2_success.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow1_error.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow1_success.hpl - checkpoint_job_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - checkpoint_job_citizen_criminal_liability_fz53.hpl - Success new citizen_criminal_liability_fz53 - Y - Y - N - - - checkpoint_job_citizen_criminal_liability_fz53.hpl (2) - branching_citizen_criminal_liability_fz53.hpl - Y - N - Y - - - Simple job_citizen_criminal_liability_fz53_exists check NEW - checkpoint_job_citizen_criminal_liability_fz53.hpl (2) - Y - N - N - - - delta_citizen_criminal_liability_fz53_flow1.hpl - change_status_delta_citizen_criminal_liability_fz53_flow1_success.hpl - Y - Y - N - - - delta_citizen_criminal_liability_fz53_flow1.hpl - change_status_delta_citizen_criminal_liability_fz53_flow1_error.hpl - Y - N - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - change_status_to_processing.hpl - Y - Y - N - - - Simple job_citizen_criminal_liability_fz53_exists check NEW - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - change_status_to_processing.hpl (2) - Y - Y - N - - - Simple citizen_criminal_liability_fz53 WHERE ERROR - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl (2) - delta_citizen_criminal_liability_fz53_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl (2) - change_status_to_processing_delta.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl (2) - Abort workflow 2 2 - Y - N - N - - - delta_citizen_criminal_liability_fz53_flow2.hpl - change_status_delta_citizen_criminal_liability_fz53_flow2_success.hpl - Y - Y - N - - - delta_citizen_criminal_liability_fz53_flow2.hpl - change_status_delta_citizen_criminal_liability_fz53_flow2_error.hpl - Y - N - N - - - delta_citizen_criminal_liability_fz53_flow3.hpl - change_status_delta_citizen_criminal_liability_fz53_flow3_success.hpl - Y - Y - N - - - delta_citizen_criminal_liability_fz53_flow3.hpl - change_status_delta_citizen_criminal_liability_fz53_flow3_error.hpl - Y - N - N - - - delta_citizen_criminal_liability_fz53_flow4.hpl - change_status_delta_citizen_criminal_liability_fz53_flow4_success.hpl - Y - Y - N - - - delta_citizen_criminal_liability_fz53_flow4.hpl - change_status_delta_citizen_criminal_liability_fz53_flow4_error.hpl - Y - N - N - - - delta_citizen_criminal_liability_fz53_flow5.hpl - change_status_delta_citizen_criminal_liability_fz53_flow5_success.hpl - Y - Y - N - - - delta_citizen_criminal_liability_fz53_flow5.hpl - change_status_delta_citizen_criminal_liability_fz53_flow5_error.hpl - Y - N - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl (2) - delta_citizen_criminal_liability_fz53_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl (2) - delta_citizen_criminal_liability_fz53_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl (2) - delta_citizen_criminal_liability_fz53_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl (2) - delta_citizen_criminal_liability_fz53_flow5.hpl - Y - Y - N - - - Simple citizen_criminal_liability_fz53 WHERE SUCCESS - branching_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - Simple delta_citizen_criminal_liability_fz53 WHERE ERROR - delta_citizen_criminal_liability_fz53 success - Y - N - N - - - branching_citizen_criminal_liability_fz53_delta.hpl - Simple delta_citizen_criminal_liability_fz53 WHERE ERROR - Y - Y - N - - - Simple delta_citizen_criminal_liability_fz53 WHERE ERROR - recruitment_rows_five_flow_citizen_criminal_liability_fz53.hpl (2) - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow1_success.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow3_success.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow2_error.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow2_success.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow1_error.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow3_error.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow4_success.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow4_error.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow5_success.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_criminal_liability_fz53_flow5_error.hpl - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Y - Y - N - - - checkpoint_job_citizen_criminal_liability_fz53_delta.hpl - Success delta_citizen_criminal_liability_fz53 - Y - Y - N - - - citizen_criminal_liability_fz53_flow1.hpl 2 - change_status_citizen_criminal_liability_fz53_flow1_success.hpl 2 - Y - Y - N - - - citizen_criminal_liability_fz53_flow1.hpl 2 - change_status_citizen_criminal_liability_fz53_flow1_error.hpl 2 - Y - N - N - - - citizen_criminal_liability_fz53_flow2.hpl 2 - change_status_citizen_criminal_liability_fz53_flow2_success.hpl 2 - Y - Y - N - - - citizen_criminal_liability_fz53_flow2.hpl 2 - change_status_citizen_criminal_liability_fz53_flow2_error.hpl 2 - Y - N - N - - - citizen_criminal_liability_fz53_flow3.hpl 2 - change_status_citizen_criminal_liability_fz53_flow3_success.hpl 2 - Y - Y - N - - - citizen_criminal_liability_fz53_flow3.hpl 2 - change_status_citizen_criminal_liability_fz53_flow3_error.hpl 2 - Y - N - N - - - citizen_criminal_liability_fz53_flow4.hpl 2 - change_status_citizen_criminal_liability_fz53_flow4_success.hpl 2 - Y - Y - N - - - citizen_criminal_liability_fz53_flow4.hpl 2 - change_status_citizen_criminal_liability_fz53_flow4_error.hpl 2 - Y - N - N - - - citizen_criminal_liability_fz53_flow5.hpl 2 - change_status_citizen_criminal_liability_fz53_flow5_success.hpl 2 - Y - Y - N - - - citizen_criminal_liability_fz53_flow5.hpl 2 - change_status_citizen_criminal_liability_fz53_flow5_error.hpl 2 - Y - N - N - - - change_status_citizen_criminal_liability_fz53_flow1_success.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow1_error.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow2_success.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow2_error.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow3_success.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow3_error.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow4_success.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow4_error.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow5_success.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_criminal_liability_fz53_flow5_error.hpl 2 - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Y - N - Y - - - checkpoint_job_citizen_criminal_liability_fz53.hpl 2 - Success citizen_criminal_liability_fz53 after error - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_criminal_liability_fz53_flow3.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_criminal_liability_fz53_flow2.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_criminal_liability_fz53_flow1.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_criminal_liability_fz53_flow4.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_criminal_liability_fz53_flow5.hpl 2 - Y - Y - N - - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 72 - 1088 - 176 - 0001-01-01 00:00:00 - -3001-01-01 00:00:00 - - 114 - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl new file mode 100644 index 0000000..175910a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl @@ -0,0 +1,407 @@ + + + + citizen_criminal_liability_fz53_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 320 + + + + Table input + TableInput + + N + + 1 + + none + + + postgres.decision-document-service + N + + SELECT + i.recruit_id, + i.created_at, + i.updated_at, + --, -- сведения о факте уголовного преследования + i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) + i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела + i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело + i.decision_number AS case_number, -- номер уголовного дела (судебный) + i.decision_date AS sentence_date, -- дата приговора + i.extra_info->>'court' AS court_decision, -- суд вынесший приговор + CASE + WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' + WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' + WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' + WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' + ELSE NULL + END AS type_punishment, -- вид наказания + CASE + WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' + WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' + ELSE null + END AS decision_reason, -- Причины уголовного наказания в связи с фз53 + i.hidden + --has_criminal_liability_fz53 +FROM public.infringement i +JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= i.created_at + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты +WHERE --hidden IS FALSE AND + i.type = 'CRIMINAL' + +${LIMIT_FW} + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + created_at + created_at + + + updated_at + updated_at + + + case_number_before + case_number_before + + + date_initiation + date_initiation + + + body_initiated + body_initiated + + + case_number + case_number + + + sentence_date + sentence_date + + + court_decision + court_decision + + + type_punishment + type_punishment + + + decision_reason + decision_reason + + + hidden + hidden + + + N + N + N + N + Y + N + ervu_dashboard + Y + citizen_criminal_liability_fz53
+ N + Y + N + Y + + + 1024 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow1.hpl deleted file mode 100644 index 7593fb2..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow1.hpl +++ /dev/null @@ -1,183 +0,0 @@ - - - - citizen_criminal_liability_fz53_flow1 - Y - - - - Normal - 0 - - - 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 - - - - = - created_at - created_at - - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 880 - 288 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F1}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F1}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 448 - 288 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow2.hpl deleted file mode 100644 index 29c6100..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow2.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - citizen_criminal_liability_fz53_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 - - - = - created_at - created_at - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 880 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F2}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 448 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow3.hpl deleted file mode 100644 index 17ccb53..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow3.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - citizen_criminal_liability_fz53_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 - - - = - created_at - created_at - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 1120 - 384 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F3}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 688 - 384 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow4.hpl deleted file mode 100644 index 67ebd63..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow4.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - citizen_criminal_liability_fz53_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 - - - = - created_at - created_at - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 1104 - 416 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F4}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 672 - 416 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow5.hpl deleted file mode 100644 index 811495c..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow5.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - citizen_criminal_liability_fz53_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 - - - = - created_at - created_at - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 944 - 384 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F5}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 512 - 384 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl new file mode 100644 index 0000000..933a736 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl @@ -0,0 +1,422 @@ + + + + citizen_criminal_liability_fz53_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 944 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1248 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + created_at + created_at + + ervu_dashboard + citizen_criminal_liability_fz53
+ + recruit_id + recruit_id + N + + + created_at + created_at + N + + + updated_at + updated_at + Y + + + case_number_before + case_number_before + Y + + + date_initiation + date_initiation + Y + + + body_initiated + body_initiated + Y + + + case_number + case_number + Y + + + sentence_date + sentence_date + Y + + + court_decision + court_decision + Y + + + type_punishment + type_punishment + Y + + + decision_reason + decision_reason + Y + + + hidden + hidden + Y + +
+ N + + + 944 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.decision-document-service + N + + SELECT + i.recruit_id, + i.created_at, + i.updated_at, + --, -- сведения о факте уголовного преследования + i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) + i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела + i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело + i.decision_number AS case_number, -- номер уголовного дела (судебный) + i.decision_date AS sentence_date, -- дата приговора + i.extra_info->>'court' AS court_decision, -- суд вынесший приговор + CASE + WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' + WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' + WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' + WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' + ELSE NULL + END AS type_punishment, -- вид наказания + CASE + WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' + WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' + ELSE null + END AS decision_reason, -- Причины уголовного наказания в связи с фз53 + i.hidden + --has_criminal_liability_fz53 +FROM public.infringement i +JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND i.updated_at >= '${M_R_UP_DATE}'::timestamp --coalesce(i.updated_at,i.created_at) + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты +WHERE --hidden IS FALSE AND + i.type = 'CRIMINAL' + +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl new file mode 100644 index 0000000..6edf97e --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl @@ -0,0 +1,437 @@ + + + + citizen_criminal_liability_fz53_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 960 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + created_at + created_at + + ervu_dashboard + citizen_criminal_liability_fz53
+ + recruit_id + recruit_id + N + + + created_at + created_at + N + + + updated_at + updated_at + Y + + + case_number_before + case_number_before + Y + + + date_initiation + date_initiation + Y + + + body_initiated + body_initiated + Y + + + case_number + case_number + Y + + + sentence_date + sentence_date + Y + + + court_decision + court_decision + Y + + + type_punishment + type_punishment + Y + + + decision_reason + decision_reason + Y + + + hidden + hidden + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.decision-document-service + N + + SELECT + i.recruit_id, + i.created_at, + i.updated_at, + --, -- сведения о факте уголовного преследования + i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) + i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела + i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело + i.decision_number AS case_number, -- номер уголовного дела (судебный) + i.decision_date AS sentence_date, -- дата приговора + i.extra_info->>'court' AS court_decision, -- суд вынесший приговор + CASE + WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' + WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' + WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' + WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' + ELSE NULL + END AS type_punishment, -- вид наказания + CASE + WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' + WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' + ELSE null + END AS decision_reason, -- Причины уголовного наказания в связи с фз53 + i.hidden + --has_criminal_liability_fz53 +FROM public.infringement i +JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= i.created_at + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты +WHERE --hidden IS FALSE AND + i.type = 'CRIMINAL' + +${LIMIT_FW} + Y + + + 480 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow1.hpl deleted file mode 100644 index bd7d195..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow1.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - delta_citizen_criminal_liability_fz53_flow1 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 928 - 336 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F1}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F1}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 496 - 336 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow2.hpl deleted file mode 100644 index eb09efe..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow2.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - delta_citizen_criminal_liability_fz53_flow2 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 1040 - 384 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F2}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 608 - 384 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow3.hpl deleted file mode 100644 index 1fa9fe1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow3.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - delta_citizen_criminal_liability_fz53_flow3 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 1056 - 224 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F3}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 624 - 224 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow4.hpl deleted file mode 100644 index f15f7f6..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow4.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - delta_citizen_criminal_liability_fz53_flow4 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 960 - 416 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F4}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 528 - 416 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow5.hpl deleted file mode 100644 index 99a4d0a..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/delta_citizen_criminal_liability_fz53_flow5.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - delta_citizen_criminal_liability_fz53_flow5 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_criminal_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - sentence_date - sentence_date - Y - - - court_decision - court_decision - Y - - - type_punishment - type_punishment - Y - - - decision_reason - decision_reason - Y - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - Y - -
- N - - - 1184 - 400 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - --, -- сведения о факте уголовного преследования - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер уголовного дела (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения уголовного дела - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший уголовное дело - i.decision_number AS case_number, -- номер уголовного дела (судебный) - i.decision_date AS sentence_date, -- дата приговора - i.extra_info->>'court' AS court_decision, -- суд вынесший приговор - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Штраф' - WHEN i.extra_info->>'punishment' = '2' THEN 'Обязательные работы' - WHEN i.extra_info->>'punishment' = '3' THEN 'Арест' - WHEN i.extra_info->>'punishment' = '4' THEN 'Лишение свободы на определенный срок' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.decision_reason = '1' THEN 'Уклонение от призыва на военную службу' - WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' - ELSE null - END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_criminal_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F5}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE --hidden IS FALSE AND - i.type = 'CRIMINAL' - Y - - - 752 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..e4d32f9 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + citizen_criminal_liability_fz53_flow_delta.hpl + Y + + + Table input + citizen_criminal_liability_fz53_flow_delta.hpl 2 + Y + + + Table input + citizen_criminal_liability_fz53_flow_delta.hpl 3 + Y + + + Table input + citizen_criminal_liability_fz53_flow_delta.hpl 4 + Y + + + Table input + citizen_criminal_liability_fz53_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_criminal_liability_fz53_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + citizen_criminal_liability_fz53_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 128 + + + + citizen_criminal_liability_fz53_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 208 + + + + citizen_criminal_liability_fz53_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 288 + + + + citizen_criminal_liability_fz53_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 368 + + + + citizen_criminal_liability_fz53_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..d7bd8bb --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + citizen_criminal_liability_fz53_flow_repeat.hpl + Y + + + Table input + citizen_criminal_liability_fz53_flow_repeat.hpl 2 + Y + + + Table input + citizen_criminal_liability_fz53_flow_repeat.hpl 3 + Y + + + Table input + citizen_criminal_liability_fz53_flow_repeat.hpl 4 + Y + + + Table input + citizen_criminal_liability_fz53_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_criminal_liability_fz53_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + citizen_criminal_liability_fz53_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 496 + 208 + + + + citizen_criminal_liability_fz53_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 496 + 288 + + + + citizen_criminal_liability_fz53_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 496 + 368 + + + + citizen_criminal_liability_fz53_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 496 + 448 + + + + citizen_criminal_liability_fz53_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 496 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_rows_five_flow_if_error.hpl deleted file mode 100644 index b7e3e03..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitment_rows_five_flow_if_error.hpl +++ /dev/null @@ -1,185 +0,0 @@ - - - - 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 -fr_check AS ( - SELECT - last_recruitment_id AS recruitment_id, - recruitment_created_date, - status, - job_name - FROM public.etl_checkpoints - WHERE status = 'ERROR' AND job_name IN ('citizen_criminal_liability_fz53_flow1', 'citizen_criminal_liability_fz53_flow2', 'citizen_criminal_liability_fz53_flow3', 'citizen_criminal_liability_fz53_flow4', 'citizen_criminal_liability_fz53_flow5') -), -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 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow1') THEN created_at END) AS cr_flow1, - MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow1') THEN idm_id::text END) AS idm_flow1, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow2') THEN created_at END) AS cr_flow2, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow2') THEN idm_id::text END) AS idm_flow2, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow3') THEN created_at END) AS cr_flow3, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow3') THEN idm_id::text END) AS idm_flow3, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow4') THEN created_at END) AS cr_flow4, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow4') THEN idm_id::text END) AS idm_flow4, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow5') THEN created_at END) AS cr_flow5, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_criminal_liability_fz53_flow5') THEN idm_id::text END) AS idm_flow5 - FROM splitted - GROUP BY position -), -remains as ( - SELECT - position, - 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 - WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) - OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) - OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) - OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) - OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) - order by position -), -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/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitments_five_flow.hpl new file mode 100644 index 0000000..eef528e --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + citizen_criminal_liability_fz53_flow.hpl + Y + + + Get all recruitments ordered by created_date + citizen_criminal_liability_fz53_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + citizen_criminal_liability_fz53_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + citizen_criminal_liability_fz53_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + citizen_criminal_liability_fz53_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + citizen_criminal_liability_fz53_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 144 + + + + citizen_criminal_liability_fz53_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 224 + + + + citizen_criminal_liability_fz53_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 304 + + + + citizen_criminal_liability_fz53_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 384 + + + + citizen_criminal_liability_fz53_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_criminal_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53.hpl deleted file mode 100644 index 8ad6911..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53.hpl +++ /dev/null @@ -1,124 +0,0 @@ - - - - branching_citizen_liability_fz53 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_citizen_liability_fz53' - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53_delta.hpl deleted file mode 100644 index 45f831f..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53_delta.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - branching_citizen_liability_fz53_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - COALESCE(job_name, 'job_citizen_liability_fz53_delta') AS PIPELINE, - COALESCE(status, 'ERROR') AS STATUS, - current_timestamp::timestamp as record_created -FROM ( - select - CASE - WHEN status = 'PROCESSING' THEN 'ERROR' - ELSE status - END AS status, - job_name - from public.etl_checkpoints - where job_name = 'job_citizen_liability_fz53_delta' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_liability_fz53_delta' - ) -) t - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/check_if_need_to_repeat_job.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow4_error.hpl rename to mappings/info_recruits/citizen_tables/citizen_liability_fz53/check_if_need_to_repeat_job.hpl index 13ffe89..657e764 100644 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow4_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/check_if_need_to_repeat_job.hpl @@ -1,7 +1,7 @@ - change_status_delta_snils_inn_flow4_error + check_if_need_to_repeat_job Y @@ -13,22 +13,22 @@ 1000 100 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 Table input - Insert / update + Set variables Y - Insert / update - InsertUpdate + Set variables + SetVariable Y @@ -37,37 +37,18 @@ none - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y - 1152 - 304 + 624 + 288
@@ -84,15 +65,19 @@ ervu-dashboard N 0 - SELECT - 'delta_snils_inn_flow4' as job_name, - 'ERROR' as status, - current_timestamp as record_created + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_liability_fz53_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; N - 784 - 304 + 336 + 288 diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_error.hpl deleted file mode 100644 index 51525dd..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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 - 'citizen_liability_fz53_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_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_success.hpl deleted file mode 100644 index 516b012..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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 - 'citizen_liability_fz53_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_error.hpl deleted file mode 100644 index 5765a9e..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_liability_fz53_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_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_success.hpl deleted file mode 100644 index f68afc4..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_liability_fz53_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_error.hpl deleted file mode 100644 index 4436574..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_liability_fz53_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_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_success.hpl deleted file mode 100644 index 8988f0c..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_liability_fz53_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_error.hpl deleted file mode 100644 index 3f3c5b7..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_liability_fz53_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_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_success.hpl deleted file mode 100644 index 8e16f42..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_liability_fz53_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_error.hpl deleted file mode 100644 index 8b54d7e..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_liability_fz53_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 - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_success.hpl deleted file mode 100644 index ba11212..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_citizen_liability_fz53_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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_liability_fz53 ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'citizen_liability_fz53_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_error.hpl deleted file mode 100644 index 84f72b4..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow1' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_success.hpl deleted file mode 100644 index 81381cb..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow1' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl deleted file mode 100644 index 543c8ef..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow2' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_success.hpl deleted file mode 100644 index 24c35d7..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow2' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_error.hpl deleted file mode 100644 index 4fd1742..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow3' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_success.hpl deleted file mode 100644 index 463529d..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow3' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_error.hpl deleted file mode 100644 index 2c43fdf..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow4' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_success.hpl deleted file mode 100644 index 4e3ac61..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow4' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_error.hpl deleted file mode 100644 index 87c2807..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow5' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_success.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_success.hpl deleted file mode 100644 index befcfd5..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_citizen_liability_fz53_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_citizen_liability_fz53_flow5' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index 688659d..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - change_status_to_processing - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/11 16:14:31.162 - - - 2025/06/11 16:14:31.162 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 784 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'job_citizen_liability_fz53' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_liability_fz53_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_liability_fz53_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_liability_fz53_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_liability_fz53_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'citizen_liability_fz53_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing_delta.hpl deleted file mode 100644 index 46b50cc..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing_delta.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_to_processing_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 13:42:26.494 - - - 2025/06/16 13:42:26.494 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1248 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'delta_citizen_liability_fz53' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 832 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_job_citizen_criminal_liability_fz53_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_citizen_liability_fz53_job_exists.hpl similarity index 68% rename from mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_job_citizen_criminal_liability_fz53_exists.hpl rename to mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_citizen_liability_fz53_job_exists.hpl index c8d9198..10715f1 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_job_citizen_criminal_liability_fz53_exists.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_citizen_liability_fz53_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_citizen_criminal_liability_fz53_exists + check_if_citizen_liability_fz53_job_exists Y @@ -13,23 +13,23 @@ 1000 100 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - Table input - Set variables - Y - Set variables Write to log N + + Table input + Set variables + Y + Set variables @@ -44,21 +44,16 @@ - job_name - PIPE - PARENT_WORKFLOW - - - status - STATUS + job_executed_flag + JOB_EXECUTED_FLAG PARENT_WORKFLOW Y - 688 - 352 + 672 + 336 @@ -75,29 +70,17 @@ ervu-dashboard N 0 - SELECT - COALESCE(job_name, 'job_citizen_criminal_liability_fz53') AS job_name, - COALESCE(status, 'NEW') AS status, - current_timestamp::timestamp as record_created -FROM ( - SELECT job_name, status - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_criminal_liability_fz53' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_criminal_liability_fz53' - ) -) t + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'recruits_info_job' + limit 1 + ) AS job_executed_flag; N - 400 - 352 + 384 + 336 @@ -120,8 +103,8 @@ FROM ( ${STATUS} - 960 - 240 + 944 + 224 diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_citizen_liability_fz53_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_citizen_liability_fz53_error.hpl deleted file mode 100644 index 0d9cb80..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_citizen_liability_fz53_error.hpl +++ /dev/null @@ -1,273 +0,0 @@ - - - - checkpoint_snils_inn_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_child ch on ch.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/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53.hpl deleted file mode 100644 index a261d64..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_citizen_liability_fz53 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - - - Table input - Insert / update - Y - - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'citizen_liability_fz53_flow1', - 'citizen_liability_fz53_flow2', - 'citizen_liability_fz53_flow3', - 'citizen_liability_fz53_flow4', - 'citizen_liability_fz53_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'citizen_liability_fz53_flow1', - 'citizen_liability_fz53_flow2', - 'citizen_liability_fz53_flow3', - 'citizen_liability_fz53_flow4', - 'citizen_liability_fz53_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_citizen_liability_fz53' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53_delta.hpl deleted file mode 100644 index e5f3aa0..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53_delta.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_citizen_liability_fz53_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - - - Table input - Insert / update - Y - - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'delta_citizen_liability_fz53_flow1', - 'delta_citizen_liability_fz53_flow2', - 'delta_citizen_liability_fz53_flow3', - 'delta_citizen_liability_fz53_flow4', - 'delta_citizen_liability_fz53_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'delta_citizen_liability_fz53_flow1', - 'delta_citizen_liability_fz53_flow2', - 'delta_citizen_liability_fz53_flow3', - 'delta_citizen_liability_fz53_flow4', - 'delta_citizen_liability_fz53_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_citizen_liability_fz53_delta' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/citizen_liability_fz53_job.hwf b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/citizen_liability_fz53_job.hwf new file mode 100644 index 0000000..920fc8d --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/citizen_liability_fz53_job.hwf @@ -0,0 +1,358 @@ + + + citizen_liability_fz53_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 192 + 304 + + + + check_if_citizen_liability_fz53_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_citizen_liability_fz53_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + citizen_liability_fz53_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 752 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1024 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_on_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 992 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 752 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 752 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 752 + 800 + + + + + + Start + check_if_citizen_liability_fz53_job_exists.hpl + Y + Y + Y + + + check_if_citizen_liability_fz53_job_exists.hpl + citizen_liability_fz53_job_exists_check + Y + Y + N + + + citizen_liability_fz53_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + citizen_liability_fz53_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 864 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 864 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 672 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + recruits_info_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 114 + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/job_citizen_liability_fz53.hwf b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/job_citizen_liability_fz53.hwf deleted file mode 100644 index b6fe762..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/job_citizen_liability_fz53.hwf +++ /dev/null @@ -1,2480 +0,0 @@ - - - job_citizen_liability_fz53 - Y - - - - 0 - - - 2025/06/05 14:27:15.055 - - - 2025/06/05 14:27:15.055 - - - M_R_CR_DATE - 3001-01-01 00:00:00 - - - - M_R_UP_DATE - - - - - - - Start - - SPECIAL - - 1 - 12 - 60 - 0 - 0 - N - 0 - 1 - N - 368 - 400 - - - - checkpoint_job_citizen_liability_fz53.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 1136 - 1280 - - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2352 - 400 - - - - citizen_liability_fz53_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 80 - - - - citizen_liability_fz53_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 240 - - - - citizen_liability_fz53_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 400 - - - - citizen_liability_fz53_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 560 - - - - citizen_liability_fz53_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 720 - - - - Abort workflow - - ABORT - - N - N - 2336 - 208 - - - - Success new citizen_liability_fz53 - - SUCCESS - - N - 3728 - 432 - - - - branching_citizen_liability_fz53.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 1536 - 1280 - - - - Simple citizen_liability_fz53 WHERE SUCCESS - - SIMPLE_EVAL - - SUCCESS - string - true - equal - equal - N - variable - STATUS - N - 1584 - 1680 - - - - Simple citizen_liability_fz53 WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 1840 - 1280 - - - - recruitment_rows_five_flow_if_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_rows_five_flow_if_error.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2384 - 1280 - - - - Abort workflow 2 - - ABORT - - N - N - 2320 - 1040 - - - - delta_citizen_liability_fz53_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow1.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2640 - 1792 - - - - check_if_job_citizen_liability_fz53_exists.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_job_citizen_liability_fz53_exists.hpl - Basic - - Y - - N - local - N - N - Y - N - 576 - 400 - - - - Simple job_citizen_liability_fz53_exists check NEW - - SIMPLE_EVAL - - NEW - string - true - equal - equal - N - variable - STATUS - N - 896 - 400 - - - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2368 - 560 - - - - change_status_citizen_liability_fz53_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 80 - - - - change_status_citizen_liability_fz53_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 160 - - - - change_status_citizen_liability_fz53_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 240 - - - - change_status_citizen_liability_fz53_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 320 - - - - change_status_citizen_liability_fz53_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 400 - - - - change_status_citizen_liability_fz53_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 480 - - - - change_status_citizen_liability_fz53_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 560 - - - - change_status_citizen_liability_fz53_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 640 - - - - change_status_citizen_liability_fz53_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 720 - - - - change_status_citizen_liability_fz53_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 800 - - - - checkpoint_job_citizen_liability_fz53.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 3456 - 432 - - - - change_status_to_processing.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2288 - 1424 - - - - change_status_to_processing_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_to_processing_delta.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2384 - 2304 - - - - change_status_delta_citizen_liability_fz53_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1792 - - - - change_status_delta_citizen_liability_fz53_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1872 - - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2320 - 2112 - - - - Abort workflow 2 2 - - ABORT - - N - N - 2336 - 1952 - - - - delta_citizen_liability_fz53_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow2.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2640 - 1952 - - - - change_status_delta_citizen_liability_fz53_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1952 - - - - change_status_delta_citizen_liability_fz53_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2032 - - - - delta_citizen_liability_fz53_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow3.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2640 - 2112 - - - - change_status_delta_citizen_liability_fz53_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2112 - - - - change_status_delta_citizen_liability_fz53_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2192 - - - - delta_citizen_liability_fz53_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow4.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2640 - 2272 - - - - change_status_delta_citizen_liability_fz53_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2272 - - - - change_status_delta_citizen_liability_fz53_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2352 - - - - delta_citizen_liability_fz53_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow5.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2640 - 2432 - - - - change_status_delta_citizen_liability_fz53_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2432 - - - - change_status_delta_citizen_liability_fz53_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2512 - - - - branching_citizen_liability_fz53_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/branching_citizen_liability_fz53_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 1616 - 2112 - - - - Simple delta_citizen_liability_fz53 WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 1936 - 2112 - - - - delta_citizen_liability_fz53 success - - SUCCESS - - N - 2160 - 1952 - - - - checkpoint_job_citizen_liability_fz53_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2112 - - - - Success delta_citizen_liability_fz53 - - SUCCESS - - N - 3728 - 2112 - - - - citizen_liability_fz53_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 960 - - - - citizen_liability_fz53_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 1120 - - - - citizen_liability_fz53_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 1280 - - - - citizen_liability_fz53_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 1440 - - - - citizen_liability_fz53_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 1600 - - - - Success citizen_liability_fz53 after error - - SUCCESS - - N - 3728 - 1312 - - - - change_status_citizen_liability_fz53_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 960 - - - - change_status_citizen_liability_fz53_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1040 - - - - change_status_citizen_liability_fz53_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1120 - - - - change_status_citizen_liability_fz53_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1200 - - - - change_status_citizen_liability_fz53_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1280 - - - - change_status_citizen_liability_fz53_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1360 - - - - change_status_citizen_liability_fz53_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1440 - - - - change_status_citizen_liability_fz53_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1520 - - - - change_status_citizen_liability_fz53_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1600 - - - - change_status_citizen_liability_fz53_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_citizen_liability_fz53_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1680 - - - - checkpoint_job_citizen_liability_fz53.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/checkpoint_job_citizen_liability_fz53.hpl - Basic - - Y - - N - local - N - N - Y - N - 3456 - 1312 - - - - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl - citizen_liability_fz53_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl - citizen_liability_fz53_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl - citizen_liability_fz53_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl - citizen_liability_fz53_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl - citizen_liability_fz53_flow5.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl - Abort workflow - Y - N - N - - - branching_citizen_liability_fz53.hpl - Simple citizen_liability_fz53 WHERE ERROR - Y - N - Y - - - branching_citizen_liability_fz53.hpl - Simple citizen_liability_fz53 WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - - - Start - check_if_job_citizen_liability_fz53_exists.hpl - Y - Y - Y - - - check_if_job_citizen_liability_fz53_exists.hpl - Simple job_citizen_liability_fz53_exists check NEW - Y - Y - N - - - citizen_liability_fz53_flow1.hpl - change_status_citizen_liability_fz53_flow1_success.hpl - Y - Y - N - - - citizen_liability_fz53_flow1.hpl - change_status_citizen_liability_fz53_flow1_error.hpl - Y - N - N - - - citizen_liability_fz53_flow2.hpl - change_status_citizen_liability_fz53_flow2_success.hpl - Y - Y - N - - - citizen_liability_fz53_flow2.hpl - change_status_citizen_liability_fz53_flow2_error.hpl - Y - N - N - - - citizen_liability_fz53_flow3.hpl - change_status_citizen_liability_fz53_flow3_success.hpl - Y - Y - N - - - citizen_liability_fz53_flow3.hpl - change_status_citizen_liability_fz53_flow3_error.hpl - Y - N - N - - - citizen_liability_fz53_flow4.hpl - change_status_citizen_liability_fz53_flow4_success.hpl - Y - Y - N - - - citizen_liability_fz53_flow4.hpl - change_status_citizen_liability_fz53_flow4_error.hpl - Y - N - N - - - citizen_liability_fz53_flow5.hpl - change_status_citizen_liability_fz53_flow5_success.hpl - Y - Y - N - - - citizen_liability_fz53_flow5.hpl - change_status_citizen_liability_fz53_flow5_error.hpl - Y - N - N - - - change_status_citizen_liability_fz53_flow5_error.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_liability_fz53_flow5_success.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_liability_fz53_flow4_error.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_liability_fz53_flow4_success.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_liability_fz53_flow3_error.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_liability_fz53_flow3_success.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_liability_fz53_flow2_error.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_liability_fz53_flow2_success.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_liability_fz53_flow1_error.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - change_status_citizen_liability_fz53_flow1_success.hpl - checkpoint_job_citizen_liability_fz53.hpl - Y - N - Y - - - checkpoint_job_citizen_liability_fz53.hpl - Success new citizen_liability_fz53 - Y - Y - N - - - checkpoint_job_citizen_liability_fz53.hpl (2) - branching_citizen_liability_fz53.hpl - Y - N - Y - - - Simple job_citizen_liability_fz53_exists check NEW - checkpoint_job_citizen_liability_fz53.hpl (2) - Y - N - N - - - delta_citizen_liability_fz53_flow1.hpl - change_status_delta_citizen_liability_fz53_flow1_success.hpl - Y - Y - N - - - delta_citizen_liability_fz53_flow1.hpl - change_status_delta_citizen_liability_fz53_flow1_error.hpl - Y - N - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl - change_status_to_processing.hpl - Y - Y - N - - - Simple job_citizen_liability_fz53_exists check NEW - recruitment_rows_five_flow_citizen_liability_fz53.hpl - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - change_status_to_processing.hpl (2) - Y - Y - N - - - Simple citizen_liability_fz53 WHERE ERROR - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl (2) - delta_citizen_liability_fz53_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl (2) - change_status_to_processing_delta.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl (2) - Abort workflow 2 2 - Y - N - N - - - delta_citizen_liability_fz53_flow2.hpl - change_status_delta_citizen_liability_fz53_flow2_success.hpl - Y - Y - N - - - delta_citizen_liability_fz53_flow2.hpl - change_status_delta_citizen_liability_fz53_flow2_error.hpl - Y - N - N - - - delta_citizen_liability_fz53_flow3.hpl - change_status_delta_citizen_liability_fz53_flow3_success.hpl - Y - Y - N - - - delta_citizen_liability_fz53_flow3.hpl - change_status_delta_citizen_liability_fz53_flow3_error.hpl - Y - N - N - - - delta_citizen_liability_fz53_flow4.hpl - change_status_delta_citizen_liability_fz53_flow4_success.hpl - Y - Y - N - - - delta_citizen_liability_fz53_flow4.hpl - change_status_delta_citizen_liability_fz53_flow4_error.hpl - Y - N - N - - - delta_citizen_liability_fz53_flow5.hpl - change_status_delta_citizen_liability_fz53_flow5_success.hpl - Y - Y - N - - - delta_citizen_liability_fz53_flow5.hpl - change_status_delta_citizen_liability_fz53_flow5_error.hpl - Y - N - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl (2) - delta_citizen_liability_fz53_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl (2) - delta_citizen_liability_fz53_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl (2) - delta_citizen_liability_fz53_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_citizen_liability_fz53.hpl (2) - delta_citizen_liability_fz53_flow5.hpl - Y - Y - N - - - Simple citizen_liability_fz53 WHERE SUCCESS - branching_citizen_liability_fz53_delta.hpl - Y - Y - N - - - Simple delta_citizen_liability_fz53 WHERE ERROR - delta_citizen_liability_fz53 success - Y - N - N - - - branching_citizen_liability_fz53_delta.hpl - Simple delta_citizen_liability_fz53 WHERE ERROR - Y - Y - N - - - Simple delta_citizen_liability_fz53 WHERE ERROR - recruitment_rows_five_flow_citizen_liability_fz53.hpl (2) - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow1_success.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow3_success.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow2_error.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow2_success.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow1_error.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow3_error.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow4_success.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow4_error.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow5_success.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - change_status_delta_citizen_liability_fz53_flow5_error.hpl - checkpoint_job_citizen_liability_fz53_delta.hpl - Y - Y - N - - - checkpoint_job_citizen_liability_fz53_delta.hpl - Success delta_citizen_liability_fz53 - Y - Y - N - - - citizen_liability_fz53_flow1.hpl 2 - change_status_citizen_liability_fz53_flow1_success.hpl 2 - Y - Y - N - - - citizen_liability_fz53_flow1.hpl 2 - change_status_citizen_liability_fz53_flow1_error.hpl 2 - Y - N - N - - - citizen_liability_fz53_flow2.hpl 2 - change_status_citizen_liability_fz53_flow2_success.hpl 2 - Y - Y - N - - - citizen_liability_fz53_flow2.hpl 2 - change_status_citizen_liability_fz53_flow2_error.hpl 2 - Y - N - N - - - citizen_liability_fz53_flow3.hpl 2 - change_status_citizen_liability_fz53_flow3_success.hpl 2 - Y - Y - N - - - citizen_liability_fz53_flow3.hpl 2 - change_status_citizen_liability_fz53_flow3_error.hpl 2 - Y - N - N - - - citizen_liability_fz53_flow4.hpl 2 - change_status_citizen_liability_fz53_flow4_success.hpl 2 - Y - Y - N - - - citizen_liability_fz53_flow4.hpl 2 - change_status_citizen_liability_fz53_flow4_error.hpl 2 - Y - N - N - - - citizen_liability_fz53_flow5.hpl 2 - change_status_citizen_liability_fz53_flow5_success.hpl 2 - Y - Y - N - - - citizen_liability_fz53_flow5.hpl 2 - change_status_citizen_liability_fz53_flow5_error.hpl 2 - Y - N - N - - - change_status_citizen_liability_fz53_flow1_success.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_liability_fz53_flow1_error.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_liability_fz53_flow2_success.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_liability_fz53_flow2_error.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_liability_fz53_flow3_success.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_liability_fz53_flow3_error.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_liability_fz53_flow4_success.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_liability_fz53_flow4_error.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_liability_fz53_flow5_success.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - change_status_citizen_liability_fz53_flow5_error.hpl 2 - checkpoint_job_citizen_liability_fz53.hpl 2 - Y - N - Y - - - checkpoint_job_citizen_liability_fz53.hpl 2 - Success citizen_liability_fz53 after error - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_liability_fz53_flow3.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_liability_fz53_flow2.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_liability_fz53_flow1.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_liability_fz53_flow4.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - citizen_liability_fz53_flow5.hpl 2 - Y - Y - N - - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 72 - 1088 - 176 - 0001-01-01 00:00:00 - -3001-01-01 00:00:00 - - 114 - - - - diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl new file mode 100644 index 0000000..c203dcb --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl @@ -0,0 +1,425 @@ + + + + citizen_liability_fz53_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 320 + + + + Table input + TableInput + + N + + 1 + + none + + + postgres.decision-document-service + N + + SELECT + i.recruit_id, + i.created_at, + i.updated_at, + i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) + i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении + i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении + i.decision_number AS case_number, -- номер дела об административном правонарушении + i.decision_date AS date_resolution, -- дата постановления + i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ + i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление + i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер + CASE + WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' + WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' + WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' + ELSE NULL + END AS reason_use, -- причина применения + i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера + i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания + CASE + WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' + WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' + ELSE NULL + END AS type_punishment, -- вид наказания + i.hidden + --has_liability_fz53 +FROM public.infringement i +JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= i.created_at + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты +WHERE -- hidden IS FALSE AND + type = 'ADMINISTRATIVE' + +${LIMIT_FW} + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + created_at + created_at + + + updated_at + updated_at + + + case_number_before + case_number_before + + + date_initiation + date_initiation + + + body_initiated + body_initiated + + + case_number + case_number + + + date_resolution + date_resolution + + + article_koap_rf + article_koap_rf + + + court_decision + court_decision + + + name_vc + name_vc + + + reason_use + reason_use + + + start_date + start_date + + + size_term_punishment + size_term_punishment + + + hidden + hidden + + + type_punishment + type_punishment + + + N + N + N + N + Y + N + ervu_dashboard + Y + citizen_liability_fz53
+ N + Y + N + Y + + + 1024 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow1.hpl deleted file mode 100644 index 61d564c..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow1.hpl +++ /dev/null @@ -1,205 +0,0 @@ - - - - citizen_liability_fz53_flow1 - Y - - - - Normal - 0 - - - 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 - - - - = - created_at - created_at - - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 880 - 288 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F1}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F1}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 448 - 288 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow2.hpl deleted file mode 100644 index 1950156..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow2.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - citizen_liability_fz53_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 - - - = - created_at - created_at - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 960 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F2}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 528 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow3.hpl deleted file mode 100644 index cb454d6..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow3.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - citizen_liability_fz53_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 - - - = - created_at - created_at - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 1056 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F3}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 624 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow4.hpl deleted file mode 100644 index 49a4f14..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow4.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - citizen_liability_fz53_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 - - - = - created_at - created_at - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 1008 - 384 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F4}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 576 - 384 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow5.hpl deleted file mode 100644 index 88a3711..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow5.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - citizen_liability_fz53_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 - - - = - created_at - created_at - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 1072 - 368 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F5}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 640 - 368 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl new file mode 100644 index 0000000..8ccde59 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl @@ -0,0 +1,443 @@ + + + + citizen_liability_fz53_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 944 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1248 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + created_at + created_at + + ervu_dashboard + citizen_liability_fz53
+ + recruit_id + recruit_id + N + + + created_at + created_at + N + + + updated_at + updated_at + Y + + + case_number_before + case_number_before + Y + + + date_initiation + date_initiation + Y + + + body_initiated + body_initiated + Y + + + case_number + case_number + Y + + + date_resolution + date_resolution + Y + + + article_koap_rf + article_koap_rf + Y + + + court_decision + court_decision + Y + + + name_vc + name_vc + Y + + + reason_use + reason_use + Y + + + start_date + start_date + Y + + + size_term_punishment + size_term_punishment + Y + + + type_punishment + type_punishment + Y + + + hidden + hidden + Y + +
+ N + + + 944 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.decision-document-service + N + SELECT + i.recruit_id, + i.created_at, + i.updated_at, + i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) + i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении + i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении + i.decision_number AS case_number, -- номер дела об административном правонарушении + i.decision_date AS date_resolution, -- дата постановления + i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ + i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление + i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер + CASE + WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' + WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' + WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' + ELSE NULL + END AS reason_use, -- причина применения + i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера + i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания + CASE + WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' + WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' + ELSE NULL + END AS type_punishment, -- вид наказания + i.hidden + --has_liability_fz53 +FROM public.infringement i +JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND i.updated_at >= '${M_R_UP_DATE}'::timestamp --coalesce(i.updated_at,i.created_at) + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты +WHERE -- hidden IS FALSE AND + type = 'ADMINISTRATIVE' + +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl new file mode 100644 index 0000000..674370a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl @@ -0,0 +1,459 @@ + + + + citizen_liability_fz53_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 960 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + created_at + created_at + + ervu_dashboard + citizen_liability_fz53
+ + recruit_id + recruit_id + N + + + created_at + created_at + N + + + updated_at + updated_at + Y + + + case_number_before + case_number_before + Y + + + date_initiation + date_initiation + Y + + + body_initiated + body_initiated + Y + + + case_number + case_number + Y + + + date_resolution + date_resolution + Y + + + article_koap_rf + article_koap_rf + Y + + + court_decision + court_decision + Y + + + name_vc + name_vc + Y + + + reason_use + reason_use + Y + + + start_date + start_date + Y + + + size_term_punishment + size_term_punishment + Y + + + type_punishment + type_punishment + Y + + + hidden + hidden + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.decision-document-service + N + + SELECT + i.recruit_id, + i.created_at, + i.updated_at, + i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) + i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении + i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении + i.decision_number AS case_number, -- номер дела об административном правонарушении + i.decision_date AS date_resolution, -- дата постановления + i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ + i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление + i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер + CASE + WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' + WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' + WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' + ELSE NULL + END AS reason_use, -- причина применения + i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера + i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания + CASE + WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' + WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' + ELSE NULL + END AS type_punishment, -- вид наказания + i.hidden + --has_liability_fz53 +FROM public.infringement i +JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= i.created_at + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты +WHERE -- hidden IS FALSE AND + type = 'ADMINISTRATIVE' + +${LIMIT_FW} + Y + + + 480 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow1.hpl deleted file mode 100644 index d336de5..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow1.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_citizen_liability_fz53_flow1 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 1168 - 336 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F1}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F1}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 736 - 336 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow2.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow2.hpl deleted file mode 100644 index 15704f1..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow2.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_citizen_liability_fz53_flow2 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 1056 - 240 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F2}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 624 - 240 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow3.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow3.hpl deleted file mode 100644 index e1fe0b5..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow3.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_citizen_liability_fz53_flow3 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 1152 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F3}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 720 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow4.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow4.hpl deleted file mode 100644 index 19d16e5..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow4.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_citizen_liability_fz53_flow4 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 1104 - 336 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F4}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 672 - 336 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow5.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow5.hpl deleted file mode 100644 index f18a7f4..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/delta_citizen_liability_fz53_flow5.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_citizen_liability_fz53_flow5 - 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 - - - = - created_at - created_at - - ervu_dashboard - citizen_liability_fz53
- - recruit_id - recruit_id - N - - - created_at - created_at - N - - - updated_at - updated_at - Y - - - case_number_before - case_number_before - Y - - - date_initiation - date_initiation - Y - - - body_initiated - body_initiated - Y - - - case_number - case_number - Y - - - date_resolution - date_resolution - Y - - - article_koap_rf - article_koap_rf - Y - - - court_decision - court_decision - Y - - - name_vc - name_vc - Y - - - reason_use - reason_use - Y - - - start_date - start_date - Y - - - size_term_punishment - size_term_punishment - Y - - - type_punishment - type_punishment - Y - - - has_liability_fz53 - has_liability_fz53 - Y - -
- N - - - 1184 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - postgres.decision-document-service - N - 0 - SELECT - i.recruit_id, - i.created_at, - i.updated_at, - i.extra_info->>'preTrialNumber' AS case_number_before, -- номер дела об административном правонарушении (досудебный) - i.extra_info->>'createInfringementDate' AS date_initiation, -- дата возбуждения дела об административном правонарушении - i.extra_info->>'organization' AS body_initiated, -- орган, возбудивший дело об административном правонарушении - i.decision_number AS case_number, -- номер дела об административном правонарушении - i.decision_date AS date_resolution, -- дата постановления - i.extra_info->>'reasonForAddEntry' AS article_koap_rf, -- пункт, часть, статья КоАП РФ - i.extra_info->>'court' AS court_decision, -- суд, вынесший постановление - i.extra_info->>'vkName' AS name_vc, -- военкомат, принявший решение о применении мер - CASE - WHEN i.decision_reason = '1' THEN 'Неисполнение гражданами обязанностей по воинскому учету' - WHEN i.decision_reason = '2' THEN 'Уклонение от медицинского обследования' - WHEN i.decision_reason = '3' THEN 'Умышленные порча или утрата документов воинского учета' - ELSE NULL - END AS reason_use, -- причина применения - i.extra_info->>'dateApplication' AS start_date, -- дата с которой наложена мера - i.extra_info->>'description' AS size_term_punishment, -- размер и срок наказания - CASE - WHEN i.extra_info->>'punishment' = '1' THEN 'Предупреждение' - WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' - ELSE NULL - END AS type_punishment, -- вид наказания - CASE - WHEN i.hidden is false THEN true - ELSE false - END AS has_liability_fz53 -FROM public.infringement i -JOIN public.recruit r ON r.id = i.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку - AND COALESCE(r.current_recruitment, r.target_recruitment) = '${ID_F5}' - --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты -WHERE -- hidden IS FALSE AND - type = 'ADMINISTRATIVE' - Y - - - 752 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..64316a1 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + citizen_liability_fz53_flow_delta.hpl + Y + + + Table input + citizen_liability_fz53_flow_delta.hpl 2 + Y + + + Table input + citizen_liability_fz53_flow_delta.hpl 3 + Y + + + Table input + citizen_liability_fz53_flow_delta.hpl 4 + Y + + + Table input + citizen_liability_fz53_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_liability_fz53_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + citizen_liability_fz53_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 128 + + + + citizen_liability_fz53_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 208 + + + + citizen_liability_fz53_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 288 + + + + citizen_liability_fz53_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 368 + + + + citizen_liability_fz53_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..597384a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + citizen_liability_fz53_flow_repeat.hpl + Y + + + Table input + citizen_liability_fz53_flow_repeat.hpl 2 + Y + + + Table input + citizen_liability_fz53_flow_repeat.hpl 3 + Y + + + Table input + citizen_liability_fz53_flow_repeat.hpl 4 + Y + + + Table input + citizen_liability_fz53_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizen_liability_fz53_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + citizen_liability_fz53_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 208 + + + + citizen_liability_fz53_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 288 + + + + citizen_liability_fz53_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 368 + + + + citizen_liability_fz53_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 448 + + + + citizen_liability_fz53_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_rows_five_flow_if_error.hpl deleted file mode 100644 index 92f9426..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_rows_five_flow_if_error.hpl +++ /dev/null @@ -1,185 +0,0 @@ - - - - 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 -fr_check AS ( - SELECT - last_recruitment_id AS recruitment_id, - recruitment_created_date, - status, - job_name - FROM public.etl_checkpoints - WHERE status = 'ERROR' AND job_name IN ('citizen_liability_fz53_flow1', 'citizen_liability_fz53_flow2', 'citizen_liability_fz53_flow3', 'citizen_liability_fz53_flow4', 'citizen_liability_fz53_flow5') -), -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 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow1') THEN created_at END) AS cr_flow1, - MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow1') THEN idm_id::text END) AS idm_flow1, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow2') THEN created_at END) AS cr_flow2, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow2') THEN idm_id::text END) AS idm_flow2, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow3') THEN created_at END) AS cr_flow3, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow3') THEN idm_id::text END) AS idm_flow3, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow4') THEN created_at END) AS cr_flow4, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow4') THEN idm_id::text END) AS idm_flow4, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow5') THEN created_at END) AS cr_flow5, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'citizen_liability_fz53_flow5') THEN idm_id::text END) AS idm_flow5 - FROM splitted - GROUP BY position -), -remains as ( - SELECT - position, - 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 - WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) - OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) - OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) - OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) - OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) - order by position -), -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/info_recruits/citizen_tables/citizen_liability_fz53/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitments_five_flow.hpl new file mode 100644 index 0000000..ccea1cd --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + citizen_liability_fz53_flow.hpl + Y + + + Get all recruitments ordered by created_date + citizen_liability_fz53_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + citizen_liability_fz53_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + citizen_liability_fz53_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + citizen_liability_fz53_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + citizen_liability_fz53_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + citizen_liability_fz53_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + citizen_liability_fz53_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + citizen_liability_fz53_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + citizen_liability_fz53_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_liability_fz53_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/snils_inn/branching_snils_inn.hpl b/mappings/info_recruits/citizen_tables/snils_inn/branching_snils_inn.hpl deleted file mode 100644 index aacbef5..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/branching_snils_inn.hpl +++ /dev/null @@ -1,124 +0,0 @@ - - - - branching_snils_inn - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_snils_inn' - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/snils_inn/branching_snils_inn_delta.hpl b/mappings/info_recruits/citizen_tables/snils_inn/branching_snils_inn_delta.hpl deleted file mode 100644 index 0415b07..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/branching_snils_inn_delta.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - branching_snils_inn_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/09 09:54:43.724 - - - 2025/06/09 09:54:43.724 - - - - - - Set variables 2 - Write to log 2 - N - - - Table input - Set variables 2 - Y - - - - Set variables 2 - SetVariable - - Y - - 1 - - none - - - - - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 1056 - 256 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - COALESCE(job_name, 'job_snils_inn_delta') AS PIPELINE, - COALESCE(status, 'ERROR') AS STATUS, - current_timestamp::timestamp as record_created -FROM ( - select - CASE - WHEN status = 'PROCESSING' THEN 'ERROR' - ELSE status - END AS status, - job_name - from public.etl_checkpoints - where job_name = 'job_snils_inn_delta' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_snils_inn_delta' - ) -) t - N - - - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow1_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/check_if_need_to_repeat_job.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow1_error.hpl rename to mappings/info_recruits/citizen_tables/snils_inn/check_if_need_to_repeat_job.hpl index 272ccc9..406fb97 100644 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow1_error.hpl +++ b/mappings/info_recruits/citizen_tables/snils_inn/check_if_need_to_repeat_job.hpl @@ -1,7 +1,7 @@ - change_status_delta_snils_inn_flow1_error + check_if_need_to_repeat_job Y @@ -13,22 +13,22 @@ 1000 100 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 - - 2025/06/16 12:20:06.191 + 2025/08/08 12:27:51.630 Table input - Insert / update + Set variables Y - Insert / update - InsertUpdate + Set variables + SetVariable Y @@ -37,37 +37,18 @@ none - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y - 1152 - 304 + 624 + 288
@@ -84,15 +65,19 @@ ervu-dashboard N 0 - SELECT - 'delta_snils_inn_flow1' as job_name, - 'ERROR' as status, - current_timestamp as record_created + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'recruits_info_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; N - 784 - 304 + 336 + 288 diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow1_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow1_success.hpl deleted file mode 100644 index 60a3e53..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow1_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_snils_inn_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow1' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_error.hpl deleted file mode 100644 index c2dbe25..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_error.hpl +++ /dev/null @@ -1,102 +0,0 @@ - - - - change_status_delta_snils_inn_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow2' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_success.hpl deleted file mode 100644 index 549321d..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_snils_inn_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow2' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_error.hpl deleted file mode 100644 index 681da71..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_snils_inn_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow3' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_success.hpl deleted file mode 100644 index 2f7cad3..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_snils_inn_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow3' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow4_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow4_success.hpl deleted file mode 100644 index 552dbf7..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow4_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_snils_inn_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow4' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_error.hpl deleted file mode 100644 index 93465e3..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_error.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_snils_inn_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow5' as job_name, - 'ERROR' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_success.hpl deleted file mode 100644 index c961ab0..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_success.hpl +++ /dev/null @@ -1,101 +0,0 @@ - - - - change_status_delta_snils_inn_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 12:20:06.191 - - - 2025/06/16 12:20:06.191 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1152 - 304 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'delta_snils_inn_flow5' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_error.hpl deleted file mode 100644 index 5bfe2fe..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_snils_inn_flow1_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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 - 'snils_inn_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_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_success.hpl deleted file mode 100644 index f6b19c4..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_snils_inn_flow1_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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 - 'snils_inn_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_error.hpl deleted file mode 100644 index 1c08c6d..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_snils_inn_flow2_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'snils_inn_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_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_success.hpl deleted file mode 100644 index 5a31299..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_snils_inn_flow2_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'snils_inn_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_error.hpl deleted file mode 100644 index 8955f9a..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_snils_inn_flow3_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'snils_inn_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_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_success.hpl deleted file mode 100644 index 1784e80..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_snils_inn_flow3_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'snils_inn_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_error.hpl deleted file mode 100644 index 164d123..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_snils_inn_flow4_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'snils_inn_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_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_success.hpl deleted file mode 100644 index d5f76cd..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_snils_inn_flow4_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'snils_inn_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -/* - union all - - SELECT - 'job_citizen_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max -*/ -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_error.hpl deleted file mode 100644 index 9763f85..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_snils_inn_flow5_error - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'snils_inn_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 - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_success.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_success.hpl deleted file mode 100644 index 72af375..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_snils_inn_flow5_success - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/16 09:14:18.787 - - - 2025/06/16 09:14:18.787 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - last_recruitment_id - last_recruitment_id - Y - - - record_created - record_created - Y - - - recruitment_created_date - recruitment_created_date - Y - - - status - status - Y - -
- N - - - 1056 - 400 - -
- - 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.snils ch on ch.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_flow1' as job_name, - idm_flow1 as last_recruitment_id, - cr_flow1 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow2' as job_name, - idm_flow2 as last_recruitment_id, - cr_flow2 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow3' as job_name, - idm_flow3 as last_recruitment_id, - cr_flow3 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all - - SELECT - 'job_citizen_flow4' as job_name, - idm_flow4 as last_recruitment_id, - cr_flow4 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - - union all -*/ - SELECT - 'snils_inn_flow5' as job_name, - idm_flow5 as last_recruitment_id, - cr_flow5 as recruitment_created_date, - 'SUCCESS' as status, - current_timestamp as record_created - from result_max - -) -select * from for_checkpoints - N - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index d0e503c..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing.hpl +++ /dev/null @@ -1,142 +0,0 @@ - - - - change_status_to_processing - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/11 16:14:31.162 - - - 2025/06/11 16:14:31.162 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 784 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - 'PROCESSING' AS status, - 'job_snils_inn' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'snils_inn_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'snils_inn_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'snils_inn_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'snils_inn_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'snils_inn_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/check_if_job_citizen_appealing_violations_fz53_exists.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/check_if_snils_inn_job_exists.hpl similarity index 68% rename from mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/check_if_job_citizen_appealing_violations_fz53_exists.hpl rename to mappings/info_recruits/citizen_tables/snils_inn/checkpoints/check_if_snils_inn_job_exists.hpl index fc0f6b5..de2d8fd 100644 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/checkpoints/check_if_job_citizen_appealing_violations_fz53_exists.hpl +++ b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/check_if_snils_inn_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_citizen_appealing_violations_fz53_exists + check_if_snils_inn_job_exists Y @@ -13,23 +13,23 @@ 1000 100 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - 2025/06/11 15:20:18.267 + 2025/08/05 13:28:46.661 - - Table input - Set variables - Y - Set variables Write to log N + + Table input + Set variables + Y + Set variables @@ -44,21 +44,16 @@ - job_name - PIPE - PARENT_WORKFLOW - - - status - STATUS + job_executed_flag + JOB_EXECUTED_FLAG PARENT_WORKFLOW Y - 688 - 352 + 672 + 336 @@ -75,29 +70,17 @@ ervu-dashboard N 0 - SELECT - COALESCE(job_name, 'job_citizen_appealing_violations_fz53') AS job_name, - COALESCE(status, 'NEW') AS status, - current_timestamp::timestamp as record_created -FROM ( - SELECT job_name, status - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_appealing_violations_fz53' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_citizen_appealing_violations_fz53' - ) -) t + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'snils_inn_job' + limit 1 + ) AS job_executed_flag; N - 400 - 352 + 384 + 336 @@ -120,8 +103,8 @@ FROM ( ${STATUS} - 960 - 240 + 944 + 224 diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn.hpl deleted file mode 100644 index 1403bee..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_snils_inn - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - - - Table input - Insert / update - Y - - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'snils_inn_flow1', - 'snils_inn_flow2', - 'snils_inn_flow3', - 'snils_inn_flow4', - 'snils_inn_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'snils_inn_flow1', - 'snils_inn_flow2', - 'snils_inn_flow3', - 'snils_inn_flow4', - 'snils_inn_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_snils_inn' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn_delta.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn_delta.hpl deleted file mode 100644 index 100f8e1..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn_delta.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_snils_inn_delta - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 14:19:02.590 - - - 2025/06/03 14:19:02.590 - - - - - - Filter rows - Abort - N - - - JSON input state_child_flow1.json - Filter rows - N - - - JSON input state_child_flow2.json - Filter rows - N - - - JSON input state_child_flow3.json - Filter rows - N - - - JSON input state_child_flow4.json - Filter rows - N - - - JSON input state_child_flow5.json - Filter rows - N - - - Table input - Insert / update - Y - - - Dummy (do nothing) - JSON input state_child_flow1.json - N - - - Dummy (do nothing) - JSON input state_child_flow2.json - N - - - Dummy (do nothing) - JSON input state_child_flow3.json - N - - - Dummy (do nothing) - JSON input state_child_flow4.json - N - - - Dummy (do nothing) - JSON input state_child_flow5.json - N - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - 0 - - - 1264 - 592 - - - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - - - - - = - pipeline - N - - - - N - -1 - constant - -1 - child_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 - child_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 - child_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 - child_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 - child_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 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - job_name - job_name - - public - etl_checkpoints
- - job_name - job_name - N - - - record_created - record_created - Y - - - status - status - Y - -
- N - - - 1264 - 208 - -
- - JSON input state_child_flow1.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow2.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow3.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow4.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_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_child_flow5.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 640 - 752 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'delta_snils_inn_flow1', - 'delta_snils_inn_flow2', - 'delta_snils_inn_flow3', - 'delta_snils_inn_flow4', - 'delta_snils_inn_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'delta_snils_inn_flow1', - 'delta_snils_inn_flow2', - 'delta_snils_inn_flow3', - 'delta_snils_inn_flow4', - 'delta_snils_inn_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_snils_inn_delta' as job_name, - CASE - WHEN has_error THEN 'ERROR' - WHEN all_success THEN 'SUCCESS' - ELSE 'ERROR' - END AS status, - current_timestamp AS record_created -FROM status_check; - N - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_snils_inn_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_snils_inn_error.hpl deleted file mode 100644 index 0d9cb80..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_snils_inn_error.hpl +++ /dev/null @@ -1,273 +0,0 @@ - - - - checkpoint_snils_inn_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_child ch on ch.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/info_recruits/citizen_tables/snils_inn/job_snils_inn.hwf b/mappings/info_recruits/citizen_tables/snils_inn/job_snils_inn.hwf deleted file mode 100644 index c94e531..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/job_snils_inn.hwf +++ /dev/null @@ -1,2516 +0,0 @@ - - - job_snils_inn - Y - - - - 0 - - - 2025/06/05 14:27:15.055 - - - 2025/06/05 14:27:15.055 - - - M_R_CR_DATE - 3001-01-01 00:00:00 - - - - M_R_UP_DATE - - - - - - - Start - - SPECIAL - - 1 - 12 - 60 - 0 - 0 - N - 0 - 1 - N - 368 - 400 - - - - checkpoint_job_snils_inn.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn.hpl - Basic - - Y - - N - local - N - N - Y - N - 1136 - 1280 - - - - recruitment_rows_five_flow_snils_inn.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_snils_inn.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2352 - 400 - - - - snils_inn_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 80 - - - - snils_inn_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 240 - - - - snils_inn_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 400 - - - - snils_inn_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 560 - - - - snils_inn_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 720 - - - - Abort workflow - - ABORT - - N - N - 2336 - 208 - - - - Success new snils_inn - - SUCCESS - - N - 3728 - 432 - - - - branching_snils_inn.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/branching_snils_inn.hpl - Basic - - Y - - N - local - N - N - Y - N - 1584 - 1280 - - - - Simple snils_inn WHERE SUCCESS - - SIMPLE_EVAL - - SUCCESS - string - true - equal - equal - N - variable - STATUS - N - 1696 - 1680 - - - - Simple snils_inn WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 1840 - 1280 - - - - recruitment_rows_five_flow_if_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/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 - - - - delta_snils_inn_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow1.hpl - - - Basic - - - M_R_UP_DATE - - ${M_R_UP_DATE} - - - ID_F1 - IDM_FLOW1 - - - Y - - Y - local - N - N - Y - N - 2640 - 1792 - - - - check_if_job_snils_inn_exists.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/check_if_job_snils_inn_exists.hpl - Basic - - Y - - N - local - N - N - Y - N - 576 - 400 - - - - Simple job_snils_inn_exists check NEW - - SIMPLE_EVAL - - NEW - string - true - equal - equal - N - variable - STATUS - N - 896 - 400 - - - - change_status_to_processing.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2368 - 560 - - - - change_status_snils_inn_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 80 - - - - change_status_snils_inn_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 160 - - - - change_status_snils_inn_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 240 - - - - change_status_snils_inn_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 320 - - - - change_status_snils_inn_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 400 - - - - change_status_snils_inn_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 480 - - - - change_status_snils_inn_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 560 - - - - change_status_snils_inn_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 640 - - - - change_status_snils_inn_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 720 - - - - change_status_snils_inn_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 800 - - - - checkpoint_job_snils_inn.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn.hpl - Basic - - Y - - N - local - N - N - Y - N - 3456 - 432 - - - - change_status_to_processing.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 2368 - 1424 - - - - change_status_to_processing_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2384 - 2304 - - - - change_status_delta_snils_inn_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow1_success.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1792 - - - - change_status_delta_snils_inn_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1872 - - - - snils_inn_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 960 - - - - snils_inn_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 1120 - - - - snils_inn_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 1280 - - - - snils_inn_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 1440 - - - - snils_inn_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 1600 - - - - Success snils_inn after error - - SUCCESS - - N - 3728 - 1312 - - - - change_status_snils_inn_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 960 - - - - change_status_snils_inn_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1040 - - - - change_status_snils_inn_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1120 - - - - change_status_snils_inn_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1200 - - - - change_status_snils_inn_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1280 - - - - change_status_snils_inn_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1360 - - - - change_status_snils_inn_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1440 - - - - change_status_snils_inn_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1520 - - - - change_status_snils_inn_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1600 - - - - change_status_snils_inn_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_snils_inn_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1680 - - - - checkpoint_job_snils_inn.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn.hpl - Basic - - Y - - N - local - N - N - Y - N - 3456 - 1312 - - - - recruitment_rows_five_flow_snils_inn.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_snils_inn.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2352 - 2112 - - - - Abort workflow 2 2 - - ABORT - - N - N - 2336 - 1952 - - - - delta_snils_inn_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow2.hpl - - - Basic - - - M_R_UP_DATE - - ${M_R_UP_DATE} - - - ID_F2 - IDM_FLOW2 - - - Y - - Y - local - N - N - Y - N - 2640 - 1952 - - - - change_status_delta_snils_inn_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_success.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1952 - - - - change_status_delta_snils_inn_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow2_error.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2032 - - - - delta_snils_inn_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow3.hpl - - - Basic - - - M_R_UP_DATE - - ${M_R_UP_DATE} - - - ID_F3 - IDM_FLOW3 - - - Y - - Y - local - N - N - Y - N - 2640 - 2112 - - - - change_status_delta_snils_inn_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_success.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2112 - - - - change_status_delta_snils_inn_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow3_error.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2192 - - - - delta_snils_inn_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow4.hpl - - - Basic - - - M_R_UP_DATE - - ${M_R_UP_DATE} - - - ID_F4 - IDM_FLOW4 - - - Y - - Y - local - N - N - Y - N - 2640 - 2272 - - - - change_status_delta_snils_inn_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow4_success.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2272 - - - - change_status_delta_snils_inn_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow4_error.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2352 - - - - delta_snils_inn_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow5.hpl - - - Basic - - - M_R_UP_DATE - - ${M_R_UP_DATE} - - - ID_F5 - IDM_FLOW5 - - - Y - - Y - local - N - N - Y - N - 2640 - 2432 - - - - change_status_delta_snils_inn_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_success.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2432 - - - - change_status_delta_snils_inn_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/change_status_delta_snils_inn_flow5_error.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 2512 - - - - branching_snils_inn_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/branching_snils_inn_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 1824 - 2112 - - - - Simple delta_snils_inn WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 2064 - 2112 - - - - delta_snils_inn success - - SUCCESS - - N - 2160 - 1952 - - - - checkpoint_job_snils_inn_delta.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/checkpoint_job_snils_inn_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 3440 - 2112 - - - - Success delta_snils_inn - - SUCCESS - - N - 3728 - 2112 - - - - - - recruitment_rows_five_flow_snils_inn.hpl - snils_inn_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl - snils_inn_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl - snils_inn_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl - snils_inn_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl - snils_inn_flow5.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl - Abort workflow - Y - N - N - - - branching_snils_inn.hpl - Simple snils_inn WHERE ERROR - Y - N - Y - - - branching_snils_inn.hpl - Simple snils_inn WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - - - Start - check_if_job_snils_inn_exists.hpl - Y - Y - Y - - - check_if_job_snils_inn_exists.hpl - Simple job_snils_inn_exists check NEW - Y - Y - N - - - snils_inn_flow1.hpl - change_status_snils_inn_flow1_success.hpl - Y - Y - N - - - snils_inn_flow1.hpl - change_status_snils_inn_flow1_error.hpl - Y - N - N - - - snils_inn_flow2.hpl - change_status_snils_inn_flow2_success.hpl - Y - Y - N - - - snils_inn_flow2.hpl - change_status_snils_inn_flow2_error.hpl - Y - N - N - - - snils_inn_flow3.hpl - change_status_snils_inn_flow3_success.hpl - Y - Y - N - - - snils_inn_flow3.hpl - change_status_snils_inn_flow3_error.hpl - Y - N - N - - - snils_inn_flow4.hpl - change_status_snils_inn_flow4_success.hpl - Y - Y - N - - - snils_inn_flow4.hpl - change_status_snils_inn_flow4_error.hpl - Y - N - N - - - snils_inn_flow5.hpl - change_status_snils_inn_flow5_success.hpl - Y - Y - N - - - snils_inn_flow5.hpl - change_status_snils_inn_flow5_error.hpl - Y - N - N - - - change_status_snils_inn_flow5_error.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - change_status_snils_inn_flow5_success.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - change_status_snils_inn_flow4_error.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - change_status_snils_inn_flow4_success.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - change_status_snils_inn_flow3_error.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - change_status_snils_inn_flow3_success.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - change_status_snils_inn_flow2_error.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - change_status_snils_inn_flow2_success.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - change_status_snils_inn_flow1_error.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - change_status_snils_inn_flow1_success.hpl - checkpoint_job_snils_inn.hpl - Y - N - Y - - - checkpoint_job_snils_inn.hpl - Success new snils_inn - Y - Y - N - - - checkpoint_job_snils_inn.hpl (2) - branching_snils_inn.hpl - Y - N - Y - - - Simple job_snils_inn_exists check NEW - checkpoint_job_snils_inn.hpl (2) - Y - N - N - - - delta_snils_inn_flow1.hpl - change_status_delta_snils_inn_flow1_success.hpl - Y - Y - N - - - delta_snils_inn_flow1.hpl - change_status_delta_snils_inn_flow1_error.hpl - Y - N - N - - - snils_inn_flow1.hpl 2 - change_status_snils_inn_flow1_success.hpl 2 - Y - Y - N - - - snils_inn_flow1.hpl 2 - change_status_snils_inn_flow1_error.hpl 2 - Y - N - N - - - snils_inn_flow2.hpl 2 - change_status_snils_inn_flow2_success.hpl 2 - Y - Y - N - - - snils_inn_flow2.hpl 2 - change_status_snils_inn_flow2_error.hpl 2 - Y - N - N - - - snils_inn_flow3.hpl 2 - change_status_snils_inn_flow3_success.hpl 2 - Y - Y - N - - - snils_inn_flow3.hpl 2 - change_status_snils_inn_flow3_error.hpl 2 - Y - N - N - - - snils_inn_flow4.hpl 2 - change_status_snils_inn_flow4_success.hpl 2 - Y - Y - N - - - snils_inn_flow4.hpl 2 - change_status_snils_inn_flow4_error.hpl 2 - Y - N - N - - - snils_inn_flow5.hpl 2 - change_status_snils_inn_flow5_success.hpl 2 - Y - Y - N - - - snils_inn_flow5.hpl 2 - change_status_snils_inn_flow5_error.hpl 2 - Y - N - N - - - change_status_snils_inn_flow1_success.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - change_status_snils_inn_flow1_error.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - change_status_snils_inn_flow2_success.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - change_status_snils_inn_flow2_error.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - change_status_snils_inn_flow3_success.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - change_status_snils_inn_flow3_error.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - change_status_snils_inn_flow4_success.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - change_status_snils_inn_flow4_error.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - change_status_snils_inn_flow5_success.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - change_status_snils_inn_flow5_error.hpl 2 - checkpoint_job_snils_inn.hpl 2 - Y - N - Y - - - checkpoint_job_snils_inn.hpl 2 - Success snils_inn after error - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - snils_inn_flow3.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - snils_inn_flow2.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - snils_inn_flow1.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - snils_inn_flow4.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - snils_inn_flow5.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl - change_status_to_processing.hpl - Y - Y - N - - - Simple job_snils_inn_exists check NEW - recruitment_rows_five_flow_snils_inn.hpl - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - change_status_to_processing.hpl (2) - Y - Y - N - - - Simple snils_inn WHERE ERROR - recruitment_rows_five_flow_if_error.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl 2 - delta_snils_inn_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl 2 - change_status_to_processing_delta.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl 2 - Abort workflow 2 2 - Y - N - N - - - delta_snils_inn_flow2.hpl - change_status_delta_snils_inn_flow2_success.hpl - Y - Y - N - - - delta_snils_inn_flow2.hpl - change_status_delta_snils_inn_flow2_error.hpl - Y - N - N - - - delta_snils_inn_flow3.hpl - change_status_delta_snils_inn_flow3_success.hpl - Y - Y - N - - - delta_snils_inn_flow3.hpl - change_status_delta_snils_inn_flow3_error.hpl - Y - N - N - - - delta_snils_inn_flow4.hpl - change_status_delta_snils_inn_flow4_success.hpl - Y - Y - N - - - delta_snils_inn_flow4.hpl - change_status_delta_snils_inn_flow4_error.hpl - Y - N - N - - - delta_snils_inn_flow5.hpl - change_status_delta_snils_inn_flow5_success.hpl - Y - Y - N - - - delta_snils_inn_flow5.hpl - change_status_delta_snils_inn_flow5_error.hpl - Y - N - N - - - recruitment_rows_five_flow_snils_inn.hpl 2 - delta_snils_inn_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl 2 - delta_snils_inn_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl 2 - delta_snils_inn_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_snils_inn.hpl 2 - delta_snils_inn_flow5.hpl - Y - Y - N - - - Simple snils_inn WHERE SUCCESS - branching_snils_inn_delta.hpl - Y - Y - N - - - Simple delta_snils_inn WHERE ERROR - delta_snils_inn success - Y - N - N - - - branching_snils_inn_delta.hpl - Simple delta_snils_inn WHERE ERROR - Y - Y - N - - - Simple delta_snils_inn WHERE ERROR - recruitment_rows_five_flow_snils_inn.hpl 2 - Y - Y - N - - - change_status_delta_snils_inn_flow1_success.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - change_status_delta_snils_inn_flow3_success.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - change_status_delta_snils_inn_flow2_error.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - change_status_delta_snils_inn_flow2_success.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - change_status_delta_snils_inn_flow1_error.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - change_status_delta_snils_inn_flow3_error.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - change_status_delta_snils_inn_flow4_success.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - change_status_delta_snils_inn_flow4_error.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - change_status_delta_snils_inn_flow5_success.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - change_status_delta_snils_inn_flow5_error.hpl - checkpoint_job_snils_inn_delta.hpl - Y - Y - N - - - checkpoint_job_snils_inn_delta.hpl - Success delta_snils_inn - Y - Y - N - - - - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 72 - 1088 - 176 - 0001-01-01 00:00:00 - -3001-01-01 00:00:00 - - 114 - - - - diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow1.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow1.hpl deleted file mode 100644 index fc9877b..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow1.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_snils_inn_flow1 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 16:10:48.509 - - - 2025/06/03 16:10:48.509 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - inn - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 1184 - 320 - -
- - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - snils - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 1184 - 480 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 - AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 704 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow2.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow2.hpl deleted file mode 100644 index dc170be..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow2.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_snils_inn_flow2 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 16:10:48.509 - - - 2025/06/03 16:10:48.509 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - inn - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 1184 - 320 - -
- - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - snils - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 1184 - 480 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 - AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 704 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow3.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow3.hpl deleted file mode 100644 index 9042d44..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow3.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_snils_inn_flow3 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 16:10:48.509 - - - 2025/06/03 16:10:48.509 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - inn - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 1184 - 320 - -
- - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - snils - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 1184 - 480 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 - AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 704 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow4.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow4.hpl deleted file mode 100644 index 655073f..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow4.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_snils_inn_flow4 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 16:10:48.509 - - - 2025/06/03 16:10:48.509 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - inn - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 1184 - 320 - -
- - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - snils - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 1184 - 480 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 - AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 704 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow5.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow5.hpl deleted file mode 100644 index f2ffc7a..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/delta_snils_inn_flow5.hpl +++ /dev/null @@ -1,202 +0,0 @@ - - - - delta_snils_inn_flow5 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 16:10:48.509 - - - 2025/06/03 16:10:48.509 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - inn - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 1184 - 320 - -
- - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - snils - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 1184 - 480 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 - AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 704 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow.hpl new file mode 100644 index 0000000..b49a69f --- /dev/null +++ b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow.hpl @@ -0,0 +1,440 @@ + + + + snils_inn_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Insert / update snils + Filter rows + Y + + + Insert / update snils + Detect empty stream + Y + + + Insert / update snils + Change job status on error + Y + + + Identify last row in a stream + Insert / update inn + Y + + + Insert / update inn + Insert / update snils + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 672 + 320 + + + + Insert / update inn + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + IS NOT NULL + inn + + ervu_dashboard + inn
+ + recruit_id + recruit_id + N + + + inn + inn + Y + + + actual + actual + Y + +
+ N + + + 864 + 320 + +
+ + Insert / update snils + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + IS NOT NULL + snils + + ervu_dashboard + snils
+ + recruit_id + recruit_id + N + + + snils + snils + Y + + + actual + actual + Y + +
+ N + + + 1024 + 320 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + WITH +base as ( + SELECT + ri.recruit_id, + ri.info + FROM ervu_dashboard.recruits_info ri + join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}'::timestamp >= ri.created_at +) +SELECT + recruit_id, + null as inn, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, + true AS actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 + +UNION ALL + +SELECT + recruit_id, + null as inn, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, + false AS actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 + +UNION ALL + +SELECT + recruit_id, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, + null as snils, + true as actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 + +UNION ALL + +SELECT + recruit_id, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, + null as snils, + false as actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 + +${LIMIT_FW} + Y + + + 496 + 320 + + + + + Insert / update snils + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow1.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow1.hpl deleted file mode 100644 index 4515f7c..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow1.hpl +++ /dev/null @@ -1,208 +0,0 @@ - - - - snils_inn_flow1 - Y - - - - Normal - 0 - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - - IS NOT NULL - inn - - - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 928 - 208 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 448 - 288 - - - - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - - IS NOT NULL - snils - - - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 928 - 368 - -
- - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow2.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow2.hpl deleted file mode 100644 index 12d0170..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow2.hpl +++ /dev/null @@ -1,201 +0,0 @@ - - - - snils_inn_flow2 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - inn - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 1152 - 320 - -
- - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - snils - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 1152 - 480 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 672 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow3.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow3.hpl deleted file mode 100644 index d2fc08b..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow3.hpl +++ /dev/null @@ -1,201 +0,0 @@ - - - - snils_inn_flow3 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - inn - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 1120 - 336 - -
- - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - snils - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 1120 - 496 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 640 - 416 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow4.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow4.hpl deleted file mode 100644 index cbdc121..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow4.hpl +++ /dev/null @@ -1,201 +0,0 @@ - - - - snils_inn_flow4 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - inn - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 1216 - 384 - -
- - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - snils - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 1216 - 544 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 736 - 464 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow5.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow5.hpl deleted file mode 100644 index 6f1cadb..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow5.hpl +++ /dev/null @@ -1,201 +0,0 @@ - - - - snils_inn_flow5 - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/05/21 14:05:02.260 - - - 2025/05/21 14:05:02.260 - - - - - - Table input - Insert / update inn - Y - - - Table input - Insert / update snils - Y - - - - Insert / update inn - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - inn - - ervu_dashboard - inn
- - recruit_id - recruit_id - N - - - inn - inn - Y - - - actual - actual - Y - -
- N - - - 1200 - 320 - -
- - Insert / update snils - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - - IS NOT NULL - snils - - ervu_dashboard - snils
- - recruit_id - recruit_id - N - - - snils - snils - Y - - - actual - actual - Y - -
- N - - - 1200 - 480 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -base as ( - SELECT - ri.recruit_id, - ri.info - 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 -) -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - true AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - null as inn, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, - false AS actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - true as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 - -UNION ALL - -SELECT - recruit_id, - REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, - null as snils, - false as actual -FROM base -WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 - Y - - - 720 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_delta.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_delta.hpl new file mode 100644 index 0000000..2b60dda --- /dev/null +++ b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_delta.hpl @@ -0,0 +1,445 @@ + + + + snils_inn_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update inn + Y + + + Insert / update inn + Insert / update snils + Y + + + Insert / update snils + Filter rows + Y + + + Insert / update snils + Detect empty stream + Y + + + Insert / update snils + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1328 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1104 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1408 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1408 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1104 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update inn + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + IS NOT NULL + inn + + ervu_dashboard + inn
+ + recruit_id + recruit_id + N + + + inn + inn + Y + + + actual + actual + Y + +
+ N + + + 928 + 224 + +
+ + Insert / update snils + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + IS NOT NULL + snils + + ervu_dashboard + snils
+ + recruit_id + recruit_id + N + + + snils + snils + Y + + + actual + actual + Y + +
+ N + + + 1104 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + + WITH +base as ( + SELECT + ri.recruit_id, + ri.info + FROM ervu_dashboard.recruits_info ri + join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + --AND '${M_R_CR_DATE}'::timestamp >= ri.created_at + AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp +) +SELECT + recruit_id, + null as inn, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, + true AS actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 + +UNION ALL + +SELECT + recruit_id, + null as inn, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, + false AS actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 + +UNION ALL + +SELECT + recruit_id, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, + null as snils, + true as actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 + +UNION ALL + +SELECT + recruit_id, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, + null as snils, + false as actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 + +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update snils + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_repeat.hpl new file mode 100644 index 0000000..fbfd0c3 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_repeat.hpl @@ -0,0 +1,458 @@ + + + + snils_inn_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Insert / update snils + Filter rows + Y + + + Insert / update snils + Detect empty stream + Y + + + Insert / update snils + Change job status on error + Y + + + Identify last row in a stream + Insert / update inn + Y + + + Insert / update inn + Insert / update snils + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1296 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1008 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1008 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 672 + 208 + + + + Insert / update inn + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + IS NOT NULL + inn + + ervu_dashboard + inn
+ + recruit_id + recruit_id + N + + + inn + inn + Y + + + actual + actual + Y + +
+ N + + + 848 + 208 + +
+ + Insert / update snils + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + IS NOT NULL + snils + + ervu_dashboard + snils
+ + recruit_id + recruit_id + N + + + snils + snils + Y + + + actual + actual + Y + +
+ N + + + 1008 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + WITH +base as ( + SELECT + ri.recruit_id, + ri.info + FROM ervu_dashboard.recruits_info ri + join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}'::timestamp >= ri.created_at +) +SELECT + recruit_id, + null as inn, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, + true AS actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'aktSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 + +UNION ALL + +SELECT + recruit_id, + null as inn, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g') AS snils, + false AS actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'snils'->'predSNILS'->>'snils', '[^0-9]', '', 'g')) = 11 + +UNION ALL + +SELECT + recruit_id, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g') AS inn, + null as snils, + true as actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'aktINN'->>'inn', '[^0-9]', '', 'g')) = 12 + +UNION ALL + +SELECT + recruit_id, + REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g') AS inn, + null as snils, + false as actual +FROM base +WHERE LENGTH(REGEXP_REPLACE(info->'svedFL'->'svedBS'->'inn'->'predINN'->>'inn', '[^0-9]', '', 'g')) = 12 + +${LIMIT_FW} + Y + + + 480 + 208 + + + + + Insert / update snils + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..0183676 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + snils_inn_flow_delta.hpl + Y + + + Table input + snils_inn_flow_delta.hpl 2 + Y + + + Table input + snils_inn_flow_delta.hpl 3 + Y + + + Table input + snils_inn_flow_delta.hpl 4 + Y + + + Table input + snils_inn_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'snils_inn_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + snils_inn_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 128 + + + + snils_inn_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 208 + + + + snils_inn_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 288 + + + + snils_inn_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 368 + + + + snils_inn_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..e82e27f --- /dev/null +++ b/mappings/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + snils_inn_flow_repeat.hpl + Y + + + Table input + snils_inn_flow_repeat.hpl 2 + Y + + + Table input + snils_inn_flow_repeat.hpl 3 + Y + + + Table input + snils_inn_flow_repeat.hpl 4 + Y + + + Table input + snils_inn_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'snils_inn_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + snils_inn_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 208 + + + + snils_inn_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 288 + + + + snils_inn_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 368 + + + + snils_inn_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 448 + + + + snils_inn_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 480 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/snils_inn/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/snils_inn/recruitment_rows_five_flow_if_error.hpl deleted file mode 100644 index a4a5b8a..0000000 --- a/mappings/info_recruits/citizen_tables/snils_inn/recruitment_rows_five_flow_if_error.hpl +++ /dev/null @@ -1,185 +0,0 @@ - - - - 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 -fr_check AS ( - SELECT - last_recruitment_id AS recruitment_id, - recruitment_created_date, - status, - job_name - FROM public.etl_checkpoints - WHERE status = 'ERROR' AND job_name IN ('snils_inn_flow1', 'snils_inn_flow2', 'snils_inn_flow3', 'snils_inn_flow4', 'snils_inn_flow5') -), -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 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow1') THEN created_at END) AS cr_flow1, - MAX(CASE WHEN flow_num = 1 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow1') THEN idm_id::text END) AS idm_flow1, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow2') THEN created_at END) AS cr_flow2, - MAX(CASE WHEN flow_num = 2 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow2') THEN idm_id::text END) AS idm_flow2, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow3') THEN created_at END) AS cr_flow3, - MAX(CASE WHEN flow_num = 3 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow3') THEN idm_id::text END) AS idm_flow3, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow4') THEN created_at END) AS cr_flow4, - MAX(CASE WHEN flow_num = 4 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow4') THEN idm_id::text END) AS idm_flow4, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow5') THEN created_at END) AS cr_flow5, - MAX(CASE WHEN flow_num = 5 AND created_at >= (SELECT recruitment_created_date FROM fr_check WHERE job_name = 'snils_inn_flow5') THEN idm_id::text END) AS idm_flow5 - FROM splitted - GROUP BY position -), -remains as ( - SELECT - position, - 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 - WHERE (cr_flow1 IS NOT NULL AND idm_flow1 IS NOT NULL) - OR (cr_flow2 IS NOT NULL AND idm_flow2 IS NOT NULL) - OR (cr_flow3 IS NOT NULL AND idm_flow3 IS NOT NULL) - OR (cr_flow4 IS NOT NULL AND idm_flow4 IS NOT NULL) - OR (cr_flow5 IS NOT NULL AND idm_flow5 IS NOT NULL) - order by position -), -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/info_recruits/citizen_tables/snils_inn/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/snils_inn/recruitments_five_flow.hpl new file mode 100644 index 0000000..7f2a3b1 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/snils_inn/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + snils_inn_flow.hpl + Y + + + Get all recruitments ordered by created_date + snils_inn_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + snils_inn_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + snils_inn_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + snils_inn_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + snils_inn_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 144 + + + + snils_inn_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 224 + + + + snils_inn_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 304 + + + + snils_inn_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 384 + + + + snils_inn_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/parallel/snils_inn_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + snils_inn_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/snils_inn/snils_inn_job.hwf b/mappings/info_recruits/citizen_tables/snils_inn/snils_inn_job.hwf new file mode 100644 index 0000000..cbcdc63 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/snils_inn/snils_inn_job.hwf @@ -0,0 +1,366 @@ + + + snils_inn_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 224 + 304 + + + + check_if_snils_inn_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/checkpoints/check_if_snils_inn_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + snils_inn_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 688 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/recruitments_five_flow.hpl + + + Basic + + Y + + N + local + N + N + Y + Y + 928 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_on_error.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 928 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/check_if_need_to_repeat_job.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 688 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 688 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/snils_inn/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 688 + 800 + + + + + + Start + check_if_snils_inn_job_exists.hpl + Y + Y + Y + + + check_if_snils_inn_job_exists.hpl + snils_inn_job_exists_check + Y + Y + N + + + snils_inn_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + snils_inn_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 800 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 800 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 608 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + snils_inn_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 114 + + + + diff --git a/mappings/info_recruits/job_parallel_recruits_info_citizen.hwf b/mappings/info_recruits/job_parallel_recruits_info_citizen.hwf index 4db745f..2d8c149 100644 --- a/mappings/info_recruits/job_parallel_recruits_info_citizen.hwf +++ b/mappings/info_recruits/job_parallel_recruits_info_citizen.hwf @@ -164,7 +164,7 @@ job_recruit_last_update_date.hwf citizen_job.hwf - N + Y Y Y diff --git a/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_delta.hpl b/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_delta.hpl index ba2390e..d3b2fe8 100644 --- a/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_delta.hpl +++ b/mappings/info_recruits/raw_data/recruits_info/parallel/recruits_info_flow_delta.hpl @@ -103,11 +103,8 @@ ervu-dashboard - Y - N - Y Y N @@ -118,7 +115,6 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 944 @@ -346,6 +342,7 @@ and recruitment_id = '${IDM_ID}'; ervu_person_registry N + SELECT r.system_create_date AS created_at, r.system_update_date AS updated_at, @@ -361,7 +358,7 @@ JOIN recruits r ON r.id = ri.recruit_id WHERE '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(current_recruitment_id, target_recruitment_id) = '${IDM_ID}' - AND '${M_R_CR_DATE}' >= r.system_create_date + --AND '${M_R_CR_DATE}' >= r.system_create_date AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp --AND '${CR_DATE}' < ri.created_at --ORDER BY ri.created_at ASC; From 5baf20c5473b8202f30004193ab1ba7b3292e95d Mon Sep 17 00:00:00 2001 From: Fusionshh Date: Tue, 19 Aug 2025 15:44:38 +0300 Subject: [PATCH 22/34] temp --- .../work/employer/employer_job.hwf | 267 ++++ .../work/employer/parallel/employer_flow.hpl | 560 +++++++++ .../employer/parallel/employer_flow_delta.hpl | 542 ++++++++ .../parallel/employer_flow_repeat.hpl | 544 +++++++++ .../work/employer/recruitment_five_flow.hpl | 356 ++++++ .../employer/recruitment_five_flow_delta.hpl | 360 ++++++ .../recruitment_five_flow_on_error.hpl | 360 ++++++ ...check_if_employer_job_execution_exists.hpl | 84 ++ .../support/check_if_need_to_repeat.hpl | 86 ++ .../individual_entrepreneur_job.hwf | 262 ++++ .../parallel/individual_entrepreneur_flow.hpl | 451 +++++++ .../individual_entrepreneur_flow_delta.hpl | 455 +++++++ .../individual_entrepreneur_flow_repeat.hpl | 454 +++++++ .../recruitment_five_flow.hpl | 356 ++++++ .../recruitment_five_flow_delta.hpl | 360 ++++++ .../recruitment_five_flow_repeat.hpl | 356 ++++++ ...dividual_entrepreneur_execution_exists.hpl | 84 ++ .../support/check_if_need_to_repeat.hpl | 86 ++ .../parallel/self_employed_flow.hpl | 423 +++++++ .../parallel/self_employed_flow_delta.hpl | 427 +++++++ .../parallel/self_employed_flow_on_error.hpl | 416 +++++++ .../self_employed/recruitment_five_flow.hpl | 356 ++++++ .../recruitment_five_flow_delta.hpl | 360 ++++++ .../recruitments_five_flow_repeat.hpl | 360 ++++++ .../work/self_employed/self_employed_job.hwf | 256 ++++ .../support/check_if_need_to_repeat.hpl | 86 ++ ..._if_self_employed_job_execution_exists.hpl | 84 ++ .../citizen_tables/work/test.hpl | 595 +++++++++ .../parallel/work_activity_flow.hpl | 1088 +++++++++++++++++ .../parallel/work_activity_flow_delta.hpl | 14 +- .../parallel/work_activity_flow_repeat.hpl | 18 +- .../recruitment_five_flow_delta.hpl | 12 +- .../recruitment_five_flow_on_error.hpl | 16 +- .../work_activity/recruitments_five_flow.hpl | 12 +- .../support}/check_if_need_to_repeat_job.hpl | 2 +- .../check_if_work_activity_job_exists.hpl | 8 +- .../work_activity/work_activity_job.hwf | 24 +- 37 files changed, 10534 insertions(+), 46 deletions(-) create mode 100644 mappings/info_recruits/citizen_tables/work/employer/employer_job.hwf create mode 100644 mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_on_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/individual_entrepreneur/individual_entrepreneur_job.hwf create mode 100644 mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_individual_entrepreneur_execution_exists.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_need_to_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/self_employed/recruitments_five_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/self_employed/self_employed_job.hwf create mode 100644 mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_need_to_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_self_employed_job_execution_exists.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/test.hpl create mode 100644 mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl rename mappings/info_recruits/citizen_tables/{ => work}/work_activity/parallel/work_activity_flow_delta.hpl (97%) rename mappings/info_recruits/citizen_tables/{ => work}/work_activity/parallel/work_activity_flow_repeat.hpl (97%) rename mappings/info_recruits/citizen_tables/{ => work}/work_activity/recruitment_five_flow_delta.hpl (95%) rename mappings/info_recruits/citizen_tables/{ => work}/work_activity/recruitment_five_flow_on_error.hpl (95%) rename mappings/info_recruits/citizen_tables/{ => work}/work_activity/recruitments_five_flow.hpl (95%) rename mappings/info_recruits/citizen_tables/{work_activity => work/work_activity/support}/check_if_need_to_repeat_job.hpl (98%) rename mappings/info_recruits/citizen_tables/{work_activity/checkpoints => work/work_activity/support}/check_if_work_activity_job_exists.hpl (97%) rename mappings/info_recruits/citizen_tables/{ => work}/work_activity/work_activity_job.hwf (94%) diff --git a/mappings/info_recruits/citizen_tables/work/employer/employer_job.hwf b/mappings/info_recruits/citizen_tables/work/employer/employer_job.hwf new file mode 100644 index 0000000..d971adf --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/employer/employer_job.hwf @@ -0,0 +1,267 @@ + + + employer_job + Y + + + + - + 2025/08/18 20:08:04.495 + - + 2025/08/18 20:08:04.495 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 48 + 48 + + + + check_if_employer_job_execution_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 272 + 48 + + + + employer_job_execution_exists_check + + SIMPLE_EVAL + + + + boolean + + + + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 576 + 48 + + + + recruitment_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl + + + Basic + + Y + + N + local + N + N + Y + Y + 896 + 48 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/recruitment_five_flow_on_error.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 816 + 352 + + + + check_if_need_to_repeat.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 576 + 208 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 576 + 352 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 576 + 544 + + + + + + check_if_employer_job_execution_exists.hpl + employer_job_execution_exists_check + Y + Y + N + + + employer_job_execution_exists_check + recruitment_five_flow.hpl + Y + Y + N + + + employer_job_execution_exists_check + check_if_need_to_repeat.hpl + Y + N + N + + + check_if_need_to_repeat.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + Start + check_if_employer_job_execution_exists.hpl + Y + Y + Y + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl new file mode 100644 index 0000000..29ac6d1 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl @@ -0,0 +1,560 @@ + + + + employer_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 18:28:13.561 + - + 2025/08/18 18:28:13.561 + + + + + + Create job execution record + employer_input + Y + + + actual_employer_output + pred_employer_output + N + + + pred_employer_output + Change job status on error + Y + + + Change job status on error + Abort + Y + + + employer_input + Identify last row in a stream + Y + + + Identify last row in a stream + actual_employer_output + Y + + + actual_employer_output + Change job status on error + Y + + + pred_employer_output + Detect empty stream + N + + + Detect empty stream + Change job status on success + N + + + pred_employer_output + Filter rows + N + + + Filter rows + Change job status on success + N + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1120 + 448 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 896 + 448 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1120 + 112 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 176 + 288 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1120 + 288 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + TRUE + last_row + N + - + + + Change job status on success + + + 896 + 112 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 528 + 288 + + + + actual_employer_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + recruit_id + recruit_id + + + source_id + source_id + + + source_update_date + akt_source_update_date + + + address + akt_address + + + separate_unit_type_code + akt_separate_unit_type + + + separate_unit_address + akt_separate_unit_address + + + employer_category_name + akt_employer_category_name + + + name + akt_name + + + inn + akt_inn + + + ogrn + akt_ogrn + + + kpp + akt_kpp + + + actual_employer + akt_actual_employer + + + is_opk_org + akt_is_opk_org + + + N + N + N + N + Y + N + ervu_dashboard + Y + employer
+ N + Y + N + Y + + + 720 + 288 + +
+ + employer_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filteredData as ( + select ri.recruit_id::text, + (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id')::text as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRabotodat' ->> 'rabotodat' != 'null' + --and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' +) +select + fd.recruit_id::text, + fd.source_id::text, +-- aktRabotodat + aktRabotodat -> 'dataSved' as akt_source_update_date, + aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, + aktRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, + aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, + case + when aktRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' + when aktRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when aktRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' + when aktRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' + END + as akt_employer_category_name, + case + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'naimOrg' + END + as akt_name, + case + when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'svedIP' ->> 'innfl' + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' ->> 'innyul' + when aktRabotodat ->> 'svedGlKFH' != 'null' then aktRabotodat -> 'svedGlKFH' ->> 'innfl' + when aktRabotodat ->> 'svedPlatFL' != 'null' then aktRabotodat -> 'svedPlatFL' ->> 'innfl' + END + as akt_inn, + case + when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedIP' ->> 'ogrnip' + END + as akt_ogrn, + case + when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + END + as akt_kpp, + true as akt_actual_employer, + case + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' + END + as akt_is_opk_org, +-- predRabotodat + predRabotodat -> 'dataSved' as pred_source_update_date, + predRabotodat -> 'extend' ->> 'adresRabotodat' as pred_address, + predRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as pred_separate_unit_type_code, + predRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as pred_separate_unit_address, + case + when predRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' + when predRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when predRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' + when predRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' + END + as pred_employer_category_name, + case + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'naimOrg' + END + as pred_name, + case + when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'svedIP' ->> 'innfl' + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' ->> 'innyul' + when predRabotodat ->> 'svedGlKFH' != 'null' then predRabotodat -> 'svedGlKFH' ->> 'innfl' + when predRabotodat ->> 'svedPlatFL' != 'null' then predRabotodat -> 'svedPlatFL' ->> 'innfl' + END + as pred_inn, + case + when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedIP' ->> 'ogrnip' + END + as pred_ogrn, + case + when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + END + as pred_kpp, + false as pred_actual_employer, + case + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' + END + as pred_is_opk_org +from filteredData fd; + Y + + + 368 + 288 + + + + pred_employer_output + TableOutput + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + source_id + source_id + + + recruit_id + recruit_id + + + source_update_date + pred_source_update_date + + + address + pred_address + + + separate_unit_address + pred_separate_unit_address + + + employer_category_name + pred_employer_category_name + + + name + pred_name + + + inn + pred_inn + + + ogrn + pred_ogrn + + + kpp + pred_kpp + + + actual_employer + pred_actual_employer + + + is_opk_org + pred_is_opk_org + + + N + N + N + N + Y + N + ervu_dashboard + Y + employer
+ N + Y + N + Y + + + 896 + 288 + +
+ + + actual_employer_output + Change job status on error + Y + + error_description + + + + + + + + pred_employer_output + Change job status on error + Y + + error_description + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl new file mode 100644 index 0000000..9043783 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl @@ -0,0 +1,542 @@ + + + + employer_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 19:01:58.918 + - + 2025/08/18 19:01:58.918 + + + + + + Change job status on error + Abort + Y + + + Insert / update 2 + Change job status on success + Y + + + Create job execution record + employer_input + Y + + + Insert / update + Insert / update 2 + Y + + + Filter rows + Change job status on success + Y + + + Insert / update + Filter rows + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Change job status on error + Y + + + employer_input + Identify last row in a stream + Y + + + + Insert / update 2 + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + source_id + + ervu_dashboard + employer
+ + source_id + source_id + Y + + + recruit_id + recruit_id + Y + + + source_update_date + pred_source_update_date + Y + + + address + pred_address + Y + + + separate_unit_type_code + pred_separate_unit_type_code + Y + + + separate_unit_address + pred_separate_unit_address + Y + + + employer_category_name + pred_employer_category_name + Y + + + name + pred_name + Y + + + inn + pred_inn + Y + + + ogrn + pred_ogrn + Y + + + kpp + pred_kpp + Y + + + actual_employer + pred_actual_employer + Y + + + is_opk_org + pred_is_opk_org + Y + +
+ N + + + 1040 + 384 + +
+ + Insert / update + InsertUpdate + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + source_id + + ervu_dashboard + employer
+ + source_id + source_id + Y + + + recruit_id + recruit_id + Y + + + source_update_date + akt_source_update_date + Y + + + address + akt_address + Y + + + separate_unit_type_code + akt_separate_unit_type + Y + + + separate_unit_address + akt_separate_unit_address + Y + + + employer_category_name + akt_employer_category_name + Y + + + name + akt_name + Y + + + inn + akt_inn + Y + + + ogrn + akt_ogrn + Y + + + kpp + akt_kpp + Y + + + actual_employer + akt_actual_employer + Y + + + is_opk_org + akt_is_opk_org + Y + +
+ N + + + 864 + 384 + +
+ + employer_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filtered_data as (select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat + from recruits_info ri +-- join на военкомат + where ri.info -> 'svedFL' -> 'svedRabotodat' ->> 'rabotodat' != 'null' + -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + and (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' ->> 'dataSved' >= '${MAX_SOURCE_DATE}' + or ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' ->> 'dataSved' >= '${MAX_SOURCE_DATE}')) +select fd.source_id, + fd.recruit_id, +-- aktRabotodat + aktRabotodat -> 'dataSved' as akt_source_update_date, + aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, + aktRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, + aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, + case + when aktRabotodat -> 'svedIP' then 'Индивидуальный предприниматель' + when aktRabotodat -> 'svedYUL' then 'Юридическое лицо' + when aktRabotodat -> 'svedGlKFH' then 'Глава КФХ' + when aktRabotodat -> 'svedPlatFL' then 'Физическое лицо' + END + as akt_employer_category_name, + case + when aktRabotodat -> 'svedYUL' then aktRabotodat -> 'svedYUL' -> 'naimOrg' + END + as akt_name, + case + when aktRabotodat -> 'svedIP' then aktRabotodat -> 'svedIP' ->> 'innfl' + when aktRabotodat -> 'svedYUL' then aktRabotodat -> 'svedYUL' ->> 'innyul' + when aktRabotodat -> 'svedGlKFH' then aktRabotodat -> 'svedGlKFH' ->> 'innfl' + when aktRabotodat -> 'svedPlatFL' then aktRabotodat -> 'svedPlatFL' ->> 'innfl' + END + as akt_inn, + case + when aktRabotodat -> 'svedIP' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when aktRabotodat -> 'svedYUL' then aktRabotodat -> 'svedIP' ->> 'ogrnip' + END + as akt_ogrn, + case + when aktRabotodat -> 'svedIP' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + END + as akt_kpp, + true as akt_actual_employer, + case + when aktRabotodat -> 'svedYUL' then aktRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' + END + as akt_is_opk_org, +-- predRabotodat + predRabotodat -> 'dataSved' as akt_source_update_date, + predRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, + predRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, + predRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, + case + when predRabotodat -> 'svedIP' then 'Индивидуальный предприниматель' + when predRabotodat -> 'svedYUL' then 'Юридическое лицо' + when predRabotodat -> 'svedGlKFH' then 'Глава КФХ' + when predRabotodat -> 'svedPlatFL' then 'Физическое лицо' + END + as akt_employer_category_name, + case + when predRabotodat -> 'svedYUL' then predRabotodat -> 'svedYUL' -> 'naimOrg' + END + as akt_name, + case + when predRabotodat -> 'svedIP' then predRabotodat -> 'svedIP' ->> 'innfl' + when predRabotodat -> 'svedYUL' then predRabotodat -> 'svedYUL' ->> 'innyul' + when predRabotodat -> 'svedGlKFH' then predRabotodat -> 'svedGlKFH' ->> 'innfl' + when predRabotodat -> 'svedPlatFL' then predRabotodat -> 'svedPlatFL' ->> 'innfl' + END + as akt_inn, + case + when predRabotodat -> 'svedIP' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when predRabotodat -> 'svedYUL' then predRabotodat -> 'svedIP' ->> 'ogrnip' + END + as akt_ogrn, + case + when predRabotodat -> 'svedIP' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + END + as akt_kpp, + true as akt_actual_employer, + case + when predRabotodat -> 'svedYUL' then predRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' + END + as akt_is_opk_org +from filtered_data fd; + Y + + + 512 + 384 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + result + + + 672 + 384 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + TRUE + result + N + - + + + Change job status on success + Change job status on success + + + 864 + 240 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 320 + 384 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1040 + 240 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1040 + 544 + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1216 + 544 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl new file mode 100644 index 0000000..3f48109 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl @@ -0,0 +1,544 @@ + + + + employer_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 18:47:26.553 + - + 2025/08/18 18:47:26.553 + + + + + + Change job status on error + Abort + Y + + + Create job execution record + employer_input + Y + + + Filter rows + Change job status on success + Y + + + employer_input + Identify last row in a stream + Y + + + Identify last row in a stream + akt_employer_upsert + Y + + + akt_employer_upsert + pred_employer_upsert + Y + + + akt_employer_upsert + Filter rows + Y + + + akt_employer_upsert + Change job status on error + Y + + + pred_employer_upsert + Change job status on success + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1248 + 560 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1072 + 560 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1072 + 256 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 352 + 400 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + TRUE + result + N + - + + + Change job status on success + Change job status on success + + + 896 + 256 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + result + + + 704 + 400 + + + + employer_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filteredData as ( + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRabotodat' ->> 'rabotodat' != 'null' + -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' +) +select + fd.source_id, + fd.recruit_id, +-- aktRabotodat + aktRabotodat -> 'dataSved' as akt_source_update_date, + aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, + aktRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, + aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, + case + when aktRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' + when aktRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when aktRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' + when aktRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' + END + as akt_employer_category_name, + case + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'naimOrg' + END + as akt_name, + case + when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'svedIP' ->> 'innfl' + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' ->> 'innyul' + when aktRabotodat ->> 'svedGlKFH' != 'null' then aktRabotodat -> 'svedGlKFH' ->> 'innfl' + when aktRabotodat ->> 'svedPlatFL' != 'null' then aktRabotodat -> 'svedPlatFL' ->> 'innfl' + END + as akt_inn, + case + when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedIP' ->> 'ogrnip' + END + as akt_ogrn, + case + when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + END + as akt_kpp, + true as akt_actual_employer, + case + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' + END + as akt_is_opk_org, +-- predRabotodat + predRabotodat -> 'dataSved' as pred_source_update_date, + predRabotodat -> 'extend' ->> 'adresRabotodat' as pred_address, + predRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as pred_separate_unit_type_code, + predRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as pred_separate_unit_address, + case + when predRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' + when predRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when predRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' + when predRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' + END + as pred_employer_category_name, + case + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'naimOrg' + END + as pred_name, + case + when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'svedIP' ->> 'innfl' + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' ->> 'innyul' + when predRabotodat ->> 'svedGlKFH' != 'null' then predRabotodat -> 'svedGlKFH' ->> 'innfl' + when predRabotodat ->> 'svedPlatFL' != 'null' then predRabotodat -> 'svedPlatFL' ->> 'innfl' + END + as pred_inn, + case + when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedIP' ->> 'ogrnip' + END + as pred_ogrn, + case + when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + END + as pred_kpp, + false as pred_actual_employer, + case + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' + END + as pred_is_opk_org +from filteredData fd; + Y + + + 544 + 400 + + + + akt_employer_upsert + InsertUpdate + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + source_id + + + ervu_dashboard + employer
+ + source_id + source_id + Y + + + recruit_id + recruit_id + Y + + + source_update_date + akt_source_update_date + Y + + + address + akt_address + Y + + + separate_unit_type_code + akt_separate_unit_type + Y + + + separate_unit_address + akt_separate_unit_address + Y + + + employer_category_name + akt_employer_category_name + Y + + + name + akt_name + Y + + + inn + akt_inn + Y + + + ogrn + akt_ogrn + Y + + + kpp + akt_kpp + Y + + + actual_employer + akt_actual_employer + Y + + + is_opk_org + akt_is_opk_org + Y + +
+ N + + + 896 + 400 + +
+ + pred_employer_upsert + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + source_id + + + ervu_dashboard + employer
+ + source_id + source_id + Y + + + recruit_id + recruit_id + Y + + + source_update_date + pred_source_update_date + Y + + + address + pred_address + Y + + + separate_unit_type_code + pred_separate_unit_type_code + Y + + + separate_unit_address + pred_separate_unit_address + Y + + + employer_category_name + pred_employer_category_name + Y + + + name + pred_name + Y + + + inn + pred_inn + Y + + + ogrn + pred_ogrn + Y + + + kpp + pred_kpp + Y + + + actual_employer + pred_actual_employer + Y + + + is_opk_org + pred_is_opk_org + Y + +
+ N + + + 1072 + 400 + +
+ + + akt_employer_upsert + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl new file mode 100644 index 0000000..a0965cf --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl @@ -0,0 +1,356 @@ + + + + recruitment_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 20:11:33.772 + - + 2025/08/18 20:11:33.772 + + + + + + Get all recruitments ordered by created_date + employer_flow.hpl + Y + + + Get all recruitments ordered by created_date + employer_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + employer_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + employer_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + employer_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 416 + 432 + + + + employer_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + employer_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 688 + 256 + + + + employer_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + employer_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 688 + 336 + + + + employer_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + employer_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 688 + 416 + + + + employer_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + employer_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 688 + 496 + + + + employer_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + employer_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 688 + 576 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..1e7c811 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 20:19:19.424 + - + 2025/08/18 20:19:19.424 + + + + + + Table input + employer_flow_delta.hpl + Y + + + Table input + employer_flow_delta.hpl 3 + Y + + + Table input + employer_flow_delta.hpl 2 + Y + + + Table input + employer_flow_delta.hpl 4 + Y + + + Table input + employer_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN public.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'employer_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 576 + 336 + + + + employer_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 176 + + + + employer_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 256 + + + + employer_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 336 + + + + employer_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 416 + + + + employer_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 496 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..54c5766 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 20:16:58.135 + - + 2025/08/18 20:16:58.135 + + + + + + Table input + employer_flow_repeat.hpl + Y + + + Table input + employer_flow_repeat.hpl 2 + Y + + + Table input + employer_flow_repeat.hpl 3 + Y + + + Table input + employer_flow_repeat.hpl 4 + Y + + + Table input + employer_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN public.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'employer_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 528 + 432 + + + + employer_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 272 + + + + employer_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 352 + + + + employer_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 432 + + + + employer_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 512 + + + + employer_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 592 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl b/mappings/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl new file mode 100644 index 0000000..ad27771 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl @@ -0,0 +1,84 @@ + + + + check_if_employer_job_execution_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 20:08:41.981 + - + 2025/08/18 20:08:41.981 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 816 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'employer_job' + limit 1 + ) AS job_executed_flag; + N + + + 528 + 336 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl b/mappings/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl new file mode 100644 index 0000000..785a778 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 20:14:41.794 + - + 2025/08/18 20:14:41.794 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 816 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'employer_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 528 + 336 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/individual_entrepreneur_job.hwf b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/individual_entrepreneur_job.hwf new file mode 100644 index 0000000..e230637 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/individual_entrepreneur_job.hwf @@ -0,0 +1,262 @@ + + + individual_entrepreneur_job + Y + + + + - + 2025/08/19 08:47:49.108 + - + 2025/08/19 08:47:49.108 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 0 + 224 + + + + check_if_individual_entrepreneur_execution_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_individual_entrepreneur_execution_exists.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 256 + 224 + + + + employer_job_execution_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 592 + 224 + + + + recruitment_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow.hpl + + + Basic + + Y + + N + local + N + N + Y + Y + 912 + 224 + + + + recruitment_five_flow_repeat.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_repeat.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 832 + 528 + + + + check_if_need_to_repeat.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_need_to_repeat.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 592 + 384 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 592 + 528 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 592 + 720 + + + + + + Start + check_if_individual_entrepreneur_execution_exists.hpl + Y + Y + Y + + + check_if_individual_entrepreneur_execution_exists.hpl + employer_job_execution_exists_check + Y + Y + N + + + employer_job_execution_exists_check + recruitment_five_flow.hpl + Y + Y + N + + + employer_job_execution_exists_check + check_if_need_to_repeat.hpl + Y + N + N + + + check_if_need_to_repeat.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_repeat.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl new file mode 100644 index 0000000..401487b --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl @@ -0,0 +1,451 @@ + + + + individual_entrepreneur_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 08:50:19.851 + - + 2025/08/19 08:50:19.851 + + + + + + Change job status on error + Abort + Y + + + Create job execution record + individual_entrepreneur_input + Y + + + Filter rows + Change job status on success + Y + + + Identify last row in a stream + akt_individual_entrepreneur_output + Y + + + akt_individual_entrepreneur_output + Change job status on error + Y + + + akt_individual_entrepreneur_output + Filter rows + Y + + + akt_individual_entrepreneur_output + pred_individual_entrepreneur_output + Y + + + pred_individual_entrepreneur_output + Change job status on error + Y + + + pred_individual_entrepreneur_output + Change job status on success + Y + + + individual_entrepreneur_input + Identify last row in a stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1536 + 624 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1360 + 624 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1360 + 272 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 384 + 448 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + TRUE + result + N + - + + + Change job status on success + + + 1040 + 272 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + result + + + 800 + 448 + + + + akt_individual_entrepreneur_output + TableOutput + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + recruit_id + recruit_id + + + source_id + source_id + + + ogrnip + akt_ogrnip + + + source_update_date + akt_source_update_date + + + registration_date + akt_registration_date + + + reg_npd_date + akt_reg_npd_date + + + dereg_npd_date + akt_dereg_npd_date + + + actual + akt_actual + + + N + N + N + N + + Y + + N + ervu_dashboard + Y + individual_entrepreneur
+ + N + Y + N + Y + + + 1040 + 448 + +
+ + pred_individual_entrepreneur_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + recruit_id + recruit_id + + + source_id + source_id + + + ogrnip + pred_ogrnip + + + source_update_date + pred_source_update_date + + + registration_date + pred_registration_date + + + deregistration_date + pred_deregistration_date + + + reg_npd_date + pred_reg_npd_date + + + dereg_npd_date + pred_dereg_npd_date + + + actual + pred_actual + + + N + N + N + N + + Y + + N + ervu_dashboard + Y + individual_entrepreneur
+ + N + Y + N + Y + + + 1360 + 448 + +
+ + individual_entrepreneur_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filtered_data as ( + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as aktIp, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as predIp + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' ->> 'regIP' != 'null' +-- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' +) +select + fd.recruit_id, + fd.source_id, + aktIp ->> 'ogrnip' as akt_ogrnip, + aktIp ->> 'dataSved' as akt_source_update_date, + aktIp ->> 'dataRegIP' as akt_registration_date, + aktIp -> 'extend' ->> 'dataUchNPD' as akt_reg_npd_date, + aktIp -> 'extend' ->> 'dataSnUchNPD' as akt_dereg_npd_date, + true as akt_actual, + predIp ->> 'ogrnip' as pred_ogrnip, + predIp ->> 'dataSved' as pred_source_update_date, + predIp ->> 'dataRegIP' as pred_registration_date, + predIp ->> 'dataINNNed' as pred_deregistration_date, + predIp -> 'extend' ->> 'dataUchNPD' as pred_reg_npd_date, + predIp -> 'extend' ->> 'dataSnUchNPD' as pred_dereg_npd_date, + false as pred_actual +from filtered_data fd; + Y + + + 592 + 448 + + + + + akt_individual_entrepreneur_output + Change job status on error + Y + + + + + + + + + + pred_individual_entrepreneur_output + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl new file mode 100644 index 0000000..7266814 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl @@ -0,0 +1,455 @@ + + + + individual_entrepreneur_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 09:17:38.141 + - + 2025/08/19 09:17:38.141 + + + + + + Change job status on error + Abort + Y + + + Create job execution record + individual_entrepreneur_input + Y + + + Filter rows + Change job status on success + Y + + + Identify last row in a stream + akt_individual_entrepreneur_upsert + Y + + + individual_entrepreneur_input + Identify last row in a stream + Y + + + akt_individual_entrepreneur_upsert + Change job status on error + Y + + + akt_individual_entrepreneur_upsert + Filter rows + Y + + + akt_individual_entrepreneur_upsert + pred_individual_entrepreneur_upsert + Y + + + pred_individual_entrepreneur_upsert + Change job status on error + Y + + + pred_individual_entrepreneur_upsert + Change job status on success + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1456 + 624 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1280 + 624 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1280 + 272 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 272 + 448 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + TRUE + result + N + - + + + Change job status on success + + + 992 + 272 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + result + + + 736 + 448 + + + + individual_entrepreneur_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filtered_data as ( + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as aktIp, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as predIp + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' ->> 'regIP' != 'null' + and (ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' ->> 'dataSved' > '${MAX_SOURCE_UPDATE_DATE}' + or ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' ->> 'dataSved' > '${MAX_SOURCE_UPDATE_DATE}') +-- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' +) +select + fd.recruit_id, + fd.source_id, + aktIp ->> 'ogrnip' as akt_ogrnip, + aktIp ->> 'dataSved' as akt_source_update_date, + aktIp ->> 'dataRegIP' as akt_registration_date, + aktIp -> 'extend' ->> 'dataUchNPD' as akt_reg_npd_date, + aktIp -> 'extend' ->> 'dataSnUchNPD' as akt_dereg_npd_date, + true as akt_actual, + predIp ->> 'ogrnip' as pred_ogrnip, + predIp ->> 'dataSved' as pred_source_update_date, + predIp ->> 'dataRegIP' as pred_registration_date, + predIp ->> 'dataINNNed' as pred_deregistration_date, + predIp -> 'extend' ->> 'dataUchNPD' as pred_reg_npd_date, + predIp -> 'extend' ->> 'dataSnUchNPD' as pred_dereg_npd_date, + false as pred_actual +from filtered_data fd; + Y + + + 496 + 448 + + + + akt_individual_entrepreneur_upsert + InsertUpdate + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + source_id + + + ervu_dashboard + individual_entrepreneur
+ + recruit_id + recruit_id + N + + + source_id + source_id + N + + + ogrnip + akt_ogrnip + Y + + + source_update_date + akt_source_update_date + Y + + + registration_date + akt_registration_date + Y + + + reg_npd_date + akt_reg_npd_date + Y + + + deregistration_date + akt_dereg_npd_date + Y + + + actual + akt_actual + Y + +
+ N + + + 992 + 448 + +
+ + pred_individual_entrepreneur_upsert + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + source_id + + ervu_dashboard + individual_entrepreneur
+ + recruit_id + recruit_id + N + + + source_id + source_id + N + + + ogrnip + pred_ogrnip + Y + + + source_update_date + pred_source_update_date + Y + + + registration_date + pred_registration_date + Y + + + deregistration_date + pred_deregistration_date + Y + + + reg_npd_date + pred_reg_npd_date + Y + + + dereg_npd_date + pred_dereg_npd_date + Y + + + actual + pred_actual + Y + +
+ N + + + 1280 + 448 + +
+ + + akt_individual_entrepreneur_upsert + Change job status on error + Y + + + + + + + + + + pred_individual_entrepreneur_upsert + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl new file mode 100644 index 0000000..a9ef581 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl @@ -0,0 +1,454 @@ + + + + individual_entrepreneur_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 09:03:42.743 + - + 2025/08/19 09:03:42.743 + + + + + + Change job status on error + Abort + Y + + + Create job execution record + individual_entrepreneur_input + Y + + + Filter rows + Change job status on success + Y + + + individual_entrepreneur_input + Identify last row in a stream + Y + + + Identify last row in a stream + akt_individual_entrepreneur_upsert + Y + + + akt_individual_entrepreneur_upsert + pred_individual_entrepreneur_upsert + Y + + + akt_individual_entrepreneur_upsert + Filter rows + Y + + + pred_individual_entrepreneur_upsert + Change job status on success + Y + + + pred_individual_entrepreneur_upsert + Change job status on error + Y + + + akt_individual_entrepreneur_upsert + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1696 + 640 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1520 + 640 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1520 + 288 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 512 + 464 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + TRUE + result + N + - + + + Change job status on success + + + 1232 + 288 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + result + + + 976 + 464 + + + + individual_entrepreneur_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filtered_data as ( + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as aktIp, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as predIp + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' ->> 'regIP' != 'null' +-- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' +) +select + fd.recruit_id, + fd.source_id, + aktIp ->> 'ogrnip' as akt_ogrnip, + aktIp ->> 'dataSved' as akt_source_update_date, + aktIp ->> 'dataRegIP' as akt_registration_date, + aktIp -> 'extend' ->> 'dataUchNPD' as akt_reg_npd_date, + aktIp -> 'extend' ->> 'dataSnUchNPD' as akt_dereg_npd_date, + true as akt_actual, + predIp ->> 'ogrnip' as pred_ogrnip, + predIp ->> 'dataSved' as pred_source_update_date, + predIp ->> 'dataRegIP' as pred_registration_date, + predIp ->> 'dataINNNed' as pred_deregistration_date, + predIp -> 'extend' ->> 'dataUchNPD' as pred_reg_npd_date, + predIp -> 'extend' ->> 'dataSnUchNPD' as pred_dereg_npd_date, + false as pred_actual +from filtered_data fd; + Y + + + 736 + 464 + + + + akt_individual_entrepreneur_upsert + InsertUpdate + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + source_id + + + ervu_dashboard + individual_entrepreneur
+ + recruit_id + recruit_id + N + + + source_id + source_id + N + + + ogrnip + akt_ogrnip + Y + + + source_update_date + akt_source_update_date + Y + + + registration_date + akt_registration_date + Y + + + reg_npd_date + akt_reg_npd_date + Y + + + deregistration_date + akt_dereg_npd_date + Y + + + actual + akt_actual + Y + +
+ N + + + 1232 + 464 + +
+ + pred_individual_entrepreneur_upsert + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + source_id + + + ervu_dashboard + individual_entrepreneur
+ + recruit_id + recruit_id + N + + + source_id + source_id + N + + + ogrnip + pred_ogrnip + Y + + + source_update_date + pred_source_update_date + Y + + + registration_date + pred_registration_date + Y + + + deregistration_date + pred_deregistration_date + Y + + + reg_npd_date + pred_reg_npd_date + Y + + + dereg_npd_date + pred_dereg_npd_date + Y + + + actual + pred_actual + Y + +
+ N + + + 1520 + 464 + +
+ + + akt_individual_entrepreneur_upsert + Change job status on error + Y + + + + + + + + + + pred_individual_entrepreneur_upsert + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow.hpl new file mode 100644 index 0000000..961a651 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow.hpl @@ -0,0 +1,356 @@ + + + + recruitment_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 08:50:18.281 + - + 2025/08/19 08:50:18.281 + + + + + + Get all recruitments + individual_entrepreneur_flow.hpl + Y + + + Get all recruitments + individual_entrepreneur_flow.hpl 2 + Y + + + Get all recruitments + individual_entrepreneur_flow.hpl 3 + Y + + + Get all recruitments + individual_entrepreneur_flow.hpl 4 + Y + + + Get all recruitments + individual_entrepreneur_flow.hpl 5 + Y + + + + Get all recruitments + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 512 + 448 + + + + individual_entrepreneur_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 288 + + + + individual_entrepreneur_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 368 + + + + individual_entrepreneur_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 448 + + + + individual_entrepreneur_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 528 + + + + individual_entrepreneur_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 608 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..d9de951 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 09:17:07.831 + - + 2025/08/19 09:17:07.831 + + + + + + Table input + individual_entrepreneur_flow_delta.hpl + Y + + + Table input + individual_entrepreneur_flow_delta.hpl 2 + Y + + + Table input + individual_entrepreneur_flow_delta.hpl 3 + Y + + + Table input + individual_entrepreneur_flow_delta.hpl 4 + Y + + + Table input + individual_entrepreneur_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN public.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'individual_entrepreneur_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 544 + 384 + + + + individual_entrepreneur_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 224 + + + + individual_entrepreneur_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 304 + + + + individual_entrepreneur_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 384 + + + + individual_entrepreneur_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 464 + + + + individual_entrepreneur_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 544 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_repeat.hpl new file mode 100644 index 0000000..d7eab5d --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_repeat.hpl @@ -0,0 +1,356 @@ + + + + recruitment_five_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 09:03:27.319 + - + 2025/08/19 09:03:27.319 + + + + + + Get all recruitments + individual_entrepreneur_flow_repeat.hpl + Y + + + Get all recruitments + individual_entrepreneur_flow_repeat.hpl 2 + Y + + + Get all recruitments + individual_entrepreneur_flow_repeat.hpl 3 + Y + + + Get all recruitments + individual_entrepreneur_flow_repeat.hpl 4 + Y + + + Get all recruitments + individual_entrepreneur_flow_repeat.hpl 5 + Y + + + + Get all recruitments + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 352 + 464 + + + + individual_entrepreneur_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 304 + + + + individual_entrepreneur_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 384 + + + + individual_entrepreneur_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 464 + + + + individual_entrepreneur_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 544 + + + + individual_entrepreneur_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + individual_entrepreneur_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 624 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_individual_entrepreneur_execution_exists.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_individual_entrepreneur_execution_exists.hpl new file mode 100644 index 0000000..375b3bb --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_individual_entrepreneur_execution_exists.hpl @@ -0,0 +1,84 @@ + + + + check_if_individual_entrepreneur_execution_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 08:48:31.859 + - + 2025/08/19 08:48:31.859 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 752 + 208 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'individual_entrepreneur_job' + limit 1 + ) AS job_executed_flag; + N + + + 464 + 208 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_need_to_repeat.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_need_to_repeat.hpl new file mode 100644 index 0000000..44e3f9a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_need_to_repeat.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 08:57:47.121 + - + 2025/08/19 08:57:47.121 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 736 + 240 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'individual_entrepreneur_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 448 + 240 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl new file mode 100644 index 0000000..32777a0 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl @@ -0,0 +1,423 @@ + + + + self_employed_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 20:37:09.559 + - + 2025/08/18 20:37:09.559 + + + + + + Change job status on error + Abort + Y + + + Create job execution record + self_employed_input + Y + + + akt_self_employed_output + pred_self_employed_output + Y + + + self_employed_input + Identify last row in a stream + Y + + + Identify last row in a stream + akt_self_employed_output + Y + + + akt_self_employed_output + Filter rows + Y + + + pred_self_employed_output + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + akt_self_employed_output + Change job status on error + Y + + + pred_self_employed_output + Change job status on error + Y + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + + N + + N + + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + + 224 + 224 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1040 + 48 + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1216 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1040 + 400 + + + + self_employed_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filtered_data as (select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as aktNpd, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as predNpd + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'npd' != 'null' + -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + limit 1) +select fd.recruit_id, + aktNpd ->> 'id' as akt_source_id, + aktNpd ->> 'dataSved' as akt_source_update_date, + aktNpd ->> 'dataUchNPD' as akt_register_date, + true as akt_actual, + predNpd ->> 'id' as pred_source_id, + predNpd ->> 'dataSved' as pred_source_update_date, + predNpd ->> 'dataUchNPD' as pred_register_date, + predNpd ->> 'dataSnUchNPD' as pred_deregistration_date, + false as pred_actual +from filtered_data fd; + Y + + + 432 + 224 + + + + akt_self_employed_output + TableOutput + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + recruit_id + recruit_id + + + source_id + akt_source_id + + + source_update_date + akt_source_update_date + + + register_date + akt_register_date + + + actual + akt_actual + + + N + N + N + N + + Y + + N + ervu_dashboard + Y + self_employed
+ + N + Y + N + Y + + + 832 + 224 + +
+ + pred_self_employed_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + recruit_id + recruit_id + + + source_id + pred_source_id + + + source_update_date + pred_source_update_date + + + register_date + pred_register_date + + + deregistration_date + pred_deregistration_date + + + actual + pred_actual + + + N + N + N + N + + Y + + N + ervu_dashboard + Y + self_employed
+ + N + Y + N + Y + + + 1040 + 224 + +
+ + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + result + + + 624 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + TRUE + result + N + - + + + Change job status on success + + + 832 + 48 + + + + + akt_self_employed_output + Change job status on error + Y + + + + + + + + + + pred_self_employed_output + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl new file mode 100644 index 0000000..5f4390a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl @@ -0,0 +1,427 @@ + + + + self_employed_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 08:32:40.523 + - + 2025/08/19 08:32:40.523 + + + + + + Create job execution record + Table input + Y + + + self_employed_upsert + pred_self_employed_upsert + Y + + + self_employed_upsert + Change job status on error + Y + + + pred_self_employed_upsert + Change job status on error + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + self_employed_upsert + Y + + + self_employed_upsert + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + pred_self_employed_upsert + Change job status on success + Y + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + + Y + + N + + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + + 1040 + 432 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1040 + 16 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL, + error_code = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 256 + 224 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filtered_data as (select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as aktNpd, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as predNpd + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'npd' != 'null' + -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + --and ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' ->> 'dataSved' > '${MAX_SOURCE_UPDATE_DATE}' + --or ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' ->> 'dataSved' > '${MAX_SOURCE_UPDATE_DATE}' + limit 1) +select fd.recruit_id, + aktNpd ->> 'id' as akt_source_id, + aktNpd ->> 'dataSved' as akt_source_update_date, + aktNpd ->> 'dataUchNPD' as akt_register_date, + true as akt_actual, + predNpd ->> 'id' as pred_source_id, + predNpd ->> 'dataSved' as pred_source_update_date, + predNpd ->> 'dataUchNPD' as pred_register_date, + predNpd ->> 'dataSnUchNPD' as pred_deregistration_date, + false as pred_actual +from filtered_data fd; + Y + + + 464 + 224 + + + + self_employed_upsert + InsertUpdate + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + akt_source_id + + + ervu_dashboard + self_employed
+ + recruit_id + recruit_id + N + + + source_id + akt_source_id + N + + + source_update_date + akt_source_update_date + Y + + + register_date + akt_register_date + Y + + + actual + akt_actual + Y + +
+ N + + + 816 + 224 + +
+ + pred_self_employed_upsert + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + akt_source_id + + + ervu_dashboard + self_employed
+ + recruit_id + recruit_id + N + + + source_id + pred_source_id + N + + + source_update_date + pred_source_update_date + Y + + + register_date + pred_register_date + Y + + + deregistration_date + pred_deregistration_date + Y + + + actual + pred_actual + Y + +
+ N + + + 1040 + 224 + +
+ + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + + 0 + + + 1296 + 432 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + result + + + 624 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + TRUE + result + N + - + + + Change job status on success + + + 816 + 16 + + + + + self_employed_upsert + Change job status on error + Y + + + + + + + + + + pred_self_employed_upsert + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl new file mode 100644 index 0000000..b84e7fe --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl @@ -0,0 +1,416 @@ + + + + self_employed_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 21:11:27.689 + - + 2025/08/18 21:11:27.689 + + + + + + Change job status on error + Abort + Y + + + Create job execution record + self_employed_input + Y + + + Filter rows + Change job status on success + Y + + + self_employed_input + Identify last row in a stream + Y + + + Identify last row in a stream + akt_self_employed_output + Y + + + akt_self_employed_output + pred_self_employed_output + Y + + + akt_self_employed_output + Filter rows + Y + + + pred_self_employed_output + Change job status on success + Y + + + pred_self_employed_output + Change job status on error + Y + + + akt_self_employed_output + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1248 + 592 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1072 + 592 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1072 + 240 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 256 + 416 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + TRUE + result + N + - + + + Change job status on success + + + 864 + 240 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + result + + + 656 + 416 + + + + self_employed_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filtered_data as (select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as aktNpd, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as predNpd + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'npd' != 'null' + -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + limit 1) +select fd.recruit_id, + aktNpd ->> 'id' as akt_source_id, + aktNpd ->> 'dataSved' as akt_source_update_date, + aktNpd ->> 'dataUchNPD' as akt_register_date, + true as akt_actual, + predNpd ->> 'id' as pred_source_id, + predNpd ->> 'dataSved' as pred_source_update_date, + predNpd ->> 'dataUchNPD' as pred_register_date, + predNpd ->> 'dataSnUchNPD' as pred_deregistration_date, + false as pred_actual +from filtered_data fd; + Y + + + 464 + 416 + + + + akt_self_employed_output + InsertUpdate + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + akt_source_id + + + ervu_dashboard + self_employed
+ + recruit_id + recruit_id + N + + + source_id + akt_source_id + Y + + + source_update_date + akt_source_update_date + Y + + + register_date + akt_register_date + Y + + + actual + akt_actual + Y + +
+ N + + + 864 + 416 + +
+ + pred_self_employed_output + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + = + source_id + pred_source_id + + + ervu_dashboard + self_employed
+ + recruit_id + recruit_id + N + + + source_id + pred_source_id + Y + + + source_update_date + pred_source_update_date + Y + + + register_date + pred_register_date + Y + + + deregistration_date + pred_deregistration_date + Y + + + actual + pred_actual + Y + +
+ N + + + 1072 + 416 + +
+ + + akt_self_employed_output + Change job status on error + Y + + + + + + + + + + pred_self_employed_output + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow.hpl new file mode 100644 index 0000000..7f01048 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow.hpl @@ -0,0 +1,356 @@ + + + + recruitment_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 21:02:07.571 + - + 2025/08/18 21:02:07.571 + + + + + + Get all recruitments + self_employed_flow.hpl + Y + + + Get all recruitments + self_employed_flow.hpl 2 + Y + + + Get all recruitments + self_employed_flow.hpl 3 + Y + + + Get all recruitments + self_employed_flow.hpl 4 + Y + + + Get all recruitments + self_employed_flow.hpl 5 + Y + + + + Get all recruitments + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 352 + 464 + + + + self_employed_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 304 + + + + self_employed_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 384 + + + + self_employed_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 464 + + + + self_employed_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 544 + + + + self_employed_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 576 + 624 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..ced7307 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/19 08:32:02.128 + - + 2025/08/19 08:32:02.128 + + + + + + Table input + self_employed_flow_delta.hpl + Y + + + Table input + self_employed_flow_delta.hpl 2 + Y + + + Table input + self_employed_flow_delta.hpl 3 + Y + + + Table input + self_employed_flow_delta.hpl 4 + Y + + + Table input + self_employed_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN public.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'self_employed_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 416 + 496 + + + + self_employed_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 336 + + + + self_employed_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 416 + + + + self_employed_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 496 + + + + self_employed_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 576 + + + + self_employed_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + self_employed_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 656 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/recruitments_five_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/recruitments_five_flow_repeat.hpl new file mode 100644 index 0000000..7d0f996 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/self_employed/recruitments_five_flow_repeat.hpl @@ -0,0 +1,360 @@ + + + + recruitments_five_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 21:33:02.351 + - + 2025/08/18 21:33:02.351 + + + + + + Table input + self_employed_flow_on_error.hpl + Y + + + Table input + self_employed_flow_on_error.hpl 2 + Y + + + Table input + self_employed_flow_on_error.hpl 3 + Y + + + Table input + self_employed_flow_on_error.hpl 4 + Y + + + Table input + self_employed_flow_on_error.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN public.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'employer_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 528 + 400 + + + + self_employed_flow_on_error.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 240 + + + + self_employed_flow_on_error.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 320 + + + + self_employed_flow_on_error.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 400 + + + + self_employed_flow_on_error.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 480 + + + + self_employed_flow_on_error.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + work_activity_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 560 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/self_employed_job.hwf b/mappings/info_recruits/citizen_tables/work/self_employed/self_employed_job.hwf new file mode 100644 index 0000000..35aea10 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/self_employed/self_employed_job.hwf @@ -0,0 +1,256 @@ + + + self_employed_job + Y + + + + - + 2025/08/18 20:32:44.739 + - + 2025/08/18 20:32:44.739 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 464 + 224 + + + + check_if_self_employed_job_execution_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/support/check_if_self_employed_job_execution_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 704 + 224 + + + + employer_job_execution_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 1008 + 224 + + + + recruitment_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1328 + 224 + + + + recruitments_five_flow_repeat.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/recruitments_five_flow_repeat.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 1248 + 528 + + + + check_if_need_to_repeat.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/support/check_if_need_to_repeat.hpl + Basic + + Y + + N + local + N + N + Y + N + 1008 + 384 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 1008 + 528 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 1008 + 720 + + + + + + check_if_self_employed_job_execution_exists.hpl + employer_job_execution_exists_check + Y + Y + N + + + employer_job_execution_exists_check + recruitment_five_flow.hpl + Y + Y + N + + + employer_job_execution_exists_check + check_if_need_to_repeat.hpl + Y + N + N + + + check_if_need_to_repeat.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitments_five_flow_repeat.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + Start + check_if_self_employed_job_execution_exists.hpl + Y + Y + Y + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_need_to_repeat.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_need_to_repeat.hpl new file mode 100644 index 0000000..652acfd --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_need_to_repeat.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 21:04:50.604 + - + 2025/08/18 21:04:50.604 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 704 + 272 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'self_employed_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 416 + 272 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_self_employed_job_execution_exists.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_self_employed_job_execution_exists.hpl new file mode 100644 index 0000000..e02aaf2 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_self_employed_job_execution_exists.hpl @@ -0,0 +1,84 @@ + + + + check_if_self_employed_job_execution_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/18 20:34:56.618 + - + 2025/08/18 20:34:56.618 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 592 + 192 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'self_employed_job' + limit 1 + ) AS job_executed_flag; + N + + + 304 + 192 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/work/test.hpl b/mappings/info_recruits/citizen_tables/work/test.hpl new file mode 100644 index 0000000..dc5e802 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/test.hpl @@ -0,0 +1,595 @@ + + + + child_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + User defined Java expression 2 + Update 2 + Y + + + Update 2 + Change job status on error + Y + + + Change job status on error + Abort + Y + + + Update 2 + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Update 2 + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Table input + Table output + Y + + + Group by 2 + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression 2 + Y + + + Table output + Change job status on error + Y + + + Table output + Group by 2 + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1216 + 1024 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1216 + 800 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS', + error_description = null +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1744 + 608 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 112 + 800 + + + + Detect empty stream + DetectEmptyStream + + N + + 1 + + none + + + + + 1568 + 480 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1392 + 608 + + + + Group by 2 + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + minors_count_raw + is_minor + SUM + + + has_minor_child_raw + is_minor + MAX + + + has_dead_child_raw + is_dead + MAX + + + N + + + recruit_id + + + N + grp + + + 560 + 480 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 784 + 480 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + ri.recruit_id::uuid AS recruit_id, + ch->>'id' AS child_external_id, + NULLIF(ch->>'idERN', '') AS child_id_ern, + CASE NULLIF(ch->>'rodstvSvyazReb', '')::int + WHEN 1 THEN 3 + WHEN 2 THEN 4 + END 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, + dates.birth_date, + dates.death_date, + ch->'svedSmert'->>'nomerZapis' AS death_az_number, + ch->'svedAZRozhd'->>'nomerZapis' AS birth_az_number, + CASE WHEN dates.death_date IS NOT NULL THEN 1 ELSE 0 END AS is_dead, + CASE + WHEN dates.death_date IS NOT NULL THEN 0 -- умершие не могут быть несовершеннолетними + WHEN dates.birth_date IS NULL THEN 0 -- если дата рождения неизвестна, считаем взрослым + WHEN dates.birth_date > CURRENT_DATE - INTERVAL '18 years' THEN 1 + ELSE 0 + END AS is_minor +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id +CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') AS ch +CROSS JOIN LATERAL ( + SELECT + 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 +) AS dates +WHERE + '${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y + + + 304 + 800 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + child_external_id + child_external_id + + + child_id_ern + child_id_ern + + + kinship_type + kinship_type + + + last_name + last_name + + + first_name + first_name + + + middle_name + middle_name + + + full_name + full_name + + + birth_date + birth_date + + + death_date + death_date + + + death_az_number + death_az_number + + + birth_az_number + birth_az_number + + + N + N + N + N + Y + N + ervu_dashboard + Y + citizen_child
+ N + Y + N + Y + + + 560 + 800 + +
+ + Update 2 + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + minors_count + minors_count + + + has_minor_child + has_minor_child + + + has_dead_child + has_dead_child + +
+ N + Y + + + 1216 + 480 + +
+ + User defined Java expression 2 + Janino + + Y + + 1 + + none + + + + minors_count + minors_count_raw == 1 ? "1" : minors_count_raw == 2 ? "2" : minors_count_raw >= 3 ? "3 и более" : "0" + String + 10 + -1 + + + + has_minor_child + has_minor_child_raw == 1 + Boolean + -1 + -1 + + + + has_dead_child + has_dead_child_raw == 1 + Boolean + -1 + -1 + + + + + 1024 + 480 + + + + + Create job execution record + Change job status on error + N + + + + + + + + + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + Update 2 + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl new file mode 100644 index 0000000..c21323a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl @@ -0,0 +1,1088 @@ + + + + work_activity_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + individual_entrepreneur_input + akt_individual_entrepreneur_output + Y + + + npd_input + akt_npd_output + Y + + + employer_input + actual_employer_output + Y + + + employer_input + pred_employer_output + Y + + + npd_input + pred_npd_output + Y + + + individual_entrepreneur_input + Table output + Y + + + citizen_work_activity_output + employee_parental_leave_output + Y + + + Create job execution record + citizen_work_activity_input + Y + + + employee_parental_leave_output + Change job status on error + Y + + + citizen_work_activity_output + Change job status on error + Y + + + Change job status on error + Abort + Y + + + employee_parental_leave_output + Change job status on success + Y + + + citizen_work_activity_input + Identify last row in a stream + Y + + + Identify last row in a stream + citizen_work_activity_output + Y + + + citizen_work_activity_output + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1248 + 528 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard-test + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1056 + 528 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1168 + 144 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard-test + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + + + N + N + N + N + Y + N + N + N + Y + N + Y + + + 976 + 1376 + + + + actual_employer_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + source_id + source_id + + + recruit_id + recruit_id + + + source_update_date + akt_source_update_date + + + address + akt_address + + + separate_unit_type_code + akt_separate_unit_type_code + + + separate_unit_address + akt_separate_unit_address + + + employer_category_name + akt_employer_category_name + + + name + akt_name + + + inn + akt_inn + + + ogrn + akt_ogrn + + + kpp + akt_kpp + + + actual_employer + akt_actual_employer + + + is_opk_org + akt_is_opk_org + + + N + N + N + N + Y + N + ervu_dashboard + Y + employer
+ N + Y + N + Y + + + 976 + 816 + +
+ + akt_individual_entrepreneur_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + recruit_id + recruit_id + + + source_id + source_id + + + ogrnip + akt_ogrnip + + + source_update_date + akt_source_update_date + + + registration_date + akt_registration_date + + + reg_npd_date + akt_reg_npd_date + + + dereg_npd_date + akt_dereg_npd_date + + + actual + akt_actual + + + N + N + N + N + Y + N + ervu_dashboard + Y + individual_entrepreneur
+ N + Y + N + Y + + + 976 + 1248 + +
+ + akt_npd_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + recruit_id + recruit_id + + + source_id + akt_source_id + + + source_update_date + akt_source_update_id + + + register_date + akt_register_date + + + actual + akt_actual + + + N + N + N + N + Y + N + ervu_dashboard + Y + self_employed
+ N + Y + N + Y + + + 976 + 1056 + +
+ + citizen_work_activity_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard-test + N + with filteredData as ( + select ri.recruit_id, + ri.info + from recruits_info ri + where jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' +) +SELECT + fd.recruit_id, + trud_elem ->> 'id' AS source_id, + trud_elem -> 'svedOrg' ->> 'naimOrg' AS employer_name, + trud_elem ->> 'trudFunkcziya' AS position, + trud_elem ->> 'dataMeropr' AS personnel_event_date, + trud_elem ->> 'naimTipKadrMeropr' AS personnel_event_type, + trud_elem ->> 'dataSved' AS source_update_date, + (trud_elem ->> 'prAktMestRab') = '1' AS actual_employer, + uhod_elem ->> 'dataNachUhodReb' AS parental_leave_start_date, + uhod_elem ->> 'dataKonUhodReb' AS parental_leave_end_date +from filteredData fd + cross join jsonb_array_elements(fd.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') as trud_elem + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(trud_elem -> 'svedUhodReb') = 'array' + THEN trud_elem -> 'svedUhodReb' + ELSE '[]'::jsonb + END + ) AS uhod_elem ON true; + Y + + + 512 + 320 + + + + citizen_work_activity_output + TableOutput + + N + + 1 + + none + + + 10000 + ervu-dashboard-test + + + source_id + source_id + + + recruit_id + recruit_id + + + employer_name + employer_name + + + position + position + + + personnel_event_date + personnel_event_date + + + personnel_event_type + personnel_event_type + + + source_update_date + source_update_date + + + actual_employer + actual_employer + + + N + N + N + N + Y + N + ervu_dashboard + Y + citizen_work_activity
+ N + Y + N + Y + + + 944 + 320 + +
+ + employee_parental_leave_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + citizen_work_activity_source_id + source_id + + + start_date + parental_leave_start_date + + + end_date + parental_leave_end_date + + + N + N + N + N + Y + N + ervu_dashboard + Y + employee_parental_leave
+ N + Y + N + Y + + + 1168 + 320 + +
+ + employer_input + TableInput + + N + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filteredData as ( + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRabotodat' ->> 'rabotodat' != 'null' + -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' +) +select + fd.source_id, + fd.recruit_id, +-- aktRabotodat + aktRabotodat -> 'dataSved' as akt_source_update_date, + aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, + aktRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, + aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, + case + when aktRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' + when aktRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when aktRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' + when aktRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' + END + as akt_employer_category_name, + case + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'naimOrg' + END + as akt_name, + case + when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'svedIP' ->> 'innfl' + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' ->> 'innyul' + when aktRabotodat ->> 'svedGlKFH' != 'null' then aktRabotodat -> 'svedGlKFH' ->> 'innfl' + when aktRabotodat ->> 'svedPlatFL' != 'null' then aktRabotodat -> 'svedPlatFL' ->> 'innfl' + END + as akt_inn, + case + when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedIP' ->> 'ogrnip' + END + as akt_ogrn, + case + when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + END + as akt_kpp, + true as akt_actual_employer, + case + when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' + END + as akt_is_opk_org, +-- predRabotodat + predRabotodat -> 'dataSved' as pred_source_update_date, + predRabotodat -> 'extend' ->> 'adresRabotodat' as pred_address, + predRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as pred_separate_unit_type_code, + predRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as pred_separate_unit_address, + case + when predRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' + when predRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when predRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' + when predRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' + END + as pred_employer_category_name, + case + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'naimOrg' + END + as pred_name, + case + when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'svedIP' ->> 'innfl' + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' ->> 'innyul' + when predRabotodat ->> 'svedGlKFH' != 'null' then predRabotodat -> 'svedGlKFH' ->> 'innfl' + when predRabotodat ->> 'svedPlatFL' != 'null' then predRabotodat -> 'svedPlatFL' ->> 'innfl' + END + as pred_inn, + case + when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedIP' ->> 'ogrnip' + END + as pred_ogrn, + case + when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + END + as pred_kpp, + false as akt_actual_employer, + case + when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' + END + as pred_is_opk_org +from filteredData fd; + Y + + + 752 + 848 + + + + individual_entrepreneur_input + TableInput + + N + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filtered_data as ( + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as aktIp, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as predIp + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' ->> 'regIP' != 'null' +-- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' +) +select + fd.recruit_id, + fd.source_id, + aktIp ->> 'ogrnip' as akt_ogrnip, + aktIp ->> 'dataSved' as akt_source_update_date, + aktIp ->> 'dataRegIP' as akt_registration_date, + aktIp -> 'extend' ->> 'dataUchNPD' as akt_reg_npd_date, + aktIp -> 'extend' ->> 'dataSnUchNPD' as akt_dereg_npd_date, + true as akt_actual, + predIp ->> 'ogrnip' as pred_ogrnip, + predIp ->> 'dataSved' as pred_source_update_date, + predIp ->> 'dataRegIP' as pred_registration_date, + predIp ->> 'dataINNNed' as pred_deregistration_date, + predIp -> 'extend' ->> 'dataUchNPD' as pred_reg_npd_date, + predIp -> 'extend' ->> 'dataSnUchNPD' as pred_dereg_npd_date, + false as pred_actual +from filtered_data fd; + Y + + + 752 + 1312 + + + + npd_input + TableInput + + N + + 1 + + none + + + ervu-dashboard-test + N + 0 + with filtered_data as ( + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as aktNpd, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as predNpd + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'npd' != 'null' +-- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' +) +select + fd.recruit_id, + aktNpd ->> 'id' as akt_source_id, + aktNpd ->> 'dataSved' as akt_source_update_id, + aktNpd ->> 'dataUchNPD' as akt_register_date, + true as akt_actual, + predNpd ->> 'id' as pred_source_id, + predNpd ->> 'dataSved' as pred_source_update_id, + predNpd ->> 'dataUchNPD' as pred_register_date, + predNpd ->> 'dataSnUchNPD' as pred_deregistration_date, + false as pred_actual +from filtered_data fd; + + Y + + + 752 + 1104 + + + + pred_employer_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + source_id + source_id + + + recruit_id + recruit_id + + + source_update_date + pred_source_update_date + + + address + pred_address + + + separate_unit_type_code + pred_separate_unit_type + + + separate_unit_address + pred_separate_unit_address + + + employer_category_name + pred_employer_category_name + + + name + pred_name + + + inn + pred_inn + + + ogrn + pred_ogrn + + + kpp + pred_kpp + + + actual_employer + pred_actual_employer + + + is_opk_org + pred_is_opk_org + + + N + N + N + N + Y + N + ervu_dashboard + Y + employer
+ N + Y + N + Y + + + 976 + 912 + +
+ + pred_npd_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + recruit_id + recruit_id + + + source_id + pred_source_id + + + source_update_date + pred_source_update_id + + + register_date + pred_register_date + + + deregistration_date + pred_deregistration_date + + + actual + pred_actual + + + N + N + N + N + Y + N + ervu_dashboard + Y + self_employed
+ N + Y + N + Y + + + 976 + 1168 + +
+ + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + result + + + 704 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + N + - + + + Change job status on success + + + 944 + 144 + + + + + Table output + Change job status on error + N + + + + + + + + + + actual_employer_output + Change job status on error + N + + + + + + + + + + akt_individual_entrepreneur_output + Change job status on error + N + + + + + + + + + + akt_npd_output + Change job status on error + N + + + + + + + + + + citizen_work_activity_output + Change job status on error + Y + + + + + + + + + + employee_parental_leave_output + Change job status on error + Y + + + + + + + + + + pred_npd_output + Change job status on error + N + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl similarity index 97% rename from mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_delta.hpl rename to mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl index 1a50b86..9ce3108 100644 --- a/mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl @@ -60,7 +60,7 @@ error_code - ervu-dashboard + ervu-dashboard-test Y @@ -97,7 +97,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard + ervu-dashboard-test Y @@ -132,9 +132,12 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard + ervu-dashboard-test + N + N + Y N N @@ -146,6 +149,7 @@ SET error_code = NULL where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}';
+ 336 @@ -163,7 +167,7 @@ and recruitment_id = '${IDM_ID}'; none - ervu-dashboard + ervu-dashboard-test N 10 WITH trud_info AS (SELECT ri.info, @@ -264,7 +268,7 @@ FROM trud_info ti; 1000 - ervu-dashboard + ervu-dashboard-test recruit_id diff --git a/mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl similarity index 97% rename from mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_repeat.hpl rename to mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl index 6d5d9cd..a4a1f14 100644 --- a/mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl @@ -60,7 +60,7 @@ error_code - ervu-dashboard + ervu-dashboard-test Y @@ -96,9 +96,12 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard + ervu-dashboard-test + Y + N + Y N N @@ -108,6 +111,7 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; + 976 @@ -127,9 +131,12 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard + ervu-dashboard-test + N + N + Y N N @@ -157,6 +164,7 @@ DO UPDATE SET execution_datetime = DEFAULT, error_description = NULL, error_code = NULL; + 272 @@ -174,7 +182,7 @@ DO UPDATE SET none - ervu-dashboard + ervu-dashboard-test N 10 WITH trud_info AS (SELECT ri.info, @@ -275,7 +283,7 @@ FROM trud_info ti; 1000 - ervu-dashboard + ervu-dashboard-test recruit_id diff --git a/mappings/info_recruits/citizen_tables/work_activity/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_delta.hpl similarity index 95% rename from mappings/info_recruits/citizen_tables/work_activity/recruitment_five_flow_delta.hpl rename to mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_delta.hpl index c8787e1..b882463 100644 --- a/mappings/info_recruits/citizen_tables/work_activity/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_delta.hpl @@ -57,7 +57,7 @@ none - ervu-dashboard + ervu-dashboard-test N 0 SELECT @@ -86,7 +86,7 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_delta.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl N 1 @@ -142,7 +142,7 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_delta.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl N 1 @@ -198,7 +198,7 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_delta.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl N 1 @@ -254,7 +254,7 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_delta.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl N 1 @@ -310,7 +310,7 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_delta.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl N 1 diff --git a/mappings/info_recruits/citizen_tables/work_activity/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_on_error.hpl similarity index 95% rename from mappings/info_recruits/citizen_tables/work_activity/recruitment_five_flow_on_error.hpl rename to mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_on_error.hpl index e1aeda3..85aee6a 100644 --- a/mappings/info_recruits/citizen_tables/work_activity/recruitment_five_flow_on_error.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_on_error.hpl @@ -27,12 +27,12 @@ Table input - work_activity_flow_repeat.hpl 3 + work_activity_flow_repeat.hpl 2 Y Table input - work_activity_flow_repeat.hpl 2 + work_activity_flow_repeat.hpl 3 Y @@ -57,7 +57,7 @@ none - ervu-dashboard + ervu-dashboard-test N 0 SELECT @@ -86,7 +86,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_repeat.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl N 1 @@ -142,7 +142,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_repeat.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl N 1 @@ -198,7 +198,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_repeat.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl N 1 @@ -254,7 +254,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_repeat.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl N 1 @@ -310,7 +310,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow_repeat.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl N 1 diff --git a/mappings/info_recruits/citizen_tables/work_activity/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/recruitments_five_flow.hpl similarity index 95% rename from mappings/info_recruits/citizen_tables/work_activity/recruitments_five_flow.hpl rename to mappings/info_recruits/citizen_tables/work/work_activity/recruitments_five_flow.hpl index b1c9b40..2fe3d2d 100644 --- a/mappings/info_recruits/citizen_tables/work_activity/recruitments_five_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/recruitments_five_flow.hpl @@ -57,7 +57,7 @@ none - ervu-dashboard + ervu-dashboard-test N 0 SELECT @@ -82,7 +82,7 @@ FROM ervu_dashboard.recruitment; local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl N 1 @@ -138,7 +138,7 @@ FROM ervu_dashboard.recruitment; local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl N 1 @@ -194,7 +194,7 @@ FROM ervu_dashboard.recruitment; local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl N 1 @@ -250,7 +250,7 @@ FROM ervu_dashboard.recruitment; local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl N 1 @@ -306,7 +306,7 @@ FROM ervu_dashboard.recruitment; local - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl N 1 diff --git a/mappings/info_recruits/citizen_tables/work_activity/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_need_to_repeat_job.hpl similarity index 98% rename from mappings/info_recruits/citizen_tables/work_activity/check_if_need_to_repeat_job.hpl rename to mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_need_to_repeat_job.hpl index dcb65d7..dd36f41 100644 --- a/mappings/info_recruits/citizen_tables/work_activity/check_if_need_to_repeat_job.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_need_to_repeat_job.hpl @@ -62,7 +62,7 @@ none - ervu-dashboard + ervu-dashboard-test N 0 SELECT EXISTS (SELECT 1 diff --git a/mappings/info_recruits/citizen_tables/work_activity/checkpoints/check_if_work_activity_job_exists.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_work_activity_job_exists.hpl similarity index 97% rename from mappings/info_recruits/citizen_tables/work_activity/checkpoints/check_if_work_activity_job_exists.hpl rename to mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_work_activity_job_exists.hpl index 70c1393..b562353 100644 --- a/mappings/info_recruits/citizen_tables/work_activity/checkpoints/check_if_work_activity_job_exists.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_work_activity_job_exists.hpl @@ -67,7 +67,7 @@ none - ervu-dashboard + ervu-dashboard-test N 0 SELECT EXISTS ( @@ -94,13 +94,13 @@ none + Basic Y - - N 0 - Basic ${STATUS} + + 944 diff --git a/mappings/info_recruits/citizen_tables/work_activity/work_activity_job.hwf b/mappings/info_recruits/citizen_tables/work/work_activity/work_activity_job.hwf similarity index 94% rename from mappings/info_recruits/citizen_tables/work_activity/work_activity_job.hwf rename to mappings/info_recruits/citizen_tables/work/work_activity/work_activity_job.hwf index e384c46..7a4306a 100644 --- a/mappings/info_recruits/citizen_tables/work_activity/work_activity_job.hwf +++ b/mappings/info_recruits/citizen_tables/work/work_activity/work_activity_job.hwf @@ -31,7 +31,7 @@ - check_if_ work_activity_job_was_executed.hpl + check_if_work_activity_job_exists.hpl PIPELINE @@ -41,7 +41,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/checkpoints/check_if_work_activity_job_exists.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/support/check_if_work_activity_job_exists.hpl Basic Y @@ -84,7 +84,9 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/recruitments_five_flow.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/recruitments_five_flow.hpl + + Basic Y @@ -95,7 +97,7 @@ N Y Y - 928 + 1040 304 @@ -110,7 +112,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/recruitment_five_flow_on_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_on_error.hpl Basic Y @@ -136,7 +138,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/check_if_need_to_repeat_job.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/support/check_if_need_to_repeat_job.hpl Basic Y @@ -179,7 +181,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/work_activity/recruitment_five_flow_delta.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_delta.hpl Basic Y @@ -198,13 +200,13 @@ Start - check_if_ work_activity_job_was_executed.hpl + check_if_work_activity_job_exists.hpl Y Y Y - check_if_ work_activity_job_was_executed.hpl + check_if_work_activity_job_exists.hpl work_activity_job_exists_check Y Y @@ -261,8 +263,8 @@ N -1 26 - 800 - 256 + 880 + 224 Первичка 65 From 699732fc14f9aa85e5726d86e275bceec9d7aeff Mon Sep 17 00:00:00 2001 From: Fusionshh Date: Tue, 19 Aug 2025 15:44:44 +0300 Subject: [PATCH 23/34] temp --- .../work_activity/delta_work_activity.hpl | 27 -- .../parallel/work_activity_flow.hpl | 384 ------------------ 2 files changed, 411 deletions(-) delete mode 100644 mappings/info_recruits/citizen_tables/work_activity/delta_work_activity.hpl delete mode 100644 mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow.hpl diff --git a/mappings/info_recruits/citizen_tables/work_activity/delta_work_activity.hpl b/mappings/info_recruits/citizen_tables/work_activity/delta_work_activity.hpl deleted file mode 100644 index c42cfdd..0000000 --- a/mappings/info_recruits/citizen_tables/work_activity/delta_work_activity.hpl +++ /dev/null @@ -1,27 +0,0 @@ - - - - delta_work_activity - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/08/05 12:54:02.780 - - - 2025/08/05 12:54:02.780 - - - - - - - - - diff --git a/mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow.hpl b/mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow.hpl deleted file mode 100644 index 1ade769..0000000 --- a/mappings/info_recruits/citizen_tables/work_activity/parallel/work_activity_flow.hpl +++ /dev/null @@ -1,384 +0,0 @@ - - - - work_activity_flow - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/08/05 14:31:22.799 - - - 2025/08/05 14:31:22.799 - - - - - - Table input - Table output - Y - - - Table output - Change job status on success - Y - - - Create job execution record - Table input - Y - - - Table output - Change job status on error - Y - - - - Change job status on error - ExecSql - - Y - - 1 - - none - - - - - error_description - - - ervu-dashboard - - Y - - N - - Y - Y - N - UPDATE etl.job_execution -SET status = 'ERROR', - error_description = ? -WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - - - - - - 992 - 512 - - - - Change job status on success - ExecSql - - Y - - 1 - - none - - - - - ervu-dashboard - Y - N - Y - N - N - UPDATE etl.job_execution -SET status = 'SUCCESS' -WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - - - - - 992 - 320 - - - - Create job execution record - ExecSql - - Y - - 1 - - none - - - - - ervu-dashboard - N - N - Y - N - N - INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) -VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - - - - - 288 - 320 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 10 - WITH trud_info AS (SELECT ri.info, - ri.recruit_id::uuid, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL - WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' THEN - ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 - END AS trud_deyat, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL - WHEN - jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb') = - 'array' THEN - ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb' -> 0 - END AS parental_leave_info, - - COALESCE( - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat', - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' - ) AS employer, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' IS NULL THEN NULL - WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP') = 'array' - THEN - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 - ELSE - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' - END AS reg_ip, - - COALESCE( - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD', - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' - ) AS self_employment - - FROM ervu_dashboard.recruits_info ri - -) -SELECT ti.recruit_id::uuid, - (ti.trud_deyat ->> 'dataMeropr')::date AS personnel_event_date, - ti.trud_deyat ->> 'naimTipKadrMeropr' AS personnel_event_type, - (ti.trud_deyat ->> 'prAktMestRab' = '1') AS current_workplace, - ti.trud_deyat ->> 'trudFunkcziya' AS position, - ti.trud_deyat -> 'svedOrg' ->> 'naimOrg' AS employer_name, - ti.employer -> 'svedYUL' ->> 'kpp' AS employer_kpp, - CASE - WHEN ti.employer->'svedYUL' IS NOT NULL THEN 'Юридическое лицо' - WHEN ti.employer->'svedIP' IS NOT NULL THEN 'Индивидуальный предприниматель' - END AS employer_category, - COALESCE( - ti.employer -> 'svedYUL' ->> 'innyul', - ti.employer -> 'svedIP' ->> 'innyfl' - ) AS employer_inn, - ti.employer -> 'svedYUL' -> 'svedOPK' ->> 'region' AS employer_address, - COALESCE( - ti.employer -> 'svedIP' ->> 'ogrnip', - ti.employer -> 'svedYUL' -> 'extend' ->> 'ogrn' - ) AS employer_ogrnip, - ti.employer -> 'extend' ->> 'tipPodrazdRabotodat' AS employer_unit_type, - ti.employer -> 'extend' ->> 'adresPodrazdRabotodat' AS employer_unit_address, - (ti.parental_leave_info ->> 'dataNachUhodReb')::date AS parental_leave_start_date, - (ti.parental_leave_info ->> 'dataKonUhodReb')::date AS parental_leave_end_date, - ( - (ti.parental_leave_info ->> 'dataNachUhodReb')::date <= current_date AND - ( - (ti.parental_leave_info ->> 'dataKonUhodReb') IS NULL OR - (ti.parental_leave_info ->> 'dataKonUhodReb')::date > current_date - ) - ) AS parental_leave_active, - (ti.reg_ip ->> 'dataRegIP')::date AS reg_ip_date, - (ti.reg_ip ->> 'dataINNNed')::date AS dereg_ip_date, - ti.reg_ip ->> 'ogrnip' AS ogrnip_ip, - ti.reg_ip IS NOT NULL AS active_ip, - ti.self_employment ->> 'dataUchNPD' AS reg_self_employment_date, - ti.self_employment ->> 'dataSnUchNPD' AS dereg_self_employment_date, - ti.self_employment IS NOT NULL AS active_self_employment -FROM trud_info ti; - - Y - - - 496 - 320 - - - - Table output - TableOutput - - Y - - 1 - - none - - - 1000 - ervu-dashboard - - - recruit_id - recruit_id - - - personnel_event_date - personnel_event_date - - - personnel_event_type - personnel_event_type - - - current_workplace - current_workplace - - - position - position - - - employer_name - employer_name - - - employer_kpp - employer_kpp - - - employer_category - employer_category - - - employer_inn - employer_inn - - - employer_address - employer_address - - - employer_ogrnip - employer_ogrnip - - - employer_unit_type - employer_unit_type - - - employer_unit_address - employer_unit_address - - - parental_leave_start_date - parental_leave_start_date - - - parental_leave_end_date - parental_leave_end_date - - - parental_leave_active - parental_leave_active - - - reg_ip_date - reg_ip_date - - - dereg_ip_date - dereg_ip_date - - - ogrnip_ip - ogrnip_ip - - - active_ip - active_ip - - - reg_self_employment_date - reg_self_employment_date - - - dereg_self_employment_date - dereg_self_employment_date - - - active_self_employment - active_self_employment - - - N - N - N - N - Y - N - ervu_dashboard - Y - citizen_work_activity
- N - Y - N - Y - - - 720 - 320 - -
- - - Table output - Change job status on error - Y - - error_description - - error_code - - - - - - -
From e3e79bd30a6510b1f03faeed621a620575885b7b Mon Sep 17 00:00:00 2001 From: Fusionshh Date: Tue, 19 Aug 2025 15:46:52 +0300 Subject: [PATCH 24/34] temp --- .../work/employer/parallel/employer_flow.hpl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl index 29ac6d1..001f345 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl @@ -325,11 +325,14 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N N N + Y + N ervu_dashboard Y employer
+ N Y N @@ -355,8 +358,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N 0 with filteredData as ( - select ri.recruit_id::text, - (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id')::text as source_id, + select ri.recruit_id, + (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id')::uuid as source_id, ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat, ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat from recruits_info ri @@ -364,8 +367,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); --and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' ) select - fd.recruit_id::text, - fd.source_id::text, + fd.recruit_id, + fd.source_id::uuid, -- aktRabotodat aktRabotodat -> 'dataSved' as akt_source_update_date, aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, @@ -373,7 +376,7 @@ select aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, case when aktRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' - when aktRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when aktRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' when aktRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' when aktRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' END From 88b66f46245328679139a030211c6ef101e2ad78 Mon Sep 17 00:00:00 2001 From: "r.gaztdinov" Date: Tue, 19 Aug 2025 17:06:41 +0300 Subject: [PATCH 25/34] fix --- ...citizen_appealing_violations_fz53_flow.hpl | 205 +++++++++++++--- ...n_appealing_violations_fz53_flow_delta.hpl | 181 ++++++++++++-- ..._appealing_violations_fz53_flow_repeat.hpl | 187 ++++++++++++--- ...zen_criminal_liability_fz53_job_exists.hpl | 2 +- .../citizen_criminal_liability_fz53_flow.hpl | 202 +++++++++++++--- ...zen_criminal_liability_fz53_flow_delta.hpl | 226 ++++++++++++++---- ...en_criminal_liability_fz53_flow_repeat.hpl | 218 +++++++++++++---- ...k_if_citizen_liability_fz53_job_exists.hpl | 2 +- .../citizen_liability_fz53_job.hwf | 4 +- .../parallel/citizen_liability_fz53_flow.hpl | 206 +++++++++++++--- .../citizen_liability_fz53_flow_delta.hpl | 189 ++++++++++++--- .../citizen_liability_fz53_flow_repeat.hpl | 190 ++++++++++++--- 12 files changed, 1498 insertions(+), 314 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl index 53da516..01420f1 100644 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl @@ -40,31 +40,51 @@ Abort Y
- - Table input - Identify last row in a stream - Y - - - Identify last row in a stream - Table output - Y - - - Table output - Filter rows - Y - Table output Change job status on error Y + + Table input + Table output + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + Table output + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y + + Update + Filter rows + Y + Abort @@ -82,8 +102,8 @@ 0 - 1376 - 512 + 1472 + 832 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}';
- 1024 - 512 + 1472 + 656 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}';
- 1632 - 160 + 1952 + 512 @@ -177,8 +197,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 288 - 320 + 432 + 656 @@ -194,8 +214,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 1632 - 320 + 1696 + 512 @@ -230,8 +250,43 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); Change job status on success - 1024 - 160 + 1696 + 608 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_appealing_violations_fz53 + has_appealing_violations_fz53 + MAX + + + N + + + recruit_id + + + N + grp + + + 832 + 512 @@ -248,15 +303,15 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); last_row - 752 - 320 + 1024 + 512 Table input TableInput - N + Y 1 @@ -281,11 +336,15 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); END AS result_appeal, -- код рассмотрения ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 + ad.hidden, + CASE + WHEN ad.hidden is false THEN 1 + ELSE 0 + END AS has_appealing_violations_fz53 FROM public.appeal_document_dto ad JOIN public.recruit r ON r.id = ad.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' - AND '${M_R_CR_DATE}' >= ad.created_at + AND '${M_R_CR_DATE}' >= ad.create_date --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты --WHERE hidden IS FALSE @@ -293,15 +352,15 @@ ${LIMIT_FW} Y - 496 - 320 + 640 + 656 Table output TableOutput - N + Y 1 @@ -367,8 +426,68 @@ ${LIMIT_FW} Y - 1024 - 320 + 832 + 656 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_appealing_violations_fz53 + has_appealing_violations_fz53 + +
+ N + Y + + + 1472 + 512 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_appealing_violations_fz53 + has_appealing_violations_fz53 == 1 + Boolean + -1 + -1 + + + + + 1248 + 512 @@ -384,6 +503,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl index 94e22da..6c862e6 100644 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl @@ -25,11 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - Detect empty stream Change job status on success @@ -46,23 +41,48 @@ Y - Identify last row in a stream + Insert / update + Change job status on error + Y + + + Table input Insert / update Y - Insert / update - Filter rows + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update Y Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y - Insert / update - Change job status on error + Update + Filter rows Y @@ -82,8 +102,8 @@ 0 - 1168 - 400 + 1360 + 384 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 944 - 400 + 1360 + 224 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 64 + 1728 + 144 @@ -197,8 +217,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 224 + 1552 + 64 @@ -233,7 +253,42 @@ and recruitment_id = '${IDM_ID}'; Change job status on success - 944 + 1472 + 144 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_appealing_violations_fz53 + has_appealing_violations_fz53 + MAX + + + N + + + recruit_id + + + N + grp + + + 720 64 @@ -251,15 +306,15 @@ and recruitment_id = '${IDM_ID}'; last_row - 736 - 224 + 912 + 64 Insert / update InsertUpdate - N + Y 1 @@ -335,7 +390,7 @@ and recruitment_id = '${IDM_ID}'; N - 944 + 720 224 @@ -343,7 +398,7 @@ and recruitment_id = '${IDM_ID}'; Table input TableInput - N + Y 1 @@ -368,7 +423,11 @@ and recruitment_id = '${IDM_ID}'; END AS result_appeal, -- код рассмотрения ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 + ad.hidden, + CASE + WHEN ad.hidden is false THEN 1 + ELSE 0 + END AS has_appealing_violations_fz53 FROM public.appeal_document_dto ad JOIN public.recruit r ON r.id = ad.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -384,6 +443,66 @@ ${LIMIT_FW} 224
+ + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_appealing_violations_fz53 + has_appealing_violations_fz53 + +
+ N + Y + + + 1360 + 64 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_appealing_violations_fz53 + has_appealing_violations_fz53 == 1 + Boolean + -1 + -1 + + + + + 1136 + 64 + + Insert / update @@ -397,6 +516,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl index d48295e..4f1a565 100644 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl @@ -25,11 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - Filter rows Change job status on success @@ -46,25 +41,50 @@ Y - Identify last row in a stream + Insert / update + Change job status on error + Y + + + Table input Insert / update Y + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update Filter rows Y - Insert / update + Update Detect empty stream Y - - Insert / update - Change job status on error - Y - Abort @@ -82,8 +102,8 @@ 0 - 1248 - 400 + 1328 + 368 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 960 - 400 + 1328 + 208 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1440 - 48 + 1792 + 80 @@ -212,8 +232,8 @@ DO UPDATE SET - 1440 - 208 + 1520 + 80 @@ -248,8 +268,43 @@ DO UPDATE SET Change job status on success - 960 - 48 + 1536 + 176 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_appealing_violations_fz53 + has_appealing_violations_fz53 + MAX + + + N + + + recruit_id + + + N + grp + + + 688 + 80 @@ -266,8 +321,8 @@ DO UPDATE SET last_row - 720 - 208 + 880 + 80 @@ -350,7 +405,7 @@ DO UPDATE SET N - 960 + 688 208 @@ -358,7 +413,7 @@ DO UPDATE SET Table input TableInput - N + Y 1 @@ -383,11 +438,15 @@ DO UPDATE SET END AS result_appeal, -- код рассмотрения ad.commission_name AS name_commission, -- наименование комиссии, принявшей решение ad.reason_for_add_entry AS grounds, -- основание для внесения записи - ad.hidden --has_appealing_violations_fz53 + ad.hidden, + CASE + WHEN ad.hidden is false THEN 1 + ELSE 0 + END AS has_appealing_violations_fz53 FROM public.appeal_document_dto ad JOIN public.recruit r ON r.id = ad.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' - AND '${M_R_CR_DATE}' >= ad.created_at + AND '${M_R_CR_DATE}' >= ad.create_date --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(ad.updated_at, ad.created_at) -- для дельты --WHERE hidden IS FALSE @@ -399,6 +458,66 @@ ${LIMIT_FW} 208 + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_appealing_violations_fz53 + has_appealing_violations_fz53 + +
+ N + Y + + + 1328 + 80 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_appealing_violations_fz53 + has_appealing_violations_fz53 == 1 + Boolean + -1 + -1 + + + + + 1104 + 80 + + Insert / update @@ -412,6 +531,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_citizen_criminal_liability_fz53_job_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_citizen_criminal_liability_fz53_job_exists.hpl index 2ab9720..a2002ee 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_citizen_criminal_liability_fz53_job_exists.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/checkpoints/check_if_citizen_criminal_liability_fz53_job_exists.hpl @@ -73,7 +73,7 @@ SELECT EXISTS ( SELECT 1 FROM etl.job_execution - WHERE job_name = 'recruits_info_job' + WHERE job_name = 'citizen_criminal_liability_fz53_job' limit 1 ) AS job_executed_flag; N diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl index 175910a..430f53f 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl @@ -40,31 +40,51 @@ Abort Y - - Table input - Identify last row in a stream - Y - - - Identify last row in a stream - Table output - Y - - - Table output - Filter rows - Y - Table output Change job status on error Y + + Table input + Table output + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + Table output + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y + + Update + Filter rows + Y + Abort @@ -82,8 +102,8 @@ 0 - 1376 - 512 + 1536 + 832 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 1024 - 512 + 1536 + 640 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1632 - 160 + 1952 + 496 @@ -177,8 +197,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 288 - 320 + 496 + 640 @@ -194,8 +214,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
- 1632 - 320 + 1728 + 496 @@ -230,8 +250,43 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); Change job status on success - 1024 - 160 + 1728 + 608 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_criminal_liability_fz53 + has_criminal_liability_fz53 + MAX + + + N + + + recruit_id + + + N + grp + + + 896 + 496 @@ -248,15 +303,15 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); last_row - 752 - 320 + 1088 + 496 Table input TableInput - N + Y 1 @@ -289,8 +344,11 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' ELSE null END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - i.hidden - --has_criminal_liability_fz53 + i.hidden, + CASE + WHEN i.hidden is false THEN 1 + ELSE 0 + END AS has_criminal_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -303,8 +361,8 @@ ${LIMIT_FW} Y - 496 - 320 + 704 + 640 @@ -385,8 +443,68 @@ ${LIMIT_FW} Y - 1024 - 320 + 896 + 640 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_criminal_liability_fz53 + has_criminal_liability_fz53 + +
+ N + Y + + + 1536 + 496 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_liability_fz53 + has_criminal_liability_fz53 == 1 + Boolean + -1 + -1 + + + + + 1312 + 496 @@ -402,6 +520,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl index 933a736..45f2100 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl @@ -25,11 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - Detect empty stream Change job status on success @@ -46,23 +41,48 @@ Y - Identify last row in a stream + Insert / update + Change job status on error + Y + + + Table input Insert / update Y - Insert / update - Filter rows + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update Y Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y - Insert / update - Change job status on error + Update + Filter rows Y @@ -82,8 +102,8 @@ 0 - 1168 - 400 + 1360 + 704 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 944 - 400 + 1360 + 528 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 64 + 1744 + 384 @@ -180,8 +200,8 @@ where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 336 - 224 + 384 + 528 @@ -197,8 +217,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 224 + 1520 + 384 @@ -233,26 +253,8 @@ and recruitment_id = '${IDM_ID}'; Change job status on success - 944 - 64 - - - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - last_row - - - 736 - 224 + 1520 + 480 @@ -273,11 +275,13 @@ and recruitment_id = '${IDM_ID}'; = recruit_id recruit_id + = created_at created_at + ervu_dashboard citizen_criminal_liability_fz53
@@ -345,15 +349,15 @@ and recruitment_id = '${IDM_ID}'; N - 944 - 224 + 720 + 528
Table input TableInput - N + Y 1 @@ -386,8 +390,11 @@ and recruitment_id = '${IDM_ID}'; WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' ELSE null END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - i.hidden - --has_criminal_liability_fz53 + i.hidden, + CASE + WHEN i.hidden is false THEN 1 + ELSE 0 + END AS has_criminal_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -400,8 +407,121 @@ ${LIMIT_FW} Y - 544 - 224 + 592 + 528 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_criminal_liability_fz53 + has_criminal_liability_fz53 + MAX + + + N + + + recruit_id + + + N + grp + + + 720 + 384 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 912 + 384 + + + + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_criminal_liability_fz53 + has_criminal_liability_fz53 == 1 + Boolean + -1 + -1 + + + + + 1136 + 384 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_criminal_liability_fz53 + has_criminal_liability_fz53 + +
+ N + Y + + + 1360 + 384
@@ -417,6 +537,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl index 6edf97e..9cc8eb9 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl @@ -25,11 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - Filter rows Change job status on success @@ -46,23 +41,48 @@ Y - Identify last row in a stream + Insert / update + Change job status on error + Y + + + Table input Insert / update Y - Insert / update - Filter rows + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update Y Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y - Insert / update - Change job status on error + Update + Filter rows Y @@ -82,8 +102,8 @@ 0 - 1248 - 400 + 1296 + 432 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 960 - 400 + 1296 + 208 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1440 - 48 + 1824 + 64 @@ -212,8 +232,8 @@ DO UPDATE SET - 1440 - 208 + 1536 + 64 @@ -248,26 +268,8 @@ DO UPDATE SET Change job status on success - 960 - 48 - - - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - last_row - - - 720 - 208 + 1536 + 176 @@ -360,7 +362,7 @@ DO UPDATE SET N - 960 + 656 208 @@ -368,7 +370,7 @@ DO UPDATE SET Table input TableInput - N + Y 1 @@ -401,8 +403,11 @@ DO UPDATE SET WHEN i.decision_reason = '2' THEN 'Уклонение от прохождения альтернативной гражданской службы лиц, освобожденных от военной службы' ELSE null END AS decision_reason, -- Причины уголовного наказания в связи с фз53 - i.hidden - --has_criminal_liability_fz53 + i.hidden, + CASE + WHEN i.hidden is false THEN 1 + ELSE 0 + END AS has_criminal_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -419,6 +424,123 @@ ${LIMIT_FW} 208 + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_criminal_liability_fz53 + has_criminal_liability_fz53 + MAX + + + + N + + + recruit_id + + + N + + grp + + + 656 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 848 + 64 + + + + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_criminal_liability_fz53 + has_criminal_liability_fz53 == 1 + Boolean + -1 + -1 + + + + + 1072 + 64 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + + = + recruit_id + recruit_id + + + ervu_dashboard + citizen
+ + has_criminal_liability_fz53 + has_criminal_liability_fz53 + +
+ N + Y + + + 1296 + 64 + +
Insert / update @@ -432,6 +554,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_citizen_liability_fz53_job_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_citizen_liability_fz53_job_exists.hpl index 10715f1..0f2ee35 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_citizen_liability_fz53_job_exists.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/check_if_citizen_liability_fz53_job_exists.hpl @@ -73,7 +73,7 @@ SELECT EXISTS ( SELECT 1 FROM etl.job_execution - WHERE job_name = 'recruits_info_job' + WHERE job_name = 'citizen_liability_fz53_job' limit 1 ) AS job_executed_flag; N diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/citizen_liability_fz53_job.hwf b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/citizen_liability_fz53_job.hwf index 920fc8d..2abe41b 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/citizen_liability_fz53_job.hwf +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/citizen_liability_fz53_job.hwf @@ -342,7 +342,7 @@ 150 1200 80 - recruits_info_job + citizen_liability_fz53_job M_R_UP_DATE @@ -351,7 +351,7 @@ M_R_CR_DATE 0001-01-01 00:00:00 3001-01-01 00:00:00 - 114 + 136 diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl index c203dcb..7f929bb 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl @@ -40,21 +40,6 @@ Abort Y - - Table input - Identify last row in a stream - Y - - - Identify last row in a stream - Table output - Y - - - Table output - Filter rows - Y - Table output Change job status on error @@ -62,9 +47,44 @@ Table output + Group by + Y + + + Group by + Identify last row in a stream + Y + + + Table input + Table output + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y + + Update + Filter rows + Y + Abort @@ -82,8 +102,8 @@ 0 - 1376 - 512 + 1360 + 1056 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 1024 - 512 + 1360 + 832 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1632 - 160 + 1808 + 656 @@ -177,8 +197,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 288 - 320 + 320 + 832 @@ -194,8 +214,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
- 1632 - 320 + 1584 + 656 @@ -230,8 +250,45 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); Change job status on success - 1024 - 160 + 1584 + 768 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_liability_fz53 + has_liability_fz53 + MAX + + + + N + + + recruit_id + + + N + + grp + + + 720 + 656 @@ -248,15 +305,15 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); last_row - 752 - 320 + 912 + 656 Table input TableInput - N + Y 1 @@ -291,8 +348,11 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' ELSE NULL END AS type_punishment, -- вид наказания - i.hidden - --has_liability_fz53 + i.hidden, + CASE + WHEN i.hidden is false THEN 1 + ELSE 0 + END AS has_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -305,8 +365,8 @@ ${LIMIT_FW} Y - 496 - 320 + 512 + 832 @@ -403,8 +463,70 @@ ${LIMIT_FW} Y - 1024 - 320 + 720 + 832 + + + + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_liability_fz53 + has_liability_fz53 == 1 + Boolean + -1 + -1 + + + + + 1136 + 656 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + + = + recruit_id + recruit_id + + + ervu_dashboard + citizen
+ + has_liability_fz53 + has_liability_fz53 + +
+ N + Y + + + 1360 + 656
@@ -420,6 +542,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl index 8ccde59..c4f86aa 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl @@ -25,11 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - Detect empty stream Change job status on success @@ -46,22 +41,47 @@ Y - Identify last row in a stream + Insert / update + Change job status on error + Y + + + Table input Insert / update Y - Insert / update - Filter rows + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update Y Insert / update + Group by + Y + + + Update Detect empty stream Y - Insert / update + Update + Filter rows + Y + + + Update Change job status on error Y @@ -82,8 +102,8 @@ 0 - 1168 - 400 + 1520 + 560 @@ -117,7 +137,7 @@ and recruitment_id = '${IDM_ID}'; - 944 + 1520 400 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 64 + 1920 + 240 @@ -180,8 +200,8 @@ where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 336 - 224 + 416 + 400 @@ -197,8 +217,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 224 + 1712 + 240 @@ -233,8 +253,43 @@ and recruitment_id = '${IDM_ID}'; Change job status on success - 944 - 64 + 1712 + 336 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_liability_fz53 + has_liability_fz53 + MAX + + + N + + + recruit_id + + + N + grp + + + 880 + 240 @@ -251,8 +306,8 @@ and recruitment_id = '${IDM_ID}'; last_row - 736 - 224 + 1072 + 240 @@ -365,15 +420,15 @@ and recruitment_id = '${IDM_ID}'; N - 944 - 224 + 880 + 400 Table input TableInput - N + Y 1 @@ -382,6 +437,7 @@ and recruitment_id = '${IDM_ID}'; postgres.decision-document-service N + SELECT i.recruit_id, i.created_at, @@ -407,8 +463,11 @@ and recruitment_id = '${IDM_ID}'; WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' ELSE NULL END AS type_punishment, -- вид наказания - i.hidden - --has_liability_fz53 + i.hidden, + CASE + WHEN i.hidden is false THEN 1 + ELSE 0 + END AS has_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -421,8 +480,68 @@ ${LIMIT_FW} Y - 544 - 224 + 624 + 400 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_liability_fz53 + has_liability_fz53 + +
+ N + Y + + + 1520 + 240 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_liability_fz53 + has_liability_fz53 == 1 + Boolean + -1 + -1 + + + + + 1296 + 240 @@ -438,6 +557,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl index 674370a..9bdf128 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl @@ -25,16 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - - - Filter rows - Change job status on success - Y - Detect empty stream Change job status on success @@ -46,23 +36,53 @@ Y - Identify last row in a stream + Insert / update + Change job status on error + Y + + + Table input Insert / update Y - Insert / update - Filter rows + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update Y Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y - Insert / update - Change job status on error + Update + Filter rows + Y + + + Filter rows + Change job status on success Y @@ -82,7 +102,7 @@ 0 - 1248 + 1312 400 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 960 - 400 + 1312 + 208 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1440 - 48 + 1872 + 80 @@ -212,8 +232,8 @@ DO UPDATE SET - 1440 - 208 + 1584 + 80 @@ -248,8 +268,43 @@ DO UPDATE SET Change job status on success - 960 - 48 + 1584 + 176 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_liability_fz53 + has_liability_fz53 + MAX + + + N + + + recruit_id + + + N + grp + + + 672 + 80 @@ -266,8 +321,8 @@ DO UPDATE SET last_row - 720 - 208 + 864 + 80 @@ -380,7 +435,7 @@ DO UPDATE SET N - 960 + 672 208 @@ -388,7 +443,7 @@ DO UPDATE SET Table input TableInput - N + Y 1 @@ -423,8 +478,11 @@ DO UPDATE SET WHEN i.extra_info->>'punishment' = '2' THEN 'Административный штраф' ELSE NULL END AS type_punishment, -- вид наказания - i.hidden - --has_liability_fz53 + i.hidden, + CASE + WHEN i.hidden is false THEN 1 + ELSE 0 + END AS has_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -441,6 +499,66 @@ ${LIMIT_FW} 208 + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_liability_fz53 + has_liability_fz53 + +
+ N + Y + + + 1312 + 80 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_liability_fz53 + has_liability_fz53 == 1 + Boolean + -1 + -1 + + + + + 1088 + 80 + + Insert / update @@ -454,6 +572,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + From d16c512e1c2fcdb34d7cfb5fddab1072e2ea2465 Mon Sep 17 00:00:00 2001 From: "r.gaztdinov" Date: Tue, 19 Aug 2025 17:34:38 +0300 Subject: [PATCH 26/34] fix flags --- ...citizen_appealing_violations_fz53_flow.hpl | 11 +- ...n_appealing_violations_fz53_flow_delta.hpl | 9 +- ..._appealing_violations_fz53_flow_repeat.hpl | 9 +- .../citizen_criminal_liability_fz53_flow.hpl | 12 +- ...zen_criminal_liability_fz53_flow_delta.hpl | 163 +++++++++--------- ...en_criminal_liability_fz53_flow_repeat.hpl | 160 +++++++++-------- .../parallel/citizen_liability_fz53_flow.hpl | 63 ++++--- .../citizen_liability_fz53_flow_delta.hpl | 13 +- .../citizen_liability_fz53_flow_repeat.hpl | 11 +- 9 files changed, 221 insertions(+), 230 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl index 01420f1..5ce3669 100644 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow.hpl @@ -270,9 +270,10 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); ${java.io.tmpdir} - has_appealing_violations_fz53 - has_appealing_violations_fz53 + has_appealing_violations_fz53_raw + is_appealing_violations_fz53 MAX + N @@ -282,6 +283,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N + grp @@ -320,7 +322,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
postgres.decision-document-service N - SELECT ad.recruit_id, ad.create_date, -- дата создания обжалования @@ -340,7 +341,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); CASE WHEN ad.hidden is false THEN 1 ELSE 0 - END AS has_appealing_violations_fz53 + END AS is_appealing_violations_fz53 FROM public.appeal_document_dto ad JOIN public.recruit r ON r.id = ad.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -478,7 +479,7 @@ ${LIMIT_FW} has_appealing_violations_fz53 - has_appealing_violations_fz53 == 1 + has_appealing_violations_fz53_raw == 1 Boolean -1 -1 diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl index 6c862e6..9dfa3ed 100644 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_delta.hpl @@ -273,8 +273,8 @@ and recruitment_id = '${IDM_ID}'; ${java.io.tmpdir} - has_appealing_violations_fz53 - has_appealing_violations_fz53 + has_appealing_violations_fz53_raw + is_appealing_violations_fz53 MAX @@ -407,7 +407,6 @@ and recruitment_id = '${IDM_ID}'; postgres.decision-document-service N - SELECT ad.recruit_id, ad.create_date, -- дата создания обжалования @@ -427,7 +426,7 @@ and recruitment_id = '${IDM_ID}'; CASE WHEN ad.hidden is false THEN 1 ELSE 0 - END AS has_appealing_violations_fz53 + END AS is_appealing_violations_fz53 FROM public.appeal_document_dto ad JOIN public.recruit r ON r.id = ad.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -491,7 +490,7 @@ ${LIMIT_FW} has_appealing_violations_fz53 - has_appealing_violations_fz53 == 1 + has_appealing_violations_fz53_raw == 1 Boolean -1 -1 diff --git a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl index 4f1a565..6bb6f26 100644 --- a/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_appealing_violations_fz53/parallel/citizen_appealing_violations_fz53_flow_repeat.hpl @@ -288,8 +288,8 @@ DO UPDATE SET ${java.io.tmpdir} - has_appealing_violations_fz53 - has_appealing_violations_fz53 + has_appealing_violations_fz53_raw + is_appealing_violations_fz53 MAX @@ -329,7 +329,7 @@ DO UPDATE SET Insert / update InsertUpdate - N + Y 1 @@ -422,7 +422,6 @@ DO UPDATE SET postgres.decision-document-service N - SELECT ad.recruit_id, ad.create_date, -- дата создания обжалования @@ -442,7 +441,7 @@ DO UPDATE SET CASE WHEN ad.hidden is false THEN 1 ELSE 0 - END AS has_appealing_violations_fz53 + END AS is_appealing_violations_fz53 FROM public.appeal_document_dto ad JOIN public.recruit r ON r.id = ad.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl index 430f53f..ecc5a21 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl @@ -270,9 +270,10 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); ${java.io.tmpdir} - has_criminal_liability_fz53 - has_criminal_liability_fz53 + has_criminal_liability_fz53_raw + is_criminal_liability_fz53 MAX + N @@ -282,6 +283,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N + grp @@ -348,7 +350,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); CASE WHEN i.hidden is false THEN 1 ELSE 0 - END AS has_criminal_liability_fz53 + END AS is_criminal_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -369,7 +371,7 @@ ${LIMIT_FW} Table output TableOutput - N + Y 1 @@ -495,7 +497,7 @@ ${LIMIT_FW} has_liability_fz53 - has_criminal_liability_fz53 == 1 + has_criminal_liability_fz53_raw == 1 Boolean -1 -1 diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl index 45f2100..ebdf8a6 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl @@ -257,11 +257,64 @@ and recruitment_id = '${IDM_ID}'; 480 + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_criminal_liability_fz53_raw + is_criminal_liability_fz53 + MAX + + + N + + + recruit_id + + + N + grp + + + 720 + 384 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 912 + 384 + + Insert / update InsertUpdate - N + Y 1 @@ -275,13 +328,11 @@ and recruitment_id = '${IDM_ID}'; = recruit_id recruit_id - = created_at created_at - ervu_dashboard citizen_criminal_liability_fz53
@@ -366,7 +417,6 @@ and recruitment_id = '${IDM_ID}';
postgres.decision-document-service N - SELECT i.recruit_id, i.created_at, @@ -394,7 +444,7 @@ and recruitment_id = '${IDM_ID}'; CASE WHEN i.hidden is false THEN 1 ELSE 0 - END AS has_criminal_liability_fz53 + END AS is_criminal_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -411,84 +461,6 @@ ${LIMIT_FW} 528
- - Group by - GroupBy - - Y - - 1 - - none - - - N - N - ${java.io.tmpdir} - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - MAX - - - N - - - recruit_id - - - N - grp - - - 720 - 384 - - - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - last_row - - - 912 - 384 - - - - User defined Java expression - Janino - - Y - - 1 - - none - - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 == 1 - Boolean - -1 - -1 - - - - - 1136 - 384 - - Update Update @@ -524,6 +496,31 @@ ${LIMIT_FW} 384 + + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_criminal_liability_fz53 + has_criminal_liability_fz53_raw == 1 + Boolean + -1 + -1 + + + + + 1136 + 384 + + Insert / update diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl index 9cc8eb9..77983ed 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl @@ -272,11 +272,66 @@ DO UPDATE SET 176 + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_criminal_liability_fz53_raw + is_criminal_liability_fz53 + MAX + + + + N + + + recruit_id + + + N + + grp + + + 656 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 848 + 64 + + Insert / update InsertUpdate - N + Y 1 @@ -407,7 +462,7 @@ DO UPDATE SET CASE WHEN i.hidden is false THEN 1 ELSE 0 - END AS has_criminal_liability_fz53 + END AS is_criminal_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -425,57 +480,37 @@ ${LIMIT_FW} - Group by - GroupBy + Update + Update - Y + N 1 none - N - N - ${java.io.tmpdir} - - - has_criminal_liability_fz53 - has_criminal_liability_fz53 - MAX - - - - N - - + 100 + ervu-dashboard + Y + + + = + recruit_id recruit_id - - - N - - grp + + ervu_dashboard + citizen
+ + has_criminal_liability_fz53 + has_criminal_liability_fz53 + + + N + Y - 656 - 64 - -
- - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - last_row - - - 848 + 1296 64 @@ -492,7 +527,7 @@ ${LIMIT_FW} has_criminal_liability_fz53 - has_criminal_liability_fz53 == 1 + has_criminal_liability_fz53_raw == 1 Boolean -1 -1 @@ -504,43 +539,6 @@ ${LIMIT_FW} 64 - - Update - Update - - N - - 1 - - none - - - 100 - ervu-dashboard - Y - - - - = - recruit_id - recruit_id - - - ervu_dashboard - citizen
- - has_criminal_liability_fz53 - has_criminal_liability_fz53 - -
- N - Y - - - 1296 - 64 - -
Insert / update diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl index 7f929bb..cd944ae 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow.hpl @@ -270,10 +270,9 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); ${java.io.tmpdir} - has_liability_fz53 - has_liability_fz53 + has_liability_fz53_raw + is_liability_fz53 MAX - N @@ -283,7 +282,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N - grp @@ -322,7 +320,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); postgres.decision-document-service N - SELECT i.recruit_id, i.created_at, @@ -352,7 +349,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); CASE WHEN i.hidden is false THEN 1 ELSE 0 - END AS has_liability_fz53 + END AS is_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -373,7 +370,7 @@ ${LIMIT_FW} Table output TableOutput - N + Y 1 @@ -467,31 +464,6 @@ ${LIMIT_FW} 832 - - User defined Java expression - Janino - - Y - - 1 - - none - - - - has_liability_fz53 - has_liability_fz53 == 1 - Boolean - -1 - -1 - - - - - 1136 - 656 - - Update Update @@ -506,13 +478,11 @@ ${LIMIT_FW} 100 ervu-dashboard Y - = recruit_id recruit_id - ervu_dashboard citizen
@@ -529,6 +499,31 @@ ${LIMIT_FW} 656
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_liability_fz53 + has_liability_fz53_raw == 1 + Boolean + -1 + -1 + + + + + 1136 + 656 + + Table output diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl index c4f86aa..a39fd49 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl @@ -273,9 +273,10 @@ and recruitment_id = '${IDM_ID}'; ${java.io.tmpdir} - has_liability_fz53 - has_liability_fz53 + has_liability_fz53_raw + is_liability_fz53 MAX + N @@ -285,6 +286,7 @@ and recruitment_id = '${IDM_ID}'; N + grp @@ -314,7 +316,7 @@ and recruitment_id = '${IDM_ID}'; Insert / update InsertUpdate - N + Y 1 @@ -437,7 +439,6 @@ and recruitment_id = '${IDM_ID}'; postgres.decision-document-service N - SELECT i.recruit_id, i.created_at, @@ -467,7 +468,7 @@ and recruitment_id = '${IDM_ID}'; CASE WHEN i.hidden is false THEN 1 ELSE 0 - END AS has_liability_fz53 + END AS is_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -532,7 +533,7 @@ ${LIMIT_FW} has_liability_fz53 - has_liability_fz53 == 1 + has_liability_fz53_raw == 1 Boolean -1 -1 diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl index 9bdf128..6a020cb 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_repeat.hpl @@ -288,8 +288,8 @@ DO UPDATE SET ${java.io.tmpdir} - has_liability_fz53 - has_liability_fz53 + has_liability_fz53_raw + is_liability_fz53 MAX @@ -329,7 +329,7 @@ DO UPDATE SET Insert / update InsertUpdate - N + Y 1 @@ -452,7 +452,6 @@ DO UPDATE SET postgres.decision-document-service N - SELECT i.recruit_id, i.created_at, @@ -482,7 +481,7 @@ DO UPDATE SET CASE WHEN i.hidden is false THEN 1 ELSE 0 - END AS has_liability_fz53 + END AS is_liability_fz53 FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' @@ -547,7 +546,7 @@ ${LIMIT_FW} has_liability_fz53 - has_liability_fz53 == 1 + has_liability_fz53_raw == 1 Boolean -1 -1 From d8fbebc9d31646297b3e8f34720c7a20b6343168 Mon Sep 17 00:00:00 2001 From: "r.gaztdinov" Date: Mon, 25 Aug 2025 09:28:18 +0300 Subject: [PATCH 27/34] / --- .../subpoena/check_if_need_to_repeat_job.hpl | 86 ++++ .../check_if_subpoena_job_exists.hpl | 113 ++++ .../subpoena/parallel/subpoena_flow.hpl | 388 ++++++++++++++ .../subpoena/parallel/subpoena_flow_delta.hpl | 389 ++++++++++++++ .../parallel/subpoena_flow_repeat.hpl | 484 ++++++++++++++++++ .../subpoena/recruitment_five_flow_delta.hpl | 360 +++++++++++++ .../recruitment_five_flow_on_error.hpl | 360 +++++++++++++ .../subpoena/recruitments_five_flow.hpl | 373 ++++++++++++++ .../citizen_tables/subpoena/subpoena_job.hwf | 366 +++++++++++++ .../reference_data/subpoena_reason.hpl | 104 ++++ 10 files changed, 3023 insertions(+) create mode 100644 mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl create mode 100644 mappings/info_recruits/citizen_tables/subpoena/checkpoints/check_if_subpoena_job_exists.hpl create mode 100644 mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/subpoena/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/subpoena/recruitment_five_flow_on_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/subpoena/recruitments_five_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/subpoena/subpoena_job.hwf create mode 100644 mappings/info_recruits/reference_data/subpoena_reason.hpl diff --git a/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..f15ccdf --- /dev/null +++ b/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat_job + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 12:27:51.630 + - + 2025/08/08 12:27:51.630 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 624 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 336 + 288 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/subpoena/checkpoints/check_if_subpoena_job_exists.hpl b/mappings/info_recruits/citizen_tables/subpoena/checkpoints/check_if_subpoena_job_exists.hpl new file mode 100644 index 0000000..e5f59bb --- /dev/null +++ b/mappings/info_recruits/citizen_tables/subpoena/checkpoints/check_if_subpoena_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_subpoena_job_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 13:28:46.661 + - + 2025/08/05 13:28:46.661 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 672 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'subpoena_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Y + + + N + 0 + Basic + ${STATUS} + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl new file mode 100644 index 0000000..ca99475 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl @@ -0,0 +1,388 @@ + + + + subpoena_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 320 + + + + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + + SELECT + s.id AS subpoena_id, --id повестки + --???, --факт направления повестки + s.send_date, --дата направления повестки + s.series, --серия повестки + s.number, --новер повестки + s.reason_id AS subpoena_reason, --причина вызова по повестке /// код передавать или сразу наименование? + s.full_name_responsible_user AS fio_commiss, --фио военного комиссара(фио пользователя сформировавшео повестку) + s.sig_info, --сертификат ключа проверки ЭП + s.recruitment_name, --наименование ВК + s.recruitment_address, --адрес, по которому необходимо явиться + s.visit_date, --дата и время явки + --, --способ направления // искать в subpoena_send_info + --, --УН заказного почтового отправления // искать в subpoena_send_info + s.status_id AS subpoena_status, --статус // ссылка на справочник subpoena_status + s.create_date, --дата создания // для загрузки данных + s.status_change_date --дата обновления // для загрузки данных (timestamp without time zone) + +-- поля для карточки, раздел "Сведения о направлении повестки военного комиссариата" + +FROM subpoena s +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND department_id = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= s.create_date + +${LIMIT_FW} + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + created_at + created_at + + + updated_at + updated_at + + + info + info + + + gir_import_data_version_id + gir_import_data_version_id + + + current_recruitment_id + current_recruitment_id + + + target_recruitment_id + target_recruitment_id + + + full_name + full_name + + + addresses + addresses + + + N + N + N + N + Y + N + ervu_dashboard + Y + recruits_info
+ N + Y + N + Y + + + 1024 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl new file mode 100644 index 0000000..5f60fb2 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl @@ -0,0 +1,389 @@ + + + + subpoena_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Insert / update + Change job status on error + Y + + + Change job status on error + Abort + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 944 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1248 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + recruits_info
+ + recruit_id + recruit_id + N + + + created_at + created_at + Y + + + updated_at + updated_at + Y + + + info + info + Y + + + gir_import_data_version_id + gir_import_data_version_id + Y + + + current_recruitment_id + current_recruitment_id + Y + + + target_recruitment_id + target_recruitment_id + Y + + + full_name + full_name + Y + + + addresses + addresses + Y + +
+ N + + + 944 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu_person_registry + N + + SELECT + r.system_create_date AS created_at, + r.system_update_date AS updated_at, + ri.recruit_id, + ri.info, + ri.gir_import_data_version_id, + r.current_recruitment_id, + r.target_recruitment_id, + r.full_name, + r.addresses +FROM recruits_info ri +JOIN recruits r ON r.id = ri.recruit_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(current_recruitment_id, target_recruitment_id) = '${IDM_ID}' + --AND '${M_R_CR_DATE}' >= r.system_create_date + AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp + --AND '${CR_DATE}' < ri.created_at +--ORDER BY ri.created_at ASC; + +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl new file mode 100644 index 0000000..582920a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl @@ -0,0 +1,484 @@ + + + + subpoena_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 960 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + recruits_info
+ + recruit_id + recruit_id + N + + + created_at + created_at + Y + + + updated_at + updated_at + Y + + + info + info + Y + + + gir_import_data_version_id + gir_import_data_version_id + Y + + + current_recruitment_id + current_recruitment_id + Y + + + target_recruitment_id + target_recruitment_id + Y + + + full_name + full_name + Y + + + addresses + addresses + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu_person_registry + N + SELECT + r.system_create_date AS created_at, + r.system_update_date AS updated_at, + ri.recruit_id, + ri.info, + ri.gir_import_data_version_id, + r.current_recruitment_id, + r.target_recruitment_id, + r.full_name, + r.addresses +FROM recruits_info ri +JOIN recruits r ON r.id = ri.recruit_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(current_recruitment_id, target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= r.system_create_date + --AND '${CR_DATE}' < ri.created_at +--ORDER BY ri.created_at ASC; + +${LIMIT_FW} + Y + + + 480 + 208 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + created_at + created_at + + + updated_at + updated_at + + + info + info + + + gir_import_data_version_id + gir_import_data_version_id + + + current_recruitment_id + current_recruitment_id + + + target_recruitment_id + target_recruitment_id + + + full_name + full_name + + + addresses + addresses + + + N + N + N + N + Y + N + ervu_dashboard + Y + recruits_info
+ N + Y + N + Y + + + 816 + 544 + +
+ + + Insert / update + Change job status on error + Y + + + + + + + + + + Table output + Change job status on error + N + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/subpoena/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/subpoena/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..e69b190 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/subpoena/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + subpoena_flow_delta.hpl + Y + + + Table input + subpoena_flow_delta.hpl 2 + Y + + + Table input + subpoena_flow_delta.hpl 3 + Y + + + Table input + subpoena_flow_delta.hpl 4 + Y + + + Table input + subpoena_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + subpoena_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 128 + + + + subpoena_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 208 + + + + subpoena_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 288 + + + + subpoena_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 368 + + + + subpoena_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/subpoena/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/subpoena/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..b6fa112 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/subpoena/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + subpoena_flow_repeat.hpl + Y + + + Table input + subpoena_flow_repeat.hpl 2 + Y + + + Table input + subpoena_flow_repeat.hpl 3 + Y + + + Table input + subpoena_flow_repeat.hpl 4 + Y + + + Table input + subpoena_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + subpoena_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 208 + + + + subpoena_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 288 + + + + subpoena_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 368 + + + + subpoena_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 448 + + + + subpoena_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/subpoena/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/subpoena/recruitments_five_flow.hpl new file mode 100644 index 0000000..6bd1738 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/subpoena/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + subpoena_flow.hpl + Y + + + Get all recruitments ordered by created_date + subpoena_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + subpoena_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + subpoena_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + subpoena_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + subpoena_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 144 + + + + subpoena_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 224 + + + + subpoena_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 304 + + + + subpoena_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 384 + + + + subpoena_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/subpoena/subpoena_job.hwf b/mappings/info_recruits/citizen_tables/subpoena/subpoena_job.hwf new file mode 100644 index 0000000..4773d5e --- /dev/null +++ b/mappings/info_recruits/citizen_tables/subpoena/subpoena_job.hwf @@ -0,0 +1,366 @@ + + + subpoena_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 224 + 304 + + + + check_if_subpoena_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/checkpoints/check_if_subpoena_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + subpoena_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 688 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/recruitments_five_flow.hpl + + + Basic + + Y + + N + local + N + N + Y + Y + 928 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/recruitment_five_flow_on_error.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 928 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 688 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 688 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 688 + 800 + + + + + + Start + check_if_subpoena_job_exists.hpl + Y + Y + Y + + + check_if_subpoena_job_exists.hpl + subpoena_job_exists_check + Y + Y + N + + + subpoena_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + subpoena_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 800 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 800 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 608 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + subpoena_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 114 + + + + diff --git a/mappings/info_recruits/reference_data/subpoena_reason.hpl b/mappings/info_recruits/reference_data/subpoena_reason.hpl new file mode 100644 index 0000000..c2fc8d8 --- /dev/null +++ b/mappings/info_recruits/reference_data/subpoena_reason.hpl @@ -0,0 +1,104 @@ + + + + subpoena_reason + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/21 14:45:11.431 + - + 2025/08/21 14:45:11.431 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + ervu_dashboard + subpoena_reason
+ + id + id + N + + + name + name + Y + + + code + code + Y + + + type + type + Y + +
+ N + + + 1264 + 464 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + postgres.subpoena + N + 0 + SELECT * FROM public.subpoena_reason + N + + + 768 + 464 + + + + + +
From 7d2be2ccd8766bf4b0be3e4daeda41df8a942637 Mon Sep 17 00:00:00 2001 From: "adel.ka" Date: Mon, 25 Aug 2025 09:55:37 +0300 Subject: [PATCH 28/34] =?UTF-8?q?ERVU-504:=20=D0=9A=D1=80=D0=B0=D1=81?= =?UTF-8?q?=D0=BE=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../child/parallel/child_flow.hpl | 4 +- .../child/parallel/child_flow_delta.hpl | 4 +- .../child/parallel/child_flow_repeat.hpl | 4 +- .../parallel/citizen_guardianship_flow.hpl | 308 +----------------- .../citizen_guardianship_flow_delta.hpl | 10 +- .../citizen_guardianship_flow_repeat.hpl | 10 +- .../parallel/citizen_spouse_flow.hpl | 11 +- .../parallel/citizen_spouse_flow_delta.hpl | 10 +- .../parallel/citizen_spouse_flow_repeat.hpl | 10 +- 9 files changed, 36 insertions(+), 335 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl index 891ec1f..0243b34 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.hpl @@ -333,8 +333,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N SELECT - ri.recruit_id::uuid AS recruit_id, - ch->>'id' AS child_external_id, + ri.recruit_id AS recruit_id, + (ch->>'id')::uuid AS child_external_id, NULLIF(ch->>'idERN', '') AS child_id_ern, CASE NULLIF(ch->>'rodstvSvyazReb', '')::int WHEN 1 THEN 3 diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl index 8f02cbe..ab93eb9 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl @@ -429,8 +429,8 @@ and recruitment_id = '${IDM_ID}'; N SELECT - ri.recruit_id::uuid AS recruit_id, - ch->>'id' AS child_external_id, + ri.recruit_id AS recruit_id, + (ch->>'id')::uuid AS child_external_id, NULLIF(ch->>'idERN', '') AS child_id_ern, CASE NULLIF(ch->>'rodstvSvyazReb', '')::int WHEN 1 THEN 3 diff --git a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl index 43fb893..67704b2 100644 --- a/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl @@ -445,8 +445,8 @@ DO UPDATE SET N SELECT - ri.recruit_id::uuid AS recruit_id, - ch->>'id' AS child_external_id, + ri.recruit_id AS recruit_id, + (ch->>'id')::uuid AS child_external_id, NULLIF(ch->>'idERN', '') AS child_id_ern, CASE NULLIF(ch->>'rodstvSvyazReb', '')::int WHEN 1 THEN 3 diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl index 791d6c9..f53452c 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl @@ -168,41 +168,6 @@ and recruitment_id = '${IDM_ID}'; 320
- - Change job status on error 2 - ExecSql - - Y - - 1 - - none - - - - - error_description - - - ervu-dashboard - Y - N - Y - Y - N - UPDATE etl.job_execution -SET status = 'ERROR', - error_description = ? -WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - - - - - 1120 - 976 - - Change job status on success 2 ExecSql @@ -264,35 +229,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); 320 - - Create job execution record 2 - ExecSql - - Y - - 1 - - none - - - - - ervu-dashboard - N - N - Y - N - N - INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) -VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - - - - - 368 - 976 - - Detect empty stream DetectEmptyStream @@ -409,8 +345,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N SELECT - r.recruit_id AS recruit_id, - ch->>'id' AS guardianship_external_id, + ri.recruit_id AS recruit_id, + (ch->>'id')::uuid AS guardianship_external_id, NULLIF(ch->>'idERN', '') AS guardian_id_ern, ch->'fioOpek'->>'familiya' AS last_name, ch->'fioOpek'->>'imya' AS first_name, @@ -426,14 +362,14 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); NULLIF(ch->'dataRozhdDok'->>'den', '')::int ) AS birth_date, ch->>'snils' AS snils -FROM ervu_dashboard.citizen r -JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array' - AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; Y @@ -441,106 +377,6 @@ WHERE 320 - - Table input 2 - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 10 - WITH trud_info AS (SELECT ri.info, - ri.recruit_id::uuid, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL - WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' THEN - ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 - END AS trud_deyat, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL - WHEN - jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb') = - 'array' THEN - ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb' -> 0 - END AS parental_leave_info, - - COALESCE( - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat', - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' - ) AS employer, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' IS NULL THEN NULL - WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP') = 'array' - THEN - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 - ELSE - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' - END AS reg_ip, - - COALESCE( - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD', - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' - ) AS self_employment - - FROM ervu_dashboard.recruits_info ri - -) -SELECT ti.recruit_id::uuid, - (ti.trud_deyat ->> 'dataMeropr')::date AS personnel_event_date, - ti.trud_deyat ->> 'naimTipKadrMeropr' AS personnel_event_type, - (ti.trud_deyat ->> 'prAktMestRab' = '1') AS current_workplace, - ti.trud_deyat ->> 'trudFunkcziya' AS position, - ti.trud_deyat -> 'svedOrg' ->> 'naimOrg' AS employer_name, - ti.employer -> 'svedYUL' ->> 'kpp' AS employer_kpp, - CASE - WHEN ti.employer->'svedYUL' IS NOT NULL THEN 'Юридическое лицо' - WHEN ti.employer->'svedIP' IS NOT NULL THEN 'Индивидуальный предприниматель' - END AS employer_category, - COALESCE( - ti.employer -> 'svedYUL' ->> 'innyul', - ti.employer -> 'svedIP' ->> 'innyfl' - ) AS employer_inn, - ti.employer -> 'svedYUL' -> 'svedOPK' ->> 'region' AS employer_address, - COALESCE( - ti.employer -> 'svedIP' ->> 'ogrnip', - ti.employer -> 'svedYUL' -> 'extend' ->> 'ogrn' - ) AS employer_ogrnip, - ti.employer -> 'extend' ->> 'tipPodrazdRabotodat' AS employer_unit_type, - ti.employer -> 'extend' ->> 'adresPodrazdRabotodat' AS employer_unit_address, - (ti.parental_leave_info ->> 'dataNachUhodReb')::date AS parental_leave_start_date, - (ti.parental_leave_info ->> 'dataKonUhodReb')::date AS parental_leave_end_date, - ( - (ti.parental_leave_info ->> 'dataNachUhodReb')::date <= current_date AND - ( - (ti.parental_leave_info ->> 'dataKonUhodReb') IS NULL OR - (ti.parental_leave_info ->> 'dataKonUhodReb')::date > current_date - ) - ) AS parental_leave_active, - (ti.reg_ip ->> 'dataRegIP')::date AS reg_ip_date, - (ti.reg_ip ->> 'dataINNNed')::date AS dereg_ip_date, - ti.reg_ip ->> 'ogrnip' AS ogrnip_ip, - ti.reg_ip IS NOT NULL AS active_ip, - ti.self_employment ->> 'dataUchNPD' AS reg_self_employment_date, - ti.self_employment ->> 'dataSnUchNPD' AS dereg_self_employment_date, - ti.self_employment IS NOT NULL AS active_self_employment -FROM trud_info ti; - - Y - - - 576 - 976 - - Table output TableOutput @@ -611,128 +447,6 @@ FROM trud_info ti; 320 - - Table output 2 - TableOutput - - N - - 1 - - none - - - 1000 - ervu-dashboard - - - recruit_id - recruit_id - - - personnel_event_date - personnel_event_date - - - personnel_event_type - personnel_event_type - - - position - position - - - employer_name - employer_name - - - employer_kpp - employer_kpp - - - employer_category - employer_category - - - employer_inn - employer_inn - - - employer_address - employer_address - - - employer_ogrnip - employer_ogrnip - - - employer_unit_type - employer_unit_type - - - employer_unit_address - employer_unit_address - - - parental_leave_start_date - parental_leave_start_date - - - parental_leave_end_date - parental_leave_end_date - - - parental_leave_active - parental_leave_active - - - reg_ip_date - reg_ip_date - - - dereg_ip_date - dereg_ip_date - - - ogrnip_ip - ogrnip_ip - - - active_ip - active_ip - - - reg_self_employment_date - reg_self_employment_date - - - dereg_self_employment_date - dereg_self_employment_date - - - active_self_employment - active_self_employment - - - N - N - N - N - Y - N - ervu_dashboard - Y - citizen_work_activity
- N - Y - N - Y - - - 800 - 976 - -
Update Update @@ -781,18 +495,6 @@ FROM trud_info ti;
- - Table output 2 - Change job status on error 2 - Y - - error_description - - error_code - - - - Update Change job status on error diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl index f2fcc5f..89a2259 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl @@ -429,8 +429,8 @@ and recruitment_id = '${IDM_ID}'; N SELECT - r.recruit_id AS recruit_id, - ch->>'id' AS guardianship_external_id, + ri.recruit_id AS recruit_id, + (ch->>'id')::uuid AS guardianship_external_id, NULLIF(ch->>'idERN', '') AS guardian_id_ern, ch->'fioOpek'->>'familiya' AS last_name, ch->'fioOpek'->>'imya' AS first_name, @@ -446,14 +446,14 @@ and recruitment_id = '${IDM_ID}'; NULLIF(ch->'dataRozhdDok'->>'den', '')::int ) AS birth_date, ch->>'snils' AS snils -FROM ervu_dashboard.citizen r -JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array' - AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date AND c.update_date >= '${M_R_UP_DATE}'::timestamp; Y diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl index 557f2eb..5ec494f 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl @@ -445,8 +445,8 @@ DO UPDATE SET N SELECT - r.recruit_id AS recruit_id, - ch->>'id' AS guardianship_external_id, + ri.recruit_id AS recruit_id, + (ch->>'id')::uuid AS guardianship_external_id, NULLIF(ch->>'idERN', '') AS guardian_id_ern, ch->'fioOpek'->>'familiya' AS last_name, ch->'fioOpek'->>'imya' AS first_name, @@ -462,14 +462,14 @@ DO UPDATE SET NULLIF(ch->'dataRozhdDok'->>'den', '')::int ) AS birth_date, ch->>'snils' AS snils -FROM ervu_dashboard.citizen r -JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array' - AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; Y diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl index 6109296..ebfe4cd 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl @@ -268,8 +268,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N SELECT - r.recruit_id, - supr->>'id' AS spouse_external_id, + ri.recruit_id AS recruit_id, + (supr->>'id')::uuid AS spouse_external_id, NULLIF(supr->>'idERN', '') AS spouse_id_ern, NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, supr->'svedFLBS'->'fio'->>'familiya' AS last_name, @@ -295,8 +295,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true ELSE false END AS information_excluded -FROM ervu_dashboard.citizen r -JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id CROSS JOIN LATERAL ( SELECT supri FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri @@ -305,8 +305,7 @@ CROSS JOIN LATERAL ( WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; - + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; Y diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl index 5a9c1c7..99e9f11 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl @@ -387,8 +387,8 @@ and recruitment_id = '${IDM_ID}'; N SELECT - r.recruit_id, - supr->>'id' AS spouse_external_id, + ri.recruit_id AS recruit_id, + (supr->>'id')::uuid AS spouse_external_id, NULLIF(supr->>'idERN', '') AS spouse_id_ern, NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, supr->'svedFLBS'->'fio'->>'familiya' AS last_name, @@ -414,8 +414,8 @@ and recruitment_id = '${IDM_ID}'; WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true ELSE false END AS information_excluded -FROM ervu_dashboard.citizen r -JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id CROSS JOIN LATERAL ( SELECT supri FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri @@ -424,7 +424,7 @@ CROSS JOIN LATERAL ( WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date AND c.update_date >= '${M_R_UP_DATE}'::timestamp; Y diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl index 36d9a02..d92ae63 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl @@ -404,8 +404,8 @@ DO UPDATE SET N SELECT - r.recruit_id, - supr->>'id' AS spouse_external_id, + ri.recruit_id AS recruit_id, + (supr->>'id')::uuid AS spouse_external_id, NULLIF(supr->>'idERN', '') AS spouse_id_ern, NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type, supr->'svedFLBS'->'fio'->>'familiya' AS last_name, @@ -431,8 +431,8 @@ DO UPDATE SET WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true ELSE false END AS information_excluded -FROM ervu_dashboard.citizen r -JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id +FROM ervu_dashboard.recruits_info ri +JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id CROSS JOIN LATERAL ( SELECT supri FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri @@ -441,7 +441,7 @@ CROSS JOIN LATERAL ( WHERE '${IDM_ID}' != '' AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - AND'${M_R_CR_DATE}'::timestamp >= c.recruit_create_date; + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; Y From 2a953f4a6b240451422292a06c293080c56a271b Mon Sep 17 00:00:00 2001 From: Fusionshh Date: Tue, 26 Aug 2025 14:59:00 +0300 Subject: [PATCH 29/34] ERVU-480 : work flow --- .../work/employer/employer_job.hwf | 23 +- .../work/employer/parallel/employer_flow.hpl | 357 +++----- .../employer/parallel/employer_flow_delta.hpl | 746 +++++++--------- .../parallel/employer_flow_repeat.hpl | 365 +++----- .../work/employer/recruitment_five_flow.hpl | 15 +- .../employer/recruitment_five_flow_delta.hpl | 91 +- ...r.hpl => recruitment_five_flow_repeat.hpl} | 22 +- ...check_if_employer_job_execution_exists.hpl | 11 +- .../support/check_if_need_to_repeat.hpl | 3 +- .../parallel/individual_entrepreneur_flow.hpl | 463 ++++++---- .../individual_entrepreneur_flow_delta.hpl | 299 ++++--- .../individual_entrepreneur_flow_repeat.hpl | 378 ++++---- .../recruitment_five_flow_delta.hpl | 67 +- .../recruitment_five_flow_repeat.hpl | 20 +- ...dividual_entrepreneur_execution_exists.hpl | 3 +- .../support/check_if_need_to_repeat.hpl | 3 +- .../parallel/self_employed_flow.hpl | 523 +++++------ .../parallel/self_employed_flow_delta.hpl | 394 ++++---- ...rror.hpl => self_employed_flow_repeat.hpl} | 218 ++--- .../recruitment_five_flow_delta.hpl | 75 +- .../recruitments_five_flow_repeat.hpl | 40 +- .../support/check_if_need_to_repeat.hpl | 2 +- ..._if_self_employed_job_execution_exists.hpl | 2 +- .../parallel/work_activity_flow.hpl | 839 +++--------------- .../parallel/work_activity_flow_delta.hpl | 514 ++++++----- .../parallel/work_activity_flow_repeat.hpl | 553 ++++++------ .../recruitment_five_flow_delta.hpl | 67 +- ...r.hpl => recruitment_five_flow_repeat.hpl} | 2 +- .../support/check_if_need_to_repeat_job.hpl | 3 +- .../check_if_work_activity_job_exists.hpl | 32 +- .../work/work_activity/work_activity_job.hwf | 10 +- 31 files changed, 2819 insertions(+), 3321 deletions(-) rename mappings/info_recruits/citizen_tables/work/employer/{recruitment_five_flow_on_error.hpl => recruitment_five_flow_repeat.hpl} (96%) rename mappings/info_recruits/citizen_tables/work/self_employed/parallel/{self_employed_flow_on_error.hpl => self_employed_flow_repeat.hpl} (69%) rename mappings/info_recruits/citizen_tables/work/work_activity/{recruitment_five_flow_on_error.hpl => recruitment_five_flow_repeat.hpl} (99%) diff --git a/mappings/info_recruits/citizen_tables/work/employer/employer_job.hwf b/mappings/info_recruits/citizen_tables/work/employer/employer_job.hwf index d971adf..8c0ba80 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/employer_job.hwf +++ b/mappings/info_recruits/citizen_tables/work/employer/employer_job.hwf @@ -42,8 +42,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl - - Basic Y @@ -63,12 +61,7 @@ SIMPLE_EVAL - - boolean - - - false equal equal @@ -92,8 +85,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl - - Basic Y @@ -109,7 +100,7 @@ - recruitment_five_flow_on_error.hpl + recruitment_five_flow_repeat.hpl PIPELINE @@ -119,9 +110,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/recruitment_five_flow_on_error.hpl - - + ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/recruitment_five_flow_repeat.hpl Basic Y @@ -148,8 +137,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl - - Basic Y @@ -161,7 +148,7 @@ Y N 576 - 208 + 192 @@ -193,8 +180,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl - - Basic Y @@ -241,7 +226,7 @@ Simple evaluation - recruitment_five_flow_on_error.hpl + recruitment_five_flow_repeat.hpl Y Y N diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl index 001f345..e519d93 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl @@ -25,16 +25,6 @@ employer_input Y - - actual_employer_output - pred_employer_output - N - - - pred_employer_output - Change job status on error - Y - Change job status on error Abort @@ -47,33 +37,33 @@ Identify last row in a stream - actual_employer_output + employer_output Y - actual_employer_output + employer_output Change job status on error Y - - pred_employer_output - Detect empty stream - N - Detect empty stream Change job status on success - N - - - pred_employer_output - Filter rows - N + Y Filter rows Change job status on success - N + Y + + + employer_output + Filter rows + Y + + + Identify last row in a stream + Detect empty stream + Y @@ -92,7 +82,7 @@ 0 - 1120 + 944 448 @@ -112,7 +102,7 @@ error_description - ervu-dashboard-test + ervu-dashboard Y N Y @@ -127,7 +117,7 @@ and recruitment_id = '${IDM_ID}'; - 896 + 720 448 @@ -144,7 +134,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard Y N Y @@ -158,7 +148,7 @@ and recruitment_id = '${IDM_ID}'; - 1120 + 944 112 @@ -175,7 +165,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard N N Y @@ -204,8 +194,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 1120 - 288 + 528 + 112 @@ -223,24 +213,32 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - TRUE + = last_row N - + + N + -1 + constant + -1 + Y + String + Change job status on success - 896 - 112 + 944 + 288 Identify last row in a stream DetectLastRow - Y + N 1 @@ -254,95 +252,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); 288 - - actual_employer_output - TableOutput - - Y - - 1 - - none - - - 10000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - source_id - source_id - - - source_update_date - akt_source_update_date - - - address - akt_address - - - separate_unit_type_code - akt_separate_unit_type - - - separate_unit_address - akt_separate_unit_address - - - employer_category_name - akt_employer_category_name - - - name - akt_name - - - inn - akt_inn - - - ogrn - akt_ogrn - - - kpp - akt_kpp - - - actual_employer - akt_actual_employer - - - is_opk_org - akt_is_opk_org - - - N - N - N - N - - Y - - N - ervu_dashboard - Y - employer
- - N - Y - N - Y - - - 720 - 288 - -
employer_input TableInput @@ -354,108 +263,76 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - ervu-dashboard-test + ervu-dashboard N 0 - with filteredData as ( - select ri.recruit_id, - (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id')::uuid as source_id, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedRabotodat' ->> 'rabotodat' != 'null' - --and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' -) -select - fd.recruit_id, - fd.source_id::uuid, --- aktRabotodat - aktRabotodat -> 'dataSved' as akt_source_update_date, - aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, - aktRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, - aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, - case - when aktRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' - when aktRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' - when aktRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' - when aktRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' - END - as akt_employer_category_name, - case - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'naimOrg' - END - as akt_name, - case - when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'svedIP' ->> 'innfl' - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' ->> 'innyul' - when aktRabotodat ->> 'svedGlKFH' != 'null' then aktRabotodat -> 'svedGlKFH' ->> 'innfl' - when aktRabotodat ->> 'svedPlatFL' != 'null' then aktRabotodat -> 'svedPlatFL' ->> 'innfl' - END - as akt_inn, - case - when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedIP' ->> 'ogrnip' - END - as akt_ogrn, - case - when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' - END - as akt_kpp, - true as akt_actual_employer, - case - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' - END - as akt_is_opk_org, --- predRabotodat - predRabotodat -> 'dataSved' as pred_source_update_date, - predRabotodat -> 'extend' ->> 'adresRabotodat' as pred_address, - predRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as pred_separate_unit_type_code, - predRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as pred_separate_unit_address, - case - when predRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' - when predRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' - when predRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' - when predRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' - END - as pred_employer_category_name, - case - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'naimOrg' - END - as pred_name, - case - when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'svedIP' ->> 'innfl' - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' ->> 'innyul' - when predRabotodat ->> 'svedGlKFH' != 'null' then predRabotodat -> 'svedGlKFH' ->> 'innfl' - when predRabotodat ->> 'svedPlatFL' != 'null' then predRabotodat -> 'svedPlatFL' ->> 'innfl' - END - as pred_inn, - case - when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedIP' ->> 'ogrnip' - END - as pred_ogrn, - case - when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' - END - as pred_kpp, - false as pred_actual_employer, - case - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' - END - as pred_is_opk_org + with filteredData as (select ri.recruit_id, + (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as rabotodat, + true as actual_employer + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'aktRabotodat' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + + union all + + select ri.recruit_id, + (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as rabotodat, + false as actual_employer + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +select fd.source_id, + fd.recruit_id, + to_date(rabotodat ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + COALESCE(rabotodat -> 'extend' ->> 'status', '0') = '1' AS status, + rabotodat -> 'extend' ->> 'adresRabotodat' as address, + rabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as separate_unit_type, + rabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as separate_unit_address, + case + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + then 'Индивидуальный предприниматель' + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' + when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' + end as employer_category_name, + rabotodat -> 'svedYUL' -> 'naimOrg' as name, + case + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + then rabotodat -> 'svedIP' ->> 'innfl' + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' + then rabotodat -> 'svedYUL' ->> 'innyul' + when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' + then rabotodat -> 'svedGlKFH' ->> 'innfl' + when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null' + then rabotodat -> 'svedPlatFL' ->> 'innfl' + end as inn, + case + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + then rabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' + then rabotodat -> 'svedIP' ->> 'ogrnip' + end as ogrn, + case + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' + then rabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + end as kpp, + coalesce(rabotodat -> 'svedYUL' -> 'extend' ->> 'priznakOpk', '0') = '1' as is_opk_org, + actual_employer from filteredData fd; Y - 368 + 352 288 - pred_employer_output + employer_output TableOutput - N + Y 1 @@ -463,55 +340,59 @@ from filteredData fd; 10000 - ervu-dashboard-test + ervu-dashboard - - source_id - source_id - recruit_id recruit_id + + source_id + source_id + source_update_date - pred_source_update_date + source_update_date address - pred_address + address + + + separate_unit_type_code + separate_unit_type separate_unit_address - pred_separate_unit_address + separate_unit_address employer_category_name - pred_employer_category_name + employer_category_name name - pred_name + name inn - pred_inn + inn ogrn - pred_ogrn + ogrn kpp - pred_kpp + kpp actual_employer - pred_actual_employer + actual_employer is_opk_org - pred_is_opk_org + is_opk_org N @@ -529,25 +410,13 @@ from filteredData fd; Y - 896 + 720 288 - actual_employer_output - Change job status on error - Y - - error_description - - - - - - - - pred_employer_output + employer_output Change job status on error Y diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl index 9043783..79fcd74 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl @@ -25,38 +25,23 @@ Abort Y - - Insert / update 2 - Change job status on success - Y - Create job execution record employer_input Y - Insert / update - Insert / update 2 - Y - - - Filter rows - Change job status on success - Y - - - Insert / update + employer_upsert Filter rows Y Identify last row in a stream - Insert / update + employer_upsert Y - Insert / update + employer_upsert Change job status on error Y @@ -65,10 +50,25 @@ Identify last row in a stream Y + + Detect empty stream + Change job status on success + Y + + + Identify last row in a stream + Detect empty stream + Y + + + Filter rows + Change job status on success + Y + - Insert / update 2 - InsertUpdate + Abort + Abort Y @@ -77,396 +77,13 @@ none - 10000 - ervu-dashboard-test - - - = - source_id - source_id - - ervu_dashboard - employer
- - source_id - source_id - Y - - - recruit_id - recruit_id - Y - - - source_update_date - pred_source_update_date - Y - - - address - pred_address - Y - - - separate_unit_type_code - pred_separate_unit_type_code - Y - - - separate_unit_address - pred_separate_unit_address - Y - - - employer_category_name - pred_employer_category_name - Y - - - name - pred_name - Y - - - inn - pred_inn - Y - - - ogrn - pred_ogrn - Y - - - kpp - pred_kpp - Y - - - actual_employer - pred_actual_employer - Y - - - is_opk_org - pred_is_opk_org - Y - -
- N + ABORT + Y + 0 1040 - 384 - -
- - Insert / update - InsertUpdate - - N - - 1 - - none - - - 10000 - ervu-dashboard-test - - - = - source_id - source_id - - ervu_dashboard - employer
- - source_id - source_id - Y - - - recruit_id - recruit_id - Y - - - source_update_date - akt_source_update_date - Y - - - address - akt_address - Y - - - separate_unit_type_code - akt_separate_unit_type - Y - - - separate_unit_address - akt_separate_unit_address - Y - - - employer_category_name - akt_employer_category_name - Y - - - name - akt_name - Y - - - inn - akt_inn - Y - - - ogrn - akt_ogrn - Y - - - kpp - akt_kpp - Y - - - actual_employer - akt_actual_employer - Y - - - is_opk_org - akt_is_opk_org - Y - -
- N - - - 864 - 384 - -
- - employer_input - TableInput - - Y - - 1 - - none - - - ervu-dashboard-test - N - 0 - with filtered_data as (select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id' as source_id, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat - from recruits_info ri --- join на военкомат - where ri.info -> 'svedFL' -> 'svedRabotodat' ->> 'rabotodat' != 'null' - -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - and (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' ->> 'dataSved' >= '${MAX_SOURCE_DATE}' - or ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' ->> 'dataSved' >= '${MAX_SOURCE_DATE}')) -select fd.source_id, - fd.recruit_id, --- aktRabotodat - aktRabotodat -> 'dataSved' as akt_source_update_date, - aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, - aktRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, - aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, - case - when aktRabotodat -> 'svedIP' then 'Индивидуальный предприниматель' - when aktRabotodat -> 'svedYUL' then 'Юридическое лицо' - when aktRabotodat -> 'svedGlKFH' then 'Глава КФХ' - when aktRabotodat -> 'svedPlatFL' then 'Физическое лицо' - END - as akt_employer_category_name, - case - when aktRabotodat -> 'svedYUL' then aktRabotodat -> 'svedYUL' -> 'naimOrg' - END - as akt_name, - case - when aktRabotodat -> 'svedIP' then aktRabotodat -> 'svedIP' ->> 'innfl' - when aktRabotodat -> 'svedYUL' then aktRabotodat -> 'svedYUL' ->> 'innyul' - when aktRabotodat -> 'svedGlKFH' then aktRabotodat -> 'svedGlKFH' ->> 'innfl' - when aktRabotodat -> 'svedPlatFL' then aktRabotodat -> 'svedPlatFL' ->> 'innfl' - END - as akt_inn, - case - when aktRabotodat -> 'svedIP' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' - when aktRabotodat -> 'svedYUL' then aktRabotodat -> 'svedIP' ->> 'ogrnip' - END - as akt_ogrn, - case - when aktRabotodat -> 'svedIP' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' - END - as akt_kpp, - true as akt_actual_employer, - case - when aktRabotodat -> 'svedYUL' then aktRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' - END - as akt_is_opk_org, --- predRabotodat - predRabotodat -> 'dataSved' as akt_source_update_date, - predRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, - predRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, - predRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, - case - when predRabotodat -> 'svedIP' then 'Индивидуальный предприниматель' - when predRabotodat -> 'svedYUL' then 'Юридическое лицо' - when predRabotodat -> 'svedGlKFH' then 'Глава КФХ' - when predRabotodat -> 'svedPlatFL' then 'Физическое лицо' - END - as akt_employer_category_name, - case - when predRabotodat -> 'svedYUL' then predRabotodat -> 'svedYUL' -> 'naimOrg' - END - as akt_name, - case - when predRabotodat -> 'svedIP' then predRabotodat -> 'svedIP' ->> 'innfl' - when predRabotodat -> 'svedYUL' then predRabotodat -> 'svedYUL' ->> 'innyul' - when predRabotodat -> 'svedGlKFH' then predRabotodat -> 'svedGlKFH' ->> 'innfl' - when predRabotodat -> 'svedPlatFL' then predRabotodat -> 'svedPlatFL' ->> 'innfl' - END - as akt_inn, - case - when predRabotodat -> 'svedIP' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' - when predRabotodat -> 'svedYUL' then predRabotodat -> 'svedIP' ->> 'ogrnip' - END - as akt_ogrn, - case - when predRabotodat -> 'svedIP' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' - END - as akt_kpp, - true as akt_actual_employer, - case - when predRabotodat -> 'svedYUL' then predRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' - END - as akt_is_opk_org -from filtered_data fd; - Y - - - 512 - 384 - - - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - result - - - 672 - 384 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - TRUE - result - N - - - - - Change job status on success - Change job status on success - - - 864 - 240 - - - - Create job execution record - ExecSql - - Y - - 1 - - none - - - - - ervu-dashboard-test - N - N - Y - N - N - INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) -VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - - - - - 320 - 384 - - - - Change job status on success - ExecSql - - Y - - 1 - - none - - - - - ervu-dashboard-test - Y - N - Y - N - N - UPDATE etl.job_execution -SET status = 'SUCCESS' -WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - - - - - 1040 - 240 + 544 @@ -485,7 +102,7 @@ and recruitment_id = '${IDM_ID}'; error_description - ervu-dashboard-test + ervu-dashboard Y N Y @@ -500,13 +117,13 @@ and recruitment_id = '${IDM_ID}'; - 1040 + 864 544 - Abort - Abort + Change job status on success + ExecSql Y @@ -515,22 +132,315 @@ and recruitment_id = '${IDM_ID}'; none - ABORT - Y - 0 + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + - 1216 - 544 + 1040 + 240 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = current_timestamp, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 320 + 384 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 672 + 240 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1040 + 384 + + + + Identify last row in a stream + DetectLastRow + + N + + 1 + + none + + + last_row + + + 672 + 384 + + + + employer_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + with filteredData as (select ri.recruit_id, + (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as rabotodat, + true as actual_employer + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'aktRabotodat' != 'null' + and to_date(ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' ->> + 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + + union all + + select ri.recruit_id, + (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as rabotodat, + false as actual_employer + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat' != 'null' + and to_date(ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' ->> + 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +select fd.source_id, + fd.recruit_id, + to_date(rabotodat ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + COALESCE(rabotodat -> 'extend' ->> 'status', '0') = '1' AS status, + rabotodat -> 'extend' ->> 'adresRabotodat' as address, + rabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as separate_unit_type, + rabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as separate_unit_address, + case + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + then 'Индивидуальный предприниматель' + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' + when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' + end as employer_category_name, + rabotodat -> 'svedYUL' -> 'naimOrg' as name, + case + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + then rabotodat -> 'svedIP' ->> 'innfl' + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' + then rabotodat -> 'svedYUL' ->> 'innyul' + when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' + then rabotodat -> 'svedGlKFH' ->> 'innfl' + when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null' + then rabotodat -> 'svedPlatFL' ->> 'innfl' + end as inn, + case + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + then rabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' + then rabotodat -> 'svedIP' ->> 'ogrnip' + end as ogrn, + case + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' + then rabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + end as kpp, + coalesce(rabotodat -> 'svedYUL' -> 'extend' ->> 'priznakOpk', '0') = '1' as is_opk_org, + actual_employer +from filteredData fd; + Y + + + 496 + 384 + + + + employer_upsert + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard + + + = + source_id + source_id + + + = + actual_employer + actual_employer + + ervu_dashboard + employer
+ + source_id + source_id + N + + + recruit_id + recruit_id + N + + + source_update_date + source_update_date + Y + + + address + address + Y + + + separate_unit_type_code + separate_unit_type + Y + + + separate_unit_address + separate_unit_address + Y + + + employer_category_name + employer_category_name + Y + + + name + name + Y + + + inn + inn + Y + + + ogrn + ogrn + Y + + + kpp + kpp + Y + + + actual_employer + actual_employer + Y + + + is_opk_org + is_opk_org + Y + +
+ N + + + 864 + 384
- Insert / update + employer_upsert Change job status on error Y - + error_description diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl index 3f48109..24d9cec 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl @@ -30,11 +30,6 @@ employer_input Y - - Filter rows - Change job status on success - Y - employer_input Identify last row in a stream @@ -42,26 +37,31 @@ Identify last row in a stream - akt_employer_upsert + employer_upsert Y - akt_employer_upsert - pred_employer_upsert - Y - - - akt_employer_upsert + employer_upsert Filter rows Y - akt_employer_upsert + employer_upsert Change job status on error Y - pred_employer_upsert + Detect empty stream + Change job status on success + Y + + + Identify last row in a stream + Detect empty stream + Y + + + Filter rows Change job status on success Y @@ -82,7 +82,7 @@ 0 - 1248 + 1072 560 @@ -102,7 +102,7 @@ error_description - ervu-dashboard-test + ervu-dashboard Y N Y @@ -117,7 +117,7 @@ and recruitment_id = '${IDM_ID}'; - 1072 + 896 560 @@ -134,7 +134,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard Y N Y @@ -165,22 +165,46 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard + N + N + Y N N INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) -VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - - +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}') +ON CONFLICT (job_name, recruitment_id) +DO UPDATE +SET status = 'PROCESSING', + error_description = null, + execution_datetime = current_timestamp; + 352 400 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 704 + 256 + + Filter rows FilterRows @@ -196,32 +220,40 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - TRUE - result + = + last_row N - + + N + -1 + constant + -1 + Y + Boolean + Change job status on success Change job status on success - 896 - 256 + 1072 + 400 Identify last row in a stream DetectLastRow - Y + N 1 none - result + last_row 704 @@ -239,95 +271,63 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - ervu-dashboard-test + ervu-dashboard N 0 - with filteredData as ( - select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id' as source_id, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedRabotodat' ->> 'rabotodat' != 'null' - -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' -) -select - fd.source_id, - fd.recruit_id, --- aktRabotodat - aktRabotodat -> 'dataSved' as akt_source_update_date, - aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, - aktRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, - aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, - case - when aktRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' - when aktRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' - when aktRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' - when aktRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' - END - as akt_employer_category_name, - case - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'naimOrg' - END - as akt_name, - case - when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'svedIP' ->> 'innfl' - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' ->> 'innyul' - when aktRabotodat ->> 'svedGlKFH' != 'null' then aktRabotodat -> 'svedGlKFH' ->> 'innfl' - when aktRabotodat ->> 'svedPlatFL' != 'null' then aktRabotodat -> 'svedPlatFL' ->> 'innfl' - END - as akt_inn, - case - when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedIP' ->> 'ogrnip' - END - as akt_ogrn, - case - when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' - END - as akt_kpp, - true as akt_actual_employer, - case - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' - END - as akt_is_opk_org, --- predRabotodat - predRabotodat -> 'dataSved' as pred_source_update_date, - predRabotodat -> 'extend' ->> 'adresRabotodat' as pred_address, - predRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as pred_separate_unit_type_code, - predRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as pred_separate_unit_address, - case - when predRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' - when predRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' - when predRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' - when predRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' - END - as pred_employer_category_name, - case - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'naimOrg' - END - as pred_name, - case - when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'svedIP' ->> 'innfl' - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' ->> 'innyul' - when predRabotodat ->> 'svedGlKFH' != 'null' then predRabotodat -> 'svedGlKFH' ->> 'innfl' - when predRabotodat ->> 'svedPlatFL' != 'null' then predRabotodat -> 'svedPlatFL' ->> 'innfl' - END - as pred_inn, - case - when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedIP' ->> 'ogrnip' - END - as pred_ogrn, - case - when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' - END - as pred_kpp, - false as pred_actual_employer, - case - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' - END - as pred_is_opk_org + with filteredData as (select ri.recruit_id, + (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as rabotodat, + true as actual_employer + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'aktRabotodat' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + + union all + + select ri.recruit_id, + (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, + ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as rabotodat, + false as actual_employer + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +select fd.source_id, + fd.recruit_id, + to_date(rabotodat ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + COALESCE(rabotodat -> 'extend' ->> 'status', '0') = '1' AS status, + rabotodat -> 'extend' ->> 'adresRabotodat' as address, + rabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as separate_unit_type, + rabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as separate_unit_address, + case + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + then 'Индивидуальный предприниматель' + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' + when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' + when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' + end as employer_category_name, + rabotodat -> 'svedYUL' -> 'naimOrg' as name, + case + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + then rabotodat -> 'svedIP' ->> 'innfl' + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' + then rabotodat -> 'svedYUL' ->> 'innyul' + when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' + then rabotodat -> 'svedGlKFH' ->> 'innfl' + when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null' + then rabotodat -> 'svedPlatFL' ->> 'innfl' + end as inn, + case + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + then rabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' + then rabotodat -> 'svedIP' ->> 'ogrnip' + end as ogrn, + case + when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' + then rabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' + end as kpp, + coalesce(rabotodat -> 'svedYUL' -> 'extend' ->> 'priznakOpk', '0') = '1' as is_opk_org, + actual_employer from filteredData fd; Y @@ -337,102 +337,7 @@ from filteredData fd; - akt_employer_upsert - InsertUpdate - - N - - 1 - - none - - - 10000 - ervu-dashboard-test - - - = - source_id - source_id - - - ervu_dashboard - employer
- - source_id - source_id - Y - - - recruit_id - recruit_id - Y - - - source_update_date - akt_source_update_date - Y - - - address - akt_address - Y - - - separate_unit_type_code - akt_separate_unit_type - Y - - - separate_unit_address - akt_separate_unit_address - Y - - - employer_category_name - akt_employer_category_name - Y - - - name - akt_name - Y - - - inn - akt_inn - Y - - - ogrn - akt_ogrn - Y - - - kpp - akt_kpp - Y - - - actual_employer - akt_actual_employer - Y - - - is_opk_org - akt_is_opk_org - Y - -
- N - - - 896 - 400 - -
- - pred_employer_upsert + employer_upsert InsertUpdate Y @@ -449,90 +354,94 @@ from filteredData fd; = source_id source_id - + + + = + actual_employer + actual_employer ervu_dashboard employer
source_id source_id - Y + N recruit_id recruit_id - Y + N source_update_date - pred_source_update_date + source_update_date Y address - pred_address + address Y separate_unit_type_code - pred_separate_unit_type_code + separate_unit_type Y separate_unit_address - pred_separate_unit_address + separate_unit_address Y employer_category_name - pred_employer_category_name + employer_category_name Y name - pred_name + name Y inn - pred_inn + inn Y ogrn - pred_ogrn + ogrn Y kpp - pred_kpp + kpp Y actual_employer - pred_actual_employer + actual_employer Y is_opk_org - pred_is_opk_org + is_opk_org Y N - 1072 + 896 400
- akt_employer_upsert + employer_upsert Change job status on error Y - + error_description diff --git a/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl index a0965cf..15d97f9 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow.hpl @@ -59,15 +59,14 @@ ervu-dashboard-test N - SELECT -idm_id AS recruitment +idm_id FROM ervu_dashboard.recruitment; N 416 - 432 + 416 @@ -91,7 +90,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + idm_id @@ -147,7 +146,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + idm_id @@ -203,7 +202,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + idm_id @@ -259,7 +258,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + idm_id @@ -315,7 +314,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + idm_id diff --git a/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl index 1e7c811..cbf15f2 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_delta.hpl @@ -26,8 +26,8 @@ Y - Table input - employer_flow_delta.hpl 3 + get_max_source_update_date + Table input Y @@ -35,6 +35,11 @@ employer_flow_delta.hpl 2 Y + + Table input + employer_flow_delta.hpl 3 + Y + Table input employer_flow_delta.hpl 4 @@ -60,12 +65,22 @@ ervu-dashboard-test N 0 + get_max_source_update_date SELECT - r.idm_id as recruitment_id + r.idm_id, + ? max_source_update_date FROM ervu_dashboard.recruitment r - LEFT JOIN public.job_execution je + LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id and job_name = 'employer_job' + JOIN recruits_info ri + ON COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = r.idm_id + AND ri.updated_at > ( + SELECT MAX(execution_datetime) + FROM etl.job_execution + WHERE job_name = 'employer_job' + AND recruitment_id = r.idm_id + ) where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); N @@ -74,6 +89,29 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING 336
+ + get_max_source_update_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + select max(source_update_date) +from employer; + N + + + 400 + 336 + + employer_flow_delta.hpl PipelineExecutor @@ -95,13 +133,18 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING IDM_ID - recruitment_id + idm_id JOB_NAME - work_activity_job + employer_job + + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + Y @@ -151,13 +194,18 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING IDM_ID - recruitment_id + idm_id JOB_NAME - work_activity_job + employer_job + + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + Y @@ -207,13 +255,18 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING IDM_ID - recruitment_id + idm_id JOB_NAME - work_activity_job + employer_job + + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + Y @@ -263,13 +316,18 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING IDM_ID - recruitment_id + idm_id JOB_NAME - work_activity_job + employer_job + + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + Y @@ -319,13 +377,18 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING IDM_ID - recruitment_id + idm_id JOB_NAME - work_activity_job + employer_job + + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + Y diff --git a/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_repeat.hpl similarity index 96% rename from mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_on_error.hpl rename to mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_repeat.hpl index 54c5766..fd60da1 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_on_error.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/recruitment_five_flow_repeat.hpl @@ -1,7 +1,7 @@ - recruitment_five_flow_on_error + recruitment_five_flow_repeat Y @@ -60,13 +60,13 @@ ervu-dashboard-test N 0 - SELECT - r.idm_id as recruitment_id + SELECT r.idm_id AS recruitment_id FROM ervu_dashboard.recruitment r - LEFT JOIN public.job_execution je + LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id - and job_name = 'employer_job' -where je.status is null or je.status in('ERROR', 'PROCESSING'); + AND je.job_name = 'employer_job' +WHERE je.id IS NULL + OR je.status IN ('ERROR', 'PROCESSING'); N @@ -101,7 +101,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + employer_job Y @@ -157,7 +157,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + employer_job Y @@ -213,7 +213,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + employer_job Y @@ -269,7 +269,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + employer_job Y @@ -325,7 +325,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + employer_job Y diff --git a/mappings/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl b/mappings/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl index ad27771..548f683 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/support/check_if_employer_job_execution_exists.hpl @@ -62,15 +62,14 @@ none - ervu-dashboard-test + ervu-dashboard N 0 SELECT EXISTS ( - SELECT 1 - FROM etl.job_execution - WHERE job_name = 'employer_job' - limit 1 - ) AS job_executed_flag; + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'employer_job' +) AS job_executed_flag; N diff --git a/mappings/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl b/mappings/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl index 785a778..9e14dda 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/support/check_if_need_to_repeat.hpl @@ -62,7 +62,7 @@ none - ervu-dashboard-test + ervu-dashboard N 0 SELECT EXISTS (SELECT 1 @@ -71,7 +71,6 @@ FROM ervu_dashboard.recruitment r ON r.idm_id = je.recruitment_id and job_name = 'employer_job' where je.status is null or je.status in ('ERROR', 'PROCESSING') -limit 1 ) as need_to_repeat_job; N diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl index 401487b..a34334f 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl @@ -37,39 +37,54 @@ Identify last row in a stream - akt_individual_entrepreneur_output + individual_entrepreneur_output Y - akt_individual_entrepreneur_output - Change job status on error - Y - - - akt_individual_entrepreneur_output + individual_entrepreneur_output Filter rows Y - - akt_individual_entrepreneur_output - pred_individual_entrepreneur_output - Y - - - pred_individual_entrepreneur_output - Change job status on error - Y - - - pred_individual_entrepreneur_output - Change job status on success - Y - individual_entrepreneur_input Identify last row in a stream Y + + Identify last row in a stream + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + filter_null_npd_dates + unique_by_rec_id + Y + + + unique_by_rec_id + individual_entrepreneur_npd_output + Y + + + individual_entrepreneur_npd_output + Change job status on error + Y + + + individual_entrepreneur_output + Change job status on error + Y + + + Identify last row in a stream + filter_null_npd_dates + Y + Abort @@ -87,8 +102,8 @@ 0 - 1536 - 624 + 1648 + 576 @@ -107,7 +122,7 @@ error_description - ervu-dashboard-test + ervu-dashboard Y N Y @@ -122,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 1360 - 624 + 1440 + 576 @@ -139,7 +154,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard Y N Y @@ -153,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1360 - 272 + 1440 + 288 @@ -170,7 +185,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard N N Y @@ -186,6 +201,23 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); 448 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 800 + 288 + + Filter rows FilterRows @@ -201,41 +233,31 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - TRUE - result + = + last_row N - + + N + -1 + constant + -1 + Y + Boolean + Change job status on success - 1040 - 272 + 1440 + 448 Identify last row in a stream DetectLastRow - Y - - 1 - - none - - - result - - - 800 - 448 - - - - akt_individual_entrepreneur_output - TableOutput - N 1 @@ -243,67 +265,16 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - 10000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - source_id - source_id - - - ogrnip - akt_ogrnip - - - source_update_date - akt_source_update_date - - - registration_date - akt_registration_date - - - reg_npd_date - akt_reg_npd_date - - - dereg_npd_date - akt_dereg_npd_date - - - actual - akt_actual - - - N - N - N - N - - Y - - N - ervu_dashboard - Y - individual_entrepreneur
- - N - Y - N - Y + last_row - 1040 + 800 448
- pred_individual_entrepreneur_output - TableOutput + filter_null_npd_dates + FilterRows Y @@ -312,66 +283,21 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - 10000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - source_id - source_id - - - ogrnip - pred_ogrnip - - - source_update_date - pred_source_update_date - - - registration_date - pred_registration_date - - - deregistration_date - pred_deregistration_date - - - reg_npd_date - pred_reg_npd_date - - - dereg_npd_date - pred_dereg_npd_date - - - actual - pred_actual - - - N - N - N - N - - Y - - N - ervu_dashboard - Y - individual_entrepreneur
- - N - Y - N - Y + + + + + IS NOT NULL + reg_npd_date + N + - + + + unique_by_rec_id - 1360 - 448 + 800 + 576
@@ -385,34 +311,42 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - ervu-dashboard-test + ervu-dashboard N 0 - with filtered_data as ( - select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as aktIp, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as predIp - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedRegIP' ->> 'regIP' != 'null' --- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' -) -select - fd.recruit_id, - fd.source_id, - aktIp ->> 'ogrnip' as akt_ogrnip, - aktIp ->> 'dataSved' as akt_source_update_date, - aktIp ->> 'dataRegIP' as akt_registration_date, - aktIp -> 'extend' ->> 'dataUchNPD' as akt_reg_npd_date, - aktIp -> 'extend' ->> 'dataSnUchNPD' as akt_dereg_npd_date, - true as akt_actual, - predIp ->> 'ogrnip' as pred_ogrnip, - predIp ->> 'dataSved' as pred_source_update_date, - predIp ->> 'dataRegIP' as pred_registration_date, - predIp ->> 'dataINNNed' as pred_deregistration_date, - predIp -> 'extend' ->> 'dataUchNPD' as pred_reg_npd_date, - predIp -> 'extend' ->> 'dataSnUchNPD' as pred_dereg_npd_date, - false as pred_actual + with filtered_data as (select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as ip_elem, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataUchNPD', + 'YYYY-MM-DD') as reg_npd_date, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataSnUchNPD', + 'YYYY-MM-DD') as dereg_npd_date, + true as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' ->> 'regIP' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + + union all + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as ip_elem, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataUchNPD', + 'YYYY-MM-DD') as reg_npd_date, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataSnUchNPD', + 'YYYY-MM-DD') as dereg_npd_date, + false as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'predRegIP' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +select fd.recruit_id, + fd.source_id, + ip_elem ->> 'ogrnip' as ogrnip, + to_date(ip_elem ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + to_date(ip_elem ->> 'dataRegIP', 'YYYY-MM-DD') as registration_date, + to_date(ip_elem ->> 'dataINNNed', 'YYYY-MM-DD') as deregistration_date, + reg_npd_date, + dereg_npd_date, + fd.actual as actual from filtered_data fd; Y @@ -421,13 +355,150 @@ from filtered_data fd; 448
+ + individual_entrepreneur_npd_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard + + + recruit_id + recruit_id + + + source_id + source_id + + + register_date + reg_npd_date + + + deregistration_date + dereg_npd_date + + + N + N + N + N + Y + N + ervu_dashboard + Y + individual_entrepreneur_npd
+ N + Y + N + Y + + + 1184 + 576 + +
+ + individual_entrepreneur_output + TableOutput + + Y + + 1 + + none + + + 10000 + ervu-dashboard-test + + + recruit_id + recruit_id + + + source_id + source_id + + + ogrnip + ogrnip + + + source_update_date + source_update_date + + + registration_date + registration_date + + + deregistration_date + deregistration_date + + + actual + actual + + + N + N + N + N + Y + N + ervu_dashboard + Y + individual_entrepreneur
+ N + Y + N + Y + + + 1232 + 448 + +
+ + unique_by_rec_id + UniqueRowsByHashSet + + Y + + 1 + + none + + + N + N + + + + recruit_id + + + + + 976 + 576 + + - akt_individual_entrepreneur_output + individual_entrepreneur_npd_output Change job status on error Y - + error_description @@ -435,11 +506,11 @@ from filtered_data fd; - pred_individual_entrepreneur_output + individual_entrepreneur_output Change job status on error Y - + error_description diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl index 7266814..686b0be 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl @@ -37,7 +37,7 @@ Identify last row in a stream - akt_individual_entrepreneur_upsert + individual_entrepreneur_upsert Y @@ -46,27 +46,42 @@ Y - akt_individual_entrepreneur_upsert - Change job status on error - Y - - - akt_individual_entrepreneur_upsert + individual_entrepreneur_upsert Filter rows Y - akt_individual_entrepreneur_upsert - pred_individual_entrepreneur_upsert + filter_null_npd_dates + unique_by_rec_id Y - pred_individual_entrepreneur_upsert + unique_by_rec_id + individual_entrepreneur_npd_upsert + Y + + + Identify last row in a stream + Detect empty stream + Y + + + Identify last row in a stream + filter_null_npd_dates + Y + + + individual_entrepreneur_upsert Change job status on error Y - pred_individual_entrepreneur_upsert + individual_entrepreneur_npd_upsert + Change job status on error + Y + + + Detect empty stream Change job status on success Y @@ -87,8 +102,8 @@ 0 - 1456 - 624 + 1616 + 592 @@ -107,14 +122,14 @@ error_description - ervu-dashboard-test + ervu-dashboard Y N Y Y N UPDATE etl.job_execution -SET status = 'ERROR', +SET status = 'DELTA_ERROR', error_description = ? WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; @@ -122,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 1280 - 624 + 1328 + 592 @@ -139,21 +154,21 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard Y N Y N N UPDATE etl.job_execution -SET status = 'SUCCESS' +SET status = 'DELTA_SUCCESS' WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 1280 + 1616 272 @@ -170,22 +185,42 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard N N Y N N - INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) -VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - - + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = current_timestamp, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; 272 448 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 736 + 272 + + Filter rows FilterRows @@ -201,23 +236,49 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - TRUE - result + = + last_row N - + + N + -1 + constant + -1 + Y + Boolean + Change job status on success - 992 - 272 + 1616 + 448 Identify last row in a stream DetectLastRow + N + + 1 + + none + + + last_row + + + 736 + 448 + + + + filter_null_npd_dates + FilterRows + Y 1 @@ -225,11 +286,21 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - result + + + + + IS NOT NULL + reg_npd_date + N + - + + + unique_by_rec_id 736 - 448 + 592 @@ -243,36 +314,46 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - ervu-dashboard-test + ervu-dashboard N 0 - with filtered_data as ( - select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as aktIp, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as predIp - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedRegIP' ->> 'regIP' != 'null' - and (ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' ->> 'dataSved' > '${MAX_SOURCE_UPDATE_DATE}' - or ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' ->> 'dataSved' > '${MAX_SOURCE_UPDATE_DATE}') --- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' -) -select - fd.recruit_id, - fd.source_id, - aktIp ->> 'ogrnip' as akt_ogrnip, - aktIp ->> 'dataSved' as akt_source_update_date, - aktIp ->> 'dataRegIP' as akt_registration_date, - aktIp -> 'extend' ->> 'dataUchNPD' as akt_reg_npd_date, - aktIp -> 'extend' ->> 'dataSnUchNPD' as akt_dereg_npd_date, - true as akt_actual, - predIp ->> 'ogrnip' as pred_ogrnip, - predIp ->> 'dataSved' as pred_source_update_date, - predIp ->> 'dataRegIP' as pred_registration_date, - predIp ->> 'dataINNNed' as pred_deregistration_date, - predIp -> 'extend' ->> 'dataUchNPD' as pred_reg_npd_date, - predIp -> 'extend' ->> 'dataSnUchNPD' as pred_dereg_npd_date, - false as pred_actual + with filtered_data as (select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as ip_elem, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataUchNPD', + 'YYYY-MM-DD') as reg_npd_date, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataSnUchNPD', + 'YYYY-MM-DD') as dereg_npd_date, + true as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'aktRegIP' != 'null' + and to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' ->> 'dataSved', + 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + + union all + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as ip_elem, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataUchNPD', + 'YYYY-MM-DD') as reg_npd_date, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataSnUchNPD', + 'YYYY-MM-DD') as dereg_npd_date, + false as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'predRegIP' != 'null' + and to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' ->> 'dataSved', + 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +select fd.recruit_id, + fd.source_id, + ip_elem ->> 'ogrnip' as ogrnip, + to_date(ip_elem ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + to_date(ip_elem ->> 'dataRegIP', 'YYYY-MM-DD') as registration_date, + to_date(ip_elem ->> 'dataINNNed', 'YYYY-MM-DD') as deregistration_date, + reg_npd_date, + dereg_npd_date, + fd.actual as actual from filtered_data fd; Y @@ -282,10 +363,10 @@ from filtered_data fd; - akt_individual_entrepreneur_upsert + individual_entrepreneur_npd_upsert InsertUpdate - N + Y 1 @@ -293,16 +374,15 @@ from filtered_data fd; 10000 - ervu-dashboard-test + ervu-dashboard = - source_id - source_id - + recruit_id + recruit_id ervu_dashboard - individual_entrepreneur
+ individual_entrepreneur_npd
recruit_id recruit_id @@ -314,45 +394,25 @@ from filtered_data fd; N - ogrnip - akt_ogrnip - Y - - - source_update_date - akt_source_update_date - Y - - - registration_date - akt_registration_date - Y - - - reg_npd_date - akt_reg_npd_date + register_date + reg_npd_date Y deregistration_date - akt_dereg_npd_date - Y - - - actual - akt_actual + dereg_npd_date Y
N - 992 - 448 + 1104 + 592
- pred_individual_entrepreneur_upsert + individual_entrepreneur_upsert InsertUpdate Y @@ -384,54 +444,69 @@ from filtered_data fd; ogrnip - pred_ogrnip + ogrnip Y source_update_date - pred_source_update_date + source_update_date Y registration_date - pred_registration_date + registration_date Y deregistration_date - pred_deregistration_date - Y - - - reg_npd_date - pred_reg_npd_date - Y - - - dereg_npd_date - pred_dereg_npd_date + dereg_npd_date Y actual - pred_actual + actual Y N - 1280 + 1328 448 + + unique_by_rec_id + UniqueRowsByHashSet + + Y + + 1 + + none + + + N + N + + + + recruit_id + + + + + 912 + 592 + + - akt_individual_entrepreneur_upsert + individual_entrepreneur_npd_upsert Change job status on error Y - + error_description @@ -439,11 +514,11 @@ from filtered_data fd; - pred_individual_entrepreneur_upsert + individual_entrepreneur_upsert Change job status on error Y - + error_description diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl index a9ef581..2234039 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl @@ -40,33 +40,48 @@ Identify last row in a stream Y + + filter_null_npd_dates + unique_by_rec_id + Y + Identify last row in a stream - akt_individual_entrepreneur_upsert + Detect empty stream Y - akt_individual_entrepreneur_upsert - pred_individual_entrepreneur_upsert - Y - - - akt_individual_entrepreneur_upsert - Filter rows - Y - - - pred_individual_entrepreneur_upsert + Detect empty stream Change job status on success Y - pred_individual_entrepreneur_upsert + Identify last row in a stream + individual_entrepreneur_upsert + Y + + + individual_entrepreneur_upsert + Filter rows + Y + + + individual_entrepreneur_upsert Change job status on error Y - akt_individual_entrepreneur_upsert + unique_by_rec_id + individual_entrepreneur_npd_upsert + Y + + + Identify last row in a stream + filter_null_npd_dates + Y + + + individual_entrepreneur_npd_upsert Change job status on error Y @@ -87,8 +102,8 @@ 0 - 1696 - 640 + 1856 + 624 @@ -107,7 +122,7 @@ error_description - ervu-dashboard-test + ervu-dashboard Y N Y @@ -122,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 1520 - 640 + 1568 + 624 @@ -139,7 +154,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard Y N Y @@ -153,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1520 - 288 + 1856 + 304 @@ -170,22 +185,46 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard + N + N + Y N N INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) -VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - - +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}') +ON CONFLICT (job_name, recruitment_id) +DO UPDATE +SET status = 'PROCESSING', + error_description = null, + execution_datetime = current_timestamp; + 512 464 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 976 + 304 + + Filter rows FilterRows @@ -201,23 +240,49 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - TRUE - result + = + last_row N - + + N + -1 + constant + -1 + Y + Boolean + Change job status on success - 1232 - 288 + 1856 + 464 Identify last row in a stream DetectLastRow + N + + 1 + + none + + + last_row + + + 976 + 464 + + + + filter_null_npd_dates + FilterRows + Y 1 @@ -225,11 +290,21 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - result + + + + + IS NOT NULL + reg_npd_date + N + - + + + unique_by_rec_id 976 - 464 + 624 @@ -243,34 +318,42 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - ervu-dashboard-test + ervu-dashboard N 0 - with filtered_data as ( - select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as aktIp, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as predIp - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedRegIP' ->> 'regIP' != 'null' --- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' -) -select - fd.recruit_id, - fd.source_id, - aktIp ->> 'ogrnip' as akt_ogrnip, - aktIp ->> 'dataSved' as akt_source_update_date, - aktIp ->> 'dataRegIP' as akt_registration_date, - aktIp -> 'extend' ->> 'dataUchNPD' as akt_reg_npd_date, - aktIp -> 'extend' ->> 'dataSnUchNPD' as akt_dereg_npd_date, - true as akt_actual, - predIp ->> 'ogrnip' as pred_ogrnip, - predIp ->> 'dataSved' as pred_source_update_date, - predIp ->> 'dataRegIP' as pred_registration_date, - predIp ->> 'dataINNNed' as pred_deregistration_date, - predIp -> 'extend' ->> 'dataUchNPD' as pred_reg_npd_date, - predIp -> 'extend' ->> 'dataSnUchNPD' as pred_dereg_npd_date, - false as pred_actual + with filtered_data as (select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as ip_elem, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataUchNPD', + 'YYYY-MM-DD') as reg_npd_date, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataSnUchNPD', + 'YYYY-MM-DD') as dereg_npd_date, + true as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'aktRegIP' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + + union all + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, + ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as ip_elem, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataUchNPD', + 'YYYY-MM-DD') as reg_npd_date, + to_date(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'extend' ->> 'dataSnUchNPD', + 'YYYY-MM-DD') as dereg_npd_date, + false as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'predRegIP' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +select fd.recruit_id, + fd.source_id, + ip_elem ->> 'ogrnip' as ogrnip, + to_date(ip_elem ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + to_date(ip_elem ->> 'dataRegIP', 'YYYY-MM-DD') as registration_date, + to_date(ip_elem ->> 'dataINNNed', 'YYYY-MM-DD') as deregistration_date, + reg_npd_date, + dereg_npd_date, + fd.actual as actual from filtered_data fd; Y @@ -280,77 +363,7 @@ from filtered_data fd; - akt_individual_entrepreneur_upsert - InsertUpdate - - N - - 1 - - none - - - 10000 - ervu-dashboard-test - - - = - source_id - source_id - - - ervu_dashboard - individual_entrepreneur
- - recruit_id - recruit_id - N - - - source_id - source_id - N - - - ogrnip - akt_ogrnip - Y - - - source_update_date - akt_source_update_date - Y - - - registration_date - akt_registration_date - Y - - - reg_npd_date - akt_reg_npd_date - Y - - - deregistration_date - akt_dereg_npd_date - Y - - - actual - akt_actual - Y - -
- N - - - 1232 - 464 - -
- - pred_individual_entrepreneur_upsert + individual_entrepreneur_npd_upsert InsertUpdate Y @@ -361,13 +374,61 @@ from filtered_data fd; 10000 - ervu-dashboard-test + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + individual_entrepreneur_npd
+ + recruit_id + recruit_id + N + + + source_id + source_id + N + + + register_date + reg_npd_date + Y + + + deregistration_date + dereg_npd_date + Y + +
+ N + + + 1328 + 624 + +
+ + individual_entrepreneur_upsert + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard = source_id source_id - ervu_dashboard individual_entrepreneur
@@ -383,54 +444,69 @@ from filtered_data fd; ogrnip - pred_ogrnip + ogrnip Y source_update_date - pred_source_update_date + source_update_date Y registration_date - pred_registration_date + registration_date Y deregistration_date - pred_deregistration_date - Y - - - reg_npd_date - pred_reg_npd_date - Y - - - dereg_npd_date - pred_dereg_npd_date + dereg_npd_date Y actual - pred_actual + actual Y
N - 1520 + 1568 464
+ + unique_by_rec_id + UniqueRowsByHashSet + + Y + + 1 + + none + + + N + N + + + + recruit_id + + + + + 1136 + 624 + + - akt_individual_entrepreneur_upsert + individual_entrepreneur_npd_upsert Change job status on error Y - + error_description @@ -438,11 +514,11 @@ from filtered_data fd; - pred_individual_entrepreneur_upsert + individual_entrepreneur_upsert Change job status on error Y - + error_description diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_delta.hpl index d9de951..afcab3f 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_delta.hpl @@ -25,6 +25,11 @@ individual_entrepreneur_flow_delta.hpl Y + + Get_max_source_update_date + Table input + Y + Table input individual_entrepreneur_flow_delta.hpl 2 @@ -46,6 +51,29 @@ Y + + Get_max_source_update_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + select max(source_update_date) + from individual_entrepreneur; + N + + + 368 + 384 + + Table input TableInput @@ -60,12 +88,22 @@ ervu-dashboard-test N 0 + Get_max_source_update_date SELECT - r.idm_id as recruitment_id + r.idm_id as recruitment_id, + ? as max_source_update_date FROM ervu_dashboard.recruitment r - LEFT JOIN public.job_execution je + LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id and job_name = 'individual_entrepreneur_job' +JOIN recruits_info ri + ON COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = r.idm_id + AND ri.updated_at > ( + SELECT MAX(execution_datetime) + FROM etl.job_execution + WHERE job_name = 'individual_entrepreneur_job' + AND recruitment_id = r.idm_id + ) where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); N @@ -103,6 +141,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING individual_entrepreneur_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -159,6 +202,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING individual_entrepreneur_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -215,6 +263,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING individual_entrepreneur_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -271,6 +324,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING individual_entrepreneur_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -327,6 +385,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING individual_entrepreneur_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_repeat.hpl index d7eab5d..f22131b 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/recruitment_five_flow_repeat.hpl @@ -60,9 +60,13 @@ ervu-dashboard-test N 0 - SELECT -idm_id AS recruitment -FROM ervu_dashboard.recruitment; + SELECT r.idm_id AS recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + AND je.job_name = 'individual_entrepreneur_job' +WHERE je.id IS NULL + OR je.status IN ('ERROR', 'PROCESSING'); N @@ -91,7 +95,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + recruitment_id @@ -147,7 +151,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + recruitment_id @@ -203,7 +207,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + recruitment_id @@ -259,7 +263,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + recruitment_id @@ -315,7 +319,7 @@ FROM ervu_dashboard.recruitment; IDM_ID - recruitment + recruitment_id diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_individual_entrepreneur_execution_exists.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_individual_entrepreneur_execution_exists.hpl index 375b3bb..ad8c141 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_individual_entrepreneur_execution_exists.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_individual_entrepreneur_execution_exists.hpl @@ -62,14 +62,13 @@ none - ervu-dashboard-test + ervu-dashboard N 0 SELECT EXISTS ( SELECT 1 FROM etl.job_execution WHERE job_name = 'individual_entrepreneur_job' - limit 1 ) AS job_executed_flag; N diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_need_to_repeat.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_need_to_repeat.hpl index 44e3f9a..ba373bd 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_need_to_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/support/check_if_need_to_repeat.hpl @@ -62,7 +62,7 @@ none - ervu-dashboard-test + ervu-dashboard N 0 SELECT EXISTS (SELECT 1 @@ -71,7 +71,6 @@ FROM ervu_dashboard.recruitment r ON r.idm_id = je.recruitment_id and job_name = 'individual_entrepreneur_job' where je.status is null or je.status in ('ERROR', 'PROCESSING') -limit 1 ) as need_to_repeat_job; N diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl index 32777a0..e40fee1 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl @@ -30,11 +30,6 @@ self_employed_input Y - - akt_self_employed_output - pred_self_employed_output - Y - self_employed_input Identify last row in a stream @@ -42,35 +37,129 @@ Identify last row in a stream - akt_self_employed_output + self_employed_output Y - akt_self_employed_output + self_employed_output Filter rows Y - - pred_self_employed_output - Change job status on success - Y - Filter rows Change job status on success Y - akt_self_employed_output + self_employed_output Change job status on error Y - pred_self_employed_output - Change job status on error + Identify last row in a stream + Detect empty stream + Y + + + Detect empty stream + Change job status on success Y + + Abort + Abort + + Y + + 1 + + none + + + ABORT + Y + 0 + + + 1040 + 384 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + + Y + + N + + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + + 832 + 384 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + + Y + + N + + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + + 1040 + 48 + + Create job execution record ExecSql @@ -84,7 +173,7 @@ - ervu-dashboard-test + ervu-dashboard N @@ -105,8 +194,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - Change job status on success - ExecSql + Detect empty stream + DetectEmptyStream Y @@ -115,254 +204,10 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - - - ervu-dashboard-test - Y - N - Y - N - N - UPDATE etl.job_execution -SET status = 'SUCCESS' -WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - - - - - 1040 - 48 - - - - Abort - Abort - - Y - - 1 - - none - - - ABORT - Y - 0 - - - 1216 - 400 - - - - Change job status on error - ExecSql - - Y - - 1 - - none - - - - - error_description - - - ervu-dashboard-test - Y - N - Y - Y - N - UPDATE etl.job_execution -SET status = 'ERROR', - error_description = ? -WHERE job_name = '${JOB_NAME}' -and recruitment_id = '${IDM_ID}'; - - - - - 1040 - 400 - - - - self_employed_input - TableInput - - Y - - 1 - - none - - - ervu-dashboard-test - N - 0 - with filtered_data as (select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as aktNpd, - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as predNpd - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedNPD' ->> 'npd' != 'null' - -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - limit 1) -select fd.recruit_id, - aktNpd ->> 'id' as akt_source_id, - aktNpd ->> 'dataSved' as akt_source_update_date, - aktNpd ->> 'dataUchNPD' as akt_register_date, - true as akt_actual, - predNpd ->> 'id' as pred_source_id, - predNpd ->> 'dataSved' as pred_source_update_date, - predNpd ->> 'dataUchNPD' as pred_register_date, - predNpd ->> 'dataSnUchNPD' as pred_deregistration_date, - false as pred_actual -from filtered_data fd; - Y - - - 432 - 224 - - - - akt_self_employed_output - TableOutput - - N - - 1 - - none - - - 10000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - source_id - akt_source_id - - - source_update_date - akt_source_update_date - - - register_date - akt_register_date - - - actual - akt_actual - - - N - N - N - N - - Y - - N - ervu_dashboard - Y - self_employed
- - N - Y - N - Y - - - 832 - 224 - -
- - pred_self_employed_output - TableOutput - - Y - - 1 - - none - - - 10000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - source_id - pred_source_id - - - source_update_date - pred_source_update_date - - - register_date - pred_register_date - - - deregistration_date - pred_deregistration_date - - - actual - pred_actual - - - N - N - N - N - - Y - - N - ervu_dashboard - Y - self_employed
- - N - Y - N - Y - - - 1040 - 224 - -
- - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - result 624 - 224 + 48 @@ -380,38 +225,156 @@ from filtered_data fd; - TRUE - result + = + last_row N - + + N + -1 + constant + -1 + Y + Boolean + Change job status on success + + 1040 + 224 + + + + Identify last row in a stream + DetectLastRow + + N + + 1 + + none + + + last_row + + + 624 + 224 + + + + self_employed_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + with filtered_data as (select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as npd_elem, + true as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'aktNPD' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + + union all + + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as npd_elem, + false as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'predNPD' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +select fd.recruit_id, + npd_elem ->> 'id' as source_id, + to_date(npd_elem ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + to_date(npd_elem ->> 'dataUchNPD', 'YYYY-MM-DD') as register_date, + to_date(npd_elem ->> 'dataSnUchNPD', 'YYYY-MM-DD') as deregistration_date, + actual +from filtered_data fd; + Y + + + 432 + 224 + + + + self_employed_output + TableOutput + + N + + 1 + + none + + + 10000 + ervu-dashboard + + + recruit_id + recruit_id + + + source_id + source_id + + + source_update_date + source_update_date + + + register_date + register_date + + + deregistration_date + deregistration_date + + + actual + actual + + + N + N + N + N + + Y + + N + ervu_dashboard + Y + self_employed
+ + N + Y + N + Y + 832 - 48 + 224
- akt_self_employed_output + self_employed_output Change job status on error Y - - - - - - - - - pred_self_employed_output - Change job status on error - Y - - + error_description diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl index 5f4390a..5d0789d 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl @@ -22,21 +22,11 @@ Create job execution record - Table input + self_employed_input Y self_employed_upsert - pred_self_employed_upsert - Y - - - self_employed_upsert - Change job status on error - Y - - - pred_self_employed_upsert Change job status on error Y @@ -46,7 +36,7 @@ Y - Table input + self_employed_input Identify last row in a stream Y @@ -66,11 +56,36 @@ Y - pred_self_employed_upsert + Detect empty stream Change job status on success Y + + Identify last row in a stream + Detect empty stream + Y + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1040 + 416 + + Change job status on error ExecSql @@ -87,12 +102,9 @@ error_description - ervu-dashboard-test - + ervu-dashboard Y - N - Y Y N @@ -103,11 +115,10 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 1040 - 432 + 848 + 416 @@ -123,7 +134,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard Y N Y @@ -154,7 +165,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard N N Y @@ -163,20 +174,19 @@ and recruitment_id = '${IDM_ID}'; UPDATE etl.job_execution SET status = 'DELTA_PROCESSING', - execution_datetime = DEFAULT, - error_description = NULL, - error_code = NULL + execution_datetime = current_timestamp, + error_description = NULL where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 256 + 272 224 - Table input - TableInput + Detect empty stream + DetectEmptyStream Y @@ -185,188 +195,10 @@ and recruitment_id = '${IDM_ID}'; none - ervu-dashboard-test - N - 0 - with filtered_data as (select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as aktNpd, - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as predNpd - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedNPD' ->> 'npd' != 'null' - -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - --and ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' ->> 'dataSved' > '${MAX_SOURCE_UPDATE_DATE}' - --or ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' ->> 'dataSved' > '${MAX_SOURCE_UPDATE_DATE}' - limit 1) -select fd.recruit_id, - aktNpd ->> 'id' as akt_source_id, - aktNpd ->> 'dataSved' as akt_source_update_date, - aktNpd ->> 'dataUchNPD' as akt_register_date, - true as akt_actual, - predNpd ->> 'id' as pred_source_id, - predNpd ->> 'dataSved' as pred_source_update_date, - predNpd ->> 'dataUchNPD' as pred_register_date, - predNpd ->> 'dataSnUchNPD' as pred_deregistration_date, - false as pred_actual -from filtered_data fd; - Y - - - 464 - 224 - - - - self_employed_upsert - InsertUpdate - - N - - 1 - - none - - - 10000 - ervu-dashboard-test - - - = - source_id - akt_source_id - - - ervu_dashboard - self_employed
- - recruit_id - recruit_id - N - - - source_id - akt_source_id - N - - - source_update_date - akt_source_update_date - Y - - - register_date - akt_register_date - Y - - - actual - akt_actual - Y - -
- N - - - 816 - 224 - -
- - pred_self_employed_upsert - InsertUpdate - - Y - - 1 - - none - - - 10000 - ervu-dashboard-test - - - = - source_id - akt_source_id - - - ervu_dashboard - self_employed
- - recruit_id - recruit_id - N - - - source_id - pred_source_id - N - - - source_update_date - pred_source_update_date - Y - - - register_date - pred_register_date - Y - - - deregistration_date - pred_deregistration_date - Y - - - actual - pred_actual - Y - -
- N - - - 1040 - 224 - -
- - Abort - Abort - - Y - - 1 - - none - - - ABORT_WITH_ERROR - Y - - 0 - - - 1296 - 432 - - - - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - result 624 - 224 + 16 @@ -384,17 +216,143 @@ from filtered_data fd; - TRUE - result + = + last_row N - + + N + -1 + constant + -1 + Y + Boolean + Change job status on success - 816 - 16 + 1040 + 224 + + + + Identify last row in a stream + DetectLastRow + + N + + 1 + + none + + + last_row + + + 624 + 224 + + + + self_employed_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + with filtered_data as (select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as npd_elem, + true as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'aktNPD' != 'null' + and + to_date(ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' ->> 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + + union all + + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as npd_elem, + false as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'predNPD' != 'null' + and to_date(ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' ->> 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +select fd.recruit_id, + npd_elem ->> 'id' as source_id, + to_date(npd_elem ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + to_date(npd_elem ->> 'dataUchNPD', 'YYYY-MM-DD') as register_date, + to_date(npd_elem ->> 'dataSnUchNPD', 'YYYY-MM-DD') as deregistration_date, + actual +from filtered_data fd; + Y + + + 448 + 224 + + + + self_employed_upsert + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard + + + = + source_id + source_id + + ervu_dashboard + self_employed
+ + recruit_id + recruit_id + N + + + source_id + source_id + N + + + source_update_date + source_update_date + Y + + + register_date + register_date + Y + + + actual + actual + Y + +
+ N + + + 848 + 224
@@ -403,19 +361,7 @@ from filtered_data fd; Change job status on error Y - - - - - - -
- - pred_self_employed_upsert - Change job status on error - Y - - + error_description diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl similarity index 69% rename from mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl rename to mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl index b84e7fe..405ec68 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl @@ -1,7 +1,7 @@ - self_employed_flow_on_error + self_employed_flow_repeat Y @@ -42,34 +42,29 @@ Identify last row in a stream - akt_self_employed_output + self_employed_output Y - akt_self_employed_output - pred_self_employed_output - Y - - - akt_self_employed_output + self_employed_output Filter rows Y - pred_self_employed_output + self_employed_output + Change job status on error + Y + + + Identify last row in a stream + Detect empty stream + Y + + + Detect empty stream Change job status on success Y - - pred_self_employed_output - Change job status on error - Y - - - akt_self_employed_output - Change job status on error - Y - Abort @@ -87,8 +82,8 @@ 0 - 1248 - 592 + 1072 + 576 @@ -107,7 +102,7 @@ error_description - ervu-dashboard-test + ervu-dashboard Y N Y @@ -122,8 +117,8 @@ and recruitment_id = '${IDM_ID}'; - 1072 - 592 + 864 + 576 @@ -139,7 +134,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard Y N Y @@ -170,22 +165,42 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard N N Y N N INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) -VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - - +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}') +ON CONFLICT (job_name, recruitment_id) +DO UPDATE +SET status = 'PROCESSING', + error_description = null, + execution_datetime = current_timestamp; 256 416 + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 656 + 240 + + Filter rows FilterRows @@ -202,30 +217,38 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); TRUE - result + last_row N - + + N + -1 + constant + -1 + Y + Boolean + Change job status on success - 864 - 240 + 1072 + 416 Identify last row in a stream DetectLastRow - Y + N 1 none - result + last_row 656 @@ -243,26 +266,30 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - ervu-dashboard-test + ervu-dashboard N 0 with filtered_data as (select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as aktNpd, - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as predNpd + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as npd_elem, + true as actual from recruits_info ri - where ri.info -> 'svedFL' -> 'svedNPD' ->> 'npd' != 'null' - -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' - limit 1) + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'aktNPD' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + + union all + + select ri.recruit_id, + ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as npd_elem, + false as actual + from recruits_info ri + where ri.info -> 'svedFL' -> 'svedNPD' ->> 'predNPD' != 'null' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') select fd.recruit_id, - aktNpd ->> 'id' as akt_source_id, - aktNpd ->> 'dataSved' as akt_source_update_date, - aktNpd ->> 'dataUchNPD' as akt_register_date, - true as akt_actual, - predNpd ->> 'id' as pred_source_id, - predNpd ->> 'dataSved' as pred_source_update_date, - predNpd ->> 'dataUchNPD' as pred_register_date, - predNpd ->> 'dataSnUchNPD' as pred_deregistration_date, - false as pred_actual + npd_elem ->> 'id' as source_id, + to_date(npd_elem ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + to_date(npd_elem ->> 'dataUchNPD', 'YYYY-MM-DD') as register_date, + to_date(npd_elem ->> 'dataSnUchNPD', 'YYYY-MM-DD') as deregistration_date, + actual from filtered_data fd; Y @@ -272,7 +299,7 @@ from filtered_data fd; - akt_self_employed_output + self_employed_output InsertUpdate N @@ -283,13 +310,12 @@ from filtered_data fd; 10000 - ervu-dashboard-test + ervu-dashboard = source_id - akt_source_id - + source_id ervu_dashboard self_employed
@@ -300,22 +326,22 @@ from filtered_data fd; source_id - akt_source_id - Y + source_id + N source_update_date - akt_source_update_date + source_update_date Y register_date - akt_register_date + register_date Y actual - akt_actual + actual Y
@@ -326,85 +352,13 @@ from filtered_data fd; 416
- - pred_self_employed_output - InsertUpdate - - Y - - 1 - - none - - - 10000 - ervu-dashboard-test - - - = - source_id - pred_source_id - - - ervu_dashboard - self_employed
- - recruit_id - recruit_id - N - - - source_id - pred_source_id - Y - - - source_update_date - pred_source_update_date - Y - - - register_date - pred_register_date - Y - - - deregistration_date - pred_deregistration_date - Y - - - actual - pred_actual - Y - -
- N - - - 1072 - 416 - -
- akt_self_employed_output + self_employed_output Change job status on error Y - - - - - - - - - pred_self_employed_output - Change job status on error - Y - - + error_description diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow_delta.hpl index ced7307..a5979c8 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/recruitment_five_flow_delta.hpl @@ -20,6 +20,11 @@ + + Get_max_source_update_date + Table input + Y + Table input self_employed_flow_delta.hpl @@ -46,6 +51,29 @@ Y + + Get_max_source_update_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + select max(source_update_date) + from self_employed; + N + + + 208 + 496 + + Table input TableInput @@ -57,20 +85,30 @@ none - ervu-dashboard-test + ervu-dashboard N 0 + Get_max_source_update_date SELECT - r.idm_id as recruitment_id + r.idm_id AS recruitment_id, + ? as max_source_update_date FROM ervu_dashboard.recruitment r - LEFT JOIN public.job_execution je + LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id - and job_name = 'self_employed_job' -where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + AND je.job_name = 'self_employed_job' + JOIN recruits_info ri + ON COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = r.idm_id + AND ri.updated_at > ( + SELECT MAX(execution_datetime) + FROM etl.job_execution + WHERE job_name = 'self_employed_job' + AND recruitment_id = r.idm_id + ) +WHERE je.status IN ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); N - 416 + 384 496 @@ -103,6 +141,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING self_employed_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -159,6 +202,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING self_employed_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -215,6 +263,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING self_employed_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -271,6 +324,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING self_employed_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -327,6 +385,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING self_employed_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/recruitments_five_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/recruitments_five_flow_repeat.hpl index 7d0f996..683de97 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/recruitments_five_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/recruitments_five_flow_repeat.hpl @@ -22,27 +22,27 @@ Table input - self_employed_flow_on_error.hpl + self_employed_flow_repeat.hpl Y Table input - self_employed_flow_on_error.hpl 2 + self_employed_flow_repeat.hpl 2 Y Table input - self_employed_flow_on_error.hpl 3 + self_employed_flow_repeat.hpl 3 Y Table input - self_employed_flow_on_error.hpl 4 + self_employed_flow_repeat.hpl 4 Y Table input - self_employed_flow_on_error.hpl 5 + self_employed_flow_repeat.hpl 5 Y @@ -75,7 +75,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); - self_employed_flow_on_error.hpl + self_employed_flow_repeat.hpl PipelineExecutor Y @@ -86,7 +86,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl N 1 @@ -101,7 +101,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + self_employed_job Y @@ -131,7 +131,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); - self_employed_flow_on_error.hpl 2 + self_employed_flow_repeat.hpl 2 PipelineExecutor Y @@ -142,7 +142,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl N 1 @@ -157,7 +157,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + self_employed_job Y @@ -187,7 +187,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); - self_employed_flow_on_error.hpl 3 + self_employed_flow_repeat.hpl 3 PipelineExecutor Y @@ -198,7 +198,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl N 1 @@ -213,7 +213,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + self_employed_job Y @@ -243,7 +243,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); - self_employed_flow_on_error.hpl 4 + self_employed_flow_repeat.hpl 4 PipelineExecutor Y @@ -254,7 +254,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl N 1 @@ -269,7 +269,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + self_employed_job Y @@ -299,7 +299,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); - self_employed_flow_on_error.hpl 5 + self_employed_flow_repeat.hpl 5 PipelineExecutor Y @@ -310,7 +310,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); local - ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_on_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl N 1 @@ -325,7 +325,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING'); JOB_NAME - work_activity_job + self_employed_job Y diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_need_to_repeat.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_need_to_repeat.hpl index 652acfd..a7a966c 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_need_to_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_need_to_repeat.hpl @@ -62,7 +62,7 @@ none - ervu-dashboard-test + ervu-dashboard N 0 SELECT EXISTS (SELECT 1 diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_self_employed_job_execution_exists.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_self_employed_job_execution_exists.hpl index e02aaf2..494e70f 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_self_employed_job_execution_exists.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/support/check_if_self_employed_job_execution_exists.hpl @@ -62,7 +62,7 @@ none - ervu-dashboard-test + ervu-dashboard N 0 SELECT EXISTS ( diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl index c21323a..3b7cbfc 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl @@ -20,51 +20,11 @@ - - individual_entrepreneur_input - akt_individual_entrepreneur_output - Y - - - npd_input - akt_npd_output - Y - - - employer_input - actual_employer_output - Y - - - employer_input - pred_employer_output - Y - - - npd_input - pred_npd_output - Y - - - individual_entrepreneur_input - Table output - Y - - - citizen_work_activity_output - employee_parental_leave_output - Y - Create job execution record citizen_work_activity_input Y - - employee_parental_leave_output - Change job status on error - Y - citizen_work_activity_output Change job status on error @@ -75,11 +35,6 @@ Abort Y - - employee_parental_leave_output - Change job status on success - Y - citizen_work_activity_input Identify last row in a stream @@ -100,6 +55,31 @@ Change job status on success Y + + Identify last row in a stream + Detect empty stream + Y + + + Detect empty stream + Filter rows + Y + + + Identify last row in a stream + Filter_null_parental_leave_dates + Y + + + Filter_null_parental_leave_dates + employee_parental_leave_output + Y + + + employee_parental_leave_output + Change job status on error + Y + Abort @@ -117,7 +97,7 @@ 0 - 1248 + 1424 528 @@ -137,7 +117,7 @@ error_description - ervu-dashboard-test + ervu-dashboard Y N Y @@ -152,7 +132,7 @@ and recruitment_id = '${IDM_ID}'; - 1056 + 1200 528 @@ -169,7 +149,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard Y N Y @@ -183,7 +163,7 @@ and recruitment_id = '${IDM_ID}'; - 1168 + 1424 144 @@ -200,7 +180,7 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test + ervu-dashboard N N Y @@ -217,8 +197,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - Table output - TableOutput + Detect empty stream + DetectEmptyStream Y @@ -227,29 +207,15 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - 1000 - - - N - N - N - N - Y - N - N - N - Y - N - Y - 976 - 1376 + 704 + 144 - actual_employer_output - TableOutput + Filter rows + FilterRows Y @@ -258,84 +224,34 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - 10000 - ervu-dashboard-test - - - source_id - source_id - - - recruit_id - recruit_id - - - source_update_date - akt_source_update_date - - - address - akt_address - - - separate_unit_type_code - akt_separate_unit_type_code - - - separate_unit_address - akt_separate_unit_address - - - employer_category_name - akt_employer_category_name - - - name - akt_name - - - inn - akt_inn - - - ogrn - akt_ogrn - - - kpp - akt_kpp - - - actual_employer - akt_actual_employer - - - is_opk_org - akt_is_opk_org - - - N - N - N - N - Y - N - ervu_dashboard - Y - employer
- N - Y - N - Y + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success - 976 - 816 + 1200 + 144
- akt_individual_entrepreneur_output - TableOutput + Filter_null_parental_leave_dates + FilterRows Y @@ -344,113 +260,39 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - 10000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - source_id - source_id - - - ogrnip - akt_ogrnip - - - source_update_date - akt_source_update_date - - - registration_date - akt_registration_date - - - reg_npd_date - akt_reg_npd_date - - - dereg_npd_date - akt_dereg_npd_date - - - actual - akt_actual - - - N - N - N - N - Y - N - ervu_dashboard - Y - individual_entrepreneur
- N - Y - N - Y + + + + + IS NOT NULL + parental_leave_start_date + N + - + + + employee_parental_leave_output - 976 - 1248 + 704 + 528
- akt_npd_output - TableOutput + Identify last row in a stream + DetectLastRow - Y + N 1 none - 10000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - source_id - akt_source_id - - - source_update_date - akt_source_update_id - - - register_date - akt_register_date - - - actual - akt_actual - - - N - N - N - N - Y - N - ervu_dashboard - Y - self_employed
- N - Y - N - Y + last_row - 976 - 1056 + 704 + 320
@@ -464,35 +306,36 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - ervu-dashboard-test + ervu-dashboard N - with filteredData as ( - select ri.recruit_id, - ri.info - from recruits_info ri - where jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' - and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' -) -SELECT - fd.recruit_id, - trud_elem ->> 'id' AS source_id, - trud_elem -> 'svedOrg' ->> 'naimOrg' AS employer_name, - trud_elem ->> 'trudFunkcziya' AS position, - trud_elem ->> 'dataMeropr' AS personnel_event_date, - trud_elem ->> 'naimTipKadrMeropr' AS personnel_event_type, - trud_elem ->> 'dataSved' AS source_update_date, - (trud_elem ->> 'prAktMestRab') = '1' AS actual_employer, - uhod_elem ->> 'dataNachUhodReb' AS parental_leave_start_date, - uhod_elem ->> 'dataKonUhodReb' AS parental_leave_end_date -from filteredData fd - cross join jsonb_array_elements(fd.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') as trud_elem - LEFT JOIN LATERAL jsonb_array_elements( - CASE - WHEN jsonb_typeof(trud_elem -> 'svedUhodReb') = 'array' - THEN trud_elem -> 'svedUhodReb' - ELSE '[]'::jsonb - END - ) AS uhod_elem ON true; + WITH filteredData AS (SELECT ri.recruit_id, + trud_elem, + uhod_elem + FROM recruits_info ri + CROSS JOIN LATERAL jsonb_array_elements( + ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' + ) AS trud_elem + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(trud_elem -> 'svedUhodReb') = 'array' + THEN trud_elem -> 'svedUhodReb' + ELSE '[]'::jsonb + END + ) AS uhod_elem ON true + WHERE jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +SELECT fd.recruit_id, + trud_elem ->> 'id' AS source_id, + trud_elem -> 'svedOrg' ->> 'naimOrg' AS employer_name, + trud_elem ->> 'trudFunkcziya' AS position, + to_date(trud_elem ->> 'dataMeropr', 'YYYY-MM-DD') AS personnel_event_date, + trud_elem ->> 'naimTipKadrMeropr' AS personnel_event_type, + to_date(trud_elem ->> 'dataSved', 'YYYY-MM-DD') AS source_update_date, + (trud_elem ->> 'prAktMestRab') = '1' AS actual_employer, + to_date(uhod_elem ->> 'dataNachUhodReb', 'YYYY-MM-DD') AS parental_leave_start_date, + to_date(uhod_elem ->> 'dataKonUhodReb', 'YYYY-MM-DD') AS parental_leave_end_date +FROM filteredData fd; + Y @@ -504,7 +347,7 @@ from filteredData fd citizen_work_activity_output TableOutput - N + Y 1 @@ -512,7 +355,7 @@ from filteredData fd 10000 - ervu-dashboard-test + ervu-dashboard source_id @@ -562,7 +405,7 @@ from filteredData fd Y - 944 + 1200 320 @@ -578,18 +421,18 @@ from filteredData fd 10000 - ervu-dashboard-test + ervu-dashboard citizen_work_activity_source_id source_id - start_date + parental_leave_start_date parental_leave_start_date - end_date + parental_leave_end_date parental_leave_end_date @@ -608,451 +451,17 @@ from filteredData fd Y - 1168 - 320 - - - - employer_input - TableInput - - N - - 1 - - none - - - ervu-dashboard-test - N - 0 - with filteredData as ( - select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id' as source_id, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat, - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedRabotodat' ->> 'rabotodat' != 'null' - -- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' -) -select - fd.source_id, - fd.recruit_id, --- aktRabotodat - aktRabotodat -> 'dataSved' as akt_source_update_date, - aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, - aktRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as akt_separate_unit_type, - aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address, - case - when aktRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' - when aktRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' - when aktRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' - when aktRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' - END - as akt_employer_category_name, - case - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'naimOrg' - END - as akt_name, - case - when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'svedIP' ->> 'innfl' - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' ->> 'innyul' - when aktRabotodat ->> 'svedGlKFH' != 'null' then aktRabotodat -> 'svedGlKFH' ->> 'innfl' - when aktRabotodat ->> 'svedPlatFL' != 'null' then aktRabotodat -> 'svedPlatFL' ->> 'innfl' - END - as akt_inn, - case - when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedIP' ->> 'ogrnip' - END - as akt_ogrn, - case - when aktRabotodat ->> 'svedIP' != 'null' then aktRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' - END - as akt_kpp, - true as akt_actual_employer, - case - when aktRabotodat ->> 'svedYUL' != 'null' then aktRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' - END - as akt_is_opk_org, --- predRabotodat - predRabotodat -> 'dataSved' as pred_source_update_date, - predRabotodat -> 'extend' ->> 'adresRabotodat' as pred_address, - predRabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as pred_separate_unit_type_code, - predRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as pred_separate_unit_address, - case - when predRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' - when predRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' - when predRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ' - when predRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо' - END - as pred_employer_category_name, - case - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'naimOrg' - END - as pred_name, - case - when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'svedIP' ->> 'innfl' - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' ->> 'innyul' - when predRabotodat ->> 'svedGlKFH' != 'null' then predRabotodat -> 'svedGlKFH' ->> 'innfl' - when predRabotodat ->> 'svedPlatFL' != 'null' then predRabotodat -> 'svedPlatFL' ->> 'innfl' - END - as pred_inn, - case - when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn' - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedIP' ->> 'ogrnip' - END - as pred_ogrn, - case - when predRabotodat ->> 'svedIP' != 'null' then predRabotodat -> 'extend' -> 'svedYUL' ->> 'kpp' - END - as pred_kpp, - false as akt_actual_employer, - case - when predRabotodat ->> 'svedYUL' != 'null' then predRabotodat -> 'svedYUL' -> 'extend' -> 'priznakOpk' - END - as pred_is_opk_org -from filteredData fd; - Y - - - 752 - 848 - - - - individual_entrepreneur_input - TableInput - - N - - 1 - - none - - - ervu-dashboard-test - N - 0 - with filtered_data as ( - select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' ->> 'id' as source_id, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 as aktIp, - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' as predIp - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedRegIP' ->> 'regIP' != 'null' --- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' -) -select - fd.recruit_id, - fd.source_id, - aktIp ->> 'ogrnip' as akt_ogrnip, - aktIp ->> 'dataSved' as akt_source_update_date, - aktIp ->> 'dataRegIP' as akt_registration_date, - aktIp -> 'extend' ->> 'dataUchNPD' as akt_reg_npd_date, - aktIp -> 'extend' ->> 'dataSnUchNPD' as akt_dereg_npd_date, - true as akt_actual, - predIp ->> 'ogrnip' as pred_ogrnip, - predIp ->> 'dataSved' as pred_source_update_date, - predIp ->> 'dataRegIP' as pred_registration_date, - predIp ->> 'dataINNNed' as pred_deregistration_date, - predIp -> 'extend' ->> 'dataUchNPD' as pred_reg_npd_date, - predIp -> 'extend' ->> 'dataSnUchNPD' as pred_dereg_npd_date, - false as pred_actual -from filtered_data fd; - Y - - - 752 - 1312 - - - - npd_input - TableInput - - N - - 1 - - none - - - ervu-dashboard-test - N - 0 - with filtered_data as ( - select ri.recruit_id, - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD' as aktNpd, - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' as predNpd - from recruits_info ri - where ri.info -> 'svedFL' -> 'svedNPD' ->> 'npd' != 'null' --- and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' -) -select - fd.recruit_id, - aktNpd ->> 'id' as akt_source_id, - aktNpd ->> 'dataSved' as akt_source_update_id, - aktNpd ->> 'dataUchNPD' as akt_register_date, - true as akt_actual, - predNpd ->> 'id' as pred_source_id, - predNpd ->> 'dataSved' as pred_source_update_id, - predNpd ->> 'dataUchNPD' as pred_register_date, - predNpd ->> 'dataSnUchNPD' as pred_deregistration_date, - false as pred_actual -from filtered_data fd; - - Y - - - 752 - 1104 - - - - pred_employer_output - TableOutput - - Y - - 1 - - none - - - 10000 - ervu-dashboard-test - - - source_id - source_id - - - recruit_id - recruit_id - - - source_update_date - pred_source_update_date - - - address - pred_address - - - separate_unit_type_code - pred_separate_unit_type - - - separate_unit_address - pred_separate_unit_address - - - employer_category_name - pred_employer_category_name - - - name - pred_name - - - inn - pred_inn - - - ogrn - pred_ogrn - - - kpp - pred_kpp - - - actual_employer - pred_actual_employer - - - is_opk_org - pred_is_opk_org - - - N - N - N - N - Y - N - ervu_dashboard - Y - employer
- N - Y - N - Y - - - 976 - 912 - -
- - pred_npd_output - TableOutput - - Y - - 1 - - none - - - 10000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - source_id - pred_source_id - - - source_update_date - pred_source_update_id - - - register_date - pred_register_date - - - deregistration_date - pred_deregistration_date - - - actual - pred_actual - - - N - N - N - N - Y - N - ervu_dashboard - Y - self_employed
- N - Y - N - Y - - - 976 - 1168 - -
- - Identify last row in a stream - DetectLastRow - - Y - - 1 - - none - - - result - - - 704 - 320 - - - - Filter rows - FilterRows - - Y - - 1 - - none - - - - - - - = - N - - - - - Change job status on success - - - 944 - 144 + 960 + 528 - - Table output - Change job status on error - N - - - - - - - - - - actual_employer_output - Change job status on error - N - - - - - - - - - - akt_individual_entrepreneur_output - Change job status on error - N - - - - - - - - - - akt_npd_output - Change job status on error - N - - - - - - - - citizen_work_activity_output Change job status on error Y - + error_description @@ -1064,19 +473,7 @@ from filtered_data fd; Change job status on error Y - - - - - - - - - pred_npd_output - Change job status on error - N - - + error_description diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl index 9ce3108..b3c17de 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl @@ -22,22 +22,57 @@ Create job execution record - Table input + citizen_work_activity_input Y - Table input - Table output + Identify last row in a stream + Detect empty stream Y - Table output + Identify last row in a stream + Filter_null_parental_leave_dates + Y + + + citizen_work_activity_input + Identify last row in a stream + Y + + + Detect empty stream + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Identify last row in a stream + citizen_work_activity_upsert + Y + + + Filter_null_parental_leave_dates + parental_leave_upsert + Y + + + citizen_work_activity_upsert + Change job status on success + Y + + + citizen_work_activity_upsert Change job status on error Y - Table output - Change job status on success + parental_leave_upsert + Change job status on error Y @@ -60,12 +95,9 @@ error_code - ervu-dashboard-test - + ervu-dashboard Y - N - Y Y N @@ -77,11 +109,10 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 1040 - 416 + 1296 + 432 @@ -97,12 +128,9 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test - + ervu-dashboard Y - N - Y N N @@ -112,11 +140,10 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 1040 - 224 + 1296 + 48 @@ -132,24 +159,19 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test - + ervu-dashboard N - N - Y N N UPDATE etl.job_execution SET status = 'DELTA_PROCESSING', - execution_datetime = DEFAULT, - error_description = NULL, - error_code = NULL + execution_datetime = current_timestamp, + error_description = NULL where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 336 @@ -157,7 +179,106 @@ and recruitment_id = '${IDM_ID}'; - Table input + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 752 + 48 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 48 + + + + Filter_null_parental_leave_dates + FilterRows + + Y + + 1 + + none + + + + + + + IS NOT NULL + parental_leave_start_date + N + - + + + parental_leave_upsert + + + 752 + 432 + + + + Identify last row in a stream + DetectLastRow + + N + + 1 + + none + + + last_row + + + 752 + 224 + + + + citizen_work_activity_input TableInput Y @@ -167,87 +288,37 @@ and recruitment_id = '${IDM_ID}'; none - ervu-dashboard-test + ervu-dashboard N - 10 - WITH trud_info AS (SELECT ri.info, - ri.recruit_id::uuid, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL - WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' THEN - ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 - END AS trud_deyat, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL - WHEN - jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb') = - 'array' THEN - ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb' -> 0 - END AS parental_leave_info, - - COALESCE( - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat', - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' - ) AS employer, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' IS NULL THEN NULL - WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP') = 'array' - THEN - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 - ELSE - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' - END AS reg_ip, - - COALESCE( - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD', - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' - ) AS self_employment - - FROM ervu_dashboard.recruits_info ri - + WITH filteredData AS (SELECT ri.recruit_id, + trud_elem, + uhod_elem + FROM recruits_info ri + CROSS JOIN LATERAL jsonb_array_elements( + ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' + ) AS trud_elem + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(trud_elem -> 'svedUhodReb') = 'array' + THEN trud_elem -> 'svedUhodReb' + ELSE '[]'::jsonb + END + ) AS uhod_elem ON true + WHERE jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' + --AND to_date(trud_elem ->> 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' + --AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' ) -SELECT ti.recruit_id::uuid, - (ti.trud_deyat ->> 'dataMeropr')::date AS personnel_event_date, - ti.trud_deyat ->> 'naimTipKadrMeropr' AS personnel_event_type, - (ti.trud_deyat ->> 'prAktMestRab' = '1') AS current_workplace, - ti.trud_deyat ->> 'trudFunkcziya' AS position, - ti.trud_deyat -> 'svedOrg' ->> 'naimOrg' AS employer_name, - ti.employer -> 'svedYUL' ->> 'kpp' AS employer_kpp, - CASE - WHEN ti.employer->'svedYUL' IS NOT NULL THEN 'Юридическое лицо' - WHEN ti.employer->'svedIP' IS NOT NULL THEN 'Индивидуальный предприниматель' - END AS employer_category, - COALESCE( - ti.employer -> 'svedYUL' ->> 'innyul', - ti.employer -> 'svedIP' ->> 'innyfl' - ) AS employer_inn, - ti.employer -> 'svedYUL' -> 'svedOPK' ->> 'region' AS employer_address, - COALESCE( - ti.employer -> 'svedIP' ->> 'ogrnip', - ti.employer -> 'svedYUL' -> 'extend' ->> 'ogrn' - ) AS employer_ogrnip, - ti.employer -> 'extend' ->> 'tipPodrazdRabotodat' AS employer_unit_type, - ti.employer -> 'extend' ->> 'adresPodrazdRabotodat' AS employer_unit_address, - (ti.parental_leave_info ->> 'dataNachUhodReb')::date AS parental_leave_start_date, - (ti.parental_leave_info ->> 'dataKonUhodReb')::date AS parental_leave_end_date, - ( - (ti.parental_leave_info ->> 'dataNachUhodReb')::date <= current_date AND - ( - (ti.parental_leave_info ->> 'dataKonUhodReb') IS NULL OR - (ti.parental_leave_info ->> 'dataKonUhodReb')::date > current_date - ) - ) AS parental_leave_active, - (ti.reg_ip ->> 'dataRegIP')::date AS reg_ip_date, - (ti.reg_ip ->> 'dataINNNed')::date AS dereg_ip_date, - ti.reg_ip ->> 'ogrnip' AS ogrnip_ip, - ti.reg_ip IS NOT NULL AS active_ip, - ti.self_employment ->> 'dataUchNPD' AS reg_self_employment_date, - ti.self_employment ->> 'dataSnUchNPD' AS dereg_self_employment_date, - ti.self_employment IS NOT NULL AS active_self_employment -FROM trud_info ti; +SELECT fd.recruit_id, + trud_elem ->> 'id' AS source_id, + trud_elem -> 'svedOrg' ->> 'naimOrg' AS employer_name, + trud_elem ->> 'trudFunkcziya' AS position, + to_date(trud_elem ->> 'dataMeropr', 'YYYY-MM-DD') AS personnel_event_date, + trud_elem ->> 'naimTipKadrMeropr' AS personnel_event_type, + to_date(trud_elem ->> 'dataSved', 'YYYY-MM-DD') AS source_update_date, + (trud_elem ->> 'prAktMestRab') = '1' AS actual_employer, + to_date(uhod_elem ->> 'dataNachUhodReb', 'YYYY-MM-DD') AS parental_leave_start_date, + to_date(uhod_elem ->> 'dataKonUhodReb', 'YYYY-MM-DD') AS parental_leave_end_date +FROM filteredData fd; Y @@ -257,8 +328,8 @@ FROM trud_info ti; - Table output - TableOutput + citizen_work_activity_upsert + InsertUpdate Y @@ -267,130 +338,129 @@ FROM trud_info ti; none - 1000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - personnel_event_date - personnel_event_date - - - personnel_event_type - personnel_event_type - - - current_workplace - current_workplace - - - position - position - - - employer_name - employer_name - - - employer_kpp - employer_kpp - - - employer_category - employer_category - - - employer_inn - employer_inn - - - employer_address - employer_address - - - employer_ogrnip - employer_ogrnip - - - employer_unit_type - employer_unit_type - - - employer_unit_address - employer_unit_address - - - parental_leave_start_date - parental_leave_start_date - - - parental_leave_end_date - parental_leave_end_date - - - parental_leave_active - parental_leave_active - - - reg_ip_date - reg_ip_date - - - dereg_ip_date - dereg_ip_date - - - ogrnip_ip - ogrnip_ip - - - active_ip - active_ip - - - reg_self_employment_date - reg_self_employment_date - - - dereg_self_employment_date - dereg_self_employment_date - - - active_self_employment - active_self_employment - - - N - N - N - N - Y - N - ervu_dashboard - Y - citizen_work_activity
- N - Y - N - Y + 10000 + ervu-dashboard + + + = + source_id + source_id + + ervu_dashboard + citizen_work_activity
+ + recruit_id + recruit_id + N + + + source_id + source_id + N + + + employer_name + employer_name + Y + + + position + position + Y + + + personnel_event_date + personnel_event_date + Y + + + personnel_event_type + personnel_event_type + Y + + + source_update_date + source_update_date + Y + + + actual_employer + actual_employer + Y + +
+ N - 768 + 1040 224
+ + parental_leave_upsert + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard + + + = + citizen_work_activity_source_id + source_id + + ervu_dashboard + employee_parental_leave
+ + start_date + parental_leave_start_date + Y + + + end_date + parental_leave_end_date + Y + + + citizen_work_activity_source_id + source_id + N + +
+ N + + + 1040 + 432 + +
- Table output + citizen_work_activity_upsert Change job status on error Y error_description - error_code + + + + + + + parental_leave_upsert + Change job status on error + Y + + error_description + + diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl index a4a1f14..4c3da16 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl @@ -20,23 +20,58 @@ + + Detect empty stream + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Identify last row in a stream + Detect empty stream + Y + + + Identify last row in a stream + Filter_null_parental_leave_dates + Y + + + citizen_work_activity_input + Identify last row in a stream + Y + Create job execution record - Table input + citizen_work_activity_input Y - Table input - Table output + Identify last row in a stream + citizen_work_activity_upsert Y - Table output + Filter_null_parental_leave_dates + parental_leave_upsert + Y + + + parental_leave_upsert Change job status on error Y - Table output + citizen_work_activity_upsert + Change job status on error + Y + + + citizen_work_activity_upsert Change job status on success Y @@ -60,27 +95,24 @@ error_code - ervu-dashboard-test - + ervu-dashboard Y - N - Y Y N UPDATE etl.job_execution -SET status = 'ERROR', - error_description = ? +SET status = 'DELTA_ERROR', + error_description = ?, + error_code = ? WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 976 - 400 + 1312 + 704 @@ -96,26 +128,22 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test - + ervu-dashboard Y - N - Y N N UPDATE etl.job_execution -SET status = 'SUCCESS' +SET status = 'DELTA_SUCCESS' WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - - 976 - 208 + 1312 + 320 @@ -131,48 +159,126 @@ and recruitment_id = '${IDM_ID}'; - ervu-dashboard-test - + ervu-dashboard N - N - Y N N - INSERT INTO etl.job_execution ( - id, - job_name, - status, - execution_datetime, - error_description, - error_code, - recruitment_id -) -VALUES ( - DEFAULT, - '${JOB_NAME}', - 'PROCESSING', - DEFAULT, - NULL, - NULL, - '${IDM_ID}' -) + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}') ON CONFLICT (job_name, recruitment_id) -DO UPDATE SET - status = 'PROCESSING', - execution_datetime = DEFAULT, - error_description = NULL, - error_code = NULL; - +DO UPDATE +SET status = 'PROCESSING', + error_description = null, + execution_datetime = current_timestamp; - 272 - 208 + 304 + 496 - Table input + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 768 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1040 + 320 + + + + Filter_null_parental_leave_dates + FilterRows + + Y + + 1 + + none + + + + + + + IS NOT NULL + parental_leave_start_date + N + - + + + parental_leave_upsert + + + 768 + 704 + + + + Identify last row in a stream + DetectLastRow + + N + + 1 + + none + + + last_row + + + 768 + 496 + + + + citizen_work_activity_input TableInput Y @@ -182,98 +288,46 @@ DO UPDATE SET none - ervu-dashboard-test + ervu-dashboard N - 10 - WITH trud_info AS (SELECT ri.info, - ri.recruit_id::uuid, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL - WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' THEN - ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 - END AS trud_deyat, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' IS NULL THEN NULL - WHEN - jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb') = - 'array' THEN - ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' -> 0 -> 'svedUhodReb' -> 0 - END AS parental_leave_info, - - COALESCE( - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat', - ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' - ) AS employer, - - CASE - WHEN ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' IS NULL THEN NULL - WHEN jsonb_typeof(ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP') = 'array' - THEN - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'aktRegIP' -> 0 - ELSE - ri.info -> 'svedFL' -> 'svedRegIP' -> 'regIP' -> 'predRegIP' - END AS reg_ip, - - COALESCE( - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'aktNPD', - ri.info -> 'svedFL' -> 'svedNPD' -> 'npd' -> 'predNPD' - ) AS self_employment - - FROM ervu_dashboard.recruits_info ri - -) -SELECT ti.recruit_id::uuid, - (ti.trud_deyat ->> 'dataMeropr')::date AS personnel_event_date, - ti.trud_deyat ->> 'naimTipKadrMeropr' AS personnel_event_type, - (ti.trud_deyat ->> 'prAktMestRab' = '1') AS current_workplace, - ti.trud_deyat ->> 'trudFunkcziya' AS position, - ti.trud_deyat -> 'svedOrg' ->> 'naimOrg' AS employer_name, - ti.employer -> 'svedYUL' ->> 'kpp' AS employer_kpp, - CASE - WHEN ti.employer->'svedYUL' IS NOT NULL THEN 'Юридическое лицо' - WHEN ti.employer->'svedIP' IS NOT NULL THEN 'Индивидуальный предприниматель' - END AS employer_category, - COALESCE( - ti.employer -> 'svedYUL' ->> 'innyul', - ti.employer -> 'svedIP' ->> 'innyfl' - ) AS employer_inn, - ti.employer -> 'svedYUL' -> 'svedOPK' ->> 'region' AS employer_address, - COALESCE( - ti.employer -> 'svedIP' ->> 'ogrnip', - ti.employer -> 'svedYUL' -> 'extend' ->> 'ogrn' - ) AS employer_ogrnip, - ti.employer -> 'extend' ->> 'tipPodrazdRabotodat' AS employer_unit_type, - ti.employer -> 'extend' ->> 'adresPodrazdRabotodat' AS employer_unit_address, - (ti.parental_leave_info ->> 'dataNachUhodReb')::date AS parental_leave_start_date, - (ti.parental_leave_info ->> 'dataKonUhodReb')::date AS parental_leave_end_date, - ( - (ti.parental_leave_info ->> 'dataNachUhodReb')::date <= current_date AND - ( - (ti.parental_leave_info ->> 'dataKonUhodReb') IS NULL OR - (ti.parental_leave_info ->> 'dataKonUhodReb')::date > current_date - ) - ) AS parental_leave_active, - (ti.reg_ip ->> 'dataRegIP')::date AS reg_ip_date, - (ti.reg_ip ->> 'dataINNNed')::date AS dereg_ip_date, - ti.reg_ip ->> 'ogrnip' AS ogrnip_ip, - ti.reg_ip IS NOT NULL AS active_ip, - ti.self_employment ->> 'dataUchNPD' AS reg_self_employment_date, - ti.self_employment ->> 'dataSnUchNPD' AS dereg_self_employment_date, - ti.self_employment IS NOT NULL AS active_self_employment -FROM trud_info ti; + WITH filteredData AS (SELECT ri.recruit_id, + trud_elem, + uhod_elem + FROM recruits_info ri + CROSS JOIN LATERAL jsonb_array_elements( + ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' + ) AS trud_elem + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(trud_elem -> 'svedUhodReb') = 'array' + THEN trud_elem -> 'svedUhodReb' + ELSE '[]'::jsonb + END + ) AS uhod_elem ON true + WHERE jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' + and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}') +SELECT fd.recruit_id, + trud_elem ->> 'id' AS source_id, + trud_elem -> 'svedOrg' ->> 'naimOrg' AS employer_name, + trud_elem ->> 'trudFunkcziya' AS position, + to_date(trud_elem ->> 'dataMeropr', 'YYYY-MM-DD') AS personnel_event_date, + trud_elem ->> 'naimTipKadrMeropr' AS personnel_event_type, + to_date(trud_elem ->> 'dataSved', 'YYYY-MM-DD') AS source_update_date, + (trud_elem ->> 'prAktMestRab') = '1' AS actual_employer, + to_date(uhod_elem ->> 'dataNachUhodReb', 'YYYY-MM-DD') AS parental_leave_start_date, + to_date(uhod_elem ->> 'dataKonUhodReb', 'YYYY-MM-DD') AS parental_leave_end_date +FROM filteredData fd; Y - 480 - 208 + 544 + 496 - Table output - TableOutput + citizen_work_activity_upsert + InsertUpdate Y @@ -282,130 +336,129 @@ FROM trud_info ti; none - 1000 - ervu-dashboard-test - - - recruit_id - recruit_id - - - personnel_event_date - personnel_event_date - - - personnel_event_type - personnel_event_type - - - current_workplace - current_workplace - - - position - position - - - employer_name - employer_name - - - employer_kpp - employer_kpp - - - employer_category - employer_category - - - employer_inn - employer_inn - - - employer_address - employer_address - - - employer_ogrnip - employer_ogrnip - - - employer_unit_type - employer_unit_type - - - employer_unit_address - employer_unit_address - - - parental_leave_start_date - parental_leave_start_date - - - parental_leave_end_date - parental_leave_end_date - - - parental_leave_active - parental_leave_active - - - reg_ip_date - reg_ip_date - - - dereg_ip_date - dereg_ip_date - - - ogrnip_ip - ogrnip_ip - - - active_ip - active_ip - - - reg_self_employment_date - reg_self_employment_date - - - dereg_self_employment_date - dereg_self_employment_date - - - active_self_employment - active_self_employment - - - N - N - N - N - Y - N - ervu_dashboard - Y - citizen_work_activity
- N - Y - N - Y + 10000 + ervu-dashboard + + + = + source_id + source_id + + ervu_dashboard + citizen_work_activity
+ + recruit_id + recruit_id + N + + + source_id + source_id + N + + + employer_name + employer_name + Y + + + position + position + Y + + + personnel_event_date + personnel_event_date + Y + + + personnel_event_type + personnel_event_type + Y + + + source_update_date + source_update_date + Y + + + actual_employer + actual_employer + Y + +
+ N - 704 - 208 + 1040 + 496 + +
+ + parental_leave_upsert + InsertUpdate + + Y + + 1 + + none + + + 10000 + ervu-dashboard + + + = + citizen_work_activity_source_id + source_id + + ervu_dashboard + employee_parental_leave
+ + start_date + parental_leave_start_date + Y + + + end_date + parental_leave_end_date + Y + + + citizen_work_activity_source_id + source_id + N + +
+ N + + + 1040 + 704
- Table output + citizen_work_activity_upsert Change job status on error Y error_description - error_code + + + + + + + parental_leave_upsert + Change job status on error + Y + + error_description + + diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_delta.hpl index b882463..e5a0cfa 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_delta.hpl @@ -25,6 +25,11 @@ work_activity_flow_delta.hpl Y + + get_max_source_update_date + Table input + Y + Table input work_activity_flow_delta.hpl 2 @@ -60,12 +65,22 @@ ervu-dashboard-test N 0 + get_max_source_update_date SELECT - r.idm_id as recruitment_id + r.idm_id as recruitment_id, + ? as max_source_update_date FROM ervu_dashboard.recruitment r - LEFT JOIN public.job_execution je + LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id and job_name = 'work_activity_job' +JOIN recruits_info ri + ON COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = r.idm_id + AND ri.updated_at > ( + SELECT MAX(execution_datetime) + FROM etl.job_execution + WHERE job_name = 'work_activity_job' + AND recruitment_id = r.idm_id + ) where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); N @@ -74,6 +89,29 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING 288 + + get_max_source_update_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + select max(source_update_date) + FROM citizen_work_activity; + N + + + 160 + 288 + + work_activity_flow_delta.hpl PipelineExecutor @@ -103,6 +141,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING work_activity_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -159,6 +202,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING work_activity_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -215,6 +263,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING work_activity_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -271,6 +324,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING work_activity_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y @@ -327,6 +385,11 @@ where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING work_activity_job + + MAX_SOURCE_UPDATE_DATE + max_source_update_date + + Y diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_repeat.hpl similarity index 99% rename from mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_on_error.hpl rename to mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_repeat.hpl index 85aee6a..60675d1 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_on_error.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_repeat.hpl @@ -1,7 +1,7 @@ - recruitment_five_flow_on_error + recruitment_five_flow_repeat Y diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_need_to_repeat_job.hpl index dd36f41..5ca8d4b 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_need_to_repeat_job.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_need_to_repeat_job.hpl @@ -62,7 +62,7 @@ none - ervu-dashboard-test + ervu-dashboard N 0 SELECT EXISTS (SELECT 1 @@ -71,7 +71,6 @@ FROM ervu_dashboard.recruitment r ON r.idm_id = je.recruitment_id and job_name = 'work_activity_job' where je.status is null or je.status in ('ERROR', 'PROCESSING') -limit 1 ) as need_to_repeat_job; N diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_work_activity_job_exists.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_work_activity_job_exists.hpl index b562353..a4b4134 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_work_activity_job_exists.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/support/check_if_work_activity_job_exists.hpl @@ -20,11 +20,6 @@ - - Set variables - Write to log - N - Table input Set variables @@ -67,14 +62,13 @@ none - ervu-dashboard-test + ervu-dashboard N 0 SELECT EXISTS ( SELECT 1 FROM etl.job_execution WHERE job_name = 'work_activity_job' - limit 1 ) AS job_executed_flag; N @@ -83,30 +77,6 @@ 336 - - Write to log - WriteToLog - - Y - - 1 - - none - - - Basic - Y - N - 0 - ${STATUS} - - - - - 944 - 224 - - diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/work_activity_job.hwf b/mappings/info_recruits/citizen_tables/work/work_activity/work_activity_job.hwf index 7a4306a..5749ad3 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/work_activity_job.hwf +++ b/mappings/info_recruits/citizen_tables/work/work_activity/work_activity_job.hwf @@ -85,8 +85,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/recruitments_five_flow.hpl - - Basic Y @@ -102,7 +100,7 @@ - recruitment_five_flow_on_error.hpl + recruitment_five_flow_repeat.hpl PIPELINE @@ -112,7 +110,9 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_on_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/work/work_activity/recruitment_five_flow_repeat.hpl + + Basic Y @@ -235,7 +235,7 @@ Simple evaluation - recruitment_five_flow_on_error.hpl + recruitment_five_flow_repeat.hpl Y Y N From a8143a3c86c77e9ff43ad91bb5b5ec8fbc56cb40 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Tue, 26 Aug 2025 19:39:52 +0500 Subject: [PATCH 30/34] =?UTF-8?q?=D0=BF=D0=BE=D0=B2=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=BA=D0=B8,=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D0=B5=20=D0=BC=D0=B5=D1=80=D1=8B,=20=D1=8F=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../check_if_need_to_repeat_job.hpl | 86 ++++ ...check_if_temporary_measures_job_exists.hpl | 113 +++++ .../parallel/temporary_measures_flow.hpl | 380 ++++++++++++++++ .../temporary_measures_flow_delta.hpl | 389 ++++++++++++++++ .../temporary_measures_flow_repeat.hpl | 402 ++++++++++++++++ .../recruitment_five_flow_delta.hpl | 360 +++++++++++++++ .../recruitment_five_flow_on_error.hpl | 360 +++++++++++++++ .../recruitments_five_flow.hpl | 373 +++++++++++++++ .../temporary_measures_job.hwf | 360 +++++++++++++++ .../check_if_need_to_repeat_job.hpl | 86 ++++ ...eck_if_restriction_document_job_exists.hpl | 113 +++++ .../parallel/restriction_document_flow.hpl | 389 ++++++++++++++++ .../restriction_document_flow_delta.hpl | 408 +++++++++++++++++ .../restriction_document_flow_repeat.hpl | 422 +++++++++++++++++ .../recruitment_five_flow_delta.hpl | 360 +++++++++++++++ .../recruitment_five_flow_on_error.hpl | 360 +++++++++++++++ .../recruitments_five_flow.hpl | 373 +++++++++++++++ .../restriction_document_job.hwf | 358 +++++++++++++++ .../check_if_need_to_repeat_job.hpl | 86 ++++ ...f_restriction_document_item_job_exists.hpl | 113 +++++ .../restriction_document_item_flow.hpl | 396 ++++++++++++++++ .../restriction_document_item_flow_delta.hpl | 415 +++++++++++++++++ .../restriction_document_item_flow_repeat.hpl | 430 ++++++++++++++++++ .../recruitment_five_flow_delta.hpl | 360 +++++++++++++++ .../recruitment_five_flow_on_error.hpl | 360 +++++++++++++++ .../recruitments_five_flow.hpl | 373 +++++++++++++++ .../restriction_document_item_job.hwf | 358 +++++++++++++++ .../check_if_need_to_repeat_job.hpl | 86 ++++ ...heck_if_subpoena_appearance_job_exists.hpl | 113 +++++ .../parallel/subpoena_appearance_flow.hpl | 361 +++++++++++++++ .../subpoena_appearance_flow_delta.hpl | 372 +++++++++++++++ .../subpoena_appearance_flow_repeat.hpl | 386 ++++++++++++++++ .../recruitment_five_flow_delta.hpl | 360 +++++++++++++++ .../recruitment_five_flow_on_error.hpl | 360 +++++++++++++++ .../recruitments_five_flow.hpl | 373 +++++++++++++++ .../subpoena_appearance_job.hwf | 358 +++++++++++++++ .../check_if_need_to_repeat_job.hpl | 86 ++++ ...check_if_subpoena_send_info_job_exists.hpl | 113 +++++ .../parallel/subpoena_send_info_flow.hpl | 391 ++++++++++++++++ .../subpoena_send_info_flow_delta.hpl | 401 ++++++++++++++++ .../subpoena_send_info_flow_repeat.hpl | 416 +++++++++++++++++ .../recruitment_five_flow_delta.hpl | 360 +++++++++++++++ .../recruitment_five_flow_on_error.hpl | 360 +++++++++++++++ .../recruitments_five_flow.hpl | 373 +++++++++++++++ .../subpoena_send_info_job.hwf | 358 +++++++++++++++ .../restriction_document_status.hpl | 99 ++++ 46 files changed, 14309 insertions(+) create mode 100644 mappings/info_recruits/citizen_tables/temporary_measures/check_if_need_to_repeat_job.hpl create mode 100644 mappings/info_recruits/citizen_tables/temporary_measures/checkpoints/check_if_temporary_measures_job_exists.hpl create mode 100644 mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_on_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/temporary_measures/recruitments_five_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/temporary_measures/temporary_measures_job.hwf create mode 100644 mappings/info_recruits/raw_data/restriction_document/check_if_need_to_repeat_job.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document/checkpoints/check_if_restriction_document_job_exists.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_delta.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_repeat.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document/recruitment_five_flow_on_error.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document/recruitments_five_flow.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document/restriction_document_job.hwf create mode 100644 mappings/info_recruits/raw_data/restriction_document_item/check_if_need_to_repeat_job.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document_item/checkpoints/check_if_restriction_document_item_job_exists.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_on_error.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document_item/recruitments_five_flow.hpl create mode 100644 mappings/info_recruits/raw_data/restriction_document_item/restriction_document_item_job.hwf create mode 100644 mappings/info_recruits/raw_data/subpoena_appearance/check_if_need_to_repeat_job.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_appearance/checkpoints/check_if_subpoena_appearance_job_exists.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_delta.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_repeat.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_on_error.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_appearance/recruitments_five_flow.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_appearance/subpoena_appearance_job.hwf create mode 100644 mappings/info_recruits/raw_data/subpoena_send_info/check_if_need_to_repeat_job.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_send_info/checkpoints/check_if_subpoena_send_info_job_exists.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_delta.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_repeat.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_on_error.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_send_info/recruitments_five_flow.hpl create mode 100644 mappings/info_recruits/raw_data/subpoena_send_info/subpoena_send_info_job.hwf create mode 100644 mappings/info_recruits/reference_data/restriction_document_status.hpl diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/temporary_measures/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..fa60b99 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/temporary_measures/check_if_need_to_repeat_job.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat_job + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 12:27:51.630 + - + 2025/08/08 12:27:51.630 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 624 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'temporary_measures_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 336 + 288 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/checkpoints/check_if_temporary_measures_job_exists.hpl b/mappings/info_recruits/citizen_tables/temporary_measures/checkpoints/check_if_temporary_measures_job_exists.hpl new file mode 100644 index 0000000..acb1487 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/temporary_measures/checkpoints/check_if_temporary_measures_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_temporary_measures_job_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 13:28:46.661 + - + 2025/08/05 13:28:46.661 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 672 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'recruits_info_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Y + + + N + 0 + Basic + ${STATUS} + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow.hpl b/mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow.hpl new file mode 100644 index 0000000..8592bb1 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow.hpl @@ -0,0 +1,380 @@ + + + + temporary_measures_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 320 + + + + Table input + TableInput + + N + + 1 + + none + + + ervu_person_registry + N + SELECT + r.system_create_date AS created_at, + r.system_update_date AS updated_at, + ri.recruit_id, + ri.info, + ri.gir_import_data_version_id, + r.current_recruitment_id, + r.target_recruitment_id, + r.full_name, + r.addresses +FROM recruits_info ri +JOIN recruits r ON r.id = ri.recruit_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(current_recruitment_id, target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= r.system_create_date + --AND '${CR_DATE}' < ri.created_at +--ORDER BY ri.created_at ASC; + +${LIMIT_FW} + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + created_at + created_at + + + updated_at + updated_at + + + info + info + + + gir_import_data_version_id + gir_import_data_version_id + + + current_recruitment_id + current_recruitment_id + + + target_recruitment_id + target_recruitment_id + + + full_name + full_name + + + addresses + addresses + + + N + N + N + N + Y + N + ervu_dashboard + Y + recruits_info
+ N + Y + N + Y + + + 1024 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_delta.hpl b/mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_delta.hpl new file mode 100644 index 0000000..bf8cff6 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_delta.hpl @@ -0,0 +1,389 @@ + + + + temporary_measures_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Insert / update + Change job status on error + Y + + + Change job status on error + Abort + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 944 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1248 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + recruits_info
+ + recruit_id + recruit_id + N + + + created_at + created_at + Y + + + updated_at + updated_at + Y + + + info + info + Y + + + gir_import_data_version_id + gir_import_data_version_id + Y + + + current_recruitment_id + current_recruitment_id + Y + + + target_recruitment_id + target_recruitment_id + Y + + + full_name + full_name + Y + + + addresses + addresses + Y + +
+ N + + + 944 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu_person_registry + N + + SELECT + r.system_create_date AS created_at, + r.system_update_date AS updated_at, + ri.recruit_id, + ri.info, + ri.gir_import_data_version_id, + r.current_recruitment_id, + r.target_recruitment_id, + r.full_name, + r.addresses +FROM recruits_info ri +JOIN recruits r ON r.id = ri.recruit_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(current_recruitment_id, target_recruitment_id) = '${IDM_ID}' + --AND '${M_R_CR_DATE}' >= r.system_create_date + AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp + --AND '${CR_DATE}' < ri.created_at +--ORDER BY ri.created_at ASC; + +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_repeat.hpl new file mode 100644 index 0000000..d4041f8 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_repeat.hpl @@ -0,0 +1,402 @@ + + + + temporary_measures_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 960 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + recruits_info
+ + recruit_id + recruit_id + N + + + created_at + created_at + Y + + + updated_at + updated_at + Y + + + info + info + Y + + + gir_import_data_version_id + gir_import_data_version_id + Y + + + current_recruitment_id + current_recruitment_id + Y + + + target_recruitment_id + target_recruitment_id + Y + + + full_name + full_name + Y + + + addresses + addresses + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu_person_registry + N + SELECT + r.system_create_date AS created_at, + r.system_update_date AS updated_at, + ri.recruit_id, + ri.info, + ri.gir_import_data_version_id, + r.current_recruitment_id, + r.target_recruitment_id, + r.full_name, + r.addresses +FROM recruits_info ri +JOIN recruits r ON r.id = ri.recruit_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(current_recruitment_id, target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= r.system_create_date + --AND '${CR_DATE}' < ri.created_at +--ORDER BY ri.created_at ASC; + +${LIMIT_FW} + Y + + + 480 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..2679e8a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + temporary_measures_flow_delta.hpl + Y + + + Table input + temporary_measures_flow_delta.hpl 2 + Y + + + Table input + temporary_measures_flow_delta.hpl 3 + Y + + + Table input + temporary_measures_flow_delta.hpl 4 + Y + + + Table input + temporary_measures_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'recruits_info_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + temporary_measures_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 128 + + + + temporary_measures_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 208 + + + + temporary_measures_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 288 + + + + temporary_measures_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 368 + + + + temporary_measures_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..f5c77e6 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + temporary_measures_flow_repeat.hpl + Y + + + Table input + temporary_measures_flow_repeat.hpl 2 + Y + + + Table input + temporary_measures_flow_repeat.hpl 3 + Y + + + Table input + temporary_measures_flow_repeat.hpl 4 + Y + + + Table input + temporary_measures_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'temporary_measures_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + temporary_measures_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 208 + + + + temporary_measures_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 288 + + + + temporary_measures_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 368 + + + + temporary_measures_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 448 + + + + temporary_measures_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/temporary_measures/recruitments_five_flow.hpl new file mode 100644 index 0000000..d6e1612 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/temporary_measures/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + temporary_measures_flow.hpl + Y + + + Get all recruitments ordered by created_date + temporary_measures_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + temporary_measures_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + temporary_measures_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + temporary_measures_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + temporary_measures_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + temporary_measures_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + temporary_measures_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + temporary_measures_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + temporary_measures_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/parallel/temporary_measures_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + temporary_measures_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/temporary_measures_job.hwf b/mappings/info_recruits/citizen_tables/temporary_measures/temporary_measures_job.hwf new file mode 100644 index 0000000..dd6f9b5 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/temporary_measures/temporary_measures_job.hwf @@ -0,0 +1,360 @@ + + + temporary_measures_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 224 + 304 + + + + check_if_temporary_measures_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/checkpoints/check_if_temporary_measures_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + temporary_measures_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 768 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1088 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_on_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 1088 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 768 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 768 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 768 + 800 + + + + + + Start + check_if_temporary_measures_job_exists.hpl + Y + Y + Y + + + check_if_temporary_measures_job_exists.hpl + temporary_measures_job_exists_check + Y + Y + N + + + temporary_measures_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + temporary_measures_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 880 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 880 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 688 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + temporary_measures_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 143 + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/raw_data/restriction_document/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..2520186 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document/check_if_need_to_repeat_job.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat_job + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 12:27:51.630 + - + 2025/08/08 12:27:51.630 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 624 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'restriction_document_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 336 + 288 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document/checkpoints/check_if_restriction_document_job_exists.hpl b/mappings/info_recruits/raw_data/restriction_document/checkpoints/check_if_restriction_document_job_exists.hpl new file mode 100644 index 0000000..ea51144 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document/checkpoints/check_if_restriction_document_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_restriction_document_job_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 13:28:46.661 + - + 2025/08/05 13:28:46.661 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 672 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'restriction_document_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Y + + + N + 0 + Basic + ${STATUS} + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow.hpl b/mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow.hpl new file mode 100644 index 0000000..4486fd5 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow.hpl @@ -0,0 +1,389 @@ + + + + restriction_document_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 320 + + + + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + + SELECT +* +FROM public.restriction_document +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND vk_id = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= created_at +${LIMIT_FW} + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + id + id + + + subpoena_id + subpoena_id + + + created_at + created_at + + + updated_at + updated_at + + + vk_id + vk_id + + + user_id + user_id + + + user_name + user_name + + + status + status + + + decision_number + decision_number + + + decision_date + decision_date + + + decision_reason + decision_reason + + + extra_info + extra_info + + + type + type + + + recruitment_name + recruitment_name + + + N + N + N + N + Y + N + ervu_dashboard + Y + restriction_document
+ N + Y + N + Y + + + 1024 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_delta.hpl b/mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_delta.hpl new file mode 100644 index 0000000..0c9ab5d --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_delta.hpl @@ -0,0 +1,408 @@ + + + + restriction_document_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 944 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1248 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + + = + created_at + created_at + + + ervu_dashboard + restriction_document
+ + id + id + N + + + subpoena_id + subpoena_id + Y + + + created_at + created_at + N + + + updated_at + updated_at + Y + + + vk_id + vk_id + Y + + + user_id + user_id + Y + + + user_name + user_name + Y + + + status + status + Y + + + decision_number + decision_number + Y + + + decision_date + decision_date + Y + + + decision_reason + decision_reason + Y + + + extra_info + extra_info + Y + + + type + type + Y + + + recruitment_name + recruitment_name + Y + +
+ N + + + 944 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + SELECT +* +FROM public.restriction_document +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND vk_id = '${IDM_ID}' + AND updated_at >= '${M_R_UP_DATE}'::timestamp + +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_repeat.hpl b/mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_repeat.hpl new file mode 100644 index 0000000..809cfea --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_repeat.hpl @@ -0,0 +1,422 @@ + + + + restriction_document_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 960 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + + = + created_at + created_at + + + ervu_dashboard + restriction_document
+ + id + id + N + + + subpoena_id + subpoena_id + Y + + + created_at + created_at + N + + + updated_at + updated_at + Y + + + vk_id + vk_id + Y + + + user_id + user_id + Y + + + user_name + user_name + Y + + + status + status + Y + + + decision_number + decision_number + Y + + + decision_date + decision_date + Y + + + decision_reason + decision_reason + Y + + + extra_info + extra_info + Y + + + type + type + Y + + + recruitment_name + recruitment_name + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + SELECT +* +FROM public.restriction_document +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND vk_id = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= created_at +${LIMIT_FW} + Y + + + 480 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/raw_data/restriction_document/recruitment_five_flow_delta.hpl b/mappings/info_recruits/raw_data/restriction_document/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..e99c9c1 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + restriction_document_flow_delta.hpl + Y + + + Table input + restriction_document_flow_delta.hpl 2 + Y + + + Table input + restriction_document_flow_delta.hpl 3 + Y + + + Table input + restriction_document_flow_delta.hpl 4 + Y + + + Table input + restriction_document_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'restriction_document_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + restriction_document_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 128 + + + + restriction_document_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 208 + + + + restriction_document_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 288 + + + + restriction_document_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 368 + + + + restriction_document_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 448 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/raw_data/restriction_document/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..5bab95b --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + restriction_document_flow_repeat.hpl + Y + + + Table input + restriction_document_flow_repeat.hpl 2 + Y + + + Table input + restriction_document_flow_repeat.hpl 3 + Y + + + Table input + restriction_document_flow_repeat.hpl 4 + Y + + + Table input + restriction_document_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'restriction_document_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + restriction_document_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 560 + 208 + + + + restriction_document_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 560 + 288 + + + + restriction_document_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 560 + 368 + + + + restriction_document_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 560 + 448 + + + + restriction_document_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 560 + 528 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document/recruitments_five_flow.hpl b/mappings/info_recruits/raw_data/restriction_document/recruitments_five_flow.hpl new file mode 100644 index 0000000..9ef48ce --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + restriction_document_flow.hpl + Y + + + Get all recruitments ordered by created_date + restriction_document_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + restriction_document_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + restriction_document_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + restriction_document_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + restriction_document_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 144 + + + + restriction_document_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 224 + + + + restriction_document_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 304 + + + + restriction_document_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 384 + + + + restriction_document_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/parallel/restriction_document_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 768 + 464 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document/restriction_document_job.hwf b/mappings/info_recruits/raw_data/restriction_document/restriction_document_job.hwf new file mode 100644 index 0000000..e5a3589 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document/restriction_document_job.hwf @@ -0,0 +1,358 @@ + + + restriction_document_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 224 + 304 + + + + check_if_restriction_document_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/checkpoints/check_if_restriction_document_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + restriction_document_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 752 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1120 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/recruitment_five_flow_on_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 1120 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 752 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 752 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 752 + 800 + + + + + + Start + check_if_restriction_document_job_exists.hpl + Y + Y + Y + + + check_if_restriction_document_job_exists.hpl + restriction_document_job_exists_check + Y + Y + N + + + restriction_document_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + restriction_document_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 864 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 864 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 672 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + restriction_document_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 146 + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document_item/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/raw_data/restriction_document_item/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..7084d6e --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document_item/check_if_need_to_repeat_job.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat_job + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 12:27:51.630 + - + 2025/08/08 12:27:51.630 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 624 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'restriction_document_item_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 336 + 288 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document_item/checkpoints/check_if_restriction_document_item_job_exists.hpl b/mappings/info_recruits/raw_data/restriction_document_item/checkpoints/check_if_restriction_document_item_job_exists.hpl new file mode 100644 index 0000000..fc707be --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document_item/checkpoints/check_if_restriction_document_item_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_restriction_document_item_job_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 13:28:46.661 + - + 2025/08/05 13:28:46.661 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 672 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'restriction_document_item_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Y + + + N + 0 + Basic + ${STATUS} + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl new file mode 100644 index 0000000..7b6dca1 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl @@ -0,0 +1,396 @@ + + + + restriction_document_item_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 320 + + + + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + + select +rdi.* +from public.restriction_document_item rdi +join public.restriction_document rd on +rd.id = coalesce(rdi.restriction_document_create_id,rdi.restriction_document_cancel_id) +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND rd.vk_id = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= rdi.created_at + +${LIMIT_FW} + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + id + id + + + restriction_document_create_id + restriction_document_create_id + + + created_at + created_at + + + updated_at + updated_at + + + restriction_id + restriction_id + + + status_applied + status_applied + + + status_text + status_text + + + applied_date + applied_date + + + cancel_date + cancel_date + + + extra_info + extra_info + + + applied_fact + applied_fact + + + restriction_document_cancel_id + restriction_document_cancel_id + + + status_canceled + status_canceled + + + foiv_code + foiv_code + + + human_readable_id + human_readable_id + + + N + N + N + N + Y + N + ervu_dashboard + Y + restriction_document_item
+ N + Y + N + Y + + + 1024 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl new file mode 100644 index 0000000..81c04a9 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl @@ -0,0 +1,415 @@ + + + + restriction_document_item_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 944 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1248 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + + = + created_at + created_at + + + ervu_dashboard + restriction_document_item
+ + id + id + N + + + restriction_document_create_id + restriction_document_create_id + Y + + + created_at + created_at + N + + + updated_at + updated_at + Y + + + restriction_id + restriction_id + Y + + + status_applied + status_applied + Y + + + status_text + status_text + Y + + + applied_date + applied_date + Y + + + cancel_date + cancel_date + Y + + + extra_info + extra_info + Y + + + applied_fact + applied_fact + Y + + + restriction_document_cancel_id + restriction_document_cancel_id + Y + + + status_canceled + status_canceled + Y + + + foiv_code + foiv_code + Y + + + human_readable_id + human_readable_id + Y + +
+ N + + + 944 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu_person_registry + N + select +rdi.* +from public.restriction_document_item rdi +join public.restriction_document rd on +rd.id = coalesce(rdi.restriction_document_create_id,rdi.restriction_document_cancel_id) +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND rd.vk_id = '${IDM_ID}' + AND rdi.updated_at >= '${M_R_UP_DATE}'::timestamp + +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl new file mode 100644 index 0000000..87a5793 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl @@ -0,0 +1,430 @@ + + + + restriction_document_item_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 960 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + + = + created_at + created_at + + + ervu_dashboard + restriction_document_item
+ + id + id + N + + + restriction_document_create_id + restriction_document_create_id + Y + + + created_at + created_at + N + + + updated_at + updated_at + Y + + + restriction_id + restriction_id + Y + + + status_applied + status_applied + Y + + + status_text + status_text + Y + + + applied_date + applied_date + Y + + + cancel_date + cancel_date + Y + + + extra_info + extra_info + Y + + + applied_fact + applied_fact + Y + + + restriction_document_cancel_id + restriction_document_cancel_id + Y + + + status_canceled + status_canceled + Y + + + foiv_code + foiv_code + Y + + + human_readable_id + human_readable_id + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + select +rdi.* +from public.restriction_document_item rdi +join public.restriction_document rd on +rd.id = coalesce(rdi.restriction_document_create_id,rdi.restriction_document_cancel_id) +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND rd.vk_id = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= rdi.created_at + +${LIMIT_FW} + Y + + + 480 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_delta.hpl b/mappings/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..dde4920 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + restriction_document_item_flow_delta.hpl + Y + + + Table input + restriction_document_item_flow_delta.hpl 2 + Y + + + Table input + restriction_document_item_flow_delta.hpl 3 + Y + + + Table input + restriction_document_item_flow_delta.hpl 4 + Y + + + Table input + restriction_document_item_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'restriction_document_item_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + restriction_document_item_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 128 + + + + restriction_document_item_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 208 + + + + restriction_document_item_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 288 + + + + restriction_document_item_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 368 + + + + restriction_document_item_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 448 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..2090737 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + restriction_document_item_flow_repeat.hpl + Y + + + Table input + restriction_document_item_flow_repeat.hpl 2 + Y + + + Table input + restriction_document_item_flow_repeat.hpl 3 + Y + + + Table input + restriction_document_item_flow_repeat.hpl 4 + Y + + + Table input + restriction_document_item_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'restriction_document_item_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + restriction_document_item_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 208 + + + + restriction_document_item_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 288 + + + + restriction_document_item_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 368 + + + + restriction_document_item_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 448 + + + + restriction_document_item_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 528 + 528 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document_item/recruitments_five_flow.hpl b/mappings/info_recruits/raw_data/restriction_document_item/recruitments_five_flow.hpl new file mode 100644 index 0000000..973ad51 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document_item/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + restriction_document_item_flow.hpl + Y + + + Get all recruitments ordered by created_date + restriction_document_item_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + restriction_document_item_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + restriction_document_item_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + restriction_document_item_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + restriction_document_item_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 144 + + + + restriction_document_item_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 224 + + + + restriction_document_item_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 304 + + + + restriction_document_item_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 384 + + + + restriction_document_item_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + restriction_document_item_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 752 + 464 + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document_item/restriction_document_item_job.hwf b/mappings/info_recruits/raw_data/restriction_document_item/restriction_document_item_job.hwf new file mode 100644 index 0000000..2d8d4f4 --- /dev/null +++ b/mappings/info_recruits/raw_data/restriction_document_item/restriction_document_item_job.hwf @@ -0,0 +1,358 @@ + + + restriction_document_item_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 224 + 304 + + + + check_if_restriction_document_item_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/checkpoints/check_if_restriction_document_item_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 448 + 304 + + + + restriction_document_item_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 768 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1072 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_on_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 1072 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 768 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 768 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/restriction_document_item/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 768 + 800 + + + + + + Start + check_if_restriction_document_item_job_exists.hpl + Y + Y + Y + + + check_if_restriction_document_item_job_exists.hpl + restriction_document_item_job_exists_check + Y + Y + N + + + restriction_document_item_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + restriction_document_item_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 880 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 912 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 688 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + restriction_document_item_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 175 + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_appearance/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/raw_data/subpoena_appearance/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..22f2d41 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_appearance/check_if_need_to_repeat_job.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat_job + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 12:27:51.630 + - + 2025/08/08 12:27:51.630 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 624 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_appearance_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 336 + 288 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_appearance/checkpoints/check_if_subpoena_appearance_job_exists.hpl b/mappings/info_recruits/raw_data/subpoena_appearance/checkpoints/check_if_subpoena_appearance_job_exists.hpl new file mode 100644 index 0000000..dbcd846 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_appearance/checkpoints/check_if_subpoena_appearance_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_subpoena_appearance_job_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 13:28:46.661 + - + 2025/08/05 13:28:46.661 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 672 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'subpoena_appearance_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Y + + + N + 0 + Basic + ${STATUS} + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow.hpl b/mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow.hpl new file mode 100644 index 0000000..cddb2f7 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow.hpl @@ -0,0 +1,361 @@ + + + + subpoena_appearance_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 320 + + + + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + + select sa.* +from public.subpoena_appearance sa +join public.subpoena s on s.id = sa.subpoena_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND s.department_id = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= sa.created_date_time +${LIMIT_FW} + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + id + id + + + subpoena_id + subpoena_id + + + fact_appearance + fact_appearance + + + date_appearance + date_appearance + + + nonappearance_info + nonappearance_info + + + created_date_time + created_date_time + + + change_date_time + change_date_time + + + N + N + N + N + Y + N + ervu_dashboard + Y + subpoena_appearance
+ N + Y + N + Y + + + 1024 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_delta.hpl b/mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_delta.hpl new file mode 100644 index 0000000..d772d1a --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_delta.hpl @@ -0,0 +1,372 @@ + + + + subpoena_appearance_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 944 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1248 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + = + created_date_time + created_date_time + + ervu_dashboard + subpoena_appearance
+ + id + id + N + + + created_date_time + created_date_time + N + + + subpoena_id + subpoena_id + Y + + + fact_appearance + fact_appearance + Y + + + date_appearance + date_appearance + Y + + + nonappearance_info + nonappearance_info + Y + + + change_date_time + change_date_time + Y + +
+ N + + + 944 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + + select sa.* +from public.subpoena_appearance sa +join public.subpoena s on s.id = sa.subpoena_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND s.department_id = '${IDM_ID}' + AND sa.change_date_time >= '${M_R_UP_DATE}'::timestamp + +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_repeat.hpl b/mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_repeat.hpl new file mode 100644 index 0000000..2e0ee69 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_repeat.hpl @@ -0,0 +1,386 @@ + + + + subpoena_appearance_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 960 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + = + created_date_time + created_date_time + + ervu_dashboard + subpoena_appearance
+ + id + id + N + + + created_date_time + created_date_time + N + + + subpoena_id + subpoena_id + Y + + + fact_appearance + fact_appearance + Y + + + date_appearance + date_appearance + Y + + + nonappearance_info + nonappearance_info + Y + + + change_date_time + change_date_time + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + + select sa.* +from public.subpoena_appearance sa +join public.subpoena s on s.id = sa.subpoena_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND s.department_id = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= sa.created_date_time +${LIMIT_FW} + Y + + + 480 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_delta.hpl b/mappings/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..31177ac --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + subpoena_appearance_flow_delta.hpl + Y + + + Table input + subpoena_appearance_flow_delta.hpl 2 + Y + + + Table input + subpoena_appearance_flow_delta.hpl 3 + Y + + + Table input + subpoena_appearance_flow_delta.hpl 4 + Y + + + Table input + subpoena_appearance_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_appearance_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + subpoena_appearance_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 128 + + + + subpoena_appearance_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 208 + + + + subpoena_appearance_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 288 + + + + subpoena_appearance_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 368 + + + + subpoena_appearance_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 608 + 448 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..513be76 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + subpoena_appearance_flow_repeat.hpl + Y + + + Table input + subpoena_appearance_flow_repeat.hpl 2 + Y + + + Table input + subpoena_appearance_flow_repeat.hpl 3 + Y + + + Table input + subpoena_appearance_flow_repeat.hpl 4 + Y + + + Table input + subpoena_appearance_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_appearance_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + subpoena_appearance_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + subpoena_appearance_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + subpoena_appearance_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + subpoena_appearance_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 448 + + + + subpoena_appearance_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 528 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_appearance/recruitments_five_flow.hpl b/mappings/info_recruits/raw_data/subpoena_appearance/recruitments_five_flow.hpl new file mode 100644 index 0000000..245e262 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_appearance/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + subpoena_appearance_flow.hpl + Y + + + Get all recruitments ordered by created_date + subpoena_appearance_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + subpoena_appearance_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + subpoena_appearance_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + subpoena_appearance_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + subpoena_appearance_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 144 + + + + subpoena_appearance_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 224 + + + + subpoena_appearance_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 304 + + + + subpoena_appearance_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 384 + + + + subpoena_appearance_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/parallel/subpoena_appearance_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_appearance_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 464 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_appearance/subpoena_appearance_job.hwf b/mappings/info_recruits/raw_data/subpoena_appearance/subpoena_appearance_job.hwf new file mode 100644 index 0000000..0e2701c --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_appearance/subpoena_appearance_job.hwf @@ -0,0 +1,358 @@ + + + subpoena_appearance_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 176 + 304 + + + + check_if_subpoena_appearance_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/checkpoints/check_if_subpoena_appearance_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + subpoena_appearance_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 752 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1056 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_on_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 1056 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 752 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 752 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_appearance/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 752 + 800 + + + + + + Start + check_if_subpoena_appearance_job_exists.hpl + Y + Y + Y + + + check_if_subpoena_appearance_job_exists.hpl + subpoena_appearance_job_exists_check + Y + Y + N + + + subpoena_appearance_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + subpoena_appearance_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 864 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 864 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 672 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + recruits_info_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 114 + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/raw_data/subpoena_send_info/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..fc7dea6 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_send_info/check_if_need_to_repeat_job.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat_job + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 12:27:51.630 + - + 2025/08/08 12:27:51.630 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 624 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_send_info_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 336 + 288 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/checkpoints/check_if_subpoena_send_info_job_exists.hpl b/mappings/info_recruits/raw_data/subpoena_send_info/checkpoints/check_if_subpoena_send_info_job_exists.hpl new file mode 100644 index 0000000..2f4bd39 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_send_info/checkpoints/check_if_subpoena_send_info_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_subpoena_send_info_job_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 13:28:46.661 + - + 2025/08/05 13:28:46.661 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 672 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'subpoena_send_info_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Y + + + N + 0 + Basic + ${STATUS} + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl b/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl new file mode 100644 index 0000000..80c5491 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl @@ -0,0 +1,391 @@ + + + + subpoena_send_info_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Identify last row in a stream + Y + + + Identify last row in a stream + Table output + Y + + + Table output + Filter rows + Y + + + Table output + Change job status on error + Y + + + Table output + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1376 + 512 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1024 + 512 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1632 + 160 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 160 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 320 + + + + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + select ssi.* +from public.subpoena_send_info ssi +join public.subpoena s on s.id = ssi.subpoena_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND s.department_id = '${IDM_ID}' + AND s.create_date >= '${M_R_UP_DATE}'::timestamp +${LIMIT_FW} + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + id + id + + + subpoena_id + subpoena_id + + + send_code + send_code + + + send_address + send_address + + + send_address_type + send_address_type + + + send_date + send_date + + + track_number + track_number + + + is_delivered + is_delivered + + + delivery_code + delivery_code + + + delivery_date + delivery_date + + + act_number + act_number + + + act_date + act_date + + + delivery_fio + delivery_fio + + + auto_delivery + auto_delivery + + + N + N + N + N + + Y + + N + ervu_dashboard + Y + subpoena_send_info
+ + N + Y + N + Y + + + 1024 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_delta.hpl b/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_delta.hpl new file mode 100644 index 0000000..2bc3a65 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_delta.hpl @@ -0,0 +1,401 @@ + + + + subpoena_send_info_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 944 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1248 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1248 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 944 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + ervu_dashboard + subpoena_send_info
+ + id + id + N + + + subpoena_id + subpoena_id + Y + + + send_code + send_code + Y + + + send_address + send_address + Y + + + send_address_type + send_address_type + Y + + + send_date + send_date + Y + + + track_number + track_number + Y + + + is_delivered + is_delivered + Y + + + delivery_code + delivery_code + Y + + + delivery_date + delivery_date + Y + + + act_number + act_number + Y + + + act_date + act_date + Y + + + delivery_fio + delivery_fio + Y + + + auto_delivery + auto_delivery + Y + +
+ N + + + 944 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + + select ssi.* +from public.subpoena_send_info ssi +join public.subpoena s on s.id = ssi.subpoena_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND s.department_id = '${IDM_ID}' + AND s.status_change_date >= '${M_R_UP_DATE}'::timestamp +${LIMIT_FW} + Y + + + 544 + 224 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_repeat.hpl b/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_repeat.hpl new file mode 100644 index 0000000..394b9b4 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_repeat.hpl @@ -0,0 +1,416 @@ + + + + subpoena_send_info_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Table input + Identify last row in a stream + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Identify last row in a stream + Insert / update + Y + + + Insert / update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1248 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 960 + 400 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1440 + 48 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1440 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 960 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 208 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + ervu_dashboard + subpoena_send_info
+ + id + id + N + + + subpoena_id + subpoena_id + Y + + + send_code + send_code + Y + + + send_address + send_address + Y + + + send_address_type + send_address_type + Y + + + send_date + send_date + Y + + + track_number + track_number + Y + + + is_delivered + is_delivered + Y + + + delivery_code + delivery_code + Y + + + delivery_date + delivery_date + Y + + + act_number + act_number + Y + + + act_date + act_date + Y + + + delivery_fio + delivery_fio + Y + + + auto_delivery + auto_delivery + Y + +
+ N + + + 960 + 208 + +
+ + Table input + TableInput + + N + + 1 + + none + + + postgres.subpoena + N + select ssi.* +from public.subpoena_send_info ssi +join public.subpoena s on s.id = ssi.subpoena_id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND s.department_id = '${IDM_ID}' + AND s.create_date >= '${M_R_UP_DATE}'::timestamp +${LIMIT_FW} + Y + + + 480 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_delta.hpl b/mappings/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..befe783 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + subpoena_send_info_flow_delta.hpl + Y + + + Table input + subpoena_send_info_flow_delta.hpl 2 + Y + + + Table input + subpoena_send_info_flow_delta.hpl 3 + Y + + + Table input + subpoena_send_info_flow_delta.hpl 4 + Y + + + Table input + subpoena_send_info_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_send_info_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + subpoena_send_info_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 128 + + + + subpoena_send_info_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 208 + + + + subpoena_send_info_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 288 + + + + subpoena_send_info_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 368 + + + + subpoena_send_info_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 624 + 448 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..422e804 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + subpoena_send_info_flow_repeat.hpl + Y + + + Table input + subpoena_send_info_flow_repeat.hpl 2 + Y + + + Table input + subpoena_send_info_flow_repeat.hpl 3 + Y + + + Table input + subpoena_send_info_flow_repeat.hpl 4 + Y + + + Table input + subpoena_send_info_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_send_info_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + subpoena_send_info_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + subpoena_send_info_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + subpoena_send_info_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + subpoena_send_info_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 448 + + + + subpoena_send_info_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 528 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/recruitments_five_flow.hpl b/mappings/info_recruits/raw_data/subpoena_send_info/recruitments_five_flow.hpl new file mode 100644 index 0000000..d69253d --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_send_info/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + subpoena_send_info_flow.hpl + Y + + + Get all recruitments ordered by created_date + subpoena_send_info_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + subpoena_send_info_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + subpoena_send_info_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + subpoena_send_info_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + subpoena_send_info_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 144 + + + + subpoena_send_info_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 224 + + + + subpoena_send_info_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 304 + + + + subpoena_send_info_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 384 + + + + subpoena_send_info_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + subpoena_send_info_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 720 + 464 + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/subpoena_send_info_job.hwf b/mappings/info_recruits/raw_data/subpoena_send_info/subpoena_send_info_job.hwf new file mode 100644 index 0000000..3db6b35 --- /dev/null +++ b/mappings/info_recruits/raw_data/subpoena_send_info/subpoena_send_info_job.hwf @@ -0,0 +1,358 @@ + + + subpoena_send_info_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 224 + 304 + + + + check_if_subpoena_send_info_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/checkpoints/check_if_subpoena_send_info_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 448 + 304 + + + + subpoena_send_info_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 752 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1040 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_on_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 1040 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 752 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 752 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/subpoena_send_info/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 752 + 800 + + + + + + Start + check_if_subpoena_send_info_job_exists.hpl + Y + Y + Y + + + check_if_subpoena_send_info_job_exists.hpl + subpoena_send_info_job_exists_check + Y + Y + N + + + subpoena_send_info_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + subpoena_send_info_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 864 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 864 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 672 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + subpoena_send_info_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 141 + + + + diff --git a/mappings/info_recruits/reference_data/restriction_document_status.hpl b/mappings/info_recruits/reference_data/restriction_document_status.hpl new file mode 100644 index 0000000..4d5a79d --- /dev/null +++ b/mappings/info_recruits/reference_data/restriction_document_status.hpl @@ -0,0 +1,99 @@ + + + + restriction_document_status + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/25 16:29:15.233 + - + 2025/08/25 16:29:15.233 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + ervu_dashboard + restriction_document_status
+ + id + id + N + + + code + code + Y + + + name + name + Y + +
+ N + + + 832 + 272 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + postgres.subpoena + N + 0 + SELECT * FROM public.restriction_document_status + N + + + 464 + 272 + + + + + +
From ecfa676e80d229e6d7ad999be1c69deb191b4ef6 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Thu, 28 Aug 2025 15:28:19 +0500 Subject: [PATCH 31/34] =?UTF-8?q?ERVU-538=20=D0=BF=D0=BE=D0=B2=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=BA=D0=B8=20=D0=B8=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=BC=D0=B5=D1=80=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subpoena/parallel/subpoena_flow.hpl | 319 +++++++++++--- .../subpoena/parallel/subpoena_flow_delta.hpl | 400 ++++++++++++++---- .../parallel/subpoena_flow_repeat.hpl | 382 +++++++++++------ .../temporary_measures_job.hwf | 4 +- .../restriction_document_item_flow.hpl | 194 +++++++-- .../restriction_document_item_flow_delta.hpl | 186 ++++++-- .../restriction_document_item_flow_repeat.hpl | 185 ++++++-- .../parallel/subpoena_send_info_flow.hpl | 3 - .../reference_data/send_dictionary.hpl | 114 +++++ 9 files changed, 1441 insertions(+), 346 deletions(-) create mode 100644 mappings/info_recruits/reference_data/send_dictionary.hpl diff --git a/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl index ca99475..90b4e7c 100644 --- a/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl +++ b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow.hpl @@ -40,31 +40,51 @@ Abort Y
- - Table input - Identify last row in a stream - Y - - - Identify last row in a stream - Table output - Y - - - Table output - Filter rows - Y - Table output Change job status on error Y + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Table input + Table output + Y + Table output + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y + + Update + Filter rows + Y +
Abort @@ -82,8 +102,8 @@ 0 - 1376 - 512 + 1328 + 496 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 1024 - 512 + 1328 + 320 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1632 - 160 + 1856 + 176 @@ -194,8 +214,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 1632 - 320 + 1536 + 176 @@ -230,8 +250,58 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); Change job status on success - 1024 - 160 + 1536 + 304 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_sent_summons_raw + is_sent_summons + MAX + + + has_served_summons_raw + is_served_summons + MAX + + + has_appeared_to_recruitment_center_raw + is_appeared_to_recruitment_center + MAX + + + has_not_appeared_by_valid_excuse_raw + is_not_appeared_by_valid_excuse + MAX + + + N + + + recruit_id + + + N + grp + + + 688 + 176 @@ -248,15 +318,15 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); last_row - 752 - 320 + 880 + 176 Table input TableInput - N + Y 1 @@ -267,29 +337,46 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N SELECT - s.id AS subpoena_id, --id повестки - --???, --факт направления повестки + s.id, --id повестки + CASE + WHEN s.send_date is not null THEN 1 + ELSE 0 + END AS is_sent_summons, --факт направления повестки///Признак наличия направленной повестки + CASE + WHEN s.system_stages->'subpoenaAwarded' != 'true' THEN 1 + ELSE 0 + END AS is_served_summons, --has_served_summons//Признак наличия врученной повестки + CASE + WHEN s.system_stages->'recruitAttendanceConfirm' != 'true' THEN 1 + ELSE 0 + END AS is_appeared_to_recruitment_center, -- appeared_to_recruitment_center//Признак явки в военный комиссариат + CASE + WHEN ss.code = '5.1' THEN 1 + ELSE 0 + END AS is_not_appeared_by_valid_excuse, -- not_appeared_by_valid_excuse//Признак неявки в военкомат по уважительной причине + s.recruit_id, s.send_date, --дата направления повестки s.series, --серия повестки s.number, --новер повестки s.reason_id AS subpoena_reason, --причина вызова по повестке /// код передавать или сразу наименование? - s.full_name_responsible_user AS fio_commiss, --фио военного комиссара(фио пользователя сформировавшео повестку) + s.full_name_responsible_user, --фио военного комиссара(фио пользователя сформировавшео повестку) s.sig_info, --сертификат ключа проверки ЭП s.recruitment_name, --наименование ВК s.recruitment_address, --адрес, по которому необходимо явиться s.visit_date, --дата и время явки --, --способ направления // искать в subpoena_send_info --, --УН заказного почтового отправления // искать в subpoena_send_info - s.status_id AS subpoena_status, --статус // ссылка на справочник subpoena_status + s.status_id, --статус // ссылка на справочник subpoena_status/// AS subpoena_status s.create_date, --дата создания // для загрузки данных s.status_change_date --дата обновления // для загрузки данных (timestamp without time zone) -- поля для карточки, раздел "Сведения о направлении повестки военного комиссариата" -FROM subpoena s +FROM public.subpoena s +join public.subpoena_status ss on s.status_id = ss.id WHERE '${IDM_ID}' != '' -- Проверка на пустую строку - AND department_id = '${IDM_ID}' + AND s.department_id = '${IDM_ID}' AND '${M_R_CR_DATE}' >= s.create_date ${LIMIT_FW} @@ -304,7 +391,7 @@ ${LIMIT_FW} Table output TableOutput - N + Y 1 @@ -314,41 +401,61 @@ ${LIMIT_FW} 1000 ervu-dashboard + + id + id + recruit_id recruit_id - created_at - created_at + send_date + send_date - updated_at - updated_at + series + series - info - info + number + number - gir_import_data_version_id - gir_import_data_version_id + reason_id + reason_id - current_recruitment_id - current_recruitment_id + full_name_responsible_user + full_name_responsible_user - target_recruitment_id - target_recruitment_id + sig_info + sig_info - full_name - full_name + recruitment_name + recruitment_name - addresses - addresses + recruitment_address + recruitment_address + + + visit_date + visit_date + + + status_id + status_id + + + create_date + create_date + + + status_change_date + status_change_date N @@ -366,10 +473,106 @@ ${LIMIT_FW} Y - 1024 + 688 320 + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_sent_summons + has_sent_summons + + + has_served_summons + has_served_summons + + + appeared_to_recruitment_center + appeared_to_recruitment_center + + + not_appeared_by_valid_excuse + not_appeared_by_valid_excuse + +
+ N + Y + + + 1328 + 176 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_sent_summons + has_sent_summons_raw == 1 + Boolean + -1 + -1 + + + + has_served_summons + has_served_summons_raw == 1 + Boolean + -1 + -1 + + + + appeared_to_recruitment_center + has_appeared_to_recruitment_center_raw == 1 + Boolean + -1 + -1 + + + + not_appeared_by_valid_excuse + has_not_appeared_by_valid_excuse_raw == 1 + Boolean + -1 + -1 + + + + + 1104 + 176 + + Table output @@ -383,6 +586,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl index 5f60fb2..824f5e6 100644 --- a/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_delta.hpl @@ -25,26 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - - - Identify last row in a stream - Insert / update - Y - - - Insert / update - Filter rows - Y - - - Insert / update - Detect empty stream - Y - Detect empty stream Change job status on success @@ -55,14 +35,54 @@ Change job status on success Y + + Change job status on error + Abort + Y + + + Table input + Insert / update + Y + Insert / update Change job status on error Y - Change job status on error - Abort + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update + Detect empty stream + Y + + + Update + Filter rows Y @@ -82,8 +102,8 @@ 0 - 1168 - 400 + 1392 + 528 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 944 - 400 + 1392 + 352 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 64 + 1872 + 208 @@ -180,8 +200,8 @@ where job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; - 336 - 224 + 352 + 352 @@ -197,8 +217,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 224 + 1632 + 208 @@ -233,8 +253,58 @@ and recruitment_id = '${IDM_ID}'; Change job status on success - 944 - 64 + 1632 + 320 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_sent_summons_raw + is_sent_summons + MAX + + + has_served_summons_raw + is_served_summons + MAX + + + has_appeared_to_recruitment_center_raw + is_appeared_to_recruitment_center + MAX + + + has_not_appeared_by_valid_excuse_raw + is_not_appeared_by_valid_excuse + MAX + + + N + + + recruit_id + + + N + grp + + + 752 + 208 @@ -251,15 +321,15 @@ and recruitment_id = '${IDM_ID}'; last_row - 736 - 224 + 944 + 208 Insert / update InsertUpdate - N + Y 1 @@ -271,68 +341,158 @@ and recruitment_id = '${IDM_ID}'; = - recruit_id - recruit_id + id + id ervu_dashboard - recruits_info
+ subpoena
- recruit_id - recruit_id + id + id N - created_at - created_at + recruit_id + recruit_id Y - updated_at - updated_at + send_date + send_date Y - info - info + series + series Y - gir_import_data_version_id - gir_import_data_version_id + number + number Y - current_recruitment_id - current_recruitment_id + reason_id + reason_id Y - target_recruitment_id - target_recruitment_id + full_name_responsible_user + full_name_responsible_user Y - full_name - full_name + sig_info + sig_info Y - addresses - addresses + recruitment_name + recruitment_name + Y + + + recruitment_address + recruitment_address + Y + + + visit_date + visit_date + Y + + + status_id + status_id + Y + + + create_date + create_date + Y + + + status_change_date + status_change_date Y
N - 944 - 224 + 752 + 352
Table input TableInput + Y + + 1 + + none + + + postgres.subpoena + N + + SELECT + s.id, --id повестки + CASE + WHEN s.send_date is not null THEN 1 + ELSE 0 + END AS is_sent_summons, --факт направления повестки///Признак наличия направленной повестки + CASE + WHEN s.system_stages->'subpoenaAwarded' != 'true' THEN 1 + ELSE 0 + END AS is_served_summons, --has_served_summons//Признак наличия врученной повестки + CASE + WHEN s.system_stages->'recruitAttendanceConfirm' != 'true' THEN 1 + ELSE 0 + END AS is_appeared_to_recruitment_center, -- appeared_to_recruitment_center//Признак явки в военный комиссариат + CASE + WHEN ss.code = '5.1' THEN 1 + ELSE 0 + END AS is_not_appeared_by_valid_excuse, -- not_appeared_by_valid_excuse//Признак неявки в военкомат по уважительной причине + s.recruit_id, + s.send_date, --дата направления повестки + s.series, --серия повестки + s.number, --новер повестки + s.reason_id AS subpoena_reason, --причина вызова по повестке /// код передавать или сразу наименование? + s.full_name_responsible_user, --фио военного комиссара(фио пользователя сформировавшео повестку) + s.sig_info, --сертификат ключа проверки ЭП + s.recruitment_name, --наименование ВК + s.recruitment_address, --адрес, по которому необходимо явиться + s.visit_date, --дата и время явки + --, --способ направления // искать в subpoena_send_info + --, --УН заказного почтового отправления // искать в subpoena_send_info + s.status_id, --статус // ссылка на справочник subpoena_status/// AS subpoena_status + s.create_date, --дата создания // для загрузки данных + s.status_change_date --дата обновления // для загрузки данных (timestamp without time zone) + +-- поля для карточки, раздел "Сведения о направлении повестки военного комиссариата" + +FROM public.subpoena s +join public.subpoena_status ss on s.status_id = ss.id +WHERE + '${IDM_ID}' != '' -- Проверка на пустую строку + AND s.department_id = '${IDM_ID}' + AND s.status_change_date >= '${M_R_UP_DATE}'::timestamp + +${LIMIT_FW} + Y + + + 560 + 352 + + + + Update + Update + N 1 @@ -340,35 +500,89 @@ and recruitment_id = '${IDM_ID}'; none - ervu_person_registry - N - - SELECT - r.system_create_date AS created_at, - r.system_update_date AS updated_at, - ri.recruit_id, - ri.info, - ri.gir_import_data_version_id, - r.current_recruitment_id, - r.target_recruitment_id, - r.full_name, - r.addresses -FROM recruits_info ri -JOIN recruits r ON r.id = ri.recruit_id -WHERE - '${IDM_ID}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${IDM_ID}' - --AND '${M_R_CR_DATE}' >= r.system_create_date - AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp - --AND '${CR_DATE}' < ri.created_at ---ORDER BY ri.created_at ASC; - -${LIMIT_FW} - Y + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_sent_summons + has_sent_summons + + + has_served_summons + has_served_summons + + + appeared_to_recruitment_center + appeared_to_recruitment_center + + + not_appeared_by_valid_excuse + not_appeared_by_valid_excuse + +
+ N + Y - 544 - 224 + 1392 + 208 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_sent_summons + has_sent_summons_raw == 1 + Boolean + -1 + -1 + + + + has_served_summons + has_served_summons_raw == 1 + Boolean + -1 + -1 + + + + appeared_to_recruitment_center + has_appeared_to_recruitment_center_raw == 1 + Boolean + -1 + -1 + + + + not_appeared_by_valid_excuse + has_not_appeared_by_valid_excuse_raw == 1 + Boolean + -1 + -1 + + + + + 1168 + 208 @@ -384,6 +598,18 @@ ${LIMIT_FW}
+ + Update + Change job status on error + Y + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl index 582920a..7a050d5 100644 --- a/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/subpoena/parallel/subpoena_flow_repeat.hpl @@ -25,11 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - Filter rows Change job status on success @@ -46,23 +41,48 @@ Y - Identify last row in a stream + Insert / update + Change job status on error + Y + + + Table input Insert / update Y - Insert / update - Filter rows + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update Y Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y - Insert / update - Change job status on error + Update + Filter rows Y @@ -82,7 +102,7 @@ 0 - 1248 + 1312 400 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 960 - 400 + 1312 + 208 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1440 - 48 + 1776 + 64 @@ -212,8 +232,8 @@ DO UPDATE SET - 1440 - 208 + 1568 + 64 @@ -248,8 +268,58 @@ DO UPDATE SET Change job status on success - 960 - 48 + 1568 + 176 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_sent_summons_raw + is_sent_summons + MAX + + + has_served_summons_raw + is_served_summons + MAX + + + has_appeared_to_recruitment_center_raw + is_appeared_to_recruitment_center + MAX + + + has_not_appeared_by_valid_excuse_raw + is_not_appeared_by_valid_excuse + MAX + + + N + + + recruit_id + + + N + grp + + + 672 + 64 @@ -266,15 +336,15 @@ DO UPDATE SET last_row - 720 - 208 + 864 + 64 Insert / update InsertUpdate - N + Y 1 @@ -286,61 +356,86 @@ DO UPDATE SET = - recruit_id - recruit_id + id + id ervu_dashboard - recruits_info
+ subpoena
- recruit_id - recruit_id + id + id N - created_at - created_at + recruit_id + recruit_id Y - updated_at - updated_at + send_date + send_date Y - info - info + series + series Y - gir_import_data_version_id - gir_import_data_version_id + number + number Y - current_recruitment_id - current_recruitment_id + reason_id + reason_id Y - target_recruitment_id - target_recruitment_id + full_name_responsible_user + full_name_responsible_user Y - full_name - full_name + sig_info + sig_info Y - addresses - addresses + recruitment_name + recruitment_name + Y + + + recruitment_address + recruitment_address + Y + + + visit_date + visit_date + Y + + + status_id + status_id + Y + + + create_date + create_date + Y + + + status_change_date + status_change_date Y
N - 960 + 672 208
@@ -348,33 +443,58 @@ DO UPDATE SET Table input TableInput - N + Y 1 none - ervu_person_registry + postgres.subpoena N + SELECT - r.system_create_date AS created_at, - r.system_update_date AS updated_at, - ri.recruit_id, - ri.info, - ri.gir_import_data_version_id, - r.current_recruitment_id, - r.target_recruitment_id, - r.full_name, - r.addresses -FROM recruits_info ri -JOIN recruits r ON r.id = ri.recruit_id + s.id, --id повестки + CASE + WHEN s.send_date is not null THEN 1 + ELSE 0 + END AS is_sent_summons, --факт направления повестки///Признак наличия направленной повестки + CASE + WHEN s.system_stages->'subpoenaAwarded' != 'true' THEN 1 + ELSE 0 + END AS is_served_summons, --has_served_summons//Признак наличия врученной повестки + CASE + WHEN s.system_stages->'recruitAttendanceConfirm' != 'true' THEN 1 + ELSE 0 + END AS is_appeared_to_recruitment_center, -- appeared_to_recruitment_center//Признак явки в военный комиссариат + CASE + WHEN ss.code = '5.1' THEN 1 + ELSE 0 + END AS is_not_appeared_by_valid_excuse, -- not_appeared_by_valid_excuse//Признак неявки в военкомат по уважительной причине + s.recruit_id, + s.send_date, --дата направления повестки + s.series, --серия повестки + s.number, --новер повестки + s.reason_id AS subpoena_reason, --причина вызова по повестке /// код передавать или сразу наименование? + s.full_name_responsible_user, --фио военного комиссара(фио пользователя сформировавшео повестку) + s.sig_info, --сертификат ключа проверки ЭП + s.recruitment_name, --наименование ВК + s.recruitment_address, --адрес, по которому необходимо явиться + s.visit_date, --дата и время явки + --, --способ направления // искать в subpoena_send_info + --, --УН заказного почтового отправления // искать в subpoena_send_info + s.status_id, --статус // ссылка на справочник subpoena_status/// AS subpoena_status + s.create_date, --дата создания // для загрузки данных + s.status_change_date --дата обновления // для загрузки данных (timestamp without time zone) + +-- поля для карточки, раздел "Сведения о направлении повестки военного комиссариата" + +FROM public.subpoena s +join public.subpoena_status ss on s.status_id = ss.id WHERE '${IDM_ID}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${IDM_ID}' - AND '${M_R_CR_DATE}' >= r.system_create_date - --AND '${CR_DATE}' < ri.created_at ---ORDER BY ri.created_at ASC; + AND s.department_id = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= s.create_date ${LIMIT_FW} Y @@ -385,8 +505,8 @@ ${LIMIT_FW} - Table output - TableOutput + Update + Update N @@ -395,63 +515,89 @@ ${LIMIT_FW} none - 1000 + 100 ervu-dashboard - - - recruit_id - recruit_id - - - created_at - created_at - - - updated_at - updated_at - - - info - info - - - gir_import_data_version_id - gir_import_data_version_id - - - current_recruitment_id - current_recruitment_id - - - target_recruitment_id - target_recruitment_id - - - full_name - full_name - - - addresses - addresses - - - N - N - N - N - Y - N - ervu_dashboard - Y - recruits_info
- N - Y - N + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_sent_summons + has_sent_summons + + + has_served_summons + has_served_summons + + + appeared_to_recruitment_center + appeared_to_recruitment_center + + + not_appeared_by_valid_excuse + not_appeared_by_valid_excuse + +
+ N Y - 816 - 544 + 1312 + 64 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_sent_summons + has_sent_summons_raw == 1 + Boolean + -1 + -1 + + + + has_served_summons + has_served_summons_raw == 1 + Boolean + -1 + -1 + + + + appeared_to_recruitment_center + has_appeared_to_recruitment_center_raw == 1 + Boolean + -1 + -1 + + + + not_appeared_by_valid_excuse + has_not_appeared_by_valid_excuse_raw == 1 + Boolean + -1 + -1 + + + + + 1088 + 64 @@ -468,9 +614,9 @@ ${LIMIT_FW}
- Table output + Update Change job status on error - N + Y diff --git a/mappings/info_recruits/citizen_tables/temporary_measures/temporary_measures_job.hwf b/mappings/info_recruits/citizen_tables/temporary_measures/temporary_measures_job.hwf index dd6f9b5..65fc996 100644 --- a/mappings/info_recruits/citizen_tables/temporary_measures/temporary_measures_job.hwf +++ b/mappings/info_recruits/citizen_tables/temporary_measures/temporary_measures_job.hwf @@ -201,8 +201,6 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/temporary_measures/recruitment_five_flow_delta.hpl - - Basic Y @@ -222,7 +220,7 @@ Start check_if_temporary_measures_job_exists.hpl - Y + N Y Y diff --git a/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl index 7b6dca1..53bb855 100644 --- a/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl +++ b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow.hpl @@ -40,31 +40,51 @@ Abort Y - - Table input - Identify last row in a stream - Y - - - Identify last row in a stream - Table output - Y - - - Table output - Filter rows - Y - Table output Change job status on error Y + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Table input + Table output + Y + Table output + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y + + Update + Filter rows + Y + Abort @@ -82,8 +102,8 @@ 0 - 1376 - 512 + 1312 + 464 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 1024 - 512 + 1312 + 320 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1632 - 160 + 1808 + 192 @@ -194,8 +214,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 1632 - 320 + 1552 + 192 @@ -230,8 +250,43 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); Change job status on success - 1024 - 160 + 1552 + 288 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_active_temporary_measure + is_active_temporary_measure + MAX + + + N + + + recruit_id + + + N + grp + + + 672 + 192 @@ -248,15 +303,15 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); last_row - 752 - 320 + 864 + 192 Table input TableInput - N + Y 1 @@ -267,10 +322,17 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N select +s.recruit_id, +CASE + WHEN rdi.applied_fact is true THEN 1 + ELSE 0 +END AS is_active_temporary_measure, -- has_active_temporary_measure//Признак наличия примененных временных мер rdi.* from public.restriction_document_item rdi join public.restriction_document rd on rd.id = coalesce(rdi.restriction_document_create_id,rdi.restriction_document_cancel_id) +join public.subpoena s on +s.id = rd.subpoena_id WHERE '${IDM_ID}' != '' -- Проверка на пустую строку AND rd.vk_id = '${IDM_ID}' @@ -288,7 +350,7 @@ ${LIMIT_FW} Table output TableOutput - N + Y 1 @@ -374,10 +436,70 @@ ${LIMIT_FW} Y - 1024 + 672 320 + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_active_temporary_measure + has_active_temporary_measure + +
+ N + Y + + + 1312 + 192 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_active_temporary_measure + has_active_temporary_measure_raw == 1 + Boolean + -1 + -1 + + + + + 1088 + 192 + + Table output @@ -391,6 +513,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl index 81c04a9..48ac0dc 100644 --- a/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl +++ b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_delta.hpl @@ -25,11 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - Detect empty stream Change job status on success @@ -46,23 +41,48 @@ Y - Identify last row in a stream + Insert / update + Change job status on error + Y + + + Table input Insert / update Y - Insert / update - Filter rows + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update Y Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y - Insert / update - Change job status on error + Update + Filter rows Y @@ -82,8 +102,8 @@ 0 - 1168 - 400 + 1376 + 368 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 944 - 400 + 1376 + 224 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 64 + 1920 + 96 @@ -197,8 +217,8 @@ and recruitment_id = '${IDM_ID}'; - 1248 - 224 + 1648 + 96 @@ -233,8 +253,43 @@ and recruitment_id = '${IDM_ID}'; Change job status on success - 944 - 64 + 1648 + 192 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_active_temporary_measure + is_active_temporary_measure + MAX + + + N + + + recruit_id + + + N + grp + + + 736 + 96 @@ -251,15 +306,15 @@ and recruitment_id = '${IDM_ID}'; last_row - 736 - 224 + 928 + 96 Insert / update InsertUpdate - N + Y 1 @@ -273,13 +328,11 @@ and recruitment_id = '${IDM_ID}'; = id id - = created_at created_at - ervu_dashboard restriction_document_item
@@ -362,7 +415,7 @@ and recruitment_id = '${IDM_ID}'; N - 944 + 736 224
@@ -370,7 +423,7 @@ and recruitment_id = '${IDM_ID}'; Table input TableInput - N + Y 1 @@ -380,10 +433,17 @@ and recruitment_id = '${IDM_ID}'; ervu_person_registry N select +s.recruit_id, +CASE + WHEN rdi.applied_fact is true THEN 1 + ELSE 0 +END AS is_active_temporary_measure, -- has_active_temporary_measure//Признак наличия примененных временных мер rdi.* from public.restriction_document_item rdi join public.restriction_document rd on rd.id = coalesce(rdi.restriction_document_create_id,rdi.restriction_document_cancel_id) +join public.subpoena s on +s.id = rd.subpoena_id WHERE '${IDM_ID}' != '' -- Проверка на пустую строку AND rd.vk_id = '${IDM_ID}' @@ -397,6 +457,66 @@ ${LIMIT_FW} 224 + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_active_temporary_measure + has_active_temporary_measure + +
+ N + Y + + + 1376 + 96 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_active_temporary_measure + has_active_temporary_measure_raw == 1 + Boolean + -1 + -1 + + + + + 1152 + 96 + + Insert / update @@ -410,6 +530,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl index 87a5793..edbbe21 100644 --- a/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl +++ b/mappings/info_recruits/raw_data/restriction_document_item/parallel/restriction_document_item_flow_repeat.hpl @@ -25,11 +25,6 @@ Table input Y - - Table input - Identify last row in a stream - Y - Filter rows Change job status on success @@ -46,23 +41,48 @@ Y - Identify last row in a stream + Insert / update + Change job status on error + Y + + + Table input Insert / update Y - Insert / update - Filter rows + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update Y Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update Detect empty stream Y - Insert / update - Change job status on error + Update + Filter rows Y @@ -82,7 +102,7 @@ 0 - 1248 + 1280 400 @@ -117,8 +137,8 @@ and recruitment_id = '${IDM_ID}'; - 960 - 400 + 1280 + 208 @@ -148,8 +168,8 @@ and recruitment_id = '${IDM_ID}'; - 1440 - 48 + 1744 + 80 @@ -212,8 +232,8 @@ DO UPDATE SET
- 1440 - 208 + 1488 + 80 @@ -248,8 +268,43 @@ DO UPDATE SET Change job status on success - 960 - 48 + 1504 + 192 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_active_temporary_measure + is_active_temporary_measure + MAX + + + N + + + recruit_id + + + N + grp + + + 640 + 80 @@ -266,15 +321,15 @@ DO UPDATE SET last_row - 720 - 208 + 832 + 80 Insert / update InsertUpdate - N + Y 1 @@ -288,13 +343,11 @@ DO UPDATE SET = id id - = created_at created_at - ervu_dashboard restriction_document_item
@@ -377,7 +430,7 @@ DO UPDATE SET N - 960 + 640 208
@@ -385,7 +438,7 @@ DO UPDATE SET Table input TableInput - N + Y 1 @@ -394,11 +447,19 @@ DO UPDATE SET postgres.subpoena N + select +s.recruit_id, +CASE + WHEN rdi.applied_fact is true THEN 1 + ELSE 0 +END AS is_active_temporary_measure, -- has_active_temporary_measure//Признак наличия примененных временных мер rdi.* from public.restriction_document_item rdi join public.restriction_document rd on rd.id = coalesce(rdi.restriction_document_create_id,rdi.restriction_document_cancel_id) +join public.subpoena s on +s.id = rd.subpoena_id WHERE '${IDM_ID}' != '' -- Проверка на пустую строку AND rd.vk_id = '${IDM_ID}' @@ -412,6 +473,66 @@ ${LIMIT_FW} 208 + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_active_temporary_measure + has_active_temporary_measure + +
+ N + Y + + + 1280 + 80 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_active_temporary_measure + has_active_temporary_measure_raw == 1 + Boolean + -1 + -1 + + + + + 1056 + 80 + + Insert / update @@ -425,6 +546,18 @@ ${LIMIT_FW} + + Update + Change job status on error + Y + + + + + + + + diff --git a/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl b/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl index 80c5491..dea22ce 100644 --- a/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl +++ b/mappings/info_recruits/raw_data/subpoena_send_info/parallel/subpoena_send_info_flow.hpl @@ -355,14 +355,11 @@ ${LIMIT_FW} N N N - Y - N ervu_dashboard Y subpoena_send_info
- N Y N diff --git a/mappings/info_recruits/reference_data/send_dictionary.hpl b/mappings/info_recruits/reference_data/send_dictionary.hpl new file mode 100644 index 0000000..3d75733 --- /dev/null +++ b/mappings/info_recruits/reference_data/send_dictionary.hpl @@ -0,0 +1,114 @@ + + + + send_dictionary + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/27 18:10:55.738 + - + 2025/08/27 18:10:55.738 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + ervu_dashboard + send_dictionary
+ + id + id + N + + + code + code + Y + + + hidden + hidden + Y + + + name + name + Y + + + to_front + to_front + Y + + + type + type + Y + +
+ N + + + 880 + 288 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + postgres.subpoena + N + 0 + select * from public.send_dictionary + N + + + 496 + 288 + + + + + +
From 22098a0ba4d7a02ae4204e3ac1df80b5fbf3bc15 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Mon, 1 Sep 2025 12:06:36 +0500 Subject: [PATCH 32/34] fix --- .../property/check_if_need_to_repeat_job.hpl | 86 ++ .../check_if_property_job_exists.hpl | 113 +++ .../property/parallel/property_flow.hpl | 722 +++++++++++++++++ .../property/parallel/property_flow_delta.hpl | 743 +++++++++++++++++ .../parallel/property_flow_repeat.hpl | 757 ++++++++++++++++++ .../citizen_tables/property/property_job.hwf | 358 +++++++++ .../property/recruitment_five_flow_delta.hpl | 360 +++++++++ .../recruitment_five_flow_on_error.hpl | 360 +++++++++ .../property/recruitments_five_flow.hpl | 373 +++++++++ .../subpoena/check_if_need_to_repeat_job.hpl | 2 +- 10 files changed, 3873 insertions(+), 1 deletion(-) create mode 100644 mappings/info_recruits/citizen_tables/property/check_if_need_to_repeat_job.hpl create mode 100644 mappings/info_recruits/citizen_tables/property/checkpoints/check_if_property_job_exists.hpl create mode 100644 mappings/info_recruits/citizen_tables/property/parallel/property_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/property/parallel/property_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/property/parallel/property_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/property/property_job.hwf create mode 100644 mappings/info_recruits/citizen_tables/property/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/property/recruitment_five_flow_on_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/property/recruitments_five_flow.hpl diff --git a/mappings/info_recruits/citizen_tables/property/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/property/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..f15ccdf --- /dev/null +++ b/mappings/info_recruits/citizen_tables/property/check_if_need_to_repeat_job.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat_job + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 12:27:51.630 + - + 2025/08/08 12:27:51.630 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 624 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'subpoena_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 336 + 288 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/property/checkpoints/check_if_property_job_exists.hpl b/mappings/info_recruits/citizen_tables/property/checkpoints/check_if_property_job_exists.hpl new file mode 100644 index 0000000..09a5ca3 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/property/checkpoints/check_if_property_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_property_job_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 13:28:46.661 + - + 2025/08/05 13:28:46.661 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 672 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'property_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Y + + + N + 0 + Basic + ${STATUS} + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/property/parallel/property_flow.hpl b/mappings/info_recruits/citizen_tables/property/parallel/property_flow.hpl new file mode 100644 index 0000000..a387b6a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/property/parallel/property_flow.hpl @@ -0,0 +1,722 @@ + + + + property_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table output + Change job status on error + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Table input + Table output + Y + + + Table output + Group by + Y + + + Update + Change job status on error + Y + + + Update + Detect empty stream + Y + + + Update + Filter rows + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1328 + 496 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1328 + 320 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1856 + 176 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1536 + 176 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1536 + 304 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_property_raw + is_property + MAX + + + has_ground_transport_raw + is_ground_transport + MAX + + + has_air_transport_raw + is_air_transport + MAX + + + has_water_transport_raw + is_water_transport + MAX + + + N + + + recruit_id + + + N + grp + + + 688 + 176 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 880 + 176 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH +base as( + SELECT + ri.recruit_id, + ri.info + FROM ervu_dashboard.recruits_info ri + join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}'::timestamp >= ri.created_at +), +prop AS ( + SELECT + base.recruit_id, + 'realty' AS property_type, + ry.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + THEN base.info->'svedFL'->'svedON'->'on' + ELSE '[]'::jsonb + END + ) AS ry ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'ground_transportation' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + THEN base.info->'svedFL'->'svedNazTS'->'nazTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'air_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + THEN base.info->'svedFL'->'svedVozTS'->'vozTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'water_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' + THEN base.info->'svedFL'->'svedVodTS'->'vodTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' +), +all_data as( + -- Недвижимость + SELECT + base.recruit_id, + property_data->>'naimVidPrav' AS kind_right, -- Исправлено название поля + property_data->'adrObSob'->>'adrObSobTekst' AS address, + NULL AS vehicle_type, -- Добавлено для соответствия числа столбцов + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPrav', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPrav', 'YYYY-MM-DD') AS close_date, + 'realty' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'realty' + + UNION ALL + + -- Наземный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'vidTS' AS vehicle_type, + property_data->>'godVyp' AS issue_year, + property_data->>'markaTS' AS brand_model, + property_data->>'gosRegZn' AS reg_plate, + property_data->>'idenNom' AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'ground_transportation' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'ground_transportation' + + UNION ALL + + -- Воздушный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'air_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'air_vehicles' + + UNION ALL + + -- Водный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'water_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'water_vehicles' +) +select + *, + CASE + WHEN type_property = 'realty' THEN 1 + ELSE 0 + END AS is_property, -- недвиж//has_property + CASE + WHEN type_property = 'ground_transportation'THEN 1 + ELSE 0 + END AS is_ground_transport, -- наземный транспорт//has_ground_transport + CASE + WHEN type_property = 'air_vehicles' THEN 1 + ELSE 0 + END AS is_air_transport, -- воздушный транспорт//has_air_transport + CASE + WHEN type_property = 'water_vehicles' THEN 1 + ELSE 0 + END AS is_water_transport -- водный транспорт//has_water_transport +from all_data + Y + + + 496 + 320 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + kind_right + kind_right + + + address + address + + + vehicle_type + vehicle_type + + + issue_year + issue_year + + + brand_model + brand_model + + + reg_plate + reg_plate + + + vin + vin + + + vehicle_category + vehicle_category + + + start_date + start_date + + + close_date + close_date + + + type_property + type_property + + + N + N + N + N + Y + N + ervu_dashboard + Y + property
+ N + Y + N + Y + + + 688 + 320 + +
+ + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_property + has_property + + + has_ground_transport + has_ground_transport + + + has_air_transport + has_air_transport + + + has_water_transport + has_water_transport + +
+ N + Y + + + 1328 + 176 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_property + has_property_raw == 1 + Boolean + -1 + -1 + + + + has_ground_transport + has_ground_transport_raw == 1 + Boolean + -1 + -1 + + + + has_air_transport + has_air_transport_raw == 1 + Boolean + -1 + -1 + + + + has_water_transport + has_water_transport_raw == 1 + Boolean + -1 + -1 + + + + + 1104 + 176 + + + + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + Update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/property/parallel/property_flow_delta.hpl b/mappings/info_recruits/citizen_tables/property/parallel/property_flow_delta.hpl new file mode 100644 index 0000000..2499f87 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/property/parallel/property_flow_delta.hpl @@ -0,0 +1,743 @@ + + + + property_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Insert / update + Y + + + Insert / update + Change job status on error + Y + + + Insert / update + Group by + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Update + Detect empty stream + Y + + + Update + Filter rows + Y + + + Update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1392 + 528 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1392 + 352 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1872 + 208 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 352 + 352 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1632 + 320 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_property_raw + is_property + MAX + + + has_ground_transport_raw + is_ground_transport + MAX + + + has_air_transport_raw + is_air_transport + MAX + + + has_water_transport_raw + is_water_transport + MAX + + + N + + + recruit_id + + + N + grp + + + 752 + 208 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 944 + 208 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + = + start_date + start_date + + + = + type_property + type_property + + ervu_dashboard + property
+ + recruit_id + recruit_id + N + + + kind_right + kind_right + Y + + + address + address + Y + + + vehicle_type + vehicle_type + Y + + + issue_year + issue_year + Y + + + brand_model + brand_model + Y + + + reg_plate + reg_plate + Y + + + vin + vin + Y + + + vehicle_category + vehicle_category + Y + + + start_date + start_date + Y + + + close_date + close_date + Y + + + type_property + type_property + Y + +
+ N + + + 752 + 352 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH +base as( + SELECT + ri.recruit_id, + ri.info + FROM ervu_dashboard.recruits_info ri + join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + --AND '${M_R_CR_DATE}'::timestamp >= ri.created_at + AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp +), +prop AS ( + SELECT + base.recruit_id, + 'realty' AS property_type, + ry.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + THEN base.info->'svedFL'->'svedON'->'on' + ELSE '[]'::jsonb + END + ) AS ry ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'ground_transportation' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + THEN base.info->'svedFL'->'svedNazTS'->'nazTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'air_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + THEN base.info->'svedFL'->'svedVozTS'->'vozTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'water_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' + THEN base.info->'svedFL'->'svedVodTS'->'vodTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' +), +all_data as( + -- Недвижимость + SELECT + base.recruit_id, + property_data->>'naimVidPrav' AS kind_right, -- Исправлено название поля + property_data->'adrObSob'->>'adrObSobTekst' AS address, + NULL AS vehicle_type, -- Добавлено для соответствия числа столбцов + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPrav', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPrav', 'YYYY-MM-DD') AS close_date, + 'realty' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'realty' + + UNION ALL + + -- Наземный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'vidTS' AS vehicle_type, + property_data->>'godVyp' AS issue_year, + property_data->>'markaTS' AS brand_model, + property_data->>'gosRegZn' AS reg_plate, + property_data->>'idenNom' AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'ground_transportation' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'ground_transportation' + + UNION ALL + + -- Воздушный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'air_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'air_vehicles' + + UNION ALL + + -- Водный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'water_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'water_vehicles' +) +select + *, + CASE + WHEN type_property = 'realty' THEN 1 + ELSE 0 + END AS is_property, -- недвиж//has_property + CASE + WHEN type_property = 'ground_transportation' THEN 1 + ELSE 0 + END AS is_ground_transport, -- наземный транспорт//has_ground_transport + CASE + WHEN type_property = 'air_vehicles' THEN 1 + ELSE 0 + END AS is_air_transport, -- воздушный транспорт//has_air_transport + CASE + WHEN type_property = 'water_vehicles' THEN 1 + ELSE 0 + END AS is_water_transport -- водный транспорт//has_water_transport +from all_data + Y + + + 560 + 352 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_property + has_property + + + has_ground_transport + has_ground_transport + + + has_air_transport + has_air_transport + + + has_water_transport + has_water_transport + +
+ N + Y + + + 1392 + 208 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_property + has_property_raw == 1 + Boolean + -1 + -1 + + + + has_ground_transport + has_ground_transport_raw == 1 + Boolean + -1 + -1 + + + + has_air_transport + has_air_transport_raw == 1 + Boolean + -1 + -1 + + + + has_water_transport + has_water_transport_raw == 1 + Boolean + -1 + -1 + + + + + 1168 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + Update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/property/parallel/property_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/property/parallel/property_flow_repeat.hpl new file mode 100644 index 0000000..2aa2f33 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/property/parallel/property_flow_repeat.hpl @@ -0,0 +1,757 @@ + + + + property_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Insert / update + Change job status on error + Y + + + Table input + Insert / update + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update + Detect empty stream + Y + + + Update + Filter rows + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1312 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1312 + 208 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1776 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1568 + 64 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1568 + 176 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_property_raw + is_property + MAX + + + has_ground_transport_raw + is_ground_transport + MAX + + + has_air_transport_raw + is_air_transport + MAX + + + has_water_transport_raw + is_water_transport + MAX + + + N + + + recruit_id + + + N + grp + + + 672 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 864 + 64 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + = + start_date + start_date + + + = + type_property + type_property + + ervu_dashboard + property
+ + recruit_id + recruit_id + N + + + kind_right + kind_right + Y + + + address + address + Y + + + vehicle_type + vehicle_type + Y + + + issue_year + issue_year + Y + + + brand_model + brand_model + Y + + + reg_plate + reg_plate + Y + + + vin + vin + Y + + + vehicle_category + vehicle_category + Y + + + start_date + start_date + Y + + + close_date + close_date + Y + + + type_property + type_property + Y + +
+ N + + + 672 + 208 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH +base as( + SELECT + ri.recruit_id, + ri.info + FROM ervu_dashboard.recruits_info ri + join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}'::timestamp >= ri.created_at +), +prop AS ( + SELECT + base.recruit_id, + 'realty' AS property_type, + ry.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + THEN base.info->'svedFL'->'svedON'->'on' + ELSE '[]'::jsonb + END + ) AS ry ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'ground_transportation' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + THEN base.info->'svedFL'->'svedNazTS'->'nazTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'air_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + THEN base.info->'svedFL'->'svedVozTS'->'vozTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'water_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' + THEN base.info->'svedFL'->'svedVodTS'->'vodTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' +), +all_data as( + -- Недвижимость + SELECT + base.recruit_id, + property_data->>'naimVidPrav' AS kind_right, -- Исправлено название поля + property_data->'adrObSob'->>'adrObSobTekst' AS address, + NULL AS vehicle_type, -- Добавлено для соответствия числа столбцов + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPrav', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPrav', 'YYYY-MM-DD') AS close_date, + 'realty' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'realty' + + UNION ALL + + -- Наземный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'vidTS' AS vehicle_type, + property_data->>'godVyp' AS issue_year, + property_data->>'markaTS' AS brand_model, + property_data->>'gosRegZn' AS reg_plate, + property_data->>'idenNom' AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'ground_transportation' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'ground_transportation' + + UNION ALL + + -- Воздушный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'air_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'air_vehicles' + + UNION ALL + + -- Водный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'water_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'water_vehicles' +) +select + *, + CASE + WHEN type_property = 'realty' THEN 1 + ELSE 0 + END AS is_property, -- недвиж//has_property + CASE + WHEN type_property = 'ground_transportation' THEN 1 + ELSE 0 + END AS is_ground_transport, -- наземный транспорт//has_ground_transport + CASE + WHEN type_property = 'air_vehicles' THEN 1 + ELSE 0 + END AS is_air_transport, -- воздушный транспорт//has_air_transport + CASE + WHEN type_property = 'water_vehicles' THEN 1 + ELSE 0 + END AS is_water_transport -- водный транспорт//has_water_transport +from all_data + Y + + + 480 + 208 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_property + has_property + + + has_ground_transport + has_ground_transport + + + has_air_transport + has_air_transport + + + has_water_transport + has_water_transport + +
+ N + Y + + + 1312 + 64 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_property + has_property_raw == 1 + Boolean + -1 + -1 + + + + has_ground_transport + has_ground_transport_raw == 1 + Boolean + -1 + -1 + + + + has_air_transport + has_air_transport_raw == 1 + Boolean + -1 + -1 + + + + has_water_transport + has_water_transport_raw == 1 + Boolean + -1 + -1 + + + + + 1088 + 64 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + Update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/property/property_job.hwf b/mappings/info_recruits/citizen_tables/property/property_job.hwf new file mode 100644 index 0000000..c805415 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/property/property_job.hwf @@ -0,0 +1,358 @@ + + + property_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 224 + 304 + + + + check_if_property_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/property/checkpoints/check_if_property_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + subpoena_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 688 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/property/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 928 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/property/recruitment_five_flow_on_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 928 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 688 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 688 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/property/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 688 + 800 + + + + + + Start + check_if_property_job_exists.hpl + Y + Y + Y + + + check_if_property_job_exists.hpl + subpoena_job_exists_check + Y + Y + N + + + subpoena_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + subpoena_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 800 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 800 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 608 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + subpoena_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 114 + + + + diff --git a/mappings/info_recruits/citizen_tables/property/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/property/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..0ac96e5 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/property/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + property_flow_delta.hpl + Y + + + Table input + property_flow_delta.hpl 2 + Y + + + Table input + property_flow_delta.hpl 3 + Y + + + Table input + property_flow_delta.hpl 4 + Y + + + Table input + property_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'property_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + property_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 128 + + + + property_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 208 + + + + property_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 288 + + + + property_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 368 + + + + property_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/property/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/property/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..b7c2cde --- /dev/null +++ b/mappings/info_recruits/citizen_tables/property/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + property_flow_repeat.hpl + Y + + + Table input + property_flow_repeat.hpl 2 + Y + + + Table input + property_flow_repeat.hpl 3 + Y + + + Table input + property_flow_repeat.hpl 4 + Y + + + Table input + property_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'property_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + property_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + property_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + property_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + property_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 448 + + + + property_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/property/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/property/recruitments_five_flow.hpl new file mode 100644 index 0000000..14c764d --- /dev/null +++ b/mappings/info_recruits/citizen_tables/property/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + property_flow.hpl + Y + + + Get all recruitments ordered by created_date + property_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + property_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + property_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + property_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + property_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 144 + + + + property_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 224 + + + + property_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 304 + + + + property_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 384 + + + + property_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/property/parallel/property_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + property_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl index f15ccdf..b70250e 100644 --- a/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl +++ b/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl @@ -69,7 +69,7 @@ FROM ervu_dashboard.recruitment r LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id - and job_name = 'subpoena_job' + and job_name = 'property_job' where je.status is null or je.status in ('ERROR', 'PROCESSING') limit 1 ) as need_to_repeat_job; From 88bcddcfe5e8ea274cab6a3a634eef170cb41072 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Wed, 3 Sep 2025 17:07:33 +0300 Subject: [PATCH 33/34] fix fz53 --- mappings/connections/external_to_test1.json | 2 +- .../citizen_criminal_liability_fz53_flow.hpl | 28 +++++- ...zen_criminal_liability_fz53_flow_delta.hpl | 21 +++- ...en_criminal_liability_fz53_flow_repeat.hpl | 31 +++++- .../restriction_document_status.hpl | 1 - .../reference_data/subpoena_status.hpl | 99 +++++++++++++++++++ 6 files changed, 173 insertions(+), 9 deletions(-) create mode 100644 mappings/info_recruits/reference_data/subpoena_status.hpl diff --git a/mappings/connections/external_to_test1.json b/mappings/connections/external_to_test1.json index 45d636b..c4da331 100644 --- a/mappings/connections/external_to_test1.json +++ b/mappings/connections/external_to_test1.json @@ -29,7 +29,7 @@ "description" : "" }, { "name" : "DB_DASHBOARD_NAME", - "value" : "ervu-dashboard-test1", + "value" : "ervu-dashboard-test", "description" : "" }, { "name" : "DB_DASHBOARD_USERNAME", diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl index ecc5a21..0d5fb92 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow.hpl @@ -273,7 +273,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); has_criminal_liability_fz53_raw is_criminal_liability_fz53 MAX - N @@ -283,7 +282,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N - grp @@ -350,15 +348,27 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); CASE WHEN i.hidden is false THEN 1 ELSE 0 - END AS is_criminal_liability_fz53 + END AS is_criminal_liability_fz53, + (i.extra_info->>'dateApplication')::date AS date_application,--дата с которой наложена мера + i.extra_info->>'description' AS description,--описание наказания + i.extra_info->>'reasonForAddEntry' AS reason_for_add_entry--основания для внесения записи + FROM public.infringement i + JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= i.created_at + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты + WHERE --hidden IS FALSE AND + i.type = 'CRIMINAL' + + ${LIMIT_FW} Y @@ -429,6 +439,18 @@ ${LIMIT_FW} hidden hidden + + date_application + date_application + + + description + description + + + reason_for_add_entry + reason_for_add_entry + N N diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl index ebdf8a6..0201a15 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl @@ -396,6 +396,21 @@ and recruitment_id = '${IDM_ID}'; hidden Y + + date_application + date_application + Y + + + description + description + Y + + + reason_for_add_entry + reason_for_add_entry + Y + N @@ -417,6 +432,7 @@ and recruitment_id = '${IDM_ID}'; postgres.decision-document-service N + SELECT i.recruit_id, i.created_at, @@ -444,7 +460,10 @@ and recruitment_id = '${IDM_ID}'; CASE WHEN i.hidden is false THEN 1 ELSE 0 - END AS is_criminal_liability_fz53 + END AS is_criminal_liability_fz53, + (i.extra_info->>'dateApplication')::date AS date_application,--дата с которой наложена мера + i.extra_info->>'description' AS description,--описание наказания + i.extra_info->>'reasonForAddEntry' AS reason_for_add_entry--основания для внесения записи FROM public.infringement i JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' diff --git a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl index 77983ed..2602be1 100644 --- a/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_repeat.hpl @@ -291,7 +291,6 @@ DO UPDATE SET has_criminal_liability_fz53_raw is_criminal_liability_fz53 MAX - N @@ -301,7 +300,6 @@ DO UPDATE SET N - grp @@ -413,6 +411,21 @@ DO UPDATE SET hidden Y + + date_application + date_application + Y + + + description + description + Y + + + reason_for_add_entry + reason_for_add_entry + Y + N @@ -462,15 +475,27 @@ DO UPDATE SET CASE WHEN i.hidden is false THEN 1 ELSE 0 - END AS is_criminal_liability_fz53 + END AS is_criminal_liability_fz53, + (i.extra_info->>'dateApplication')::date AS date_application,--дата с которой наложена мера + i.extra_info->>'description' AS description,--описание наказания + i.extra_info->>'reasonForAddEntry' AS reason_for_add_entry--основания для внесения записи + FROM public.infringement i + JOIN public.recruit r ON r.id = i.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(r.current_recruitment, r.target_recruitment) = '${IDM_ID}' + AND '${M_R_CR_DATE}' >= i.created_at + --AND '${INFRINGEMENT_DATE}'::timestamp <= coalesce(i.updated_at, i.created_at) -- для дельты + WHERE --hidden IS FALSE AND + i.type = 'CRIMINAL' + + ${LIMIT_FW} Y diff --git a/mappings/info_recruits/reference_data/restriction_document_status.hpl b/mappings/info_recruits/reference_data/restriction_document_status.hpl index 4d5a79d..75245f5 100644 --- a/mappings/info_recruits/reference_data/restriction_document_status.hpl +++ b/mappings/info_recruits/reference_data/restriction_document_status.hpl @@ -44,7 +44,6 @@ = id id - ervu_dashboard restriction_document_status
diff --git a/mappings/info_recruits/reference_data/subpoena_status.hpl b/mappings/info_recruits/reference_data/subpoena_status.hpl new file mode 100644 index 0000000..7b03598 --- /dev/null +++ b/mappings/info_recruits/reference_data/subpoena_status.hpl @@ -0,0 +1,99 @@ + + + + subpoena_status + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/09/03 11:49:15.431 + - + 2025/09/03 11:49:15.431 + + + + + + Table input + Insert / update + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + ervu_dashboard + subpoena_status
+ + id + id + N + + + code + code + Y + + + name + name + Y + +
+ N + + + 1008 + 336 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + postgres.subpoena + N + 0 + select * from public.subpoena_status + N + + + 624 + 336 + + + + + +
From 41da6ea4d969c60112f742f3f21617b9cf58090e Mon Sep 17 00:00:00 2001 From: Ruslan Date: Thu, 4 Sep 2025 08:04:15 +0300 Subject: [PATCH 34/34] / --- .../check_if_need_to_repeat_job.hpl | 86 ++ .../check_if_citizenship_job_exists.hpl | 113 +++ .../citizenship/citizenship_job.hwf | 358 +++++++++ .../citizenship/parallel/citizenship_flow.hpl | 722 +++++++++++++++++ .../parallel/citizenship_flow_delta.hpl | 743 +++++++++++++++++ .../parallel/citizenship_flow_repeat.hpl | 757 ++++++++++++++++++ .../recruitment_five_flow_delta.hpl | 360 +++++++++ .../recruitment_five_flow_on_error.hpl | 360 +++++++++ .../citizenship/recruitments_five_flow.hpl | 373 +++++++++ .../property/check_if_need_to_repeat_job.hpl | 2 +- .../citizen_tables/property/property_job.hwf | 4 +- .../subpoena/check_if_need_to_repeat_job.hpl | 2 +- 12 files changed, 3877 insertions(+), 3 deletions(-) create mode 100644 mappings/info_recruits/citizen_tables/citizenship/check_if_need_to_repeat_job.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizenship/checkpoints/check_if_citizenship_job_exists.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizenship/citizenship_job.hwf create mode 100644 mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_repeat.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizenship/recruitment_five_flow_delta.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizenship/recruitment_five_flow_on_error.hpl create mode 100644 mappings/info_recruits/citizen_tables/citizenship/recruitments_five_flow.hpl diff --git a/mappings/info_recruits/citizen_tables/citizenship/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/citizenship/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..b63f652 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizenship/check_if_need_to_repeat_job.hpl @@ -0,0 +1,86 @@ + + + + check_if_need_to_repeat_job + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 12:27:51.630 + - + 2025/08/08 12:27:51.630 + + + + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + need_to_repeat_job + NEED_TO_REPEAT_JOB + ROOT_WORKFLOW + + + Y + + + 624 + 288 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS (SELECT 1 +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizenship_job' +where je.status is null or je.status in ('ERROR', 'PROCESSING') +limit 1 +) as need_to_repeat_job; + N + + + 336 + 288 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizenship/checkpoints/check_if_citizenship_job_exists.hpl b/mappings/info_recruits/citizen_tables/citizenship/checkpoints/check_if_citizenship_job_exists.hpl new file mode 100644 index 0000000..99157b0 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizenship/checkpoints/check_if_citizenship_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_citizenship_job_exists + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 13:28:46.661 + - + 2025/08/05 13:28:46.661 + + + + + + Set variables + Write to log + N + + + Table input + Set variables + Y + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + job_executed_flag + JOB_EXECUTED_FLAG + PARENT_WORKFLOW + + + Y + + + 672 + 336 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'citizenship_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Y + + + N + 0 + Basic + ${STATUS} + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizenship/citizenship_job.hwf b/mappings/info_recruits/citizen_tables/citizenship/citizenship_job.hwf new file mode 100644 index 0000000..f0195f9 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizenship/citizenship_job.hwf @@ -0,0 +1,358 @@ + + + citizenship_job + Y + + + + 0 + - + 2025/08/05 12:45:28.561 + - + 2025/08/05 12:45:28.561 + + + COMMENT + + + + + LIMIT_FW + ; + + + + M_R_CR_DATE + 3001-01-01 00:00:00 + + + + M_R_UP_DATE + 0001-01-01 00:00:00 + + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 224 + 304 + + + + check_if_citizenship_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/checkpoints/check_if_citizenship_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + citizenship_job_exists_check + + SIMPLE_EVAL + + boolean + false + equal + equal + N + variable + JOB_EXECUTED_FLAG + N + 688 + 304 + + + + recruitments_five_flow.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/recruitments_five_flow.hpl + Basic + + Y + + N + local + N + N + Y + Y + 928 + 304 + + + + recruitment_five_flow_on_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/recruitment_five_flow_on_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 928 + 608 + + + + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/check_if_need_to_repeat_job.hpl + Basic + + Y + + N + local + N + N + Y + N + 688 + 464 + + + + Simple evaluation + + SIMPLE_EVAL + + boolean + true + equal + equal + N + variable + NEED_TO_REPEAT_JOB + N + 688 + 608 + + + + recruitment_five_flow_delta.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 688 + 800 + + + + + + Start + check_if_citizenship_job_exists.hpl + Y + Y + Y + + + check_if_citizenship_job_exists.hpl + citizenship_job_exists_check + Y + Y + N + + + citizenship_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + citizenship_job_exists_check + check_if_need_to_repeat_job.hpl + Y + N + N + + + check_if_need_to_repeat_job.hpl + Simple evaluation + Y + Y + N + + + Simple evaluation + recruitment_five_flow_on_error.hpl + Y + Y + N + + + Simple evaluation + recruitment_five_flow_delta.hpl + Y + N + N + + + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 800 + 256 + Первичка + 65 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 800 + 560 + Повторка + 64 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + -1 + 26 + 608 + 720 + Дельта + 49 + + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 150 + 1200 + 80 + citizenship_job + +M_R_UP_DATE + +M_R_CR_DATE + +0001-01-01 00:00:00 + +3001-01-01 00:00:00 + 114 + + + + diff --git a/mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow.hpl b/mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow.hpl new file mode 100644 index 0000000..632f01c --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow.hpl @@ -0,0 +1,722 @@ + + + + citizenship_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 14:31:22.799 + - + 2025/08/05 14:31:22.799 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table output + Change job status on error + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Table input + Table output + Y + + + Table output + Group by + Y + + + Update + Change job status on error + Y + + + Update + Detect empty stream + Y + + + Update + Filter rows + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1328 + 496 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1328 + 320 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1856 + 176 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id) +VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + + + + + 288 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1536 + 176 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1536 + 304 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_property_raw + is_property + MAX + + + has_ground_transport_raw + is_ground_transport + MAX + + + has_air_transport_raw + is_air_transport + MAX + + + has_water_transport_raw + is_water_transport + MAX + + + N + + + recruit_id + + + N + grp + + + 688 + 176 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 880 + 176 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH +base as( + SELECT + ri.recruit_id, + ri.info + FROM ervu_dashboard.recruits_info ri + join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}'::timestamp >= ri.created_at +), +prop AS ( + SELECT + base.recruit_id, + 'realty' AS property_type, + ry.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + THEN base.info->'svedFL'->'svedON'->'on' + ELSE '[]'::jsonb + END + ) AS ry ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'ground_transportation' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + THEN base.info->'svedFL'->'svedNazTS'->'nazTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'air_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + THEN base.info->'svedFL'->'svedVozTS'->'vozTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'water_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' + THEN base.info->'svedFL'->'svedVodTS'->'vodTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' +), +all_data as( + -- Недвижимость + SELECT + base.recruit_id, + property_data->>'naimVidPrav' AS kind_right, -- Исправлено название поля + property_data->'adrObSob'->>'adrObSobTekst' AS address, + NULL AS vehicle_type, -- Добавлено для соответствия числа столбцов + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPrav', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPrav', 'YYYY-MM-DD') AS close_date, + 'realty' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'realty' + + UNION ALL + + -- Наземный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'vidTS' AS vehicle_type, + property_data->>'godVyp' AS issue_year, + property_data->>'markaTS' AS brand_model, + property_data->>'gosRegZn' AS reg_plate, + property_data->>'idenNom' AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'ground_transportation' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'ground_transportation' + + UNION ALL + + -- Воздушный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'air_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'air_vehicles' + + UNION ALL + + -- Водный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'water_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'water_vehicles' +) +select + *, + CASE + WHEN type_property = 'realty' THEN 1 + ELSE 0 + END AS is_property, -- недвиж//has_property + CASE + WHEN type_property = 'ground_transportation'THEN 1 + ELSE 0 + END AS is_ground_transport, -- наземный транспорт//has_ground_transport + CASE + WHEN type_property = 'air_vehicles' THEN 1 + ELSE 0 + END AS is_air_transport, -- воздушный транспорт//has_air_transport + CASE + WHEN type_property = 'water_vehicles' THEN 1 + ELSE 0 + END AS is_water_transport -- водный транспорт//has_water_transport +from all_data + Y + + + 496 + 320 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + kind_right + kind_right + + + address + address + + + vehicle_type + vehicle_type + + + issue_year + issue_year + + + brand_model + brand_model + + + reg_plate + reg_plate + + + vin + vin + + + vehicle_category + vehicle_category + + + start_date + start_date + + + close_date + close_date + + + type_property + type_property + + + N + N + N + N + Y + N + ervu_dashboard + Y + property
+ N + Y + N + Y + + + 688 + 320 + +
+ + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_property + has_property + + + has_ground_transport + has_ground_transport + + + has_air_transport + has_air_transport + + + has_water_transport + has_water_transport + +
+ N + Y + + + 1328 + 176 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_property + has_property_raw == 1 + Boolean + -1 + -1 + + + + has_ground_transport + has_ground_transport_raw == 1 + Boolean + -1 + -1 + + + + has_air_transport + has_air_transport_raw == 1 + Boolean + -1 + -1 + + + + has_water_transport + has_water_transport_raw == 1 + Boolean + -1 + -1 + + + + + 1104 + 176 + + + + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + Update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_delta.hpl new file mode 100644 index 0000000..08270bf --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_delta.hpl @@ -0,0 +1,743 @@ + + + + citizenship_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Create job execution record + Table input + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Table input + Insert / update + Y + + + Insert / update + Change job status on error + Y + + + Insert / update + Group by + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Update + Detect empty stream + Y + + + Update + Filter rows + Y + + + Update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1392 + 528 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1392 + 352 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1872 + 208 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + UPDATE etl.job_execution +SET + status = 'DELTA_PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 352 + 352 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1632 + 208 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1632 + 320 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_property_raw + is_property + MAX + + + has_ground_transport_raw + is_ground_transport + MAX + + + has_air_transport_raw + is_air_transport + MAX + + + has_water_transport_raw + is_water_transport + MAX + + + N + + + recruit_id + + + N + grp + + + 752 + 208 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 944 + 208 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + = + start_date + start_date + + + = + type_property + type_property + + ervu_dashboard + property
+ + recruit_id + recruit_id + N + + + kind_right + kind_right + Y + + + address + address + Y + + + vehicle_type + vehicle_type + Y + + + issue_year + issue_year + Y + + + brand_model + brand_model + Y + + + reg_plate + reg_plate + Y + + + vin + vin + Y + + + vehicle_category + vehicle_category + Y + + + start_date + start_date + Y + + + close_date + close_date + Y + + + type_property + type_property + Y + +
+ N + + + 752 + 352 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH +base as( + SELECT + ri.recruit_id, + ri.info + FROM ervu_dashboard.recruits_info ri + join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + --AND '${M_R_CR_DATE}'::timestamp >= ri.created_at + AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp +), +prop AS ( + SELECT + base.recruit_id, + 'realty' AS property_type, + ry.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + THEN base.info->'svedFL'->'svedON'->'on' + ELSE '[]'::jsonb + END + ) AS ry ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'ground_transportation' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + THEN base.info->'svedFL'->'svedNazTS'->'nazTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'air_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + THEN base.info->'svedFL'->'svedVozTS'->'vozTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'water_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' + THEN base.info->'svedFL'->'svedVodTS'->'vodTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' +), +all_data as( + -- Недвижимость + SELECT + base.recruit_id, + property_data->>'naimVidPrav' AS kind_right, -- Исправлено название поля + property_data->'adrObSob'->>'adrObSobTekst' AS address, + NULL AS vehicle_type, -- Добавлено для соответствия числа столбцов + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPrav', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPrav', 'YYYY-MM-DD') AS close_date, + 'realty' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'realty' + + UNION ALL + + -- Наземный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'vidTS' AS vehicle_type, + property_data->>'godVyp' AS issue_year, + property_data->>'markaTS' AS brand_model, + property_data->>'gosRegZn' AS reg_plate, + property_data->>'idenNom' AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'ground_transportation' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'ground_transportation' + + UNION ALL + + -- Воздушный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'air_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'air_vehicles' + + UNION ALL + + -- Водный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'water_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'water_vehicles' +) +select + *, + CASE + WHEN type_property = 'realty' THEN 1 + ELSE 0 + END AS is_property, -- недвиж//has_property + CASE + WHEN type_property = 'ground_transportation' THEN 1 + ELSE 0 + END AS is_ground_transport, -- наземный транспорт//has_ground_transport + CASE + WHEN type_property = 'air_vehicles' THEN 1 + ELSE 0 + END AS is_air_transport, -- воздушный транспорт//has_air_transport + CASE + WHEN type_property = 'water_vehicles' THEN 1 + ELSE 0 + END AS is_water_transport -- водный транспорт//has_water_transport +from all_data + Y + + + 560 + 352 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_property + has_property + + + has_ground_transport + has_ground_transport + + + has_air_transport + has_air_transport + + + has_water_transport + has_water_transport + +
+ N + Y + + + 1392 + 208 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_property + has_property_raw == 1 + Boolean + -1 + -1 + + + + has_ground_transport + has_ground_transport_raw == 1 + Boolean + -1 + -1 + + + + has_air_transport + has_air_transport_raw == 1 + Boolean + -1 + -1 + + + + has_water_transport + has_water_transport_raw == 1 + Boolean + -1 + -1 + + + + + 1168 + 208 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + Update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_repeat.hpl new file mode 100644 index 0000000..1fbed12 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_repeat.hpl @@ -0,0 +1,757 @@ + + + + citizenship_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + Create job execution record + Table input + Y + + + Filter rows + Change job status on success + Y + + + Detect empty stream + Change job status on success + Y + + + Change job status on error + Abort + Y + + + Insert / update + Change job status on error + Y + + + Table input + Insert / update + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + User defined Java expression + Y + + + User defined Java expression + Update + Y + + + Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + Update + Detect empty stream + Y + + + Update + Filter rows + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1312 + 400 + + + + Change job status on error + ExecSql + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + Y + N + UPDATE etl.job_execution +SET status = 'ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1312 + 208 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'SUCCESS' +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1776 + 64 + + + + Create job execution record + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + N + N + Y + N + N + INSERT INTO etl.job_execution ( + id, + job_name, + status, + execution_datetime, + error_description, + recruitment_id +) +VALUES ( + DEFAULT, + '${JOB_NAME}', + 'PROCESSING', + DEFAULT, + NULL, + '${IDM_ID}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL + + + + 272 + 208 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1568 + 64 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1568 + 176 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + has_property_raw + is_property + MAX + + + has_ground_transport_raw + is_ground_transport + MAX + + + has_air_transport_raw + is_air_transport + MAX + + + has_water_transport_raw + is_water_transport + MAX + + + N + + + recruit_id + + + N + grp + + + 672 + 64 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 864 + 64 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + id + id + + + = + start_date + start_date + + + = + type_property + type_property + + ervu_dashboard + property
+ + recruit_id + recruit_id + N + + + kind_right + kind_right + Y + + + address + address + Y + + + vehicle_type + vehicle_type + Y + + + issue_year + issue_year + Y + + + brand_model + brand_model + Y + + + reg_plate + reg_plate + Y + + + vin + vin + Y + + + vehicle_category + vehicle_category + Y + + + start_date + start_date + Y + + + close_date + close_date + Y + + + type_property + type_property + Y + +
+ N + + + 672 + 208 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH +base as( + SELECT + ri.recruit_id, + ri.info + FROM ervu_dashboard.recruits_info ri + join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}'::timestamp >= ri.created_at +), +prop AS ( + SELECT + base.recruit_id, + 'realty' AS property_type, + ry.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + THEN base.info->'svedFL'->'svedON'->'on' + ELSE '[]'::jsonb + END + ) AS ry ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedON'->'on') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'ground_transportation' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + THEN base.info->'svedFL'->'svedNazTS'->'nazTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedNazTS'->'nazTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'air_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + THEN base.info->'svedFL'->'svedVozTS'->'vozTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVozTS'->'vozTS') = 'array' + + UNION ALL + + SELECT + base.recruit_id, + 'water_vehicles' AS property_type, + property_data.value AS property_data + FROM base + LEFT JOIN LATERAL jsonb_array_elements( + CASE + WHEN jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' + THEN base.info->'svedFL'->'svedVodTS'->'vodTS' + ELSE '[]'::jsonb + END + ) AS property_data ON true + WHERE jsonb_typeof(base.info->'svedFL'->'svedVodTS'->'vodTS') = 'array' +), +all_data as( + -- Недвижимость + SELECT + base.recruit_id, + property_data->>'naimVidPrav' AS kind_right, -- Исправлено название поля + property_data->'adrObSob'->>'adrObSobTekst' AS address, + NULL AS vehicle_type, -- Добавлено для соответствия числа столбцов + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPrav', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPrav', 'YYYY-MM-DD') AS close_date, + 'realty' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'realty' + + UNION ALL + + -- Наземный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'vidTS' AS vehicle_type, + property_data->>'godVyp' AS issue_year, + property_data->>'markaTS' AS brand_model, + property_data->>'gosRegZn' AS reg_plate, + property_data->>'idenNom' AS vin, + NULL AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'ground_transportation' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'ground_transportation' + + UNION ALL + + -- Воздушный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'air_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'air_vehicles' + + UNION ALL + + -- Водный транспорт + SELECT + base.recruit_id, + NULL AS kind_right, + NULL AS address, + property_data->>'naimVid' AS vehicle_type, + NULL AS issue_year, + NULL AS brand_model, + NULL AS reg_plate, + NULL AS vin, + property_data->>'naznKat' AS vehicle_category, + to_date(property_data->>'dataRegPr', 'YYYY-MM-DD') AS start_date, + to_date(property_data->>'dataPrekPr', 'YYYY-MM-DD') AS close_date, + 'water_vehicles' AS type_property + FROM base + JOIN prop ON base.recruit_id = prop.recruit_id + WHERE prop.property_type = 'water_vehicles' +) +select + *, + CASE + WHEN type_property = 'realty' THEN 1 + ELSE 0 + END AS is_property, -- недвиж//has_property + CASE + WHEN type_property = 'ground_transportation' THEN 1 + ELSE 0 + END AS is_ground_transport, -- наземный транспорт//has_ground_transport + CASE + WHEN type_property = 'air_vehicles' THEN 1 + ELSE 0 + END AS is_air_transport, -- воздушный транспорт//has_air_transport + CASE + WHEN type_property = 'water_vehicles' THEN 1 + ELSE 0 + END AS is_water_transport -- водный транспорт//has_water_transport +from all_data + Y + + + 480 + 208 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_property + has_property + + + has_ground_transport + has_ground_transport + + + has_air_transport + has_air_transport + + + has_water_transport + has_water_transport + +
+ N + Y + + + 1312 + 64 + +
+ + User defined Java expression + Janino + + Y + + 1 + + none + + + + has_property + has_property_raw == 1 + Boolean + -1 + -1 + + + + has_ground_transport + has_ground_transport_raw == 1 + Boolean + -1 + -1 + + + + has_air_transport + has_air_transport_raw == 1 + Boolean + -1 + -1 + + + + has_water_transport + has_water_transport_raw == 1 + Boolean + -1 + -1 + + + + + 1088 + 64 + + + + + Insert / update + Change job status on error + Y + + + + + + + + + + Update + Change job status on error + Y + + + + + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizenship/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizenship/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..be774d3 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizenship/recruitment_five_flow_delta.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:16:11.204 + - + 2025/08/11 13:16:11.204 + + + + + + Table input + citizenship_flow_delta.hpl + Y + + + Table input + citizenship_flow_delta.hpl 2 + Y + + + Table input + citizenship_flow_delta.hpl 3 + Y + + + Table input + citizenship_flow_delta.hpl 4 + Y + + + Table input + citizenship_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizenship_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + citizenship_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 640 + 128 + + + + citizenship_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 208 + + + + citizenship_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 288 + + + + citizenship_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 368 + + + + citizenship_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 656 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizenship/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizenship/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..4001044 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizenship/recruitment_five_flow_on_error.hpl @@ -0,0 +1,360 @@ + + + + recruitment_five_flow_on_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/05 12:54:50.126 + - + 2025/08/05 12:54:50.126 + + + + + + Table input + citizenship_flow_repeat.hpl + Y + + + Table input + citizenship_flow_repeat.hpl 2 + Y + + + Table input + citizenship_flow_repeat.hpl 3 + Y + + + Table input + citizenship_flow_repeat.hpl 4 + Y + + + Table input + citizenship_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + r.idm_id as recruitment_id +FROM ervu_dashboard.recruitment r + LEFT JOIN etl.job_execution je + ON r.idm_id = je.recruitment_id + and job_name = 'citizenship_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + citizenship_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + citizenship_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 560 + 288 + + + + citizenship_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 560 + 368 + + + + citizenship_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 560 + 448 + + + + citizenship_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 560 + 528 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizenship/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizenship/recruitments_five_flow.hpl new file mode 100644 index 0000000..31961c5 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizenship/recruitments_five_flow.hpl @@ -0,0 +1,373 @@ + + + + recruitments_five_flow + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Get all recruitments ordered by created_date + citizenship_flow.hpl + Y + + + Get all recruitments ordered by created_date + citizenship_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + citizenship_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + citizenship_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + citizenship_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment +${COMMENT}/* +where idm_id in ('110686b2-4a01-4976-885b-d26a2980f53a', +'cff66da8-2be0-4839-bd8e-332b1a150031', +'34c8685e-f08a-4877-afb1-a0589800a21c', +'0e10678c-f272-41c3-94dd-c15830321f9a', +'9703f108-761a-467a-aad3-89617e5539ed', +'55eae374-9bb5-4295-9e3a-5fbcdaba870d', +'dad6c101-34be-45c3-8173-57190cb69dfb', +'fc10523f-af31-4f6b-b0e2-00799758f634', +'61807cc2-9913-4060-8802-0672877c28c8', +'eba7fd7d-e3da-49a7-8e65-8fc85e47190e', +'f59afe6d-c166-4196-a489-6d17f02fc05e', +'22c64b79-f8e4-41e7-a2f3-1aa9df424fd9', +'0fe2bdf0-afbb-402d-93da-67e511799afa', +'6139de3b-2378-496f-9fca-7df7dab90832', +'50ba73dd-1726-48f1-8b7c-7a77ff965299') +${COMMENT}*/ + Y + + + 432 + 304 + + + + citizenship_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 144 + + + + citizenship_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 240 + + + + citizenship_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 336 + + + + citizenship_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 432 + + + + citizenship_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizenship/parallel/citizenship_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizenship_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 736 + 512 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/property/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/property/check_if_need_to_repeat_job.hpl index f15ccdf..b70250e 100644 --- a/mappings/info_recruits/citizen_tables/property/check_if_need_to_repeat_job.hpl +++ b/mappings/info_recruits/citizen_tables/property/check_if_need_to_repeat_job.hpl @@ -69,7 +69,7 @@ FROM ervu_dashboard.recruitment r LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id - and job_name = 'subpoena_job' + and job_name = 'property_job' where je.status is null or je.status in ('ERROR', 'PROCESSING') limit 1 ) as need_to_repeat_job; diff --git a/mappings/info_recruits/citizen_tables/property/property_job.hwf b/mappings/info_recruits/citizen_tables/property/property_job.hwf index c805415..1b74416 100644 --- a/mappings/info_recruits/citizen_tables/property/property_job.hwf +++ b/mappings/info_recruits/citizen_tables/property/property_job.hwf @@ -157,7 +157,9 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/property/check_if_need_to_repeat_job.hpl + + Basic Y diff --git a/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl index b70250e..f15ccdf 100644 --- a/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl +++ b/mappings/info_recruits/citizen_tables/subpoena/check_if_need_to_repeat_job.hpl @@ -69,7 +69,7 @@ FROM ervu_dashboard.recruitment r LEFT JOIN etl.job_execution je ON r.idm_id = je.recruitment_id - and job_name = 'property_job' + and job_name = 'subpoena_job' where je.status is null or je.status in ('ERROR', 'PROCESSING') limit 1 ) as need_to_repeat_job;