diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl index 7f19e37..56f74de 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl @@ -196,46 +196,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -295,29 +265,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${ID_F1}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F1}' - AND '${M_R_CR_DATE}' >= r.system_create_date::timestamp -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -335,7 +284,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, @@ -354,21 +303,6 @@ SELECT ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет mrr.value AS reason_registration, - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F1}' != '' -- Проверка на пустую строку @@ -384,7 +318,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl index 4326e40..a0856e8 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl @@ -153,46 +153,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -215,29 +185,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${ID_F2}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F2}' - AND '${M_R_CR_DATE}' >= r.system_create_date::timestamp -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -255,7 +204,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, @@ -274,21 +223,6 @@ SELECT ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет mrr.value AS reason_registration, - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F2}' != '' -- Проверка на пустую строку @@ -304,7 +238,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl index cafff2b..35b85d2 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl @@ -153,46 +153,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -215,29 +185,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${ID_F3}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F3}' - AND '${M_R_CR_DATE}' >= r.system_create_date::timestamp -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -255,7 +204,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, @@ -274,21 +223,6 @@ SELECT ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет mrr.value AS reason_registration, - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F3}' != '' -- Проверка на пустую строку @@ -304,7 +238,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl index fb42956..b73f9d0 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl @@ -153,46 +153,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -215,29 +185,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${ID_F4}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F4}' - AND '${M_R_CR_DATE}' >= r.system_create_date::timestamp -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -255,7 +204,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, @@ -274,21 +223,6 @@ SELECT ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет mrr.value AS reason_registration, - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F4}' != '' -- Проверка на пустую строку @@ -304,7 +238,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl index 9b1237a..c82c6c8 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl @@ -153,46 +153,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -215,29 +185,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${ID_F5}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F5}' - AND '${M_R_CR_DATE}' >= r.system_create_date::timestamp -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -255,7 +204,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, @@ -274,21 +223,6 @@ SELECT ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет mrr.value AS reason_registration, - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F5}' != '' -- Проверка на пустую строку @@ -304,7 +238,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow1.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow1.hpl index cf2529f..32bcb16 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow1.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow1.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -152,46 +153,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -214,30 +185,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${M_R_CR_DATE}'::timestamp >= r.system_create_date - AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp - AND '${ID_F1}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F1}' -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -255,7 +204,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, @@ -271,22 +220,7 @@ SELECT WHEN ddd.hidden IS false then ddd.hidden ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет - mrr.value AS reason_registration - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 + mrr.value AS reason_registration, system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F1}' != '' -- Проверка на пустую строку @@ -303,7 +237,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow2.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow2.hpl index 9ce6d7a..be496f5 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow2.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow2.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -152,46 +153,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -214,30 +185,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${M_R_CR_DATE}'::timestamp >= r.system_create_date - AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp - AND '${ID_F2}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F2}' -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -255,7 +204,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, @@ -271,22 +220,7 @@ SELECT WHEN ddd.hidden IS false then ddd.hidden ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет - mrr.value AS reason_registration - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 + mrr.value AS reason_registration, system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F2}' != '' -- Проверка на пустую строку @@ -303,7 +237,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow3.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow3.hpl index 4759817..1bdbe0a 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow3.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow3.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -152,46 +153,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -214,30 +185,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${M_R_CR_DATE}'::timestamp >= r.system_create_date - AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp - AND '${ID_F3}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F3}' -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -255,7 +204,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, @@ -271,22 +220,7 @@ SELECT WHEN ddd.hidden IS false then ddd.hidden ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет - mrr.value AS reason_registration - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 + mrr.value AS reason_registration, system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F3}' != '' -- Проверка на пустую строку @@ -303,7 +237,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow4.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow4.hpl index d209638..82cb74c 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow4.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow4.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -152,46 +153,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -214,30 +185,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${M_R_CR_DATE}'::timestamp >= r.system_create_date - AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp - AND '${ID_F4}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F4}' -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -255,7 +204,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, @@ -271,22 +220,7 @@ SELECT WHEN ddd.hidden IS false then ddd.hidden ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет - mrr.value AS reason_registration - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 + mrr.value AS reason_registration, system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F4}' != '' -- Проверка на пустую строку @@ -303,7 +237,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow5.hpl b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow5.hpl index d3c3287..5e902c3 100644 --- a/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow5.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen/parallel/delta_citizen_flow5.hpl @@ -44,6 +44,7 @@ = recruit_id recruit_id + ervu_dashboard citizen
@@ -152,46 +153,16 @@ reason_registration Y - - residence - residence - Y - - - start_date_residence - start_date_residence - Y - - - end_date_residence - end_date_residence - Y - - - address_place_stay - address_place_stay - Y - - - start_date_place_stay - start_date_place_stay - Y - - - end_date_place_stay - end_date_place_stay - Y - - - type_place_stay - type_place_stay - Y - id_ern id_ern Y + + marital_status + marital_status + Y + N @@ -214,30 +185,8 @@ ervu_person_registry N 0 - with -adresses as ( -- по одному ли адресу тут должно быть?? -SELECT - r.id as recruit_id, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS actualAddress, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateStart' END) AS actualAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'regDateEnd' END) AS actualAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS residenceAddress, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateStart' END) AS residenceAddress_regDateStart, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'regDateEnd' END) AS residenceAddress_regDateEnd, - MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) AS residenceAddress_kodTipReg -FROM - public.recruits AS r -LEFT JOIN - LATERAL jsonb_array_elements(r.addresses) AS addr ON true -WHERE '${M_R_CR_DATE}'::timestamp >= r.system_create_date - AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp - AND '${ID_F5}' != '' -- Проверка на пустую строку - AND COALESCE(current_recruitment_id, target_recruitment_id) = '${ID_F5}' -GROUP BY - r.id -) -SELECT - r.system_pgs_status, + SELECT + r.system_pgs_status, r.full_name, r.last_name, r.first_name, @@ -255,7 +204,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, @@ -271,22 +220,7 @@ SELECT WHEN ddd.hidden IS false then ddd.hidden ELSE true END AS deferment_liberation,-- когда hidden ис фолс отсрочка есть, когда тру или нулл - нет - mrr.value AS reason_registration - adr.actualAddress as residence, -- адрес места жительства - adr.actualAddress_regDateStart as start_date_residence, -- дата регистрации по месту жительства - adr.actualAddress_regDateEnd as end_date_residence, -- дата снятия с регистрации по месту жительства - adr.residenceAddress as address_place_stay, -- адресс регистрации по месту пребывания - adr.residenceAddress_regDateStart as start_date_place_stay, -- дата регистрации по месту пребывания - adr.residenceAddress_regDateEnd as end_date_place_stay, -- дата снятия с регистрации по месту пребывания - case - when adr.residenceAddress_kodTipReg='1' then 'В жилом помещении, не являющимся местом жительства физического лица' - when adr.residenceAddress_kodTipReg='2' then 'В учреждении уголовно-исполнительной системы' - else null - end as type_place_stay, -- тип регистрации - -- address_actual -- Адрес фактического проживания ***1 - -- source_info_actual -- Источник сведений о месте фактического проживания ***1 - -- date_info_actual -- Дата получения сведений об адресе фактического проживания ***1 - -- date_loss_info_actual -- Дата потери актуальности сведений об адресе фактического проживания ***1 + mrr.value AS reason_registration, system_id_ern AS id_ern -- id единого регистра населения FROM public.recruits AS r JOIN public.recruits_info AS ri ON ri.recruit_id = r.id AND '${ID_F5}' != '' -- Проверка на пустую строку @@ -303,7 +237,6 @@ LEFT JOIN ( JOIN public.military_registration_reason AS mrr ON r.registration_reasons::jsonb @> to_jsonb(mrr.code::text) --JOIN public.recruits_history rh on rh.recruit_id=r.id --WHERE r.system_update_date >= '${UP_D}' -join adresses adr ON r.recruit_id=adr.recruit_id -- ***1 - страница личные сведения есть поле, нет данных Y diff --git a/map_v1/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl b/map_v1/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl index 543c8ef..17d98b1 100644 --- a/map_v1/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl +++ b/map_v1/info_recruits/citizen_tables/citizen_liability_fz53/checkpoints/change_status_delta_citizen_liability_fz53_flow2_error.hpl @@ -87,8 +87,7 @@ SELECT 'delta_citizen_liability_fz53_flow2' as job_name, 'ERROR' as status, - current_timestamp as record_created - + current_timestamp as record_created N diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow1.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow1.hpl index 18c37c6..44169e5 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow1.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow1.hpl @@ -55,6 +55,7 @@ = recruit_id recruit_id + ervu_dashboard recruits_info
@@ -98,6 +99,11 @@ info Y + + addresses + addresses + Y + N @@ -128,7 +134,8 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, - r.full_name + r.full_name, + r.addresses FROM recruits_info ri JOIN recruits r ON r.id = ri.recruit_id WHERE diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow2.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow2.hpl index 56fd955..4346caa 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow2.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow2.hpl @@ -55,6 +55,7 @@ = recruit_id recruit_id + ervu_dashboard recruits_info
@@ -98,6 +99,11 @@ info Y + + addresses + addresses + Y + N @@ -128,7 +134,8 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, - r.full_name + r.full_name, + r.addresses FROM recruits_info ri JOIN recruits r ON r.id = ri.recruit_id WHERE diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow3.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow3.hpl index a9d4a9e..1df8992 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow3.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow3.hpl @@ -55,6 +55,7 @@ = recruit_id recruit_id + ervu_dashboard recruits_info
@@ -98,6 +99,11 @@ info Y + + addresses + addresses + Y + N @@ -128,7 +134,8 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, - r.full_name + r.full_name, + r.addresses FROM recruits_info ri JOIN recruits r ON r.id = ri.recruit_id WHERE diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow4.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow4.hpl index 39dc059..a038a86 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow4.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow4.hpl @@ -55,6 +55,7 @@ = recruit_id recruit_id + ervu_dashboard recruits_info
@@ -98,6 +99,11 @@ info Y + + addresses + addresses + Y + N @@ -128,7 +134,8 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, - r.full_name + r.full_name, + r.addresses FROM recruits_info ri JOIN recruits r ON r.id = ri.recruit_id WHERE diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow5.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow5.hpl index 3bfe18d..9c7181c 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow5.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/delta_recruits_info_flow5.hpl @@ -55,6 +55,7 @@ = recruit_id recruit_id + ervu_dashboard recruits_info
@@ -98,6 +99,11 @@ info Y + + addresses + addresses + Y + N @@ -128,7 +134,8 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, - r.full_name + r.full_name, + r.addresses FROM recruits_info ri JOIN recruits r ON r.id = ri.recruit_id WHERE diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow1.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow1.hpl index 71a7b98..aff5d71 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow1.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow1.hpl @@ -131,6 +131,11 @@ full_name Y + + addresses + addresses + Y + N @@ -198,7 +203,8 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, - r.full_name + r.full_name, + r.addresses FROM recruits_info ri JOIN recruits r ON r.id = ri.recruit_id WHERE diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow2.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow2.hpl index 068d2c1..ff08786 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow2.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow2.hpl @@ -88,6 +88,11 @@ full_name Y + + addresses + addresses + Y + N @@ -118,6 +123,7 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, + r.addresses, r.full_name--, --'${RN_RMNT}' AS rn_recruitment -- порядковый номер военкомата FROM recruits_info ri diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow3.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow3.hpl index 78ca857..abc697c 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow3.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow3.hpl @@ -88,6 +88,11 @@ full_name Y + + addresses + addresses + Y + N @@ -118,6 +123,7 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, + r.addresses, r.full_name--, --'${RN_RMNT}' AS rn_recruitment -- порядковый номер военкомата FROM recruits_info ri diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow4.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow4.hpl index 1201625..7d5ffa3 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow4.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow4.hpl @@ -88,6 +88,11 @@ full_name Y + + addresses + addresses + Y + N @@ -118,6 +123,7 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, + r.addresses, r.full_name--, --'${RN_RMNT}' AS rn_recruitment -- порядковый номер военкомата FROM recruits_info ri diff --git a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow5.hpl b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow5.hpl index 332bc6e..f8e7091 100644 --- a/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow5.hpl +++ b/map_v1/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow5.hpl @@ -88,6 +88,11 @@ full_name Y + + addresses + addresses + Y + N @@ -118,6 +123,7 @@ ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, + r.addresses, r.full_name--, --'${RN_RMNT}' AS rn_recruitment -- порядковый номер военкомата FROM recruits_info ri diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_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_flow4_error.hpl rename to mappings/info_recruits/citizen_tables/child/check_if_need_to_repeat_job.hpl index c39e38f..440d53c 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_error.hpl +++ b/mappings/info_recruits/citizen_tables/child/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,15 +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 = '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_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl deleted file mode 100644 index 7a7dc06..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_success.hpl +++ /dev/null @@ -1,103 +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_flow3_success.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl deleted file mode 100644 index 96e5db8..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_success.hpl +++ /dev/null @@ -1,103 +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 381c4fc..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow4_success.hpl +++ /dev/null @@ -1,103 +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 460b876..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_error.hpl +++ /dev/null @@ -1,101 +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 8035bc7..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow5_success.hpl +++ /dev/null @@ -1,103 +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/passport/checkpoints/check_if_job_passport_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/passport/checkpoints/check_if_job_passport_exists.hpl rename to mappings/info_recruits/citizen_tables/child/checkpoints/check_if_child_job_exists.hpl index 4f21ffb..de6f58a 100644 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/check_if_job_passport_exists.hpl +++ b/mappings/info_recruits/citizen_tables/child/checkpoints/check_if_child_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_passport_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_passport') 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_passport' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_passport' - ) -) 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_job_child_delta.hpl b/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl deleted file mode 100644 index 9097bd1..0000000 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child_delta.hpl +++ /dev/null @@ -1,869 +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 - - - - - - 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_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 - - - 896 - 208 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/child/job_child.hwf b/mappings/info_recruits/citizen_tables/child/job_child.hwf index 9dd20b8..997b5e5 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_flow1.hpl - Basic - - - ID_F1 - 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_flow2.hpl - Basic - - - ID_F2 - 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_flow3.hpl - Basic - - - ID_F3 - 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_flow4.hpl - Basic - - - ID_F4 - 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_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 720 - - - - Abort workflow - - ABORT - - N - N - 2336 + 416 208 - Success new citizen - - 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 - 1696 - 1712 + 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,7 @@ 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,207 +106,12 @@ N Y Y - 2384 - 1280 + 1120 + 208 - Abort workflow 2 - - ABORT - - N - N - 2288 - 1040 - - - - child_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow1.hpl - Basic - - - ID_F1 - 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_flow2.hpl - Basic - - - ID_F2 - 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_flow3.hpl - Basic - - - ID_F3 - 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_flow4.hpl - Basic - - - ID_F4 - 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_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 1600 - - - - delta_child_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow1.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 1776 - - - - check_if_job_child_exists.hpl + recruitment_five_flow_on_error.hpl PIPELINE @@ -558,7 +121,7 @@ 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 @@ -569,30 +132,55 @@ 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_to_processing.hpl + recruitment_five_flow_delta.hpl PIPELINE @@ -602,7 +190,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/change_status_to_processing.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruitment_five_flow_delta.hpl Basic Y @@ -613,1866 +201,63 @@ N Y N - 2368 - 576 - - - - change_status_child_flow1_success.hpl - - 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 - 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 child after error - - 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 - 2416 - 1472 - - - - 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 - 2320 - 2304 - - - - 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 - 2992 - 1776 - - - - 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 - 2992 - 1856 - - - - 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 - - Y - - N - local - N - N - Y - Y - 2416 - 2096 - - - - Abort workflow 2 2 - - ABORT - - N - N - 2256 - 2208 - - - - Simple delta_child WHERE ERROR - - SIMPLE_EVAL - - ERROR - string - true - equal - equal - N - variable - STATUS - N - 2048 - 2096 - - - - delta_child success - - SUCCESS - - N - 2144 - 1904 - - - - 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 - 1792 - 2096 - - - - 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 - 3456 - 2096 - - - - child_delta success - - SUCCESS - - N - 3712 - 2096 - - - - delta_child_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow2.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 1936 - - - - 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 - 2992 - 1936 - - - - 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 - 2992 - 2016 - - - - delta_child_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow3.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 2096 - - - - 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 - 2992 - 2096 - - - - 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 - 2992 - 2176 - - - - delta_child_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow4.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 2256 - - - - 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 - 2992 - 2256 - - - - 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 - 2992 - 2336 - - - - delta_child_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/delta_child_flow5.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 2416 - - - - 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 - 2992 - 2416 - - - - 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 - 2992 - 2496 + 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 citizen - 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 child after error - 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 - - - delta_child_flow1.hpl - change_status_delta_child_flow1_success.hpl - Y - Y - N - - - delta_child_flow1.hpl - change_status_delta_child_flow1_error.hpl - Y - N - N - - - Simple job_child_exists check NEW - recruitment_rows_five_flow_child.hpl - Y - Y - 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 - delta_child_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl 2 - change_status_to_processing_delta.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl 2 - Abort workflow 2 2 - Y - Y - N - - - Simple delta_child WHERE ERROR - delta_child success - Y - N - N - - - Simple delta_child WHERE ERROR - recruitment_rows_five_flow_child.hpl 2 - Y - Y - Y - - - Simple child WHERE SUCCESS - branching_child_delta.hpl - Y - Y - N - - - branching_child_delta.hpl - Simple delta_child WHERE ERROR - Y - Y - Y - - - 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 - - - delta_child_flow2.hpl - change_status_delta_child_flow2_success.hpl - Y - Y - N - - - delta_child_flow2.hpl - change_status_delta_child_flow2_error.hpl - Y - N - N - - - delta_child_flow3.hpl - change_status_delta_child_flow3_success.hpl - Y - Y - N - - - delta_child_flow3.hpl - change_status_delta_child_flow3_error.hpl - Y - N - N - - - delta_child_flow4.hpl - change_status_delta_child_flow4_success.hpl - Y - Y - N - - - delta_child_flow4.hpl - change_status_delta_child_flow4_error.hpl - Y - N - N - - - delta_child_flow5.hpl - change_status_delta_child_flow5_success.hpl - Y - Y - N - - - delta_child_flow5.hpl - change_status_delta_child_flow5_error.hpl - Y - N - N - - - recruitment_rows_five_flow_child.hpl 2 - delta_child_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl 2 - delta_child_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl 2 - delta_child_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_child.hpl 2 - delta_child_flow5.hpl - Y - Y - N - - - change_status_delta_child_flow2_success.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_flow2_error.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 - - - 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 new file mode 100644 index 0000000..0243b34 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow.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 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 + 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/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 - - - - - -
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 new file mode 100644 index 0000000..ab93eb9 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_delta.hpl @@ -0,0 +1,598 @@ + + + + child_flow_delta + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/11 13:22:56.048 + - + 2025/08/11 13:22:56.048 + + + + + + Insert / update + Change job status on error + Y + + + Insert / update + Group by + Y + + + Update + Change job status on error + Y + + + User defined Java expression + Update + Y + + + Create job execution record + 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 + + Y + + 1 + + none + + + + + error_description + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1376 + 224 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS', + error_description = null +WHERE job_name = '${JOB_NAME}' + and recruitment_id = '${IDM_ID}' +and status = 'DELTA_PROCESSING'; + + + + 1872 + 0 + + + + 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 +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 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 + + 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 + + + 784 + 0 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 1024 + 0 + + + + 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 + + + 784 + 224 + +
+ + Table input 2 + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + 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 + 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 c.update_date >= '${M_R_UP_DATE}'::timestamp + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y + + + 496 + 224 + + + + Update + 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 + + + 1376 + 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 + + + + + 1232 + 0 + + + + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + 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..67704b2 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/child/parallel/child_flow_repeat.hpl @@ -0,0 +1,613 @@ + + + + child_flow_repeat + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/08/08 13:25:52.319 + - + 2025/08/08 13:25:52.319 + + + + + + User defined Java expression + Update + Y + + + Create job execution record 2 + Table input 2 + Y + + + Update + Change job status on error 2 + Y + + + Insert / update + Change job status on error 2 + Y + + + Insert / update + 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 + + 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}'; + + + + + 976 + 432 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1440 + 0 + + + + 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}' +) +ON CONFLICT (job_name, recruitment_id) +DO UPDATE SET + status = 'PROCESSING', + execution_datetime = DEFAULT, + error_description = NULL; + + + 0 + 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 + + 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 + + + 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 + +
+ + Table input 2 + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + 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 + 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 + + + 272 + 432 + + + + Update + 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 + + + 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 + + + + + 800 + 0 + + + + + Insert / update + Change job status on error 2 + Y + + + + + + + + + + Update + Change job status on error 2 + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow1.hpl b/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow1.hpl deleted file mode 100644 index 8008a21..0000000 --- a/mappings/info_recruits/citizen_tables/child/parallel/delta_child_flow1.hpl +++ /dev/null @@ -1,143 +0,0 @@ - - - - delta_child_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 - - 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_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 - 352 - - - - - -
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..d9d0f7a --- /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 + + 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 0a663c3..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 2 - 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..57195c7 --- /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 + + 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 + + Change job status on success + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + Change job status on success + + 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 + + Change job status on success 2 + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + Change job status on success 2 + + 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 + + Change job status on success 4 + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + Change job status on success 3 + + 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 + + Change job status on success 4 + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + Change job status on success 4 + + 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 + + Change job status on success 5 + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + Change job status on success 5 + + FileName + + + + 704 + 464 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_address/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/citizen_address/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..f384b3b --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_address/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 = 'citizen_address_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/punishment/checkpoints/check_if_job_punishment_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_address/checkpoints/check_if_citizen_address_job_exists.hpl similarity index 70% rename from mappings/info_recruits/citizen_tables/punishment/checkpoints/check_if_job_punishment_exists.hpl rename to mappings/info_recruits/citizen_tables/citizen_address/checkpoints/check_if_citizen_address_job_exists.hpl index 6333e4e..2de59ca 100644 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/check_if_job_punishment_exists.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_address/checkpoints/check_if_citizen_address_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_punishment_exists + check_if_citizen_address_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_punishment') 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_punishment' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_punishment' - ) -) t + SELECT EXISTS ( + SELECT 1 + FROM etl.job_execution + WHERE job_name = 'citizen_address_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_address/job_citizen_address.hwf b/mappings/info_recruits/citizen_tables/citizen_address/job_citizen_address.hwf new file mode 100644 index 0000000..495a2c2 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_address/job_citizen_address.hwf @@ -0,0 +1,268 @@ + + + job_citizen_address + 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_address_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/check_if_citizen_address_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 608 + 208 + + + + citizen_address_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_address/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_address/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_address/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_address/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 880 + 704 + + + + + + Start + check_if_citizen_address_job_exists.hpl + Y + Y + Y + + + check_if_citizen_address_job_exists.hpl + citizen_address_job_exists_check + Y + Y + N + + + citizen_address_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + citizen_address_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_address/parallel/citizen_address_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow.hpl new file mode 100644 index 0000000..fbffb7c --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow.hpl @@ -0,0 +1,395 @@ + + + + citizen_address_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 + + + Table output + Change job status on error + Y + + + Change job status on error + Abort + Y + + + Table output + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + 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 + + + 1328 + 704 + + + + 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 + 704 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1328 + 96 + + + + 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}'); + + + + + 240 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 832 + 96 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1328 + 320 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 640 + 320 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + ri.recruit_id::uuid, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateStart')::date END) AS residence_registration_date, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateEnd')::date END) AS residence_deregistration_date, + + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS place_stay_address, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateStart')::date END) AS place_stay_registration_date, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateEnd')::date END) AS place_stay_deregistration_date, + CASE + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '1' THEN 'В жилом помещении, не являющимся местом жительства физического лица' + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '2' THEN 'В учреждении уголовно-исполнительной системы' + ELSE NULL + END AS place_stay_registration_type, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN addr->>'reg' END) AS factual_address, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateStart')::date END) AS factual_info_received_date, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateEnd')::date END) AS factual_info_expiry_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.addresses) AS addr +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 +GROUP BY ri.recruit_id; + Y + + + 464 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + residence_address + residence_address + + + residence_registration_date + residence_registration_date + + + residence_deregistration_date + residence_deregistration_date + + + place_stay_address + place_stay_address + + + place_stay_registration_date + place_stay_registration_date + + + place_stay_deregistration_date + place_stay_deregistration_date + + + place_stay_registration_type + place_stay_registration_type + + + factual_address + factual_address + + + factual_info_received_date + factual_info_received_date + + + factual_info_expiry_date + factual_info_expiry_date + + + N + N + N + N + Y + N + ervu_dashboard + Y + citizen_address
+ N + Y + N + Y + + + 832 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_delta.hpl new file mode 100644 index 0000000..262fee7 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_delta.hpl @@ -0,0 +1,405 @@ + + + + citizen_address_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 + + + Insert / update + Change job status on error + 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 + Identify last row in a stream + Y + + + Identify last row in a stream + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1008 + 464 + + + + 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}'; + + + + + 752 + 464 + + + + 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}' +and status = 'DELTA_PROCESSING'; + + + + + 1120 + 16 + + + + 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}'; + + + 128 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 752 + 16 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1120 + 224 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 944 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen_address
+ + recruit_id + recruit_id + N + + + residence_address + residence_address + Y + + + residence_registration_date + residence_registration_date + Y + + + residence_deregistration_date + residence_deregistration_date + Y + + + place_stay_address + place_stay_address + Y + + + place_stay_registration_date + place_stay_registration_date + Y + + + place_stay_deregistration_date + place_stay_deregistration_date + Y + + + place_stay_registration_type + place_stay_registration_type + Y + + + factual_address + factual_address + Y + + + factual_info_received_date + factual_info_received_date + Y + + + factual_info_expiry_date + factual_info_expiry_date + Y + +
+ N + + + 752 + 224 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + ri.recruit_id::uuid, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateStart')::date END) AS residence_registration_date, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateEnd')::date END) AS residence_deregistration_date, + + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS place_stay_address, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateStart')::date END) AS place_stay_registration_date, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateEnd')::date END) AS place_stay_deregistration_date, + CASE + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '1' THEN 'В жилом помещении, не являющимся местом жительства физического лица' + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '2' THEN 'В учреждении уголовно-исполнительной системы' + ELSE NULL + END AS place_stay_registration_type, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN addr->>'reg' END) AS factual_address, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateStart')::date END) AS factual_info_received_date, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateEnd')::date END) AS factual_info_expiry_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.addresses) AS addr +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 +GROUP BY ri.recruit_id; + Y + + + 400 + 224 + + + + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_repeat.hpl new file mode 100644 index 0000000..6722b66 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_repeat.hpl @@ -0,0 +1,418 @@ + + + + citizen_address_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 + + + Insert / update + Change job status on error + Y + + + Insert / update + Detect empty 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 + + + Insert / update + Identify last row in a stream + Y + + + Identify last row in a stream + Filter rows + Y + + + Table input + Insert / update + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1232 + 544 + + + + 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}'; + + + + + 768 + 544 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1120 + 16 + + + + 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; + + + 176 + 272 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 768 + 16 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1120 + 272 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 960 + 272 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen_address
+ + recruit_id + recruit_id + N + + + residence_address + residence_address + Y + + + residence_registration_date + residence_registration_date + Y + + + residence_deregistration_date + residence_deregistration_date + Y + + + place_stay_address + place_stay_address + Y + + + place_stay_registration_date + place_stay_registration_date + Y + + + place_stay_deregistration_date + place_stay_deregistration_date + Y + + + place_stay_registration_type + place_stay_registration_type + Y + + + factual_address + factual_address + Y + + + factual_info_received_date + factual_info_received_date + Y + + + factual_info_expiry_date + factual_info_expiry_date + Y + +
+ N + + + 768 + 272 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + ri.recruit_id::uuid, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateStart')::date END) AS residence_registration_date, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateEnd')::date END) AS residence_deregistration_date, + + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS place_stay_address, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateStart')::date END) AS place_stay_registration_date, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateEnd')::date END) AS place_stay_deregistration_date, + CASE + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '1' THEN 'В жилом помещении, не являющимся местом жительства физического лица' + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '2' THEN 'В учреждении уголовно-исполнительной системы' + ELSE NULL + END AS place_stay_registration_type, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN addr->>'reg' END) AS factual_address, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateStart')::date END) AS factual_info_received_date, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateEnd')::date END) AS factual_info_expiry_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.addresses) AS addr +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 +GROUP BY ri.recruit_id; + Y + + + 480 + 272 + + + + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_address/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_address/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..3224f5a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_address/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_address_flow_delta.hpl + Y + + + Table input + citizen_address_flow_delta.hpl 2 + Y + + + Table input + citizen_address_flow_delta.hpl 3 + Y + + + Table input + citizen_address_flow_delta.hpl 4 + Y + + + Table input + citizen_address_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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_address_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + citizen_address_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 128 + + + + citizen_address_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + citizen_address_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + citizen_address_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + citizen_address_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_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_address/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizen_address/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..9f6a26c --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_address/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_address_flow_repeat.hpl + Y + + + Table input + citizen_address_flow_repeat.hpl 3 + Y + + + Table input + citizen_address_flow_repeat.hpl 2 + Y + + + Table input + citizen_address_flow_repeat.hpl 4 + Y + + + Table input + citizen_address_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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_address_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + citizen_address_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 208 + + + + citizen_address_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 288 + + + + citizen_address_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 368 + + + + citizen_address_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 448 + + + + citizen_address_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_address_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_address/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_address/recruitments_five_flow.hpl new file mode 100644 index 0000000..9510b67 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_address/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_address_flow.hpl + Y + + + Get all recruitments ordered by created_date + citizen_address_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + citizen_address_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + citizen_address_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + citizen_address_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 432 + 304 + + + + citizen_address_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + citizen_address_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + citizen_address_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + citizen_address_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_address_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + citizen_address_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_address_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/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..b3fff70 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/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 = 'citizen_guardianship_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/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_error.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_error.hpl deleted file mode 100644 index 62e0d8a..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_error.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_citizen_guardianship_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' 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 - - - 784 - 304 - - - - - -
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_success.hpl deleted file mode 100644 index 5628f74..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_success.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_citizen_guardianship_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' 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 - - - 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 8be76b7..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_child' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 832 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/check_if_job_prosecution_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_citizen_guardianship_job_exists.hpl similarity index 70% rename from mappings/info_recruits/citizen_tables/prosecution/checkpoints/check_if_job_prosecution_exists.hpl rename to mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_citizen_guardianship_job_exists.hpl index 3a00226..8ff4ff0 100644 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/check_if_job_prosecution_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_prosecution_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_prosecution') 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_prosecution' - - UNION ALL - - SELECT NULL, NULL - WHERE NOT EXISTS ( - SELECT 1 - FROM public.etl_checkpoints - WHERE job_name = 'job_prosecution' - ) -) 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/check_if_job_citizen_guardianship_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_job_citizen_guardianship_exists.hpl deleted file mode 100644 index 64a9b1d..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/check_if_job_citizen_guardianship_exists.hpl +++ /dev/null @@ -1,130 +0,0 @@ - - - - check_if_job_citizen_guardianship_exists - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/11 15:20:18.267 - - - 2025/06/11 15:20:18.267 - - - - - - Table input - Set variables - Y - - - Set variables - Write to log - N - - - - Set variables - SetVariable - - Y - - 1 - - none - - - - - job_name - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 688 - 352 - - - - Table input - TableInput - - Y - - 1 - - none - - - 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 - N - - - 400 - 352 - - - - Write to log - WriteToLog - - Y - - 1 - - none - - - Y - - - N - 0 - Basic - ${STATUS} - - - 960 - 240 - - - - - - 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 deleted file mode 100644 index d8ed97e..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl +++ /dev/null @@ -1,122 +0,0 @@ - - - - delta_citizen_guardianship - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 16:10:48.509 - - - 2025/06/03 16:10:48.509 - - - - - - Table input - Insert / update - Y - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - citizen_guardianship
- - recruit_id - recruit_id - N - - - birth_date - birth_date - Y - - - full_name - full_name - Y - - - snils - snils - Y - -
- N - - - 1072 - 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_guardianship.hwf b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf new file mode 100644 index 0000000..a09271a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/job_guardianship.hwf @@ -0,0 +1,268 @@ + + + job_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 + 1248 + 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 new file mode 100644 index 0000000..f53452c --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow.hpl @@ -0,0 +1,512 @@ + + + + citizen_guardianship_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 + + + Create job execution record + Table input + Y + + + Table output + Change job status on error + Y + + + Add constants + Update + Y + + + Update + Change job status on error + Y + + + Table output + 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 + 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 + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1280 + 544 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 1104 + 0 + + + + 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}'; + + + + + 1280 + 320 + + + + Change job status on success 2 + 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}' +and status = 'PROCESSING'; + + + + + 1840 + 0 + + + + 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 + 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 + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + 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, + 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.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; + Y + + + 496 + 320 + + + + Table output + TableOutput + + Y + + 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 + +
+ + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 1280 + 0 + +
+ + + Table output + Change job status on error + 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_flow1.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl deleted file mode 100644 index 5db084f..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl +++ /dev/null @@ -1,228 +0,0 @@ - - - - citizen_guardianship_flow1 - Y - - - - Normal - 0 - - - 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 - 560 - 208 - сведения о лице опекаемом или находящемся на попечении - 349 - - - - - 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_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 - - Y - - 1 - - none - - - - N - - ID_F1 - ID_F1 - String - -2 - -2 - - false - - - false - - - - - - - - - - 720 - 400 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - with person as -(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') 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 - Y - - - 448 - 288 - - - - - Select values 4 2 - Get variables - Y - - - - - - - - - - -
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 - - - - - -
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 new file mode 100644 index 0000000..89a2259 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_delta.hpl @@ -0,0 +1,527 @@ + + + + citizen_guardianship_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 + + + Add constants + Update + Y + + + Insert / update + Change job status on error + Y + + + Table input + Insert / update + Y + + + Insert / update + Group by + Y + + + 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 + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1200 + 480 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 1024 + 0 + + + + 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 = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 1200 + 224 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS', + error_description = null +WHERE job_name = '${JOB_NAME}' + and recruitment_id = '${IDM_ID}' + and status = 'DELTA_PROCESSING'; + + + + 1712 + 0 + + + + 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 +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 336 + 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 + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 704 + 0 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 864 + 0 + + + + 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 + + + 704 + 224 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + 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, + 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.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 c.update_date >= '${M_R_UP_DATE}'::timestamp; + Y + + + 544 + 224 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 1200 + 0 + +
+ + + Insert / update + Change job status on error + 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_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl new file mode 100644 index 0000000..5ec494f --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow_repeat.hpl @@ -0,0 +1,542 @@ + + + + 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 error + Y + + + Add constants + Update + Y + + + 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 + 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 + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 1040 + 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}'; + + + + + + 1232 + 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}' +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, + 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 + + + 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 + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 704 + 48 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 896 + 48 + + + + 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 + + + 704 + 208 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + 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, + 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.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; + Y + + + 416 + 208 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 1232 + 48 + +
+ + + Insert / update + Change job status on error + 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/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/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/child/checkpoints/change_status_delta_child_flow3_error.hpl b/mappings/info_recruits/citizen_tables/citizen_information_search/check_if_need_to_repeat_job.hpl similarity index 57% rename from mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl rename to mappings/info_recruits/citizen_tables/citizen_information_search/check_if_need_to_repeat_job.hpl index 16a7007..17816ff 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow3_error.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_information_search/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,15 +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 = 'citizen_information_search_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_information_search/checkpoints/check_if_citizen_information_search_job_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_information_search/checkpoints/check_if_citizen_information_search_job_exists.hpl new file mode 100644 index 0000000..86c4b6a --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_information_search/checkpoints/check_if_citizen_information_search_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_citizen_information_search_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 = 'citizen_information_search_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Basic + Y + N + 0 + ${STATUS} + + + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_information_search/job_citizen_information_search.hwf b/mappings/info_recruits/citizen_tables/citizen_information_search/job_citizen_information_search.hwf new file mode 100644 index 0000000..79f22b2 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_information_search/job_citizen_information_search.hwf @@ -0,0 +1,291 @@ + + + job_citizen_information_search + 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_information_search_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/checkpoints/check_if_citizen_information_search_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 608 + 208 + + + + citizen_information_search_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_information_search/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_information_search/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_information_search/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_information_search/recruitment_five_flow_delta.hpl + Basic + + Y + + N + local + N + N + Y + N + 880 + 704 + + + + + + Start + check_if_citizen_information_search_job_exists.hpl + Y + Y + Y + + + check_if_citizen_information_search_job_exists.hpl + citizen_information_search_job_exists_check + Y + Y + N + + + citizen_information_search_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + citizen_information_search_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 + Segoe UI + 9 + 149 + 976 + 0 + + +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_information_search/parallel/citizen_information_search_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow.hpl new file mode 100644 index 0000000..a511083 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow.hpl @@ -0,0 +1,460 @@ + + + + citizen_information_search_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 + + + Table output + Change job status on error + Y + + + Change job status on error + Abort + Y + + + Filter rows + Change job status on success + Y + + + Table output + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Table input + Table output + Y + + + Identify last row in a stream + Add constants + Y + + + Add constants + Update + Y + + + Update + Filter rows + Y + + + Update + Change job status on error + Y + + + Table output + Identify last row in a stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 448 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_wanted + true + -1 + N + Boolean + + + + + 880 + 624 + + + + 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 + 448 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1488 + 624 + + + + 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}'); + + + + + 80 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1488 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1200 + 624 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 624 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + +SELECT + ri.recruit_id, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'naimOrg' AS name_organ_start_search, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'ugolovZakon' AS article_criminal_code, + TO_DATE(ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'dataNachRozisk', 'YYYY-MM-DD') AS wanted_start_date, + TO_DATE(ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'dataPrekrRozysk', 'YYYY-MM-DD') AS wanted_end_date, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'osnovPrekrRozysk' AS grounds_stopping_search, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'naimOrgPrekrRozysk' AS name_organ_end_search +FROM recruits_info ri + JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id +WHERE'${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}'::timestamp >= ri.created_at + AND jsonb_typeof(ri.info->'svedFL'->'extend'->'rozysk') = 'object' + + Y + + + 336 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + name_organ_start_search + name_organ_start_search + + + article_criminal_code + article_criminal_code + + + wanted_start_date + wanted_start_date + + + wanted_end_date + wanted_end_date + + + grounds_stopping_search + grounds_stopping_search + + + name_organ_end_search + name_organ_end_search + + + N + N + N + N + Y + N + ervu_dashboard + Y + citizen_information_search
+ N + Y + N + Y + + + 720 + 320 + +
+ + Update + Update + + N + + 1 + + none + + + 1000 + ervu-dashboard + N + + + + = + recruit_id + recruit_id + + + ervu_dashboard + citizen
+ + is_wanted + is_wanted + +
+ N + N + + + 1008 + 624 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + Update + Change job status on error + Y + + error_decription + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_delta.hpl new file mode 100644 index 0000000..ba10b53 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_delta.hpl @@ -0,0 +1,464 @@ + + + + citizen_information_search_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 + + + Insert / update + Change job status on error + Y + + + Insert / update + Detect empty 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 + + + Table input + Insert / update + Y + + + Identify last row in a stream + Add constants + Y + + + Add constants + Update + Y + + + Update + Filter rows + Y + + + Update + Change job status on error + Y + + + Insert / update + Identify last row in a stream + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1120 + 384 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_wanted + true + -1 + N + Boolean + + + + + 864 + 608 + + + + 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}'; + + + + + 960 + 384 + + + + 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}' +and status = 'DELTA_PROCESSING'; + + + + + 1280 + 608 + + + + 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}'; + + + 128 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1280 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1072 + 608 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 608 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen_information_search
+ + recruit_id + recruit_id + N + + + name_organ_start_search + name_organ_start_search + Y + + + article_criminal_code + article_criminal_code + Y + + + wanted_start_date + wanted_start_date + Y + + + wanted_end_date + wanted_end_date + Y + + + grounds_stopping_search + grounds_stopping_search + Y + + + name_organ_end_search + name_organ_end_search + Y + +
+ N + + + 752 + 224 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + +SELECT + ri.recruit_id, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'naimOrg' AS name_organ_start_search, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'ugolovZakon' AS article_criminal_code, + TO_DATE(ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'dataNachRozisk', 'YYYY-MM-DD') AS wanted_start_date, + TO_DATE(ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'dataPrekrRozysk', 'YYYY-MM-DD') AS wanted_end_date, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'osnovPrekrRozysk' AS grounds_stopping_search, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'naimOrgPrekrRozysk' AS name_organ_end_search +FROM recruits_info ri + JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id +WHERE'${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 + AND jsonb_typeof(ri.info->'svedFL'->'extend'->'rozysk') = 'object' + + Y + + + 400 + 224 + + + + Update + Update + + N + + 1 + + none + + + 1000 + ervu-dashboard + N + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_wanted + is_wanted + +
+ N + N + + + 960 + 608 + +
+ + + 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/citizen_information_search/parallel/citizen_information_search_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_repeat.hpl new file mode 100644 index 0000000..92f0032 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_repeat.hpl @@ -0,0 +1,477 @@ + + + + citizen_information_search_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 + + + Add constants + Update + Y + + + Change job status on error + Abort + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Identify last row in a stream 2 + Add constants + Y + + + Update + Change job status on error + Y + + + Update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + Table input + Insert / update + Y + + + Insert / update + Identify last row in a stream 2 + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1152 + 432 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_wanted + true + -1 + N + Boolean + + + + + 880 + 640 + + + + 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 + 432 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1312 + 640 + + + + 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; + + + 176 + 272 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1312 + 272 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1136 + 640 + + + + Identify last row in a stream 2 + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 688 + 640 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen_information_search
+ + recruit_id + recruit_id + N + + + name_organ_start_search + name_organ_start_search + Y + + + article_criminal_code + article_criminal_code + Y + + + wanted_start_date + wanted_start_date + Y + + + wanted_end_date + wanted_end_date + Y + + + grounds_stopping_search + grounds_stopping_search + Y + + + name_organ_end_search + name_organ_end_search + Y + +
+ N + + + 688 + 272 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + +SELECT + ri.recruit_id, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'naimOrg' AS name_organ_start_search, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'ugolovZakon' AS article_criminal_code, + TO_DATE(ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'dataNachRozisk', 'YYYY-MM-DD') AS wanted_start_date, + TO_DATE(ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'dataPrekrRozysk', 'YYYY-MM-DD') AS wanted_end_date, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'osnovPrekrRozysk' AS grounds_stopping_search, + ri.info -> 'svedFL' -> 'extend' -> 'rozysk' ->> 'naimOrgPrekrRozysk' AS name_organ_end_search +FROM recruits_info ri + JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id +WHERE'${IDM_ID}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' + AND '${M_R_CR_DATE}'::timestamp >= ri.created_at + AND jsonb_typeof(ri.info->'svedFL'->'extend'->'rozysk') = 'object' + + Y + + + 416 + 272 + + + + Update + Update + + N + + 1 + + none + + + 1000 + ervu-dashboard + N + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_wanted + is_wanted + +
+ N + N + + + 992 + 640 + +
+ + + 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/citizen_information_search/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_information_search/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..71506fe --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_information_search/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_information_search_flow_delta.hpl + Y + + + Table input + citizen_information_search_flow_delta.hpl 2 + Y + + + Table input + citizen_information_search_flow_delta.hpl 3 + Y + + + Table input + citizen_information_search_flow_delta.hpl 4 + Y + + + Table input + citizen_information_search_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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_information_search_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + citizen_information_search_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 128 + + + + citizen_information_search_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + citizen_information_search_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + citizen_information_search_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + citizen_information_search_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_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_information_search/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/citizen_information_search/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..7515721 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_information_search/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_information_search_flow_repeat.hpl + Y + + + Table input + citizen_information_search_flow_repeat.hpl 3 + Y + + + Table input + citizen_information_search_flow_repeat.hpl 2 + Y + + + Table input + citizen_information_search_flow_repeat.hpl 4 + Y + + + Table input + citizen_information_search_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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_information_search_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + citizen_information_search_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 208 + + + + citizen_information_search_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 288 + + + + citizen_information_search_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 368 + + + + citizen_information_search_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 448 + + + + citizen_information_search_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + citizen_information_search_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_information_search/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_information_search/recruitments_five_flow.hpl new file mode 100644 index 0000000..dd8e714 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_information_search/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_information_search_flow.hpl + Y + + + Get all recruitments ordered by created_date + citizen_information_search_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + citizen_information_search_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + citizen_information_search_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + citizen_information_search_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 432 + 304 + + + + citizen_information_search_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + citizen_information_search_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + citizen_information_search_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + citizen_information_search_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_information_search_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + citizen_information_search_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_information_search/parallel/citizen_information_search_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + citizen_information_search_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/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..d371924 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/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 = 'citizen_spouse_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/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_error.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_error.hpl deleted file mode 100644 index dcc34fb..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_error.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_citizen_spouse_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' 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 - - - 784 - 304 - - - - - -
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_success.hpl deleted file mode 100644 index d704ea8..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/change_status_delta_citizen_spouse_success.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_citizen_spouse_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' 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 - - - 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_spouse/checkpoints/check_if_citizen_spouse_job_exists.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_citizen_spouse_job_exists.hpl new file mode 100644 index 0000000..a62f9ed --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_citizen_spouse_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_citizen_spouse_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 = 'citizen_spouse_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Basic + Y + N + 0 + ${STATUS} + + + + + 944 + 224 + + + + + + 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_spouse/checkpoints/check_if_job_citizen_spouse_exists.hpl deleted file mode 100644 index d1c2864..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/check_if_job_citizen_spouse_exists.hpl +++ /dev/null @@ -1,130 +0,0 @@ - - - - check_if_job_citizen_spouse_exists - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/11 15:20:18.267 - - - 2025/06/11 15:20:18.267 - - - - - - Table input - Set variables - Y - - - Set variables - Write to log - N - - - - Set variables - SetVariable - - Y - - 1 - - none - - - - - job_name - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW - - - Y - - - 688 - 352 - - - - Table input - TableInput - - Y - - 1 - - none - - - 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 - N - - - 400 - 352 - - - - Write to log - WriteToLog - - Y - - 1 - - none - - - Y - - - N - 0 - Basic - ${STATUS} - - - 960 - 240 - - - - - - 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/delta_citizen_spouse.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl deleted file mode 100644 index ee470cb..0000000 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl +++ /dev/null @@ -1,181 +0,0 @@ - - - - delta_citizen_spouse - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 16:10:48.509 - - - 2025/06/03 16:10:48.509 - - - - - - Table input - Insert / update - Y - - - - 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_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(' ', - 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 - - - 624 - 352 - - - - 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 - - - 1024 - 352 - -
- - - -
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 new file mode 100644 index 0000000..ebfe4cd --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl @@ -0,0 +1,429 @@ + + + + citizen_spouse_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 + + + Table output + 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 + + 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}'; + + + + + 720 + 528 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1120 + 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}'); + + + + + 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 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 576 + 320 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + 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, + 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.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 + 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}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; + Y + + + 368 + 320 + + + + Table output + TableOutput + + N + + 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 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
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 - - - - - -
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 new file mode 100644 index 0000000..99e9f11 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_delta.hpl @@ -0,0 +1,452 @@ + + + + citizen_spouse_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 + + + 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 + + + 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 + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 976 + 480 + + + + 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 = 'DELTA_ERROR', + error_description = ? +WHERE job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + + + 736 + 480 + + + + Change job status on success + ExecSql + + Y + + 1 + + none + + + + + ervu-dashboard + Y + N + Y + N + N + UPDATE etl.job_execution +SET status = 'DELTA_SUCCESS', + error_description = null +WHERE job_name = '${JOB_NAME}' + and recruitment_id = '${IDM_ID}' + and status = 'DELTA_PROCESSING'; + + + + 1200 + 80 + + + + 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 +where job_name = '${JOB_NAME}' +and recruitment_id = '${IDM_ID}'; + + + 96 + 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 + + 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 + + + 736 + 224 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + + SELECT + 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, + 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.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 + 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}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date + AND c.update_date >= '${M_R_UP_DATE}'::timestamp; + + Y + + + 368 + 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..d92ae63 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow_repeat.hpl @@ -0,0 +1,467 @@ + + + + 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 + + + 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 + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1008 + 576 + + + + 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}'; + + + + + 704 + 576 + + + + 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}' +and status = 'PROCESSING'; + + + + + + 1136 + 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 + + + 112 + 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 + + 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 + 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, + 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.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 + 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}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; + Y + + + 352 + 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..a89ab4b --- /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 + + 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..b0ef287 --- /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 + + 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/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/citizen_spouse/recruitments_five_flow.hpl new file mode 100644 index 0000000..6dccdb6 --- /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 + + 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 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/passport/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/passport/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..c2451f4 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/passport/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 = 'passport_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/passport/checkpoints/change_status_delta_passport_error.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_delta_passport_error.hpl deleted file mode 100644 index eb035c0..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_delta_passport_error.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_passport_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_passport' as job_name, - 'ERROR' as status, - current_timestamp as record_created - -union all - - SELECT - 'job_passport' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_delta_passport_success.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_delta_passport_success.hpl deleted file mode 100644 index bed6c3f..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_delta_passport_success.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_passport_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_passport' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - -union all - - SELECT - 'job_passport' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow1_error.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow1_error.hpl deleted file mode 100644 index 11a8f7c..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_passport_flow1_success.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow1_success.hpl deleted file mode 100644 index 3615a2d..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_passport_flow2_error.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow2_error.hpl deleted file mode 100644 index 37d5e94..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_passport_flow2_success.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow2_success.hpl deleted file mode 100644 index 1248307..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_passport_flow3_error.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow3_error.hpl deleted file mode 100644 index 8d7d458..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_passport_flow3_success.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow3_success.hpl deleted file mode 100644 index be0921a..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_passport_flow4_error.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow4_error.hpl deleted file mode 100644 index 3065833..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_passport_flow4_success.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow4_success.hpl deleted file mode 100644 index 3df9671..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_passport_flow5_error.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow5_error.hpl deleted file mode 100644 index 5728a91..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_passport_flow5_success.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow5_success.hpl deleted file mode 100644 index e6e205c..0000000 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_passport_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.passport 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 - 'passport_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/passport/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index fa312e9..0000000 --- a/mappings/info_recruits/citizen_tables/passport/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_passport' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'passport_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'passport_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'passport_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'passport_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'passport_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/change_status_to_processing_delta.hpl deleted file mode 100644 index 451d2a8..0000000 --- a/mappings/info_recruits/citizen_tables/passport/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_passport' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 832 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/passport/checkpoints/check_if_passport_job_exists.hpl b/mappings/info_recruits/citizen_tables/passport/checkpoints/check_if_passport_job_exists.hpl new file mode 100644 index 0000000..9081aed --- /dev/null +++ b/mappings/info_recruits/citizen_tables/passport/checkpoints/check_if_passport_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_passport_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 = 'passport_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Basic + Y + N + 0 + ${STATUS} + + + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/passport/job_passport.hwf b/mappings/info_recruits/citizen_tables/passport/job_passport.hwf index cd6680c..fbe26dd 100644 --- a/mappings/info_recruits/citizen_tables/passport/job_passport.hwf +++ b/mappings/info_recruits/citizen_tables/passport/job_passport.hwf @@ -37,235 +37,12 @@ 0 1 N - 368 - 400 - - - - checkpoint_job_passport.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl - Basic - - Y - - N - local - N - N - Y - N - 1136 - 1280 - - - - recruitment_rows_five_flow_passport.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_passport.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2352 - 400 - - - - passport_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 80 - - - - passport_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 240 - - - - passport_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 400 - - - - passport_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 560 - - - - passport_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 720 - - - - Abort workflow - - ABORT - - N - N - 2336 + 416 208 - Success new citizen - - SUCCESS - - N - 3728 - 432 - - - - branching_passport.hpl + check_if_passport_job_exists.hpl PIPELINE @@ -275,7 +52,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/branching_passport.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/check_if_passport_job_exists.hpl Basic Y @@ -286,48 +63,29 @@ N Y N - 1584 - 1280 + 608 + 208 - Simple passport WHERE SUCCESS + passport_job_exists_check SIMPLE_EVAL - SUCCESS - string - true + boolean + false equal equal N variable - STATUS + JOB_EXECUTED_FLAG N - 1840 - 1792 + 880 + 208 - Simple passport 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,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/recruitment_rows_five_flow_if_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/recruitments_five_flow.hpl Basic Y @@ -348,23 +106,12 @@ N Y Y - 2384 - 1280 + 1120 + 208 - Abort workflow 2 - - ABORT - - N - N - 2288 - 1040 - - - - delta_passport.hpl + recruitment_five_flow_on_error.hpl PIPELINE @@ -374,57 +121,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/delta_passport.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - Y - - N - local - N - N - Y - N - 2640 - 1792 - - - - Success delta_citizen - - SUCCESS - - N - 3216 - 1792 - - - - error delta_citizen - - SUCCESS - - N - 3216 - 1872 - - - - check_if_job_passport_exists.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/check_if_job_passport_exists.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/recruitment_five_flow_on_error.hpl Basic Y @@ -435,30 +132,60 @@ N Y N - 544 - 400 + 1120 + 512 - Simple job_passport_exists check NEW + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/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_to_processing.hpl + recruitment_five_flow_delta.hpl PIPELINE @@ -468,7 +195,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_to_processing.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/recruitment_five_flow_delta.hpl Basic Y @@ -479,1367 +206,63 @@ N Y N - 1136 - 400 - - - - change_status_passport_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 80 - - - - change_status_passport_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 160 - - - - change_status_passport_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 240 - - - - change_status_passport_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 320 - - - - change_status_passport_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 400 - - - - change_status_passport_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 480 - - - - change_status_passport_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 560 - - - - change_status_passport_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 640 - - - - change_status_passport_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 720 - - - - change_status_passport_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 800 - - - - checkpoint_job_passport.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.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/passport/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/passport/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2144 - 1792 - - - - change_status_delta_passport_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_delta_passport_success.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1792 - - - - change_status_delta_passport_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_delta_passport_error.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1872 - - - - passport_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 960 - - - - passport_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 1120 - - - - passport_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 1280 - - - - passport_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 1440 - - - - passport_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 1600 - - - - Success new citizen 2 - - SUCCESS - - N - 3728 - 1312 - - - - change_status_passport_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 960 - - - - change_status_passport_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1040 - - - - change_status_passport_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1120 - - - - change_status_passport_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1200 - - - - change_status_passport_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1280 - - - - change_status_passport_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1360 - - - - change_status_passport_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1440 - - - - change_status_passport_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1520 - - - - change_status_passport_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1600 - - - - change_status_passport_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/change_status_passport_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1680 - - - - checkpoint_job_passport.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl - Basic - - Y - - N - local - N - N - Y - N - 3456 - 1312 + 880 + 704 - - recruitment_rows_five_flow_passport.hpl - passport_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_passport.hpl - passport_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_passport.hpl - passport_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_passport.hpl - passport_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_passport.hpl - passport_flow5.hpl - Y - Y - N - - - recruitment_rows_five_flow_passport.hpl - Abort workflow - Y - N - N - - - branching_passport.hpl - Simple passport WHERE ERROR - Y - N - Y - - - branching_passport.hpl - Simple passport WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - Start - check_if_job_passport_exists.hpl + check_if_passport_job_exists.hpl Y Y Y - check_if_job_passport_exists.hpl - Simple job_passport_exists check NEW + check_if_passport_job_exists.hpl + passport_job_exists_check Y Y N - Simple job_passport_exists check NEW - change_status_to_processing.hpl + passport_job_exists_check + recruitments_five_flow.hpl Y Y N - change_status_to_processing.hpl - recruitment_rows_five_flow_passport.hpl + passport_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 - passport_flow1.hpl - change_status_passport_flow1_success.hpl + Simple evaluation + recruitment_five_flow_on_error.hpl Y Y N - passport_flow1.hpl - change_status_passport_flow1_error.hpl + Simple evaluation + recruitment_five_flow_delta.hpl Y N N - - passport_flow2.hpl - change_status_passport_flow2_success.hpl - Y - Y - N - - - passport_flow2.hpl - change_status_passport_flow2_error.hpl - Y - N - N - - - passport_flow3.hpl - change_status_passport_flow3_success.hpl - Y - Y - N - - - passport_flow3.hpl - change_status_passport_flow3_error.hpl - Y - N - N - - - passport_flow4.hpl - change_status_passport_flow4_success.hpl - Y - Y - N - - - passport_flow4.hpl - change_status_passport_flow4_error.hpl - Y - N - N - - - passport_flow5.hpl - change_status_passport_flow5_success.hpl - Y - Y - N - - - passport_flow5.hpl - change_status_passport_flow5_error.hpl - Y - N - N - - - change_status_passport_flow5_error.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - change_status_passport_flow5_success.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - change_status_passport_flow4_error.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - change_status_passport_flow4_success.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - change_status_passport_flow3_error.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - change_status_passport_flow3_success.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - change_status_passport_flow2_error.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - change_status_passport_flow2_success.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - change_status_passport_flow1_error.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - change_status_passport_flow1_success.hpl - checkpoint_job_passport.hpl - Y - N - Y - - - checkpoint_job_passport.hpl - Success new citizen - Y - Y - N - - - checkpoint_job_passport.hpl (2) - branching_passport.hpl - Y - N - Y - - - Simple job_passport_exists check NEW - checkpoint_job_passport.hpl (2) - Y - N - N - - - Simple passport 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 passport WHERE SUCCESS - change_status_to_processing_delta.hpl - Y - Y - N - - - delta_passport.hpl - change_status_delta_passport_success.hpl - Y - Y - N - - - change_status_delta_passport_success.hpl - Success delta_citizen - Y - Y - N - - - delta_passport.hpl - change_status_delta_passport_error.hpl - Y - N - N - - - change_status_delta_passport_error.hpl - error delta_citizen - Y - Y - N - - - passport_flow1.hpl 2 - change_status_passport_flow1_success.hpl 2 - Y - Y - N - - - passport_flow1.hpl 2 - change_status_passport_flow1_error.hpl 2 - Y - N - N - - - passport_flow2.hpl 2 - change_status_passport_flow2_success.hpl 2 - Y - Y - N - - - passport_flow2.hpl 2 - change_status_passport_flow2_error.hpl 2 - Y - N - N - - - passport_flow3.hpl 2 - change_status_passport_flow3_success.hpl 2 - Y - Y - N - - - passport_flow3.hpl 2 - change_status_passport_flow3_error.hpl 2 - Y - N - N - - - passport_flow4.hpl 2 - change_status_passport_flow4_success.hpl 2 - Y - Y - N - - - passport_flow4.hpl 2 - change_status_passport_flow4_error.hpl 2 - Y - N - N - - - passport_flow5.hpl 2 - change_status_passport_flow5_success.hpl 2 - Y - Y - N - - - passport_flow5.hpl 2 - change_status_passport_flow5_error.hpl 2 - Y - N - N - - - change_status_passport_flow1_success.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - change_status_passport_flow1_error.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - change_status_passport_flow2_success.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - change_status_passport_flow2_error.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - change_status_passport_flow3_success.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - change_status_passport_flow3_error.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - change_status_passport_flow4_success.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - change_status_passport_flow4_error.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - change_status_passport_flow5_success.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - change_status_passport_flow5_error.hpl 2 - checkpoint_job_passport.hpl 2 - Y - N - Y - - - checkpoint_job_passport.hpl 2 - Success new citizen 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - passport_flow3.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - passport_flow2.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - passport_flow1.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - passport_flow4.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - passport_flow5.hpl 2 - Y - Y - N - - - change_status_to_processing_delta.hpl - delta_passport.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/passport/parallel/passport_flow.hpl b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl new file mode 100644 index 0000000..cb2fe0c --- /dev/null +++ b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl @@ -0,0 +1,380 @@ + + + + passport_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 + + + Table output + Change job status on error + Y + + + Table output + 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 + Table output + Y + + + Table output + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1264 + 608 + + + + 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}'; + + + + + 896 + 608 + + + + 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} +and status = 'PROCESSING'; + + + + + 1264 + 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 + + + + + 896 + 176 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1264 + 320 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 640 + 320 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + ri.recruit_id, + NULLIF(p.passport_data->>'nomDok', '') AS passport_number, + NULLIF(p.passport_data->>'serDok', '') AS passport_series, + NULLIF(p.passport_data->>'vydDok', '') AS organization_name, + NULLIF(p.passport_data->>'kodVydDok', '') AS unit_code, + TO_DATE(NULLIF(p.passport_data->>'dataDok', ''), 'YYYY-MM-DD') AS issue_date, + CASE + WHEN NULLIF(p.passport_data->>'kodStatus', '') = '1' THEN TRUE + ELSE FALSE + END AS actual +FROM 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 >= r.recruit_create_date +JOIN LATERAL ( + SELECT passport_data + FROM UNNEST(ARRAY[ + ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF', + ri.info->'svedFL'->'svedBS'->'pasportRF'->'predPasportRF' + ]) AS passport_data + WHERE passport_data IS NOT NULL AND passport_data::text <> 'null' +) AS p ON TRUE + + Y + + + 496 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + passport_number + passport_number + + + passport_series + passport_series + + + organization_name + organization_name + + + unit_code + unit_code + + + issue_date + issue_date + + + actual + actual + + + N + N + N + N + Y + N + ervu_dashboard + Y + passport
+ N + Y + N + Y + + + 896 + 320 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow2.hpl b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow2.hpl deleted file mode 100644 index 884e7b9..0000000 --- a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow2.hpl +++ /dev/null @@ -1,137 +0,0 @@ - - - - passport_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 - passport
- - recruit_id - recruit_id - N - - - actual - actual - Y - - - issue_date - issue_date - Y - - - organization_name - organization_name - Y - - - passport_number - passport_number - Y - - - passport_series - passport_series - Y - - - unit_code - unit_code - Y - -
- N - - - 1216 - 416 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - r.recruit_id AS recruit_id, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'vydDok' AS organization_name, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodVydDok' AS unit_code, - TO_DATE(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'dataDok', 'YYYY-MM-DD') AS issue_date, - CASE - WHEN ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodStatus' = '1' - THEN TRUE ELSE FALSE - END AS actual -FROM ervu_dashboard.recruits_info ri ---join public.recruits r on r.id = ri.recruit_id -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 ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' IS NOT NULL -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok') = 4 -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') = 6 - Y - - - 720 - 416 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow3.hpl b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow3.hpl deleted file mode 100644 index 9597d30..0000000 --- a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow3.hpl +++ /dev/null @@ -1,137 +0,0 @@ - - - - passport_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 - passport
- - recruit_id - recruit_id - N - - - actual - actual - Y - - - issue_date - issue_date - Y - - - organization_name - organization_name - Y - - - passport_number - passport_number - Y - - - passport_series - passport_series - Y - - - unit_code - unit_code - Y - -
- N - - - 1280 - 432 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - r.recruit_id AS recruit_id, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'vydDok' AS organization_name, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodVydDok' AS unit_code, - TO_DATE(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'dataDok', 'YYYY-MM-DD') AS issue_date, - CASE - WHEN ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodStatus' = '1' - THEN TRUE ELSE FALSE - END AS actual -FROM ervu_dashboard.recruits_info ri ---join public.recruits r on r.id = ri.recruit_id -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 ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' IS NOT NULL -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok') = 4 -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') = 6 - Y - - - 784 - 432 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow4.hpl b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow4.hpl deleted file mode 100644 index 6d005a8..0000000 --- a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow4.hpl +++ /dev/null @@ -1,137 +0,0 @@ - - - - passport_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 - passport
- - recruit_id - recruit_id - N - - - actual - actual - Y - - - issue_date - issue_date - Y - - - organization_name - organization_name - Y - - - passport_number - passport_number - Y - - - passport_series - passport_series - Y - - - unit_code - unit_code - Y - -
- N - - - 1280 - 448 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - r.recruit_id AS recruit_id, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'vydDok' AS organization_name, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodVydDok' AS unit_code, - TO_DATE(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'dataDok', 'YYYY-MM-DD') AS issue_date, - CASE - WHEN ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodStatus' = '1' - THEN TRUE ELSE FALSE - END AS actual -FROM ervu_dashboard.recruits_info ri ---join public.recruits r on r.id = ri.recruit_id -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 ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' IS NOT NULL -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok') = 4 -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') = 6 - Y - - - 784 - 448 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow5.hpl b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow5.hpl deleted file mode 100644 index c1d7b20..0000000 --- a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow5.hpl +++ /dev/null @@ -1,137 +0,0 @@ - - - - passport_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 - passport
- - recruit_id - recruit_id - N - - - actual - actual - Y - - - issue_date - issue_date - Y - - - organization_name - organization_name - Y - - - passport_number - passport_number - Y - - - passport_series - passport_series - Y - - - unit_code - unit_code - Y - -
- N - - - 1296 - 496 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - SELECT - r.recruit_id AS recruit_id, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'vydDok' AS organization_name, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodVydDok' AS unit_code, - TO_DATE(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'dataDok', 'YYYY-MM-DD') AS issue_date, - CASE - WHEN ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodStatus' = '1' - THEN TRUE ELSE FALSE - END AS actual -FROM ervu_dashboard.recruits_info ri ---join public.recruits r on r.id = ri.recruit_id -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 ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' IS NOT NULL -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok') = 4 -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') = 6 - Y - - - 800 - 496 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow_delta.hpl b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow_delta.hpl new file mode 100644 index 0000000..b7c0e1c --- /dev/null +++ b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow_delta.hpl @@ -0,0 +1,391 @@ + + + + passport_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 + + + Insert / update + Change job status on error + 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 + + + Insert / update + Filter rows + Y + + + Filter rows + Change job status on success + Y + + + Change job status on error + Abort + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1008 + 464 + + + + 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}'; + + + + + 752 + 464 + + + + 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}' +and status = 'DELTA_PROCESSING'; + + + + + 1120 + 80 + + + + 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}'; + + + 128 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 752 + 80 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1120 + 224 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 560 + 224 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + actual + actual + + ervu_dashboard + passport
+ + recruit_id + recruit_id + N + + + passport_number + passport_number + Y + + + passport_series + passport_series + Y + + + organization_name + organization_name + Y + + + unit_code + unit_code + Y + + + issue_date + issue_date + Y + + + actual + actual + N + +
+ N + + + 752 + 224 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + ri.recruit_id, + NULLIF(p.passport_data->>'nomDok', '') AS passport_number, + NULLIF(p.passport_data->>'serDok', '') AS passport_series, + NULLIF(p.passport_data->>'vydDok', '') AS organization_name, + NULLIF(p.passport_data->>'kodVydDok', '') AS unit_code, + TO_DATE(NULLIF(p.passport_data->>'dataDok', ''), 'YYYY-MM-DD') AS issue_date, + CASE + WHEN NULLIF(p.passport_data->>'kodStatus', '') = '1' THEN TRUE + ELSE FALSE + END AS actual +FROM 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 >= r.recruit_create_date + AND r.update_date >= '${M_R_UP_DATE}'::timestamp +JOIN LATERAL ( + SELECT passport_data + FROM UNNEST(ARRAY[ + ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF', + ri.info->'svedFL'->'svedBS'->'pasportRF'->'predPasportRF' + ]) AS passport_data + WHERE passport_data IS NOT NULL AND passport_data::text <> 'null' +) AS p ON TRUE + + Y + + + 400 + 224 + + + + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow_repeat.hpl new file mode 100644 index 0000000..04fa7bf --- /dev/null +++ b/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow_repeat.hpl @@ -0,0 +1,404 @@ + + + + passport_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 + + + Insert / update + Change job status on error + Y + + + Insert / update + Detect empty stream + Y + + + Detect empty stream + Change job status on success + 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 + + + Change job status on error + Abort + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1232 + 544 + + + + 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}'; + + + + + 768 + 544 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1040 + 16 + + + + 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; + + + 176 + 272 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 768 + 16 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1040 + 272 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 608 + 272 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + actual + actual + + ervu_dashboard + passport
+ + recruit_id + recruit_id + N + + + passport_number + passport_number + Y + + + passport_series + passport_series + Y + + + organization_name + organization_name + Y + + + unit_code + unit_code + Y + + + issue_date + issue_date + Y + + + actual + actual + N + +
+ N + + + 768 + 272 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT + ri.recruit_id, + NULLIF(p.passport_data->>'nomDok', '') AS passport_number, + NULLIF(p.passport_data->>'serDok', '') AS passport_series, + NULLIF(p.passport_data->>'vydDok', '') AS organization_name, + NULLIF(p.passport_data->>'kodVydDok', '') AS unit_code, + TO_DATE(NULLIF(p.passport_data->>'dataDok', ''), 'YYYY-MM-DD') AS issue_date, + CASE + WHEN NULLIF(p.passport_data->>'kodStatus', '') = '1' THEN TRUE + ELSE FALSE + END AS actual +FROM 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 >= r.recruit_create_date +JOIN LATERAL ( + SELECT passport_data + FROM UNNEST(ARRAY[ + ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF', + ri.info->'svedFL'->'svedBS'->'pasportRF'->'predPasportRF' + ]) AS passport_data + WHERE passport_data IS NOT NULL AND passport_data::text <> 'null' +) AS p ON TRUE + + Y + + + 416 + 272 + + + + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/passport/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/passport/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..8259a10 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/passport/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 + passport_flow_delta.hpl + Y + + + Table input + passport_flow_delta.hpl 2 + Y + + + Table input + passport_flow_delta.hpl 3 + Y + + + Table input + passport_flow_delta.hpl 4 + Y + + + Table input + passport_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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 = 'passport_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + passport_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 128 + + + + passport_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + passport_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + passport_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + passport_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_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/passport/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/passport/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..56c602d --- /dev/null +++ b/mappings/info_recruits/citizen_tables/passport/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 + passport_flow_repeat.hpl + Y + + + Table input + passport_flow_repeat.hpl 3 + Y + + + Table input + passport_flow_repeat.hpl 2 + Y + + + Table input + passport_flow_repeat.hpl 4 + Y + + + Table input + passport_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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 = 'passport_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + passport_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 208 + + + + passport_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 288 + + + + passport_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 368 + + + + passport_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 448 + + + + passport_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + passport_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/passport/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/passport/recruitments_five_flow.hpl new file mode 100644 index 0000000..18397ed --- /dev/null +++ b/mappings/info_recruits/citizen_tables/passport/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 + passport_flow.hpl + Y + + + Get all recruitments ordered by created_date + passport_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + passport_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + passport_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + passport_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 432 + 304 + + + + passport_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + passport_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + passport_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + passport_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + passport_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + passport_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + passport_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/prosecution/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/prosecution/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..4c54578 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/prosecution/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 = 'prosecution_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/prosecution/checkpoints/change_status_delta_prosecution_error.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_delta_prosecution_error.hpl deleted file mode 100644 index c48e595..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_delta_prosecution_error.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_prosecution_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_prosecution' as job_name, - 'ERROR' as status, - current_timestamp as record_created - -union all - - SELECT - 'job_prosecution' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_delta_prosecution_success.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_delta_prosecution_success.hpl deleted file mode 100644 index cce1fed..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_delta_prosecution_success.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_prosecution_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_prosecution' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - -union all - - SELECT - 'job_prosecution' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow1_error.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow1_error.hpl deleted file mode 100644 index 0169754..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_prosecution_flow1_success.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow1_success.hpl deleted file mode 100644 index b7da38b..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_prosecution_flow2_error.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow2_error.hpl deleted file mode 100644 index 7e19275..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_prosecution_flow2_success.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow2_success.hpl deleted file mode 100644 index 31210c2..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_prosecution_flow3_error.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow3_error.hpl deleted file mode 100644 index fadd007..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_prosecution_flow3_success.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow3_success.hpl deleted file mode 100644 index b359b96..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_prosecution_flow4_error.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow4_error.hpl deleted file mode 100644 index 999578d..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_prosecution_flow4_success.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow4_success.hpl deleted file mode 100644 index a171b65..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_prosecution_flow5_error.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow5_error.hpl deleted file mode 100644 index 3ddd2e7..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_prosecution_flow5_success.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow5_success.hpl deleted file mode 100644 index bebb11a..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_prosecution_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.prosecution 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 - 'prosecution_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/prosecution/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index 86aba83..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/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_prosecution' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'prosecution_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'prosecution_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'prosecution_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'prosecution_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'prosecution_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/change_status_to_processing_delta.hpl deleted file mode 100644 index 5be41e9..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/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_prosecution' 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/prosecution/checkpoints/check_if_prosecution_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/prosecution/checkpoints/check_if_prosecution_job_exists.hpl index a2bc69c..d898c29 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/check_if_job_child_exists.hpl +++ b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/check_if_prosecution_job_exists.hpl @@ -1,7 +1,7 @@ - check_if_job_child_exists + check_if_prosecution_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 = 'prosecution_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/prosecution/checkpoints/checkpoint_job_prosecution.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/checkpoint_job_prosecution.hpl deleted file mode 100644 index b56b2e5..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/checkpoint_job_prosecution.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_prosecution - 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 ( - 'prosecution_flow1', - 'prosecution_flow2', - 'prosecution_flow3', - 'prosecution_flow4', - 'prosecution_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'prosecution_flow1', - 'prosecution_flow2', - 'prosecution_flow3', - 'prosecution_flow4', - 'prosecution_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_prosecution' 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/prosecution/checkpoints/checkpoint_prosecution_error.hpl b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/checkpoint_prosecution_error.hpl deleted file mode 100644 index 06ffe21..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/checkpoints/checkpoint_prosecution_error.hpl +++ /dev/null @@ -1,273 +0,0 @@ - - - - checkpoint_prosecution_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/prosecution/checkpoints/xxjob_create_files_child.hwf b/mappings/info_recruits/citizen_tables/prosecution/checkpoints/xxjob_create_files_child.hwf deleted file mode 100644 index b31ca9f..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/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/prosecution/delta_prosecution.hpl b/mappings/info_recruits/citizen_tables/prosecution/delta_prosecution.hpl deleted file mode 100644 index bc20c7a..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/delta_prosecution.hpl +++ /dev/null @@ -1,180 +0,0 @@ - - - - delta_prosecution - Y - - - - Normal - - - N - 1000 - 100 - - - 2025/06/03 16:10:48.509 - - - 2025/06/03 16:10:48.509 - - - - - - Table input - Insert / update - Y - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -ugolov_presl AS ( - SELECT - jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up, - ri.recruit_id - --'prOtsSvedUgolovPresl' - 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'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array' -) -SELECT - r.recruit_id AS recruit_id, - --up->'sledSud'->>'uk', -- уголовный кодекс? - up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный) - up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния - --up->'sledSud'->'extend'->>'kodVidUgolovPresl', -- - up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования - CASE - WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд - ELSE false -- нет или нет инфы - END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина? - - --up->'sledSud'->>'naimSud', -- Наименование суда??? - up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный) - STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса - up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение - --up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования??? - --up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования - --up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? = - up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела - up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования? - --up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ???? - up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела - --up->>'sledSudTekst', -- ??? - --up->>'sledSudPriznak' -- ??? - --'UG_PRESL' AS info_type -FROM ervu_dashboard.citizen r -JOIN ugolov_presl up ON r.recruit_id = up.recruit_id -LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true -GROUP BY r.recruit_id, up - Y - - - 624 - 352 - - - - Insert / update - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruit_id - recruit_id - - ervu_dashboard - prosecution
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - case_number - case_number - Y - - - case_number_court - case_number_court - Y - - - close_date - close_date - Y - - - create_date - create_date - Y - - - kind - kind - Y - - - law_point - law_point - Y - - - reclassification - reclassification - Y - - - termination_basis - termination_basis - Y - - - transfer_to_court - transfer_to_court - Y - -
- N - - - 1040 - 352 - -
- - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/job_prosecution.hwf b/mappings/info_recruits/citizen_tables/prosecution/job_prosecution.hwf deleted file mode 100644 index 4ec227f..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/job_prosecution.hwf +++ /dev/null @@ -1,1843 +0,0 @@ - - - job_prosecution - 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_prosecution.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/checkpoint_job_prosecution.hpl - Basic - - Y - - N - local - N - N - Y - N - 1136 - 1280 - - - - recruitment_rows_five_flow_prosecution.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_prosecution.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2352 - 400 - - - - prosecution_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 80 - - - - prosecution_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 240 - - - - prosecution_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 400 - - - - prosecution_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 560 - - - - prosecution_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_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 prosecution - - SUCCESS - - N - 3728 - 432 - - - - branching_prosecution.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/branching_prosecution.hpl - Basic - - Y - - N - local - N - N - Y - N - 1584 - 1280 - - - - Simple prosecution WHERE SUCCESS - - SIMPLE_EVAL - - SUCCESS - string - true - equal - equal - N - variable - STATUS - N - 1840 - 1792 - - - - Simple prosecution 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/prosecution/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_prosecution.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/delta_prosecution.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - Y - - N - local - N - N - Y - N - 2640 - 1792 - - - - Success delta_prosecution - - SUCCESS - - N - 3280 - 1792 - - - - error delta_prosecution - - SUCCESS - - N - 3280 - 1872 - - - - check_if_job_prosecution_exists.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/check_if_job_prosecution_exists.hpl - Basic - - Y - - N - local - N - N - Y - N - 576 - 400 - - - - Simple job_prosecution_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/prosecution/checkpoints/change_status_to_processing.hpl - Basic - - Y - - N - local - N - N - Y - N - 1264 - 400 - - - - change_status_prosecution_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 80 - - - - change_status_prosecution_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 160 - - - - change_status_prosecution_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 240 - - - - change_status_prosecution_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 320 - - - - change_status_prosecution_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 400 - - - - change_status_prosecution_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 480 - - - - change_status_prosecution_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 560 - - - - change_status_prosecution_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 640 - - - - change_status_prosecution_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 720 - - - - change_status_prosecution_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 800 - - - - checkpoint_job_prosecution.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/checkpoint_job_prosecution.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/prosecution/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/prosecution/checkpoints/change_status_to_processing_delta.hpl - - - Basic - - Y - - N - local - N - N - Y - N - 2144 - 1792 - - - - change_status_delta_prosecution_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_delta_prosecution_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1792 - - - - change_status_delta_prosecution_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_delta_prosecution_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1872 - - - - prosecution_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 960 - - - - prosecution_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 1120 - - - - prosecution_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 1280 - - - - prosecution_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 1440 - - - - prosecution_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 1600 - - - - Success new prosecution 2 - - SUCCESS - - N - 3728 - 1312 - - - - change_status_prosecution_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 960 - - - - change_status_prosecution_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1040 - - - - change_status_prosecution_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1120 - - - - change_status_prosecution_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1200 - - - - change_status_prosecution_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1280 - - - - change_status_prosecution_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1360 - - - - change_status_prosecution_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1440 - - - - change_status_prosecution_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1520 - - - - change_status_prosecution_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1600 - - - - change_status_prosecution_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/change_status_prosecution_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1680 - - - - checkpoint_job_prosecution.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/checkpoint_job_prosecution.hpl - Basic - - Y - - N - local - N - N - Y - N - 3456 - 1312 - - - - - - recruitment_rows_five_flow_prosecution.hpl - prosecution_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_prosecution.hpl - prosecution_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_prosecution.hpl - prosecution_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_prosecution.hpl - prosecution_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_prosecution.hpl - prosecution_flow5.hpl - Y - Y - N - - - recruitment_rows_five_flow_prosecution.hpl - Abort workflow - Y - N - N - - - branching_prosecution.hpl - Simple prosecution WHERE ERROR - Y - N - Y - - - branching_prosecution.hpl - Simple prosecution WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - - - Start - check_if_job_prosecution_exists.hpl - Y - Y - Y - - - check_if_job_prosecution_exists.hpl - Simple job_prosecution_exists check NEW - Y - Y - N - - - Simple job_prosecution_exists check NEW - change_status_to_processing.hpl - Y - Y - N - - - change_status_to_processing.hpl - recruitment_rows_five_flow_prosecution.hpl - Y - Y - N - - - prosecution_flow1.hpl - change_status_prosecution_flow1_success.hpl - Y - Y - N - - - prosecution_flow1.hpl - change_status_prosecution_flow1_error.hpl - Y - N - N - - - prosecution_flow2.hpl - change_status_prosecution_flow2_success.hpl - Y - Y - N - - - prosecution_flow2.hpl - change_status_prosecution_flow2_error.hpl - Y - N - N - - - prosecution_flow3.hpl - change_status_prosecution_flow3_success.hpl - Y - Y - N - - - prosecution_flow3.hpl - change_status_prosecution_flow3_error.hpl - Y - N - N - - - prosecution_flow4.hpl - change_status_prosecution_flow4_success.hpl - Y - Y - N - - - prosecution_flow4.hpl - change_status_prosecution_flow4_error.hpl - Y - N - N - - - prosecution_flow5.hpl - change_status_prosecution_flow5_success.hpl - Y - Y - N - - - prosecution_flow5.hpl - change_status_prosecution_flow5_error.hpl - Y - N - N - - - change_status_prosecution_flow5_error.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - change_status_prosecution_flow5_success.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - change_status_prosecution_flow4_error.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - change_status_prosecution_flow4_success.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - change_status_prosecution_flow3_error.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - change_status_prosecution_flow3_success.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - change_status_prosecution_flow2_error.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - change_status_prosecution_flow2_success.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - change_status_prosecution_flow1_error.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - change_status_prosecution_flow1_success.hpl - checkpoint_job_prosecution.hpl - Y - N - Y - - - checkpoint_job_prosecution.hpl - Success new prosecution - Y - Y - N - - - checkpoint_job_prosecution.hpl (2) - branching_prosecution.hpl - Y - N - Y - - - Simple job_prosecution_exists check NEW - checkpoint_job_prosecution.hpl (2) - Y - N - N - - - Simple prosecution 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 prosecution WHERE SUCCESS - change_status_to_processing_delta.hpl - Y - Y - N - - - delta_prosecution.hpl - change_status_delta_prosecution_success.hpl - Y - Y - N - - - change_status_delta_prosecution_success.hpl - Success delta_prosecution - Y - Y - N - - - delta_prosecution.hpl - change_status_delta_prosecution_error.hpl - Y - N - N - - - change_status_delta_prosecution_error.hpl - error delta_prosecution - Y - Y - N - - - change_status_to_processing_delta.hpl - delta_prosecution.hpl - Y - Y - N - - - prosecution_flow1.hpl 2 - change_status_prosecution_flow1_success.hpl 2 - Y - Y - N - - - prosecution_flow1.hpl 2 - change_status_prosecution_flow1_error.hpl 2 - Y - N - N - - - prosecution_flow2.hpl 2 - change_status_prosecution_flow2_success.hpl 2 - Y - Y - N - - - prosecution_flow2.hpl 2 - change_status_prosecution_flow2_error.hpl 2 - Y - N - N - - - prosecution_flow3.hpl 2 - change_status_prosecution_flow3_success.hpl 2 - Y - Y - N - - - prosecution_flow3.hpl 2 - change_status_prosecution_flow3_error.hpl 2 - Y - N - N - - - prosecution_flow4.hpl 2 - change_status_prosecution_flow4_success.hpl 2 - Y - Y - N - - - prosecution_flow4.hpl 2 - change_status_prosecution_flow4_error.hpl 2 - Y - N - N - - - prosecution_flow5.hpl 2 - change_status_prosecution_flow5_success.hpl 2 - Y - Y - N - - - prosecution_flow5.hpl 2 - change_status_prosecution_flow5_error.hpl 2 - Y - N - N - - - change_status_prosecution_flow1_success.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - change_status_prosecution_flow1_error.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - change_status_prosecution_flow2_success.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - change_status_prosecution_flow2_error.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - change_status_prosecution_flow3_success.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - change_status_prosecution_flow3_error.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - change_status_prosecution_flow4_success.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - change_status_prosecution_flow4_error.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - change_status_prosecution_flow5_success.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - change_status_prosecution_flow5_error.hpl 2 - checkpoint_job_prosecution.hpl 2 - Y - N - Y - - - checkpoint_job_prosecution.hpl 2 - Success new prosecution 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - prosecution_flow3.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - prosecution_flow2.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - prosecution_flow1.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - prosecution_flow4.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - prosecution_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/prosecution/parallel/prosecution_flow.hpl b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow.hpl new file mode 100644 index 0000000..1009170 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow.hpl @@ -0,0 +1,579 @@ + + + + prosecution_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 + + + Table output + Change job status on error + Y + + + Change job status on error + Abort + Y + + + Filter rows + Change job status on success + Y + + + Table output + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Table input + Table output + Y + + + Table output + Group by + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + Add constants + Y + + + Add constants + Update + Y + + + Update + Filter rows + Y + + + Update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1216 + 224 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + has_criminal_prosecution + true + -1 + N + Boolean + + + + + 832 + 32 + + + + 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}'; + + + + + 1056 + 224 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1456 + 32 + + + + 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}'); + + + + + 272 + 464 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1456 + 464 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1200 + 32 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 832 + 320 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 832 + 176 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH +ugolov_presl AS ( + SELECT + jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up, + ri.recruit_id + 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 + WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array' +) +SELECT + r.recruit_id AS recruit_id, + (up->>'id')::uuid AS prosecution_external_id, + NULLIF(up->'sledSud'->>'uk', '') AS uk_name, + NULLIF(up->'sledSud'->'extend'->>'nomerUDPredv', '') AS case_number, + NULLIF(up->'sledSud'->'extend'->>'svedPerekvalif', '') AS reclassification, + NULLIF(up->'sledSud'->'extend'->>'naimVidUgolovPresl', '') AS kind, + CASE + WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true + ELSE false -- нет или нет инфы + END AS transfer_to_court, + NULLIF(up->'sledSud'->>'naimSud','') AS court_name, + NULLIF(up->'sledSud'->>'nomerUD','') AS case_number_court, + STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, + NULLIF(up->'sledSud'->>'naimOrgan', '') AS authority_name, + NULLIF(up->'sledSud'->'svedSnyat'->>'osnSnyatSud', '') AS conviction_removal_basis, + TO_DATE(up->'sledSud'->'svedSnyat'->>'dataSnyatSud', 'YYYY-MM-DD') AS conviction_removal_date, + TO_DATE(up->'sledSud'->>'dataOsuzhd', 'YYYY-MM-DD') AS conviction_date, + TO_DATE(up->'sledSud'->>'dataVozbUD', 'YYYY-MM-DD') AS create_date, + NULLIF(up->'sledSud'->>'osnPrekrUD', '') AS termination_basis, + NULLIF(up->'sledSud'->>'statusNaim', '') AS conviction_status, + TO_DATE(up->'sledSud'->>'dataPrekrUD', 'YYYY-MM-DD') AS close_date, + NULLIF(up->'sledSudTekst'->>'svedTekst' , '') AS sled_sud_tekst_sved_tekst, + NULLIF(up->'sledSudTekst'->>'statusNaim', '') AS sled_sud_tekst_status_naim, + CASE + WHEN (up->>'sledSud') IS NOT NULL AND up->>'sledSud' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в структурированном формате' + WHEN (up->>'sledSudTekst') IS NOT NULL AND up->>'sledSudTekst' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в текстовом виде' + ELSE 'Есть сведения о фактах уголовного преследования или судимости без указания подробностей' + END AS type_info +FROM ervu_dashboard.citizen r + JOIN ugolov_presl up ON r.recruit_id = up.recruit_id + LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true +GROUP BY r.recruit_id, up; + Y + + + 480 + 464 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + prosecution_external_id + prosecution_external_id + + + uk_name + uk_name + + + case_number + case_number + + + reclassification + reclassification + + + kind + kind + + + transfer_to_court + transfer_to_court + + + court_name + court_name + + + case_number_court + case_number_court + + + law_point + law_point + + + authority_name + authority_name + + + conviction_removal_basis + conviction_removal_basis + + + conviction_removal_date + conviction_removal_date + + + conviction_date + conviction_date + + + create_date + create_date + + + termination_basis + termination_basis + + + conviction_status + conviction_status + + + close_date + close_date + + + sled_sud_tekst_sved_tekst + sled_sud_tekst_sved_tekst + + + sled_sud_tekst_status_naim + sled_sud_tekst_status_naim + + + type_info + type_info + + + N + N + N + N + Y + N + ervu_dashboard + Y + prosecution
+ N + Y + N + Y + + + 832 + 464 + +
+ + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + N + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_criminal_prosecution + has_criminal_prosecution + +
+ N + Y + + + 1056 + 32 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + Update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow1.hpl b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow1.hpl deleted file mode 100644 index 4443790..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow1.hpl +++ /dev/null @@ -1,266 +0,0 @@ - - - - prosecution_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 - prosecution
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - case_number - case_number - Y - - - case_number_court - case_number_court - Y - - - close_date - close_date - Y - - - create_date - create_date - Y - - - kind - kind - Y - - - law_point - law_point - Y - - - reclassification - reclassification - Y - - - termination_basis - termination_basis - Y - - - transfer_to_court - transfer_to_court - Y - -
- N - - - 960 - 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 -ugolov_presl AS ( - SELECT - jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up, - ri.recruit_id - --'prOtsSvedUgolovPresl' - 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'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array' -) -SELECT - r.recruit_id AS recruit_id, - --up->'sledSud'->>'uk', -- уголовный кодекс? - up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный) - up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния - --up->'sledSud'->'extend'->>'kodVidUgolovPresl', -- - up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования - CASE - WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд - ELSE false -- нет или нет инфы - END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина? - - --up->'sledSud'->>'naimSud', -- Наименование суда??? - up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный) - STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса - up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение - --up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования??? - --up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования - --up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? = - up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела - up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования? - --up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ???? - up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела - --up->>'sledSudTekst', -- ??? - --up->>'sledSudPriznak' -- ??? - --'UG_PRESL' AS info_type -FROM ervu_dashboard.citizen r -JOIN ugolov_presl up ON r.recruit_id = up.recruit_id -LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true -GROUP BY r.recruit_id, up - Y - - - 448 - 288 - - - - - Select values 4 2 - Get variables - Y - - - - - - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow2.hpl b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow2.hpl deleted file mode 100644 index 2ae10e8..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow2.hpl +++ /dev/null @@ -1,179 +0,0 @@ - - - - prosecution_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 - prosecution
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - case_number - case_number - Y - - - case_number_court - case_number_court - Y - - - close_date - close_date - Y - - - create_date - create_date - Y - - - kind - kind - Y - - - law_point - law_point - Y - - - reclassification - reclassification - Y - - - termination_basis - termination_basis - Y - - - transfer_to_court - transfer_to_court - Y - -
- N - - - 1232 - 400 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -ugolov_presl AS ( - SELECT - jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up, - ri.recruit_id - --'prOtsSvedUgolovPresl' - 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'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array' -) -SELECT - r.recruit_id AS recruit_id, - --up->'sledSud'->>'uk', -- уголовный кодекс? - up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный) - up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния - --up->'sledSud'->'extend'->>'kodVidUgolovPresl', -- - up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования - CASE - WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд - ELSE false -- нет или нет инфы - END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина? - - --up->'sledSud'->>'naimSud', -- Наименование суда??? - up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный) - STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса - up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение - --up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования??? - --up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования - --up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? = - up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела - up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования? - --up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ???? - up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела - --up->>'sledSudTekst', -- ??? - --up->>'sledSudPriznak' -- ??? - --'UG_PRESL' AS info_type -FROM ervu_dashboard.citizen r -JOIN ugolov_presl up ON r.recruit_id = up.recruit_id -LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true -GROUP BY r.recruit_id, up - Y - - - 736 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow3.hpl b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow3.hpl deleted file mode 100644 index edc58d3..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow3.hpl +++ /dev/null @@ -1,179 +0,0 @@ - - - - prosecution_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 - prosecution
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - case_number - case_number - Y - - - case_number_court - case_number_court - Y - - - close_date - close_date - Y - - - create_date - create_date - Y - - - kind - kind - Y - - - law_point - law_point - Y - - - reclassification - reclassification - Y - - - termination_basis - termination_basis - Y - - - transfer_to_court - transfer_to_court - Y - -
- N - - - 1216 - 400 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -ugolov_presl AS ( - SELECT - jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up, - ri.recruit_id - --'prOtsSvedUgolovPresl' - 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'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array' -) -SELECT - r.recruit_id AS recruit_id, - --up->'sledSud'->>'uk', -- уголовный кодекс? - up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный) - up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния - --up->'sledSud'->'extend'->>'kodVidUgolovPresl', -- - up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования - CASE - WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд - ELSE false -- нет или нет инфы - END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина? - - --up->'sledSud'->>'naimSud', -- Наименование суда??? - up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный) - STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса - up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение - --up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования??? - --up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования - --up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? = - up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела - up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования? - --up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ???? - up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела - --up->>'sledSudTekst', -- ??? - --up->>'sledSudPriznak' -- ??? - --'UG_PRESL' AS info_type -FROM ervu_dashboard.citizen r -JOIN ugolov_presl up ON r.recruit_id = up.recruit_id -LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true -GROUP BY r.recruit_id, up - Y - - - 720 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow4.hpl b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow4.hpl deleted file mode 100644 index 165c016..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow4.hpl +++ /dev/null @@ -1,179 +0,0 @@ - - - - prosecution_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 - prosecution
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - case_number - case_number - Y - - - case_number_court - case_number_court - Y - - - close_date - close_date - Y - - - create_date - create_date - Y - - - kind - kind - Y - - - law_point - law_point - Y - - - reclassification - reclassification - Y - - - termination_basis - termination_basis - Y - - - transfer_to_court - transfer_to_court - Y - -
- N - - - 1184 - 400 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -ugolov_presl AS ( - SELECT - jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up, - ri.recruit_id - --'prOtsSvedUgolovPresl' - 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'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array' -) -SELECT - r.recruit_id AS recruit_id, - --up->'sledSud'->>'uk', -- уголовный кодекс? - up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный) - up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния - --up->'sledSud'->'extend'->>'kodVidUgolovPresl', -- - up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования - CASE - WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд - ELSE false -- нет или нет инфы - END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина? - - --up->'sledSud'->>'naimSud', -- Наименование суда??? - up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный) - STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса - up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение - --up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования??? - --up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования - --up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? = - up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела - up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования? - --up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ???? - up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела - --up->>'sledSudTekst', -- ??? - --up->>'sledSudPriznak' -- ??? - --'UG_PRESL' AS info_type -FROM ervu_dashboard.citizen r -JOIN ugolov_presl up ON r.recruit_id = up.recruit_id -LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true -GROUP BY r.recruit_id, up - Y - - - 688 - 400 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow5.hpl b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow5.hpl deleted file mode 100644 index b74189b..0000000 --- a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow5.hpl +++ /dev/null @@ -1,179 +0,0 @@ - - - - prosecution_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 - prosecution
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - case_number - case_number - Y - - - case_number_court - case_number_court - Y - - - close_date - close_date - Y - - - create_date - create_date - Y - - - kind - kind - Y - - - law_point - law_point - Y - - - reclassification - reclassification - Y - - - termination_basis - termination_basis - Y - - - transfer_to_court - transfer_to_court - Y - -
- N - - - 1216 - 368 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH -ugolov_presl AS ( - SELECT - jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up, - ri.recruit_id - --'prOtsSvedUgolovPresl' - 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'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array' -) -SELECT - r.recruit_id AS recruit_id, - --up->'sledSud'->>'uk', -- уголовный кодекс? - up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный) - up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния - --up->'sledSud'->'extend'->>'kodVidUgolovPresl', -- - up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования - CASE - WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд - ELSE false -- нет или нет инфы - END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина? - - --up->'sledSud'->>'naimSud', -- Наименование суда??? - up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный) - STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса - up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение - --up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования??? - --up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования - --up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? = - up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела - up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования? - --up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ???? - up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела - --up->>'sledSudTekst', -- ??? - --up->>'sledSudPriznak' -- ??? - --'UG_PRESL' AS info_type -FROM ervu_dashboard.citizen r -JOIN ugolov_presl up ON r.recruit_id = up.recruit_id -LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true -GROUP BY r.recruit_id, up - Y - - - 720 - 368 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_delta.hpl b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_delta.hpl new file mode 100644 index 0000000..ed6e89d --- /dev/null +++ b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_delta.hpl @@ -0,0 +1,605 @@ + + + + prosecution_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 + + + Insert / update + Change job status on error + Y + + + Insert / update + Detect empty 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 2 + Add constants + Y + + + Group by + Identify last row in a stream 2 + Y + + + Insert / update + Group by + Y + + + Add constants + Update + Y + + + Update + Filter rows + Y + + + Update + Change job status on error + Y + + + Table input + Insert / update + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 992 + 592 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + has_criminal_prosecution + true + -1 + N + Boolean + + + + + 736 + 416 + + + + 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}'; + + + + + 880 + 592 + + + + 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}' +and status = 'DELTA_PROCESSING'; + + + + + 1152 + 416 + + + + 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}'; + + + 112 + 768 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1152 + 768 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1024 + 416 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 736 + 640 + + + + Identify last row in a stream 2 + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 736 + 528 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + prosecution_external_id + prosecution_external_id + + ervu_dashboard + prosecution
+ + recruit_id + recruit_id + N + + + prosecution_external_id + prosecution_external_id + N + + + uk_name + uk_name + Y + + + case_number + case_number + Y + + + reclassification + reclassification + Y + + + kind + kind + Y + + + transfer_to_court + transfer_to_court + Y + + + court_name + court_name + Y + + + case_number_court + case_number_court + Y + + + law_point + law_point + Y + + + authority_name + authority_name + Y + + + conviction_removal_basis + conviction_removal_basis + Y + + + conviction_removal_date + conviction_removal_date + Y + + + conviction_date + conviction_date + Y + + + create_date + create_date + Y + + + termination_basis + termination_basis + Y + + + conviction_status + conviction_status + Y + + + close_date + close_date + Y + + + sled_sud_tekst_sved_tekst + sled_sud_tekst_sved_tekst + Y + + + sled_sud_tekst_status_naim + sled_sud_tekst_status_naim + Y + + + type_info + type_info + Y + +
+ N + + + 736 + 768 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH +ugolov_presl AS ( + SELECT + jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up, + ri.recruit_id + --'prOtsSvedUgolovPresl' + 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 + WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array' +) +SELECT + r.recruit_id AS recruit_id, + (up->>'id')::uuid AS prosecution_external_id, + NULLIF(up->'sledSud'->>'uk', '') AS uk_name, -- УК осуждения + NULLIF(up->'sledSud'->'extend'->>'nomerUDPredv', '') AS case_number, -- номер уголовного дела (предварительный) + NULLIF(up->'sledSud'->'extend'->>'svedPerekvalif', '') AS reclassification, -- сведения о переквалификации деяния + NULLIF(up->'sledSud'->'extend'->>'naimVidUgolovPresl', '') AS kind, -- наименование вида уголовного преследования + CASE + WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд + ELSE false -- нет или нет инфы + END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина + NULLIF(up->'sledSud'->>'naimSud','') AS court_name, -- Наименование суда, вынесшего приговор + NULLIF(up->'sledSud'->>'nomerUD','') AS case_number_court, -- номер уголовного дела (судебный) + STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса + NULLIF(up->'sledSud'->>'naimOrgan', '') AS authority_name, -- наименование органа, принявшего решение о возбуждении уголовного дела + NULLIF(up->'sledSud'->'svedSnyat'->>'osnSnyatSud', '') AS conviction_removal_basis, -- основание снятия судимости + TO_DATE(up->'sledSud'->'svedSnyat'->>'dataSnyatSud', 'YYYY-MM-DD') AS conviction_removal_date, -- дата снятия судимости + TO_DATE(up->'sledSud'->>'dataOsuzhd', 'YYYY-MM-DD') AS conviction_date, -- дата осуждения + TO_DATE(up->'sledSud'->>'dataVozbUD', 'YYYY-MM-DD') AS create_date, -- дата возбуждения уголовного дела + NULLIF(up->'sledSud'->>'osnPrekrUD', '') AS termination_basis, -- основания прекращения уголовного дела + NULLIF(up->'sledSud'->>'statusNaim', '') AS conviction_status, -- статус судимости + TO_DATE(up->'sledSud'->>'dataPrekrUD', 'YYYY-MM-DD') AS close_date, -- дата прекращения уголовного дела + NULLIF(up->'sledSudTekst'->>'svedTekst' , '') AS sled_sud_tekst_sved_tekst, -- текст судимости в текстовом формате + NULLIF(up->'sledSudTekst'->>'statusNaim', '') AS sled_sud_tekst_status_naim, -- статус судимости в текстовом формате + CASE + WHEN (up->>'sledSud') IS NOT NULL AND up->>'sledSud' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в структурированном формате' + WHEN (up->>'sledSudTekst') IS NOT NULL AND up->>'sledSudTekst' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в текстовом виде' + ELSE 'Есть сведения о фактах уголовного преследования или судимости без указания подробностей' + END AS type_info +FROM ervu_dashboard.citizen r + JOIN ugolov_presl up ON r.recruit_id = up.recruit_id + LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true +GROUP BY r.recruit_id, up; + Y + + + 384 + 768 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + N + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_criminal_prosecution + has_criminal_prosecution + +
+ N + Y + + + 880 + 416 + +
+ + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + Update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_repeat.hpl new file mode 100644 index 0000000..f597b73 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_repeat.hpl @@ -0,0 +1,617 @@ + + + + prosecution_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 + + + Insert / update + Change job status on error + Y + + + Insert / update + Detect empty 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 + + + Table input + Insert / update + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + Add constants + Y + + + Insert / update + Group by + Y + + + Add constants + Update + Y + + + Update + Filter rows + Y + + + Update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1120 + 736 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + has_criminal_prosecution + true + -1 + N + Boolean + + + + + 768 + 576 + + + + 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}'; + + + + + 944 + 736 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1296 + 576 + + + + 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; + + + 176 + 944 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1296 + 944 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1088 + 576 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 768 + 800 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 768 + 704 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + prosecution_external_id + prosecution_external_id + + ervu_dashboard + prosecution
+ + recruit_id + recruit_id + N + + + prosecution_external_id + prosecution_external_id + N + + + uk_name + uk_name + Y + + + case_number + case_number + Y + + + reclassification + reclassification + Y + + + kind + kind + Y + + + transfer_to_court + transfer_to_court + Y + + + court_name + court_name + Y + + + case_number_court + case_number_court + Y + + + law_point + law_point + Y + + + authority_name + authority_name + Y + + + conviction_removal_basis + conviction_removal_basis + Y + + + conviction_removal_date + conviction_removal_date + Y + + + conviction_date + conviction_date + Y + + + create_date + create_date + Y + + + termination_basis + termination_basis + Y + + + conviction_status + conviction_status + Y + + + close_date + close_date + Y + + + sled_sud_tekst_sved_tekst + sled_sud_tekst_sved_tekst + Y + + + sled_sud_tekst_status_naim + sled_sud_tekst_status_naim + Y + + + type_info + type_info + Y + +
+ N + + + 768 + 944 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH +ugolov_presl AS ( + SELECT + jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up, + ri.recruit_id + 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 + WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array' +) +SELECT + r.recruit_id AS recruit_id, + (up->>'id')::uuid AS prosecution_external_id, + NULLIF(up->'sledSud'->>'uk', '') AS uk_name, + NULLIF(up->'sledSud'->'extend'->>'nomerUDPredv', '') AS case_number, + NULLIF(up->'sledSud'->'extend'->>'svedPerekvalif', '') AS reclassification, + NULLIF(up->'sledSud'->'extend'->>'naimVidUgolovPresl', '') AS kind, + CASE + WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true + ELSE false -- нет или нет инфы + END AS transfer_to_court, + NULLIF(up->'sledSud'->>'naimSud','') AS court_name, + NULLIF(up->'sledSud'->>'nomerUD','') AS case_number_court, + STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, + NULLIF(up->'sledSud'->>'naimOrgan', '') AS authority_name, + NULLIF(up->'sledSud'->'svedSnyat'->>'osnSnyatSud', '') AS conviction_removal_basis, + TO_DATE(up->'sledSud'->'svedSnyat'->>'dataSnyatSud', 'YYYY-MM-DD') AS conviction_removal_date, + TO_DATE(up->'sledSud'->>'dataOsuzhd', 'YYYY-MM-DD') AS conviction_date, + TO_DATE(up->'sledSud'->>'dataVozbUD', 'YYYY-MM-DD') AS create_date, + NULLIF(up->'sledSud'->>'osnPrekrUD', '') AS termination_basis, + NULLIF(up->'sledSud'->>'statusNaim', '') AS conviction_status, + TO_DATE(up->'sledSud'->>'dataPrekrUD', 'YYYY-MM-DD') AS close_date, + NULLIF(up->'sledSudTekst'->>'svedTekst' , '') AS sled_sud_tekst_sved_tekst, + NULLIF(up->'sledSudTekst'->>'statusNaim', '') AS sled_sud_tekst_status_naim, + CASE + WHEN (up->>'sledSud') IS NOT NULL AND up->>'sledSud' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в структурированном формате' + WHEN (up->>'sledSudTekst') IS NOT NULL AND up->>'sledSudTekst' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в текстовом виде' + ELSE 'Есть сведения о фактах уголовного преследования или судимости без указания подробностей' + END AS type_info +FROM ervu_dashboard.citizen r + JOIN ugolov_presl up ON r.recruit_id = up.recruit_id + LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true +GROUP BY r.recruit_id, up; + Y + + + 416 + 944 + + + + Update + Update + + N + + 1 + + none + + + 100 + ervu-dashboard + N + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_criminal_prosecution + has_criminal_prosecution + +
+ N + Y + + + 976 + 576 + +
+ + + Insert / update + Change job status on error + Y + + error_description + + error_code + + + + + + Update + Change job status on error + Y + + error_description + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/prosecution/prosecution_job.hwf b/mappings/info_recruits/citizen_tables/prosecution/prosecution_job.hwf new file mode 100644 index 0000000..1471460 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/prosecution/prosecution_job.hwf @@ -0,0 +1,364 @@ + + + prosecution_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_prosecution_job_exists.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/check_if_prosecution_job_exists.hpl + Basic + + Y + + N + local + N + N + Y + N + 416 + 304 + + + + prosecution_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/prosecution/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/prosecution/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/prosecution/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/prosecution/recruitment_five_flow_delta.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 688 + 800 + + + + + + Start + check_if_prosecution_job_exists.hpl + Y + Y + Y + + + check_if_prosecution_job_exists.hpl + prosecution_job_exists_check + Y + Y + N + + + prosecution_job_exists_check + recruitments_five_flow.hpl + Y + Y + N + + + prosecution_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 + prosecution_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/prosecution/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/prosecution/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..6585d53 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/prosecution/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 + prosecution_flow_delta.hpl + Y + + + Table input + prosecution_flow_delta.hpl 2 + Y + + + Table input + prosecution_flow_delta.hpl 3 + Y + + + Table input + prosecution_flow_delta.hpl 4 + Y + + + Table input + prosecution_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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 = 'prosecution_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + prosecution_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 128 + + + + prosecution_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + prosecution_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + prosecution_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + prosecution_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_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/prosecution/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/prosecution/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..633bf36 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/prosecution/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 + prosecution_flow_repeat.hpl + Y + + + Table input + prosecution_flow_repeat.hpl 3 + Y + + + Table input + prosecution_flow_repeat.hpl 2 + Y + + + Table input + prosecution_flow_repeat.hpl 4 + Y + + + Table input + prosecution_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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 = 'prosecution_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + prosecution_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 208 + + + + prosecution_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 288 + + + + prosecution_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 368 + + + + prosecution_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 448 + + + + prosecution_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + prosecution_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/prosecution/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/prosecution/recruitments_five_flow.hpl new file mode 100644 index 0000000..2d2c4ac --- /dev/null +++ b/mappings/info_recruits/citizen_tables/prosecution/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 + prosecution_flow.hpl + Y + + + Get all recruitments ordered by created_date + prosecution_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + prosecution_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + prosecution_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + prosecution_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 432 + 304 + + + + prosecution_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + prosecution_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + prosecution_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + prosecution_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + prosecution_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + prosecution_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/parallel/prosecution_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + prosecution_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/punishment/check_if_need_to_repeat_job.hpl b/mappings/info_recruits/citizen_tables/punishment/check_if_need_to_repeat_job.hpl new file mode 100644 index 0000000..113adcf --- /dev/null +++ b/mappings/info_recruits/citizen_tables/punishment/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 = 'punishment_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/punishment/checkpoints/change_status_delta_punishment_error.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_delta_punishment_error.hpl deleted file mode 100644 index adf6c94..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_delta_punishment_error.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_punishment_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_punishment' as job_name, - 'ERROR' as status, - current_timestamp as record_created - -union all - - SELECT - 'job_punishment' as job_name, - 'ERROR' as status, - current_timestamp as record_created - - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_delta_punishment_success.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_delta_punishment_success.hpl deleted file mode 100644 index 54bcb5c..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_delta_punishment_success.hpl +++ /dev/null @@ -1,110 +0,0 @@ - - - - change_status_delta_punishment_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_punishment' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - -union all - - SELECT - 'job_punishment' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - - N - - - 784 - 304 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow1_error.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow1_error.hpl deleted file mode 100644 index 91e4623..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow1_error.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_punishment_flow1_success.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow1_success.hpl deleted file mode 100644 index 0ff574d..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow1_success.hpl +++ /dev/null @@ -1,250 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_punishment_flow2_error.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow2_error.hpl deleted file mode 100644 index 5e28ac4..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow2_error.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_punishment_flow2_success.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow2_success.hpl deleted file mode 100644 index 25899f0..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow2_success.hpl +++ /dev/null @@ -1,254 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_punishment_flow3_error.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow3_error.hpl deleted file mode 100644 index 3691584..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow3_error.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_punishment_flow3_success.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow3_success.hpl deleted file mode 100644 index 74aef8f..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow3_success.hpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_punishment_flow4_error.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow4_error.hpl deleted file mode 100644 index c7f7cf6..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow4_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_punishment_flow4_success.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow4_success.hpl deleted file mode 100644 index 752e93e..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow4_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_punishment_flow5_error.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow5_error.hpl deleted file mode 100644 index 86d3ef7..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow5_error.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_punishment_flow5_success.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow5_success.hpl deleted file mode 100644 index 7d1092e..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow5_success.hpl +++ /dev/null @@ -1,256 +0,0 @@ - - - - change_status_punishment_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.punishment 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 - 'punishment_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/punishment/checkpoints/change_status_to_processing.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_to_processing.hpl deleted file mode 100644 index 82712b4..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/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_punishment' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'punishment_flow1' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'punishment_flow2' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'punishment_flow3' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'punishment_flow4' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - -UNION ALL - -SELECT - 'PROCESSING' AS status, - 'punishment_flow5' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 368 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_to_processing_delta.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/change_status_to_processing_delta.hpl deleted file mode 100644 index 4408027..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/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_punishment' AS job_name, - current_timestamp AS record_created ---FROM public.etl_checkpoints - N - - - 832 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/checkpoints/check_if_punishment_job_exists.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/check_if_punishment_job_exists.hpl new file mode 100644 index 0000000..68cacfd --- /dev/null +++ b/mappings/info_recruits/citizen_tables/punishment/checkpoints/check_if_punishment_job_exists.hpl @@ -0,0 +1,113 @@ + + + + check_if_punishment_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 = 'punishment_job' + limit 1 + ) AS job_executed_flag; + N + + + 384 + 336 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Basic + Y + N + 0 + ${STATUS} + + + + + 944 + 224 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/punishment/checkpoints/checkpoint_job_punishment.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/checkpoint_job_punishment.hpl deleted file mode 100644 index 7a9995f..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/checkpoint_job_punishment.hpl +++ /dev/null @@ -1,869 +0,0 @@ - - - - checkpoint_job_punishment - 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 ( - 'punishment_flow1', - 'punishment_flow2', - 'punishment_flow3', - 'punishment_flow4', - 'punishment_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'punishment_flow1', - 'punishment_flow2', - 'punishment_flow3', - 'punishment_flow4', - 'punishment_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_punishment' 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/punishment/checkpoints/checkpoint_punishment_error.hpl b/mappings/info_recruits/citizen_tables/punishment/checkpoints/checkpoint_punishment_error.hpl deleted file mode 100644 index d8db141..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/checkpoints/checkpoint_punishment_error.hpl +++ /dev/null @@ -1,273 +0,0 @@ - - - - checkpoint_punishment_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/punishment/checkpoints/xxjob_create_files_child.hwf b/mappings/info_recruits/citizen_tables/punishment/checkpoints/xxjob_create_files_child.hwf deleted file mode 100644 index b31ca9f..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/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/punishment/delta_punishment.hpl b/mappings/info_recruits/citizen_tables/punishment/delta_punishment.hpl deleted file mode 100644 index 0741988..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/delta_punishment.hpl +++ /dev/null @@ -1,162 +0,0 @@ - - - - delta_punishment - 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 - punishment
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - sentence - sentence - Y - - - sentence_place - sentence_place - Y - - - sentence_changed - sentence_changed - Y - - - punishment_type - punishment_type - Y - - - start_date - start_date - Y - - - release_date - release_date - Y - - - sentense_date - sentense_date - Y - - - law_point - law_point - Y - - - release_reason - release_reason - Y - -
- N - - - 1264 - 416 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH ugol AS ( - SELECT ri.recruit_id, - jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS nakaz - 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 ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null' -) -SELECT recruit_id, - nakaz ->> 'naimSud' AS authority_name, - nakaz ->> 'srokNakaz' AS sentence, - nakaz ->> 'adresOrg' AS sentence_place, --- nakaz->>'vidNakaz' AS punishment_code, - nakaz ->> 'naimIzmSrokNakaz' AS sentence_changed, - nakaz ->> 'vidNakaz' AS punishment_type, - TO_DATE(nakaz ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, - TO_DATE(nakaz ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date, - TO_DATE(nakaz ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date, - string_agg(statiuk_elem, ', ') AS law_point, - nakaz ->> 'osnOsvob' AS release_reason -FROM ugol - LEFT JOIN LATERAL jsonb_array_elements_text(nakaz -> 'statiUK') AS statiuk_elem ON true -GROUP BY recruit_id, nakaz; - Y - - - 768 - 416 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/job_punishment.hwf b/mappings/info_recruits/citizen_tables/punishment/job_punishment.hwf index 04c4ac1..990e210 100644 --- a/mappings/info_recruits/citizen_tables/punishment/job_punishment.hwf +++ b/mappings/info_recruits/citizen_tables/punishment/job_punishment.hwf @@ -37,235 +37,12 @@ 0 1 N - 368 - 400 - - - - checkpoint_job_punishment.hpl (2) - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/checkpoint_job_punishment.hpl - Basic - - Y - - N - local - N - N - Y - N - 1136 - 1280 - - - - recruitment_rows_five_flow_punishment.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_punishment.hpl - Basic - - Y - - N - local - N - N - Y - Y - 2352 - 400 - - - - punishment_flow1.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 80 - - - - punishment_flow2.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 240 - - - - punishment_flow3.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 400 - - - - punishment_flow4.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 560 - - - - punishment_flow5.hpl - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 720 - - - - Abort workflow - - ABORT - - N - N - 2336 + 416 208 - Success punishment - - SUCCESS - - N - 3728 - 432 - - - - branching_citizen_spouse.hpl + check_if_punishment_job_exists.hpl PIPELINE @@ -275,7 +52,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/check_if_punishment_job_exists.hpl Basic Y @@ -286,48 +63,29 @@ N Y N - 1584 - 1280 + 608 + 208 - Simple punishment WHERE SUCCESS + punishment_job_exists_check SIMPLE_EVAL - SUCCESS - string - true + boolean + false equal equal N variable - STATUS + JOB_EXECUTED_FLAG N - 1840 - 1792 + 880 + 208 - Simple punishment 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,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/recruitment_rows_five_flow_if_error.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/recruitments_five_flow.hpl Basic Y @@ -348,23 +106,12 @@ N Y Y - 2384 - 1280 + 1120 + 208 - Abort workflow 2 - - ABORT - - N - N - 2288 - 1040 - - - - delta_punishment.hpl + recruitment_five_flow_on_error.hpl PIPELINE @@ -374,57 +121,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/delta_punishment.hpl - Basic - - - M_R_UP_DATE - ${M_R_UP_DATE} - - Y - - N - local - N - N - Y - N - 2640 - 1792 - - - - Success delta_punishment - - SUCCESS - - N - 3280 - 1792 - - - - error delta_punishment - - SUCCESS - - N - 3280 - 1872 - - - - check_if_job_punishment_exists.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/check_if_job_punishment_exists.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/recruitment_five_flow_on_error.hpl Basic Y @@ -435,30 +132,55 @@ N Y N - 576 - 400 + 1120 + 512 - Simple job_punishment_exists check NEW + check_if_need_to_repeat_job.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/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 - 896 - 400 + 880 + 512 - change_status_to_processing.hpl + recruitment_five_flow_delta.hpl PIPELINE @@ -468,7 +190,7 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_to_processing.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/recruitment_five_flow_delta.hpl Basic Y @@ -479,1338 +201,61 @@ N Y N - 1264 - 400 - - - - change_status_punishment_flow1_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 80 - - - - change_status_punishment_flow1_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 160 - - - - change_status_punishment_flow2_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 240 - - - - change_status_punishment_flow2_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 320 - - - - change_status_punishment_flow3_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 400 - - - - change_status_punishment_flow3_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 480 - - - - change_status_punishment_flow4_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 560 - - - - change_status_punishment_flow4_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 640 - - - - change_status_punishment_flow5_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 720 - - - - change_status_punishment_flow5_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 800 - - - - checkpoint_job_punishment.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/checkpoint_job_punishment.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/punishment/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/punishment/checkpoints/change_status_to_processing_delta.hpl - Basic - - Y - - N - local - N - N - Y - N - 2144 - 1792 - - - - change_status_delta_punishment_success.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_delta_punishment_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1792 - - - - change_status_delta_punishment_error.hpl - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_delta_punishment_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1872 - - - - punishment_flow1.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow1.hpl - Basic - - - ID_F1 - IDM_FLOW1 - - Y - - Y - local - N - N - Y - N - 2672 - 960 - - - - punishment_flow2.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow2.hpl - Basic - - - ID_F2 - IDM_FLOW2 - - Y - - Y - local - N - N - Y - N - 2672 - 1120 - - - - punishment_flow3.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow3.hpl - Basic - - - ID_F3 - IDM_FLOW3 - - Y - - Y - local - N - N - Y - N - 2672 - 1280 - - - - punishment_flow4.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow4.hpl - Basic - - - ID_F4 - IDM_FLOW4 - - Y - - Y - local - N - N - Y - N - 2672 - 1440 - - - - punishment_flow5.hpl 2 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 1600 - - - - Success new punishment 2 - - SUCCESS - - N - 3728 - 1312 - - - - change_status_punishment_flow1_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow1_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 960 - - - - change_status_punishment_flow1_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow1_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1040 - - - - change_status_punishment_flow2_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow2_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1120 - - - - change_status_punishment_flow2_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow2_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1200 - - - - change_status_punishment_flow3_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow3_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1280 - - - - change_status_punishment_flow3_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow3_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1360 - - - - change_status_punishment_flow4_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow4_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1440 - - - - change_status_punishment_flow4_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow4_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1520 - - - - change_status_punishment_flow5_success.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow5_success.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1600 - - - - change_status_punishment_flow5_error.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/change_status_punishment_flow5_error.hpl - Basic - - Y - - N - local - N - N - Y - N - 2992 - 1680 - - - - checkpoint_job_punishment.hpl 2 - - PIPELINE - - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/checkpoints/checkpoint_job_punishment.hpl - Basic - - Y - - N - local - N - N - Y - N - 3456 - 1312 + 880 + 704 - - recruitment_rows_five_flow_punishment.hpl - punishment_flow1.hpl - Y - Y - N - - - recruitment_rows_five_flow_punishment.hpl - punishment_flow2.hpl - Y - Y - N - - - recruitment_rows_five_flow_punishment.hpl - punishment_flow3.hpl - Y - Y - N - - - recruitment_rows_five_flow_punishment.hpl - punishment_flow4.hpl - Y - Y - N - - - recruitment_rows_five_flow_punishment.hpl - punishment_flow5.hpl - Y - Y - N - - - recruitment_rows_five_flow_punishment.hpl - Abort workflow - Y - N - N - - - branching_citizen_spouse.hpl - Simple punishment WHERE ERROR - Y - N - Y - - - branching_citizen_spouse.hpl - Simple punishment WHERE SUCCESS - Y - N - Y - - - recruitment_rows_five_flow_if_error.hpl - Abort workflow 2 - Y - N - N - Start - check_if_job_punishment_exists.hpl + check_if_punishment_job_exists.hpl Y Y Y - check_if_job_punishment_exists.hpl - Simple job_punishment_exists check NEW + check_if_punishment_job_exists.hpl + punishment_job_exists_check Y Y N - Simple job_punishment_exists check NEW - change_status_to_processing.hpl + punishment_job_exists_check + recruitments_five_flow.hpl Y Y N - change_status_to_processing.hpl - recruitment_rows_five_flow_punishment.hpl + punishment_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 - punishment_flow1.hpl - change_status_punishment_flow1_success.hpl + Simple evaluation + recruitment_five_flow_on_error.hpl Y Y N - punishment_flow1.hpl - change_status_punishment_flow1_error.hpl + Simple evaluation + recruitment_five_flow_delta.hpl Y N N - - punishment_flow2.hpl - change_status_punishment_flow2_success.hpl - Y - Y - N - - - punishment_flow2.hpl - change_status_punishment_flow2_error.hpl - Y - N - N - - - punishment_flow3.hpl - change_status_punishment_flow3_success.hpl - Y - Y - N - - - punishment_flow3.hpl - change_status_punishment_flow3_error.hpl - Y - N - N - - - punishment_flow4.hpl - change_status_punishment_flow4_success.hpl - Y - Y - N - - - punishment_flow4.hpl - change_status_punishment_flow4_error.hpl - Y - N - N - - - punishment_flow5.hpl - change_status_punishment_flow5_success.hpl - Y - Y - N - - - punishment_flow5.hpl - change_status_punishment_flow5_error.hpl - Y - N - N - - - change_status_punishment_flow5_error.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - change_status_punishment_flow5_success.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - change_status_punishment_flow4_error.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - change_status_punishment_flow4_success.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - change_status_punishment_flow3_error.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - change_status_punishment_flow3_success.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - change_status_punishment_flow2_error.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - change_status_punishment_flow2_success.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - change_status_punishment_flow1_error.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - change_status_punishment_flow1_success.hpl - checkpoint_job_punishment.hpl - Y - N - Y - - - checkpoint_job_punishment.hpl - Success punishment - Y - Y - N - - - checkpoint_job_punishment.hpl (2) - branching_citizen_spouse.hpl - Y - N - Y - - - Simple job_punishment_exists check NEW - checkpoint_job_punishment.hpl (2) - Y - N - N - - - Simple punishment 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 punishment WHERE SUCCESS - change_status_to_processing_delta.hpl - Y - Y - N - - - delta_punishment.hpl - change_status_delta_punishment_success.hpl - Y - Y - N - - - change_status_delta_punishment_success.hpl - Success delta_punishment - Y - Y - N - - - delta_punishment.hpl - change_status_delta_punishment_error.hpl - Y - N - N - - - change_status_delta_punishment_error.hpl - error delta_punishment - Y - Y - N - - - change_status_to_processing_delta.hpl - delta_punishment.hpl - Y - Y - N - - - punishment_flow1.hpl 2 - change_status_punishment_flow1_success.hpl 2 - Y - Y - N - - - punishment_flow1.hpl 2 - change_status_punishment_flow1_error.hpl 2 - Y - N - N - - - punishment_flow2.hpl 2 - change_status_punishment_flow2_success.hpl 2 - Y - Y - N - - - punishment_flow2.hpl 2 - change_status_punishment_flow2_error.hpl 2 - Y - N - N - - - punishment_flow3.hpl 2 - change_status_punishment_flow3_success.hpl 2 - Y - Y - N - - - punishment_flow3.hpl 2 - change_status_punishment_flow3_error.hpl 2 - Y - N - N - - - punishment_flow4.hpl 2 - change_status_punishment_flow4_success.hpl 2 - Y - Y - N - - - punishment_flow4.hpl 2 - change_status_punishment_flow4_error.hpl 2 - Y - N - N - - - punishment_flow5.hpl 2 - change_status_punishment_flow5_success.hpl 2 - Y - Y - N - - - punishment_flow5.hpl 2 - change_status_punishment_flow5_error.hpl 2 - Y - N - N - - - change_status_punishment_flow1_success.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - change_status_punishment_flow1_error.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - change_status_punishment_flow2_success.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - change_status_punishment_flow2_error.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - change_status_punishment_flow3_success.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - change_status_punishment_flow3_error.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - change_status_punishment_flow4_success.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - change_status_punishment_flow4_error.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - change_status_punishment_flow5_success.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - change_status_punishment_flow5_error.hpl 2 - checkpoint_job_punishment.hpl 2 - Y - N - Y - - - checkpoint_job_punishment.hpl 2 - Success new punishment 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - punishment_flow3.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - punishment_flow2.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - punishment_flow1.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - punishment_flow4.hpl 2 - Y - Y - N - - - recruitment_rows_five_flow_if_error.hpl - punishment_flow5.hpl 2 - Y - Y - N - @@ -1827,13 +272,18 @@ N Segoe UI 9 - 72 - 1088 - 176 - 0001-01-01 00:00:00 + 149 + 976 + 0 + -3001-01-01 00:00:00 - +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/punishment/parallel/punishment_flow.hpl b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow.hpl new file mode 100644 index 0000000..a1eb3ff --- /dev/null +++ b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow.hpl @@ -0,0 +1,580 @@ + + + + punishment_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 + + + Table output + Change job status on error + Y + + + Change job status on error + Abort + Y + + + Filter rows + Change job status on success + Y + + + Table output + Detect empty stream + Y + + + Detect empty stream + Change job status on success + Y + + + Table input + Table output + Y + + + Table output + Group by + Y + + + Group by + Identify last row in a stream + Y + + + Identify last row in a stream + Add constants + Y + + + Add constants + Update + Y + + + Update + Filter rows + Y + + + Update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1168 + 448 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + has_punishment_execution_info + true + -1 + N + Boolean + + + -1 + has_sentence_info + true + -1 + N + Boolean + + + + + 880 + 624 + + + + 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 + 448 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1488 + 624 + + + + 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}'); + + + + + 80 + 320 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1488 + 320 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1200 + 624 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 720 + 464 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 720 + 624 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH punishment_data AS ( + SELECT ri.recruit_id, + jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS punishment_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 + WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null' +) +SELECT recruit_id, + (punishment_info ->> 'id')::uuid AS punishment_external_id, + -- Блок "Сведения о вынесенном приговоре" + punishment_info ->> 'vidNakaz' AS punishment_type, -- Вид наказания + punishment_info ->> 'kodVidNakaz' AS punishment_code, -- Код вида наказания + TO_DATE(punishment_info ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date, -- Дата осуждения + punishment_info ->> 'naimSud' AS authority_name, -- Наименование суда + punishment_info ->> 'srokNakaz' AS sentence, -- Срок наказания + CASE + WHEN punishment_info ->> 'kodIzmSrokNakaz' = '1' THEN 'Изменений срока наказания не было' + WHEN punishment_info ->> 'kodIzmSrokNakaz' = '2' THEN 'Были изменения срока наказания' + ELSE punishment_info ->> 'kodIzmSrokNakaz' + END AS sentence_changed, -- Признак изменения срока + string_agg(law_articles, ', ') AS law_point, -- Статьи УК + -- Блок "Сведения об отбывании наказания" + punishment_info ->> 'katUcheta' AS registration_category, -- Категория учета + punishment_info ->> 'naimSubekt' AS region_name, -- Наименование субъекта + punishment_info ->> 'naimOrg' AS facility_name, -- Название учреждения + punishment_info ->> 'adresOrg' AS facility_address, -- Адрес учреждения + punishment_info ->> 'nomerUD' AS criminal_case_number, -- Номер уголовного дела + TO_DATE(punishment_info ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, -- Дата начала срока + TO_DATE(punishment_info ->> 'dataOkonchSrok', 'YYYY-MM-DD') AS planned_date, -- Планируемая дата освобождения + CASE + WHEN punishment_info ->> 'kodPerekvalif' = '1' THEN 'Изменений статьи не было' + WHEN punishment_info ->> 'kodPerekvalif' = '2' THEN 'Были изменения статьи' + ELSE punishment_info ->> 'kodPerekvalif' + END AS article_modification_flag, -- Признак переквалификации + punishment_info ->> 'osnOsvob' AS release_reason, -- Основание освобождения + TO_DATE(punishment_info ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date -- Фактическая дата освобождения +FROM punishment_data +LEFT JOIN LATERAL jsonb_array_elements_text(punishment_info -> 'statiUK') AS law_articles ON true +GROUP BY recruit_id, punishment_info; + Y + + + 336 + 320 + + + + Table output + TableOutput + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + punishment_external_id + punishment_external_id + + + punishment_type + punishment_type + + + punishment_code + punishment_code + + + sentense_date + sentense_date + + + authority_name + authority_name + + + sentence + sentence + + + sentence_changed + sentence_changed + + + law_point + law_point + + + registration_category + registration_category + + + region_name + region_name + + + facility_name + facility_name + + + facility_address + facility_address + + + criminal_case_number + criminal_case_number + + + start_date + start_date + + + planned_date + planned_date + + + article_modification_flag + article_modification_flag + + + release_reason + release_reason + + + release_date + release_date + + + N + N + N + N + Y + N + ervu_dashboard + Y + punishment
+ N + Y + N + Y + + + 720 + 320 + +
+ + Update + Update + + N + + 1 + + none + + + 1000 + ervu-dashboard + N + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_punishment_execution_info + has_punishment_execution_info + + + has_sentence_info + has_sentence_info + +
+ N + N + + + 1008 + 624 + +
+ + + Table output + Change job status on error + Y + + error_description + + error_code + + + + + + Update + Change job status on error + Y + + error_decription + + error_code + + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow1.hpl b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow1.hpl deleted file mode 100644 index a5f6f18..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow1.hpl +++ /dev/null @@ -1,163 +0,0 @@ - - - - punishment_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 - - - ervu_dashboard - punishment
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - sentence - sentence - Y - - - sentence_place - sentence_place - Y - - - sentence_changed - sentence_changed - Y - - - punishment_type - punishment_type - Y - - - start_date - start_date - Y - - - release_date - release_date - Y - - - sentense_date - sentense_date - Y - - - law_point - law_point - Y - - - release_reason - release_reason - Y - -
- N - - - 944 - 288 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH ugol AS ( - SELECT ri.recruit_id, - jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS nakaz - 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 ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null' -) -SELECT recruit_id, - nakaz ->> 'naimSud' AS authority_name, - nakaz ->> 'srokNakaz' AS sentence, - nakaz ->> 'adresOrg' AS sentence_place, --- nakaz->>'vidNakaz' AS punishment_code, - nakaz ->> 'naimIzmSrokNakaz' AS sentence_changed, - nakaz ->> 'vidNakaz' AS punishment_type, - TO_DATE(nakaz ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, - TO_DATE(nakaz ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date, - TO_DATE(nakaz ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date, - string_agg(statiuk_elem, ', ') AS law_point, - nakaz ->> 'osnOsvob' AS release_reason -FROM ugol - LEFT JOIN LATERAL jsonb_array_elements_text(nakaz -> 'statiUK') AS statiuk_elem ON true -GROUP BY recruit_id, nakaz; - Y - - - 448 - 288 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow2.hpl b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow2.hpl deleted file mode 100644 index 1a606b8..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow2.hpl +++ /dev/null @@ -1,162 +0,0 @@ - - - - punishment_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 - punishment
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - sentence - sentence - Y - - - sentence_place - sentence_place - Y - - - sentence_changed - sentence_changed - Y - - - punishment_type - punishment_type - Y - - - start_date - start_date - Y - - - release_date - release_date - Y - - - sentense_date - sentense_date - Y - - - law_point - law_point - Y - - - release_reason - release_reason - Y - -
- N - - - 1184 - 352 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH ugol AS ( - SELECT ri.recruit_id, - jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS nakaz - 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 ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null' -) -SELECT recruit_id, - nakaz ->> 'naimSud' AS authority_name, - nakaz ->> 'srokNakaz' AS sentence, - nakaz ->> 'adresOrg' AS sentence_place, --- nakaz->>'vidNakaz' AS punishment_code, - nakaz ->> 'naimIzmSrokNakaz' AS sentence_changed, - nakaz ->> 'vidNakaz' AS punishment_type, - TO_DATE(nakaz ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, - TO_DATE(nakaz ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date, - TO_DATE(nakaz ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date, - string_agg(statiuk_elem, ', ') AS law_point, - nakaz ->> 'osnOsvob' AS release_reason -FROM ugol - LEFT JOIN LATERAL jsonb_array_elements_text(nakaz -> 'statiUK') AS statiuk_elem ON true -GROUP BY recruit_id, nakaz; - Y - - - 688 - 352 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow3.hpl b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow3.hpl deleted file mode 100644 index 3b0454f..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow3.hpl +++ /dev/null @@ -1,161 +0,0 @@ - - - - punishment_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 - punishment
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - sentence - sentence - Y - - - sentence_place - sentence_place - Y - - - sentence_changed - sentence_changed - Y - - - punishment_type - punishment_type - Y - - - start_date - start_date - Y - - - release_date - release_date - Y - - - sentense_date - sentense_date - Y - - - law_point - law_point - Y - - - release_reason - release_reason - Y - -
- N - - - 1200 - 384 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH ugol AS ( - SELECT ri.recruit_id, - jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS nakaz - 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 ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null' -) -SELECT recruit_id, - nakaz ->> 'naimSud' AS authority_name, - nakaz ->> 'srokNakaz' AS sentence, - nakaz ->> 'adresOrg' AS sentence_place, --- nakaz->>'vidNakaz' AS punishment_code, - nakaz ->> 'naimIzmSrokNakaz' AS sentence_changed, - nakaz ->> 'vidNakaz' AS punishment_type, - TO_DATE(nakaz ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, - TO_DATE(nakaz ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date, - TO_DATE(nakaz ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date, - string_agg(statiuk_elem, ', ') AS law_point, - nakaz ->> 'osnOsvob' AS release_reason -FROM ugol - LEFT JOIN LATERAL jsonb_array_elements_text(nakaz -> 'statiUK') AS statiuk_elem ON true -GROUP BY recruit_id, nakaz; - Y - - - 704 - 384 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow4.hpl b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow4.hpl deleted file mode 100644 index b3cb7c1..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow4.hpl +++ /dev/null @@ -1,161 +0,0 @@ - - - - punishment_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 - punishment
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - sentence - sentence - Y - - - sentence_place - sentence_place - Y - - - sentence_changed - sentence_changed - Y - - - punishment_type - punishment_type - Y - - - start_date - start_date - Y - - - release_date - release_date - Y - - - sentense_date - sentense_date - Y - - - law_point - law_point - Y - - - release_reason - release_reason - Y - -
- N - - - 1152 - 368 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH ugol AS ( - SELECT ri.recruit_id, - jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS nakaz - 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 ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null' -) -SELECT recruit_id, - nakaz ->> 'naimSud' AS authority_name, - nakaz ->> 'srokNakaz' AS sentence, - nakaz ->> 'adresOrg' AS sentence_place, --- nakaz->>'vidNakaz' AS punishment_code, - nakaz ->> 'naimIzmSrokNakaz' AS sentence_changed, - nakaz ->> 'vidNakaz' AS punishment_type, - TO_DATE(nakaz ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, - TO_DATE(nakaz ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date, - TO_DATE(nakaz ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date, - string_agg(statiuk_elem, ', ') AS law_point, - nakaz ->> 'osnOsvob' AS release_reason -FROM ugol - LEFT JOIN LATERAL jsonb_array_elements_text(nakaz -> 'statiUK') AS statiuk_elem ON true -GROUP BY recruit_id, nakaz; - Y - - - 656 - 368 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow5.hpl b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow5.hpl deleted file mode 100644 index d65536f..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow5.hpl +++ /dev/null @@ -1,161 +0,0 @@ - - - - punishment_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 - punishment
- - recruit_id - recruit_id - N - - - authority_name - authority_name - Y - - - sentence - sentence - Y - - - sentence_place - sentence_place - Y - - - sentence_changed - sentence_changed - Y - - - punishment_type - punishment_type - Y - - - start_date - start_date - Y - - - release_date - release_date - Y - - - sentense_date - sentense_date - Y - - - law_point - law_point - Y - - - release_reason - release_reason - Y - -
- N - - - 1344 - 416 - -
- - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH ugol AS ( - SELECT ri.recruit_id, - jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS nakaz - 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 ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null' -) -SELECT recruit_id, - nakaz ->> 'naimSud' AS authority_name, - nakaz ->> 'srokNakaz' AS sentence, - nakaz ->> 'adresOrg' AS sentence_place, --- nakaz->>'vidNakaz' AS punishment_code, - nakaz ->> 'naimIzmSrokNakaz' AS sentence_changed, - nakaz ->> 'vidNakaz' AS punishment_type, - TO_DATE(nakaz ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, - TO_DATE(nakaz ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date, - TO_DATE(nakaz ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date, - string_agg(statiuk_elem, ', ') AS law_point, - nakaz ->> 'osnOsvob' AS release_reason -FROM ugol - LEFT JOIN LATERAL jsonb_array_elements_text(nakaz -> 'statiUK') AS statiuk_elem ON true -GROUP BY recruit_id, nakaz; - Y - - - 848 - 416 - - - - - -
diff --git a/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow_delta.hpl b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow_delta.hpl new file mode 100644 index 0000000..013b7cb --- /dev/null +++ b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow_delta.hpl @@ -0,0 +1,603 @@ + + + + punishment_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 + + + Insert / update + Change job status on error + Y + + + Insert / update + Detect empty 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 + + + Table input + Insert / update + Y + + + Insert / update + Group by + Y + + + Identify last row in a stream + Add constants + Y + + + Group by + Identify last row in a stream + Y + + + Add constants + Update + Y + + + Update + Filter rows + Y + + + Update + Change job status on error + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1120 + 384 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + has_punishment_execution_info + true + -1 + N + Boolean + + + -1 + has_sentence_info + true + -1 + N + Boolean + + + + + 864 + 608 + + + + 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}'; + + + + + 960 + 384 + + + + 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}' +and status = 'DELTA_PROCESSING'; + + + + + 1280 + 608 + + + + 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}'; + + + 128 + 224 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1280 + 224 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1072 + 608 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 752 + 400 + + + + Identify last row in a stream + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 752 + 608 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + punishment_external_id + punishment_external_id + + ervu_dashboard + punishment
+ + recruit_id + recruit_id + N + + + punishment_external_id + punishment_external_id + N + + + punishment_type + punishment_type + Y + + + punishment_code + punishment_code + Y + + + sentense_date + sentense_date + Y + + + authority_name + authority_name + Y + + + sentence + sentence + Y + + + sentence_changed + sentence_changed + Y + + + law_point + law_point + Y + + + registration_category + registration_category + Y + + + region_name + region_name + Y + + + facility_name + facility_name + Y + + + facility_address + facility_address + Y + + + criminal_case_number + criminal_case_number + Y + + + start_date + start_date + Y + + + planned_date + planned_date + Y + + + article_modification_flag + article_modification_flag + Y + + + release_reason + release_reason + Y + + + release_date + release_date + Y + +
+ N + + + 752 + 224 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH punishment_data AS ( + SELECT ri.recruit_id, + jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS punishment_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 + WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null' +) +SELECT recruit_id, + (punishment_info ->> 'id')::uuid AS punishment_external_id, + -- Блок "Сведения о вынесенном приговоре" + punishment_info ->> 'vidNakaz' AS punishment_type, -- Вид наказания + punishment_info ->> 'kodVidNakaz' AS punishment_code, -- Код вида наказания + TO_DATE(punishment_info ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date, -- Дата осуждения + punishment_info ->> 'naimSud' AS authority_name, -- Наименование суда + punishment_info ->> 'srokNakaz' AS sentence, -- Срок наказания + CASE + WHEN punishment_info ->> 'kodIzmSrokNakaz' = '1' THEN 'Изменений срока наказания не было' + WHEN punishment_info ->> 'kodIzmSrokNakaz' = '2' THEN 'Были изменения срока наказания' + ELSE punishment_info ->> 'kodIzmSrokNakaz' + END AS sentence_changed, -- Признак изменения срока + string_agg(law_articles, ', ') AS law_point, -- Статьи УК + -- Блок "Сведения об отбывании наказания" + punishment_info ->> 'katUcheta' AS registration_category, -- Категория учета + punishment_info ->> 'naimSubekt' AS region_name, -- Наименование субъекта + punishment_info ->> 'naimOrg' AS facility_name, -- Название учреждения + punishment_info ->> 'adresOrg' AS facility_address, -- Адрес учреждения + punishment_info ->> 'nomerUD' AS criminal_case_number, -- Номер уголовного дела + TO_DATE(punishment_info ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, -- Дата начала срока + TO_DATE(punishment_info ->> 'dataOkonchSrok', 'YYYY-MM-DD') AS planned_date, -- Планируемая дата освобождения + CASE + WHEN punishment_info ->> 'kodPerekvalif' = '1' THEN 'Изменений статьи не было' + WHEN punishment_info ->> 'kodPerekvalif' = '2' THEN 'Были изменения статьи' + ELSE punishment_info ->> 'kodPerekvalif' + END AS article_modification_flag, -- Признак переквалификации + punishment_info ->> 'osnOsvob' AS release_reason, -- Основание освобождения + TO_DATE(punishment_info ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date -- Фактическая дата освобождения +FROM punishment_data +LEFT JOIN LATERAL jsonb_array_elements_text(punishment_info -> 'statiUK') AS law_articles ON true +GROUP BY recruit_id, punishment_info; + Y + + + 400 + 224 + + + + Update + Update + + N + + 1 + + none + + + 1000 + ervu-dashboard + N + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_punishment_execution_info + has_punishment_execution_info + + + has_sentence_info + has_sentence_info + +
+ N + N + + + 960 + 608 + +
+ + + 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/punishment/parallel/punishment_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow_repeat.hpl new file mode 100644 index 0000000..f24f92e --- /dev/null +++ b/mappings/info_recruits/citizen_tables/punishment/parallel/punishment_flow_repeat.hpl @@ -0,0 +1,616 @@ + + + + punishment_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 + + + Add constants + Update + Y + + + Change job status on error + Abort + Y + + + Detect empty stream + Change job status on success + Y + + + Filter rows + Change job status on success + Y + + + Group by + Identify last row in a stream 2 + Y + + + Identify last row in a stream 2 + Add constants + Y + + + Update + Change job status on error + Y + + + Update + Filter rows + Y + + + Insert / update + Detect empty stream + Y + + + Insert / update + Change job status on error + Y + + + Table input + Insert / update + Y + + + Insert / update + Group by + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 1152 + 432 + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + has_punishment_execution_info + true + -1 + N + Boolean + + + -1 + has_sentence_info + true + -1 + N + Boolean + + + + + 880 + 640 + + + + 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 + 432 + + + + 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}' +and status = 'PROCESSING'; + + + + + 1312 + 640 + + + + 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; + + + 176 + 272 + + + + Detect empty stream + DetectEmptyStream + + Y + + 1 + + none + + + + + 1312 + 272 + + + + Filter rows + FilterRows + + Y + + 1 + + none + + + + + + + = + last_row + N + - + + N + -1 + constant + -1 + Y + Boolean + + + + Change job status on success + + + 1136 + 640 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 688 + 432 + + + + Identify last row in a stream 2 + DetectLastRow + + Y + + 1 + + none + + + last_row + + + 688 + 640 + + + + Insert / update + InsertUpdate + + N + + 1 + + none + + + 1000 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + punishment_external_id + punishment_external_id + + ervu_dashboard + punishment
+ + recruit_id + recruit_id + N + + + punishment_external_id + punishment_external_id + N + + + punishment_type + punishment_type + Y + + + punishment_code + punishment_code + Y + + + sentense_date + sentense_date + Y + + + authority_name + authority_name + Y + + + sentence + sentence + Y + + + sentence_changed + sentence_changed + Y + + + law_point + law_point + Y + + + registration_category + registration_category + Y + + + region_name + region_name + Y + + + facility_name + facility_name + Y + + + facility_address + facility_address + Y + + + criminal_case_number + criminal_case_number + Y + + + start_date + start_date + Y + + + planned_date + planned_date + Y + + + article_modification_flag + article_modification_flag + Y + + + release_reason + release_reason + Y + + + release_date + release_date + Y + +
+ N + + + 688 + 272 + +
+ + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + WITH punishment_data AS ( + SELECT ri.recruit_id, + jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS punishment_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 + WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null' +) +SELECT recruit_id, + (punishment_info ->> 'id')::uuid AS punishment_external_id, + -- Блок "Сведения о вынесенном приговоре" + punishment_info ->> 'vidNakaz' AS punishment_type, -- Вид наказания + punishment_info ->> 'kodVidNakaz' AS punishment_code, -- Код вида наказания + TO_DATE(punishment_info ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date, -- Дата осуждения + punishment_info ->> 'naimSud' AS authority_name, -- Наименование суда + punishment_info ->> 'srokNakaz' AS sentence, -- Срок наказания + CASE + WHEN punishment_info ->> 'kodIzmSrokNakaz' = '1' THEN 'Изменений срока наказания не было' + WHEN punishment_info ->> 'kodIzmSrokNakaz' = '2' THEN 'Были изменения срока наказания' + ELSE punishment_info ->> 'kodIzmSrokNakaz' + END AS sentence_changed, -- Признак изменения срока + string_agg(law_articles, ', ') AS law_point, -- Статьи УК + -- Блок "Сведения об отбывании наказания" + punishment_info ->> 'katUcheta' AS registration_category, -- Категория учета + punishment_info ->> 'naimSubekt' AS region_name, -- Наименование субъекта + punishment_info ->> 'naimOrg' AS facility_name, -- Название учреждения + punishment_info ->> 'adresOrg' AS facility_address, -- Адрес учреждения + punishment_info ->> 'nomerUD' AS criminal_case_number, -- Номер уголовного дела + TO_DATE(punishment_info ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, -- Дата начала срока + TO_DATE(punishment_info ->> 'dataOkonchSrok', 'YYYY-MM-DD') AS planned_date, -- Планируемая дата освобождения + CASE + WHEN punishment_info ->> 'kodPerekvalif' = '1' THEN 'Изменений статьи не было' + WHEN punishment_info ->> 'kodPerekvalif' = '2' THEN 'Были изменения статьи' + ELSE punishment_info ->> 'kodPerekvalif' + END AS article_modification_flag, -- Признак переквалификации + punishment_info ->> 'osnOsvob' AS release_reason, -- Основание освобождения + TO_DATE(punishment_info ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date -- Фактическая дата освобождения +FROM punishment_data +LEFT JOIN LATERAL jsonb_array_elements_text(punishment_info -> 'statiUK') AS law_articles ON true +GROUP BY recruit_id, punishment_info; + Y + + + 416 + 272 + + + + Update + Update + + N + + 1 + + none + + + 1000 + ervu-dashboard + N + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_punishment_execution_info + has_punishment_execution_info + + + has_sentence_info + has_sentence_info + +
+ N + N + + + 992 + 640 + +
+ + + 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/punishment/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/punishment/recruitment_five_flow_delta.hpl new file mode 100644 index 0000000..45065a2 --- /dev/null +++ b/mappings/info_recruits/citizen_tables/punishment/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 + punishment_flow_delta.hpl + Y + + + Table input + punishment_flow_delta.hpl 2 + Y + + + Table input + punishment_flow_delta.hpl 3 + Y + + + Table input + punishment_flow_delta.hpl 4 + Y + + + Table input + punishment_flow_delta.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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 = 'punishment_job' +where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING'); + N + + + 352 + 288 + + + + punishment_flow_delta.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 128 + + + + punishment_flow_delta.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 208 + + + + punishment_flow_delta.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 288 + + + + punishment_flow_delta.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 544 + 368 + + + + punishment_flow_delta.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_delta.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_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/punishment/recruitment_five_flow_on_error.hpl b/mappings/info_recruits/citizen_tables/punishment/recruitment_five_flow_on_error.hpl new file mode 100644 index 0000000..da6ae9d --- /dev/null +++ b/mappings/info_recruits/citizen_tables/punishment/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 + punishment_flow_repeat.hpl + Y + + + Table input + punishment_flow_repeat.hpl 3 + Y + + + Table input + punishment_flow_repeat.hpl 2 + Y + + + Table input + punishment_flow_repeat.hpl 4 + Y + + + Table input + punishment_flow_repeat.hpl 5 + Y + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + 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 = 'punishment_job' +where je.status is null or je.status in('ERROR', 'PROCESSING'); + N + + + 272 + 368 + + + + punishment_flow_repeat.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 208 + + + + punishment_flow_repeat.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 288 + + + + punishment_flow_repeat.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 368 + + + + punishment_flow_repeat.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 464 + 448 + + + + punishment_flow_repeat.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow_repeat.hpl + N + + 1 + + + + + IDM_ID + recruitment_id + + + + JOB_NAME + + punishment_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/punishment/recruitment_rows_five_flow_if_error.hpl b/mappings/info_recruits/citizen_tables/punishment/recruitment_rows_five_flow_if_error.hpl deleted file mode 100644 index 4e3598a..0000000 --- a/mappings/info_recruits/citizen_tables/punishment/recruitment_rows_five_flow_if_error.hpl +++ /dev/null @@ -1,261 +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 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.punishment 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 -), -remains as ( - select - CASE - WHEN created_at >= (select cr_flow1 from result_max) and flow_num = 1 THEN created_at - ELSE null - END as cr_flow1, - CASE - WHEN created_at >= (select cr_flow1 from result_max) and flow_num = 1 THEN idm_id - ELSE null - END as idm_flow1, - - CASE - WHEN created_at >= (select cr_flow2 from result_max) and flow_num = 2 THEN created_at - ELSE null - END as cr_flow2, - CASE - WHEN created_at >= (select cr_flow2 from result_max) and flow_num = 2 THEN idm_id - ELSE null - END as idm_flow2, - - CASE - WHEN created_at >= (select cr_flow3 from result_max) and flow_num = 3 THEN created_at - ELSE null - END as cr_flow3, - CASE - WHEN created_at >= (select cr_flow3 from result_max) and flow_num = 3 THEN idm_id - ELSE null - END as idm_flow3, - - CASE - WHEN created_at >= (select cr_flow4 from result_max) and flow_num = 4 THEN created_at - ELSE null - END as cr_flow4, - CASE - WHEN created_at >= (select cr_flow4 from result_max) and flow_num = 4 THEN idm_id - ELSE null - END as idm_flow4, - - CASE - WHEN created_at >= (select cr_flow5 from result_max) and flow_num = 5 THEN created_at - ELSE null - END as cr_flow5, - CASE - WHEN created_at >= (select cr_flow5 from result_max) and flow_num = 5 THEN idm_id - ELSE null - END as idm_flow5 - from splitted -), -idm1 as ( - select - cr_flow1, - idm_flow1 - from remains - where cr_flow1 is not null and idm_flow1 is not null -), -idm2 as ( - select - cr_flow2, - idm_flow2 - from remains - where cr_flow2 is not null and idm_flow2 is not null -), -idm3 as ( - select - cr_flow3, - idm_flow3 - from remains - where cr_flow3 is not null and idm_flow3 is not null -), -idm4 as ( - select - cr_flow4, - idm_flow4 - from remains - where cr_flow4 is not null and idm_flow4 is not null -), -idm5 as ( - select - cr_flow5, - idm_flow5 - from remains - where cr_flow5 is not null and idm_flow5 is not null -) -select - i1.*, - i2.*, - i3.*, - i4.*, - i5.* -FROM - (SELECT *, ROW_NUMBER() OVER () as rn FROM idm1) i1 -FULL OUTER JOIN - (SELECT *, ROW_NUMBER() OVER () as rn FROM idm2) i2 ON i1.rn = i2.rn -FULL OUTER JOIN - (SELECT *, ROW_NUMBER() OVER () as rn FROM idm3) i3 ON i1.rn = i3.rn -FULL OUTER JOIN - (SELECT *, ROW_NUMBER() OVER () as rn FROM idm4) i4 ON i1.rn = i4.rn -FULL OUTER JOIN - (SELECT *, ROW_NUMBER() OVER () as rn FROM idm5) i5 ON i1.rn = i5.rn -ORDER BY COALESCE(i1.rn, i2.rn, i3.rn, i4.rn, i5.rn) -limit 2 - N - - - 512 - 288 - - - - - - diff --git a/mappings/info_recruits/citizen_tables/punishment/recruitments_five_flow.hpl b/mappings/info_recruits/citizen_tables/punishment/recruitments_five_flow.hpl new file mode 100644 index 0000000..33ee4da --- /dev/null +++ b/mappings/info_recruits/citizen_tables/punishment/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 + punishment_flow.hpl + Y + + + Get all recruitments ordered by created_date + punishment_flow.hpl 2 + Y + + + Get all recruitments ordered by created_date + punishment_flow.hpl 3 + Y + + + Get all recruitments ordered by created_date + punishment_flow.hpl 4 + Y + + + Get all recruitments ordered by created_date + punishment_flow.hpl 5 + Y + + + + Get all recruitments ordered by created_date + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + + SELECT +idm_id AS recruitment +FROM ervu_dashboard.recruitment; + N + + + 432 + 304 + + + + punishment_flow.hpl + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 144 + + + + punishment_flow.hpl 2 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 224 + + + + punishment_flow.hpl 3 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 304 + + + + punishment_flow.hpl 4 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + punishment_job + + Y + + + ExecutionTime + ExecutionResult + ExecutionNrErrors + ExecutionLinesRead + ExecutionLinesWritten + ExecutionLinesInput + ExecutionLinesOutput + ExecutionLinesRejected + ExecutionLinesUpdated + ExecutionLinesDeleted + ExecutionFilesRetrieved + ExecutionExitStatus + ExecutionLogText + ExecutionLogChannelId + + + FileName + + + + 704 + 384 + + + + punishment_flow.hpl 5 + PipelineExecutor + + Y + + 1 + + none + + + local + ${PROJECT_HOME}/info_recruits/citizen_tables/punishment/parallel/punishment_flow.hpl + N + + 1 + + + + + IDM_ID + recruitment + + + + JOB_NAME + + punishment_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/supportive_jobs/recruitment_rows_five_flow_citizen_address.hpl b/mappings/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_address.hpl new file mode 100644 index 0000000..1061e29 --- /dev/null +++ b/mappings/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_address.hpl @@ -0,0 +1,121 @@ + + + + recruitment_rows_five_flow_citizen_address + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 832 + 304 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH ordered AS ( + SELECT + idm_id, + created_at, + ROW_NUMBER() OVER (ORDER BY created_at) AS rn, + COUNT(*) OVER () AS total_rows + from ervu_dashboard.recruitment +), +splitted AS ( + SELECT *, + CEIL(total_rows / 5.0) AS part_size, + FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num, + ((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position + FROM ordered +), +pivoted AS ( + SELECT + position, + + MAX(CASE WHEN flow_num = 1 THEN created_at END) AS cr_flow1, + MAX(CASE WHEN flow_num = 1 THEN idm_id::text END) AS idm_flow1, + + MAX(CASE WHEN flow_num = 2 THEN created_at END) AS cr_flow2, + MAX(CASE WHEN flow_num = 2 THEN idm_id::text END) AS idm_flow2, + + MAX(CASE WHEN flow_num = 3 THEN created_at END) AS cr_flow3, + MAX(CASE WHEN flow_num = 3 THEN idm_id::text END) AS idm_flow3, + + MAX(CASE WHEN flow_num = 4 THEN created_at END) AS cr_flow4, + MAX(CASE WHEN flow_num = 4 THEN idm_id::text END) AS idm_flow4, + + MAX(CASE WHEN flow_num = 5 THEN created_at END) AS cr_flow5, + MAX(CASE WHEN flow_num = 5 THEN idm_id::text END) AS idm_flow5 + + FROM splitted + GROUP BY position + ORDER BY position +) +SELECT + cr_flow1, + IDM_FLOW1::uuid, + cr_flow2, + IDM_FLOW2::uuid, + cr_flow3, + IDM_FLOW3::uuid, + cr_flow4, + IDM_FLOW4::uuid, + cr_flow5, + IDM_FLOW5::uuid +FROM pivoted +limit 3 + N + + + 464 + 304 + + + + + + diff --git a/mappings_new/info_recruits/checkpoints/checkpoint_job_info_recruits_from_json.hpl b/mappings_new/info_recruits/checkpoints/checkpoint_job_info_recruits_from_json.hpl index cb521a8..b8d99cd 100644 --- a/mappings_new/info_recruits/checkpoints/checkpoint_job_info_recruits_from_json.hpl +++ b/mappings_new/info_recruits/checkpoints/checkpoint_job_info_recruits_from_json.hpl @@ -21,9 +21,9 @@ - JSON input state_job_???.json + JSON input state_job_passport.json Filter rows - N + Y JSON input state_child_delta.json @@ -31,9 +31,9 @@ Y - JSON input state_???_delta.json + JSON input state_passport_delta.json Filter rows - N + Y JSON input state_job_child.json @@ -129,7 +129,6 @@ N -1 - constant -1 job_child @@ -178,7 +177,6 @@ N -1 - constant -1 delta_child @@ -215,6 +213,108 @@ String + + + + + + = + pipeline + N + OR + + N + -1 + + constant + -1 + delta_passport + String + + + + + + = + status + N + AND + + N + -1 + + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + + constant + -1 + delta_passport + String + + + + + + + + = + pipeline + N + OR + + N + -1 + + constant + -1 + job_passport + String + + + + + + = + status + N + AND + + N + -1 + + constant + -1 + ERROR + String + + + + = + pipeline + N + OR + + N + -1 + + constant + -1 + job_passport + String + + = pipeline @@ -238,7 +338,7 @@
- JSON input state_???_delta.json + JSON input state_passport_delta.json JsonInput Y @@ -260,7 +360,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen/checkpoints/state_citizen_delta.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_delta.json N @@ -312,81 +412,6 @@ 832 - - JSON input state_job_???.json - JsonInput - - Y - - 1 - - none - - - N - - N - N - N - N - N - Y - Y - Y - - - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen/checkpoints/state_job_citizen.json - - - N - N - - - - pipeline - $.pipeline - String - - - - - -1 - -1 - none - N - - - status - $.status - String - - - - - -1 - -1 - none - N - - - 0 - N - N - - - - - - - - - - - - 448 - 912 - - JSON input state_child_delta.json JsonInput @@ -462,6 +487,81 @@ 656 + + JSON input state_job_passport.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 448 + 912 + + JSON input state_job_child.json JsonInput @@ -598,13 +698,13 @@ none + Basic Y - - N 0 - Basic ${STATUS} + + 1520 @@ -622,13 +722,13 @@ none + Basic Y - - N 0 - Basic ${STATUS} + + 1520 diff --git a/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl b/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl index e758f3c..6eb97b0 100644 --- a/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/delta_child.hpl @@ -23,9 +23,161 @@ Table input Insert / update + N + + + Table input + Execute SQL script + Y + + + Group by + Select values + Y + + + Select values + Update + Y + + + Table input + Group by Y + + Execute SQL script + ExecSql + + Y + + 1 + + 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; + + + 768 + 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 @@ -45,6 +197,11 @@ recruit_id recruit_id + + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -82,6 +239,31 @@ kinship_type Y + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + N @@ -90,11 +272,111 @@ 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 + + + + + + + + + + 976 + 224 + + Table input TableInput - Y + N 1 @@ -104,32 +386,51 @@ ervu-dashboard N 0 - with child as -(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch, - ri.recruit_id -from ervu_person_registry_raw.recruits_info ri -join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id --AND '${ID_F1}' != '' -- Проверка на пустую строку + 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}' - AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date - AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp -where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -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 + '${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 @@ -137,6 +438,49 @@ join child on r.recruit_id = child.recruit_id
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 + + + 1088 + 192 + +
diff --git a/mappings_new/info_recruits/citizen_tables/child/job_child.hwf b/mappings_new/info_recruits/citizen_tables/child/job_child.hwf index 99c7624..358297b 100644 --- a/mappings_new/info_recruits/citizen_tables/child/job_child.hwf +++ b/mappings_new/info_recruits/citizen_tables/child/job_child.hwf @@ -108,13 +108,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow1.hpl Basic + + ID_F1 + IDM_FLOW1 + Y - N + Y local N N @@ -134,13 +138,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow2.hpl Basic + + ID_F2 + IDM_FLOW2 + Y - N + Y local N N @@ -160,13 +168,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow3.hpl Basic + + ID_F3 + IDM_FLOW3 + Y - N + Y local N N @@ -186,13 +198,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow4.hpl Basic + + ID_F4 + IDM_FLOW4 + Y - N + Y local N N @@ -212,13 +228,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow5.hpl Basic + + ID_F5 + IDM_FLOW5 + Y - N + Y local N N @@ -652,13 +672,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow1.hpl Basic + + ID_F1 + IDM_FLOW1 + Y - N + Y local N N @@ -678,13 +702,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow2.hpl Basic + + ID_F2 + IDM_FLOW2 + Y - N + Y local N N @@ -704,13 +732,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow3.hpl Basic + + ID_F3 + IDM_FLOW3 + Y - N + Y local N N @@ -730,13 +762,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow4.hpl Basic + + ID_F4 + IDM_FLOW4 + Y - N + Y local N N @@ -756,13 +792,17 @@ N N N - N + Y ${PROJECT_HOME}/info_recruits/citizen_tables/child/parallel/child_flow5.hpl Basic + + ID_F5 + IDM_FLOW5 + Y - N + Y local N N @@ -1080,6 +1120,10 @@ ${PROJECT_HOME}/info_recruits/citizen_tables/child/delta_child.hpl Basic + + M_R_UP_DATE + ${M_R_UP_DATE} + Y N @@ -1093,7 +1137,7 @@ - Success delta_citizen + Success delta_child SUCCESS @@ -1143,7 +1187,7 @@ - error delta_citizen + error delta_child SUCCESS @@ -1425,14 +1469,14 @@ Simple child WHERE ERROR Y N - Y + N branching_child.hpl Simple child WHERE SUCCESS Y - N - Y + Y + N checkpoint_child_error.hpl @@ -1639,14 +1683,14 @@ state_delta_child_success - Success delta_citizen + Success delta_child Y Y N state_delta_child_error - error delta_citizen + error delta_child Y Y N diff --git a/mappings_new/info_recruits/citizen_tables/child/job_recruit_last_update_date.hwf b/mappings_new/info_recruits/citizen_tables/child/job_recruit_last_update_date.hwf index fe4c912..5872f7e 100644 --- a/mappings_new/info_recruits/citizen_tables/child/job_recruit_last_update_date.hwf +++ b/mappings_new/info_recruits/citizen_tables/child/job_recruit_last_update_date.hwf @@ -41,7 +41,7 @@ N N N - ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/recruit_update_date_ervu_dashboard.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl Basic diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow1.hpl b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow1.hpl index 255ea10..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 @@ -19,6 +19,28 @@ 2025/05/21 14:05:02.260 + + 251 + 232 + 201 + 90 + 58 + 14 + N + 90 + 58 + 14 + N + Segoe UI + 9 + 58 + 656 + 32 + Привожу minor_count к нужному формату +Как это пофиксить без Select хз((( +Часа три искал решения + 247 + @@ -34,9 +56,116 @@ Table input Insert / update + N + + + Table input + Execute SQL script + Y + + + Table input + Group by + Y + + + Group by + Select values + Y + + + Select values + Update Y + + Execute SQL script + ExecSql + + Y + + 1 + + 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; + + + 592 + 80 + + Get variables GetVariable @@ -64,6 +193,245 @@ 400 + + 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 + + + 656 + 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 + + + 944 + 288 + +
+ + 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 + + + + + + + + + + 784 + 144 + + Select values 4 2 SelectValues @@ -105,7 +473,7 @@ Table input TableInput - Y + N 1 @@ -115,41 +483,60 @@ ervu-dashboard N 0 - with child as -(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch, - ri.recruit_id -from ervu_person_registry_raw.recruits_info ri -join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F1}' != '' -- Проверка на пустую строку + 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}' - AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date -where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -select - r.recruit_id::uuid recruit_id, - ch->>'naimRodstvSvyazReb' kinship_type, - concat_ws(' ', ch->'svedFLBS'->'fio'->>'familiya', - ch->'svedFLBS'->'fio'->>'imya', - ch->'svedFLBS'->'fio'->>'otchestvo') full_name, - make_date(NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den','')::int) birth_date, - make_date(NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz','')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'den','')::int) death_date, - ch->'svedSmert'->>'nomerZapis' death_az_number, - ch->'svedAZRozhd'->>'nomerZapis' birth_az_number -from ervu_dashboard.citizen r -join child on r.recruit_id = child.recruit_id + AND '${M_R_CR_DATE}'::timestamp >= c.recruit_create_date + AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'; + Y - 448 + 496 288 - Insert / update - InsertUpdate + Update + Update Y @@ -160,6 +547,7 @@ join child on r.recruit_id = child.recruit_id
100 ervu-dashboard + Y = @@ -167,48 +555,26 @@ join child on r.recruit_id = child.recruit_id
recruit_id ervu_dashboard - citizen_child
+ citizen
- recruit_id - recruit_id - N + minors_count + minors_count - birth_az_number - birth_az_number - Y + has_minor_child + has_minor_child - 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 + has_dead_child + has_dead_child - N + N + Y - 944 - 288 + 880 + 112 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 deleted file mode 100644 index 25a1f51..0000000 --- a/mappings_new/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 - - - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - with child as -(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch, - ri.recruit_id -from ervu_person_registry_raw.recruits_info ri -join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}' - AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date -where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -select - r.recruit_id::uuid recruit_id, - ch->>'naimRodstvSvyazReb' kinship_type, - concat_ws(' ', ch->'svedFLBS'->'fio'->>'familiya', - ch->'svedFLBS'->'fio'->>'imya', - ch->'svedFLBS'->'fio'->>'otchestvo') full_name, - make_date(NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den','')::int) birth_date, - make_date(NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz','')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'den','')::int) death_date, - ch->'svedSmert'->>'nomerZapis' death_az_number, - ch->'svedAZRozhd'->>'nomerZapis' birth_az_number -from ervu_dashboard.citizen r -join child on r.recruit_id = child.recruit_id - Y - - - 560 - 288 - - - - Insert / update - InsertUpdate - - 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 - -
- - - -
diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow3.hpl b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow3.hpl index b54983c..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 @@ -23,12 +23,32 @@ Table input Insert / update + N + + + Table input + Execute SQL script + Y + + + Group by + Select values + Y + + + Select values + Update + Y + + + Table input + Group by Y - Table input - TableInput + Execute SQL script + ExecSql Y @@ -37,39 +57,125 @@ 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 - N - 0 - with child as -(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch, - ri.recruit_id -from ervu_person_registry_raw.recruits_info ri -join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}' - AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date -where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -select - r.recruit_id::uuid recruit_id, - ch->>'naimRodstvSvyazReb' kinship_type, - concat_ws(' ', ch->'svedFLBS'->'fio'->>'familiya', - ch->'svedFLBS'->'fio'->>'imya', - ch->'svedFLBS'->'fio'->>'otchestvo') full_name, - make_date(NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den','')::int) birth_date, - make_date(NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz','')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'den','')::int) death_date, - ch->'svedSmert'->>'nomerZapis' death_az_number, - ch->'svedAZRozhd'->>'nomerZapis' birth_az_number -from ervu_dashboard.citizen r -join child on r.recruit_id = child.recruit_id - Y + 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; - 672 - 352 + 800 + 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 @@ -91,6 +197,11 @@ join child on r.recruit_id = child.recruit_id
recruit_id recruit_id + + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -128,6 +239,31 @@ join child on r.recruit_id = child.recruit_id
kinship_type Y + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + N @@ -136,6 +272,214 @@ join child on r.recruit_id = child.recruit_id
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 + + + + + + + + + + 1008 + 208 + + + + 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_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 + + + 672 + 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 + + + 1120 + 176 + +
diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow4.hpl b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow4.hpl index ae5598f..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 @@ -23,12 +23,32 @@ Table input Insert / update + N + + + Table input + Execute SQL script + Y + + + Group by + Select values + Y + + + Select values + Update + Y + + + Table input + Group by Y - Table input - TableInput + Execute SQL script + ExecSql Y @@ -37,39 +57,125 @@ 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 - N - 0 - with child as -(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch, - ri.recruit_id -from ervu_person_registry_raw.recruits_info ri -join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}' - AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date -where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -select - r.recruit_id::uuid recruit_id, - ch->>'naimRodstvSvyazReb' kinship_type, - concat_ws(' ', ch->'svedFLBS'->'fio'->>'familiya', - ch->'svedFLBS'->'fio'->>'imya', - ch->'svedFLBS'->'fio'->>'otchestvo') full_name, - make_date(NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den','')::int) birth_date, - make_date(NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz','')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'den','')::int) death_date, - ch->'svedSmert'->>'nomerZapis' death_az_number, - ch->'svedAZRozhd'->>'nomerZapis' birth_az_number -from ervu_dashboard.citizen r -join child on r.recruit_id = child.recruit_id - Y + 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; - 528 - 320 + 624 + 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 @@ -91,6 +197,11 @@ join child on r.recruit_id = child.recruit_id
recruit_id recruit_id + + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -128,6 +239,31 @@ join child on r.recruit_id = child.recruit_id
kinship_type Y + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + N @@ -136,6 +272,214 @@ join child on r.recruit_id = child.recruit_id
320 + + 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 + + + + + + + + + + 848 + 176 + + + + 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_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 + + + 528 + 320 + + + + 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 + + + 960 + 128 + +
diff --git a/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow5.hpl b/mappings_new/info_recruits/citizen_tables/child/parallel/child_flow5.hpl index 36bf1e2..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 @@ -23,12 +23,32 @@ Table input Insert / update + N + + + Table input + Execute SQL script + Y + + + Group by + Select values + Y + + + Select values + Update + Y + + + Table input + Group by Y - Table input - TableInput + Execute SQL script + ExecSql Y @@ -37,39 +57,125 @@ 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 - N - 0 - with child as -(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch, - ri.recruit_id -from ervu_person_registry_raw.recruits_info ri -join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку - AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}' - AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date -where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array' -) -select - r.recruit_id::uuid recruit_id, - ch->>'naimRodstvSvyazReb' kinship_type, - concat_ws(' ', ch->'svedFLBS'->'fio'->>'familiya', - ch->'svedFLBS'->'fio'->>'imya', - ch->'svedFLBS'->'fio'->>'otchestvo') full_name, - make_date(NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int, - NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den','')::int) birth_date, - make_date(NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz','')::int, - NULLIF(ch->'svedSmert'->'dataSmert'->>'den','')::int) death_date, - ch->'svedSmert'->>'nomerZapis' death_az_number, - ch->'svedAZRozhd'->>'nomerZapis' birth_az_number -from ervu_dashboard.citizen r -join child on r.recruit_id = child.recruit_id - Y + 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; - 560 - 368 + 688 + 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 @@ -91,6 +197,11 @@ join child on r.recruit_id = child.recruit_id recruit_id recruit_id + + = + child_external_id + child_external_id + ervu_dashboard citizen_child
@@ -128,6 +239,31 @@ join child on r.recruit_id = child.recruit_id kinship_type Y + + child_external_id + child_external_id + N + + + first_name + first_name + Y + + + middle_name + middle_name + Y + + + last_name + last_name + Y + + + child_id_ern + child_id_ern + Y + N @@ -136,6 +272,214 @@ join child on r.recruit_id = child.recruit_id 368
+ + 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 + + + + + + + + + + 880 + 224 + + + + 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_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 + + + 560 + 368 + + + + 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 + + + 1008 + 176 + +
diff --git a/mappings_new/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl b/mappings_new/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl index 5aa7685..6f63f21 100644 --- a/mappings_new/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl +++ b/mappings_new/info_recruits/citizen_tables/child/recruit_update_date_ervu_dashboard.hpl @@ -45,8 +45,8 @@ updated_at AS system_update_date, current_timestamp AS record_created, 'job_recruits_info' AS workflow -FROM ervu_person_registry_raw.recruits_info -WHERE updated_at = (SELECT MAX(updated_at) FROM ervu_person_registry_raw.recruits_info) +FROM ervu_dashboard.recruits_info +WHERE updated_at = (SELECT MAX(updated_at) FROM ervu_dashboard.recruits_info) limit 1 N @@ -74,11 +74,14 @@ limit 1 N N N + Y + N public N recruit_create
+ N Y N diff --git a/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl index bd4629d..27e8b7b 100644 --- a/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow1.hpl @@ -196,6 +196,11 @@ reason_registration Y + + marital_status + marital_status + Y + N @@ -274,7 +279,7 @@ 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_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl index 7da9f7e..da408b6 100644 --- a/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow2.hpl @@ -153,6 +153,11 @@ reason_registration Y + + marital_status + marital_status + Y + N @@ -194,7 +199,7 @@ 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_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl index cebde2f..867f1da 100644 --- a/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow3.hpl @@ -153,6 +153,11 @@ reason_registration Y + + marital_status + marital_status + Y + N @@ -194,7 +199,7 @@ 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_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl index 91bb987..f5805df 100644 --- a/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow4.hpl @@ -153,6 +153,11 @@ reason_registration Y + + marital_status + marital_status + Y + N @@ -194,7 +199,7 @@ 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_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl index ba4aad2..733ca56 100644 --- a/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen/parallel/citizen_flow5.hpl @@ -153,6 +153,11 @@ reason_registration Y + + marital_status + marital_status + Y + N @@ -194,7 +199,7 @@ 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_new/info_recruits/citizen_tables/citizen_address/branching_citizen_address.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/branching_citizen_address.hpl new file mode 100644 index 0000000..254a003 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/branching_citizen_address.hpl @@ -0,0 +1,173 @@ + + + + branching_citizen_address + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/09 09:54:43.724 + - + 2025/06/09 09:54:43.724 + + + + + + JSON input state_job_citizen_address.json + Set variables + Y + + + Set variables + Write to log + N + + + + JSON input state_job_citizen_address.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_job_citizen_address.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 816 + 448 + + + + Set variables + SetVariable + + Y + + 1 + + none + + + + + pipeline + PIPE + PARENT_WORKFLOW + + + status + STATUS + PARENT_WORKFLOW + + + Y + + + 1072 + 448 + + + + Write to log + WriteToLog + + Y + + 1 + + none + + + Y + + + pipeline + + + status + + + N + 0 + Basic + ${PIPE} +${STATUS} + + + 1296 + 448 + + + + + + diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_child_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/checkpoint_citizen_address_error.hpl similarity index 98% rename from mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_child_error.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/checkpoint_citizen_address_error.hpl index 0f593da..6229d0c 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_child_error.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/checkpoint_citizen_address_error.hpl @@ -1,7 +1,7 @@ - checkpoint_child_error + checkpoint_citizen_address_error Y @@ -112,7 +112,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_address ca on ca.recruit_id = cit.recruit_id ), flow_data AS ( SELECT diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/checkpoint_job_citizen_address.hpl similarity index 79% rename from mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/checkpoint_job_citizen_address.hpl index 06568da..887591a 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/checkpoint_job_child.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/checkpoint_job_citizen_address.hpl @@ -1,7 +1,7 @@ - checkpoint_job_child + checkpoint_job_citizen_address Y @@ -23,62 +23,32 @@ 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 + JSON input state_citizen_address_flow1.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow2.json - N + JSON input state_citizen_address_flow2.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow3.json - N + JSON input state_citizen_address_flow3.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow4.json - N + JSON input state_citizen_address_flow4.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow5.json - N + JSON input state_citizen_address_flow5.json + Filter rows + Y @@ -101,23 +71,6 @@ 592 - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - Filter rows FilterRows @@ -144,9 +97,10 @@ N -1 + constant -1 - child_flow1 + citizen_address_flow1 String @@ -192,9 +146,10 @@ N -1 + constant -1 - child_flow2 + citizen_address_flow2 String @@ -240,9 +195,10 @@ N -1 + constant -1 - child_flow3 + citizen_address_flow3 String @@ -288,9 +244,10 @@ N -1 + constant -1 - child_flow4 + citizen_address_flow4 String @@ -336,9 +293,10 @@ N -1 + constant -1 - child_flow5 + citizen_address_flow5 String @@ -395,51 +353,7 @@ - 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 + JSON input state_citizen_address_flow1.json JsonInput Y @@ -461,7 +375,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow1.json N @@ -514,7 +428,7 @@ - JSON input state_child_flow2.json + JSON input state_citizen_address_flow2.json JsonInput Y @@ -536,7 +450,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow2.json N @@ -589,7 +503,7 @@ - JSON input state_child_flow3.json + JSON input state_citizen_address_flow3.json JsonInput Y @@ -611,7 +525,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow3.json N @@ -664,7 +578,7 @@ - JSON input state_child_flow4.json + JSON input state_citizen_address_flow4.json JsonInput Y @@ -686,7 +600,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow4.json N @@ -739,7 +653,7 @@ - JSON input state_child_flow5.json + JSON input state_citizen_address_flow5.json JsonInput Y @@ -761,7 +675,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow5.json N @@ -813,56 +727,6 @@ 752 - - 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/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/job_create_files_citizen_address.hwf similarity index 71% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf rename to mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/job_create_files_citizen_address.hwf index 1a90995..20d9635 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/job_create_files_citizen_address.hwf @@ -1,6 +1,6 @@ - job_create_files_citizen_guardianship + job_create_files_citizen_address Y @@ -31,90 +31,90 @@ - state_child_flow2_new + state_citizen_address_flow2_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow2" + "pipeline": "citizen_address_flow2" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow2.json N 848 416 - state_child_flow1_new + state_citizen_address_flow1_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow1" + "pipeline": "citizen_address_flow1" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow1.json N 848 336 - state_child_flow3_new + state_citizen_address_flow3_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow3" + "pipeline": "citizen_address_flow3" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow3.json N 848 496 - state_child_flow4_new + state_citizen_address_flow4_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow4" + "pipeline": "citizen_address_flow4" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow4.json N 848 576 - state_child_flow5_new + state_citizen_address_flow5_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow5" + "pipeline": "citizen_address_flow5" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow5.json N 848 656 @@ -131,12 +131,12 @@ - Delete file state_job_child + Delete file state_job_citizen_address DELETE_FILE N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_job_citizen_address.json N 848 256 @@ -146,69 +146,69 @@ Start - state_child_flow3_new + state_citizen_address_flow3_new Y Y Y Start - state_child_flow2_new + state_citizen_address_flow2_new Y Y Y Start - state_child_flow1_new + state_citizen_address_flow1_new Y Y Y Start - state_child_flow4_new + state_citizen_address_flow4_new Y Y Y Start - state_child_flow5_new + state_citizen_address_flow5_new Y Y Y - state_child_flow5_new + state_citizen_address_flow5_new Success Y Y N - state_child_flow4_new + state_citizen_address_flow4_new Success Y Y N - state_child_flow3_new + state_citizen_address_flow3_new Success Y Y N - state_child_flow2_new + state_citizen_address_flow2_new Success Y Y N - state_child_flow1_new + state_citizen_address_flow1_new Success Y Y @@ -216,13 +216,13 @@ Start - Delete file state_job_child + Delete file state_job_citizen_address Y Y Y - Delete file state_job_child + Delete file state_job_citizen_address Success Y Y diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_delta.json b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_delta.json new file mode 100644 index 0000000..d4291b5 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_delta.json @@ -0,0 +1,6 @@ +{ + "status": "SUCCESS", + "pipeline": "delta_citizen_address", + "max_create_date": "2025/04/08 20:21:38.528691000", + "max_update_date": "2025/04/09 00:25:46.935442000" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow1.json b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow1.json new file mode 100644 index 0000000..9d49159 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow1.json @@ -0,0 +1,4 @@ +{ + "status": "ERROR", + "pipeline": "citizen_address_flow1" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow2.json b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow2.json new file mode 100644 index 0000000..e81b95e --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow2.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "citizen_address_flow2" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow3.json b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow3.json new file mode 100644 index 0000000..4986db5 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow3.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "citizen_address_flow3" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow4.json b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow4.json new file mode 100644 index 0000000..faeea12 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow4.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "citizen_address_flow4" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow5.json b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow5.json new file mode 100644 index 0000000..23e7b79 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow5.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "citizen_address_flow5" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/delta_citizen_address.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/delta_citizen_address.hpl new file mode 100644 index 0000000..7f8c0f4 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/delta_citizen_address.hpl @@ -0,0 +1,163 @@ + + + + delta_citizen_address + 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_address
+ + recruit_id + recruit_id + N + + + factual_address + factual_address + Y + + + factual_info_expiry_date + factual_info_expiry_date + Y + + + factual_info_received_date + factual_info_received_date + Y + + + place_stay_address + place_stay_address + Y + + + place_stay_deregistration_date + place_stay_deregistration_date + Y + + + place_stay_registration_date + place_stay_registration_date + Y + + + place_stay_registration_type + place_stay_registration_type + Y + + + residence_address + residence_address + Y + + + residence_deregistration_date + residence_deregistration_date + Y + + + residence_registration_date + residence_registration_date + Y + +
+ N + + + 1040 + 336 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + ri.recruit_id::uuid, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateStart')::date END) AS residence_registration_date, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateEnd')::date END) AS residence_deregistration_date, + + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS place_stay_address, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateStart')::date END) AS place_stay_registration_date, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateEnd')::date END) AS place_stay_deregistration_date, + CASE + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '1' THEN 'В жилом помещении, не являющимся местом жительства физического лица' + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '2' THEN 'В учреждении уголовно-исполнительной системы' + ELSE NULL + END AS place_stay_registration_type, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN addr->>'reg' END) AS factual_address, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateStart')::date END) AS factual_info_received_date, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateEnd')::date END) AS factual_info_expiry_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.addresses) AS addr +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 +GROUP BY ri.recruit_id; + Y + + + 624 + 352 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/job_citizen_address.hwf b/mappings_new/info_recruits/citizen_tables/citizen_address/job_citizen_address.hwf new file mode 100644 index 0000000..b8dbc75 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/job_citizen_address.hwf @@ -0,0 +1,1716 @@ + + + job_citizen_address + Y + + + + - + 2025/06/05 14:27:15.055 + - + 2025/06/05 14:27:15.055 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 624 + 400 + + + + Checks if files exist state_job_citizen_address.json + + FILES_EXIST + + + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_job_citizen_address.json + + + N + 848 + 400 + + + + checkpoint_job_citizen_address.hpl (2) + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/checkpoint_job_citizen_address.hpl + Basic + + Y + + N + local + N + N + Y + N + 1136 + 1280 + + + + recruitment_rows_five_flow_citizen_address.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_address.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1488 + 400 + + + + citizen_address_flow1.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow1.hpl + Basic + + + ID_F1 + IDM_FLOW1 + + Y + + Y + local + N + N + Y + N + 1808 + 80 + + + + citizen_address_flow2.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow2.hpl + Basic + + + ID_F2 + IDM_FLOW2 + + Y + + Y + local + N + N + Y + N + 1808 + 240 + + + + citizen_address_flow3.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow3.hpl + Basic + + + ID_F3 + IDM_FLOW3 + + Y + + Y + local + N + N + Y + N + 1808 + 400 + + + + citizen_address_flow4.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow4.hpl + Basic + + + ID_F4 + IDM_FLOW4 + + Y + + Y + local + N + N + Y + N + 1808 + 560 + + + + citizen_address_flow5.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow5.hpl + Basic + + + ID_F5 + IDM_FLOW5 + + Y + + Y + local + N + N + Y + N + 1808 + 720 + + + + Write state_citizen_address_flow1 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow1.json + N + 2096 + 80 + + + + Write state_citizen_address_flow1 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow1.json + N + 2096 + 160 + + + + Write state_citizen_address_flow2 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow2.json + N + 2096 + 240 + + + + Write state_citizen_address_flow2 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow2.json + N + 2096 + 320 + + + + Write state_citizen_address_flow3 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow3.json + N + 2096 + 400 + + + + Write state_citizen_address_flow3 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow3.json + N + 2096 + 480 + + + + Write state_citizen_address_flow4 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow4.json + N + 2096 + 560 + + + + Write state_citizen_address_flow4 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow4.json + N + 2096 + 640 + + + + Write state_citizen_address_flow5 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow5.json + N + 2096 + 720 + + + + Write state_citizen_address_flow5 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow5.json + N + 2096 + 800 + + + + Abort workflow + + ABORT + + N + N + 1472 + 208 + + + + checkpoint_job_citizen_address.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/checkpoint_job_citizen_address.hpl + Basic + + Y + + N + local + N + N + Y + N + 2496 + 384 + + + + Success new citizen + + SUCCESS + + N + 3024 + 384 + + + + state_job_citizen_address_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_address" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_job_citizen_address.json + N + 2784 + 384 + + + + state_job_citizen_address_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_address" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_job_citizen_address.json + N + 2784 + 480 + + + + state_job_citizen_address_success 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_address" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_job_citizen_address.json + N + 1360 + 1280 + + + + state_job_citizen_address_error 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_address" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_job_citizen_address.json + N + 1360 + 1376 + + + + branching_citizen_address.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/branching_citizen_address.hpl + Basic + + Y + + N + local + N + N + Y + N + 1584 + 1280 + + + + Simple citizen_address WHERE SUCCESS + + SIMPLE_EVAL + + SUCCESS + string + true + equal + equal + N + variable + STATUS + N + 2240 + 1792 + + + + Simple citizen_address WHERE ERROR + + SIMPLE_EVAL + + ERROR + string + true + equal + equal + N + variable + STATUS + N + 1840 + 1280 + + + + checkpoint_citizen_address_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/checkpoint_citizen_address_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2064 + 1280 + + + + recruitment_rows_five_flow_if_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/recruitment_rows_five_flow_if_error.hpl + Basic + + Y + + N + local + N + N + Y + Y + 2384 + 1280 + + + + Abort workflow 2 + + ABORT + + N + N + 2288 + 1040 + + + + citizen_address_flow1.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow1.hpl + Basic + + + ID_F1 + IDM_FLOW1 + + Y + + Y + local + N + N + Y + N + 2672 + 960 + + + + citizen_address_flow2.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow2.hpl + Basic + + + ID_F2 + IDM_FLOW2 + + Y + + Y + local + N + N + Y + N + 2672 + 1120 + + + + citizen_address_flow3.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow3.hpl + Basic + + + ID_F3 + IDM_FLOW3 + + Y + + Y + local + N + N + Y + N + 2672 + 1280 + + + + citizen_address_flow4.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow4.hpl + Basic + + + ID_F4 + IDM_FLOW4 + + Y + + Y + local + N + N + Y + N + 2672 + 1440 + + + + citizen_address_flow5.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow5.hpl + Basic + + + ID_F5 + IDM_FLOW5 + + Y + + Y + local + N + N + Y + N + 2672 + 1600 + + + + Write state_citizen_address_flow1 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow1.json + N + 2960 + 960 + + + + Write state_citizen_address_flow1 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow1.json + N + 2960 + 1040 + + + + Write state_citizen_address_flow2 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow2.json + N + 2960 + 1120 + + + + Write state_citizen_address_flow2 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow2.json + N + 2960 + 1200 + + + + Write state_citizen_address_flow3 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow3.json + N + 2960 + 1280 + + + + Write state_citizen_address_flow3 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow3.json + N + 2960 + 1360 + + + + Write state_citizen_address_flow4 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow4.json + N + 2960 + 1440 + + + + Write state_citizen_address_flow4 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow4.json + N + 2960 + 1520 + + + + Write state_citizen_address_flow5 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_address_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow5.json + N + 2960 + 1600 + + + + Write state_citizen_address_flow5 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_address_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_flow5.json + N + 2960 + 1680 + + + + Success after_error_citizen_address_flow1 + + SUCCESS + + N + 3216 + 960 + + + + error after_error_citizen_address_flow1 + + SUCCESS + + N + 3216 + 1040 + + + + Success after_error_citizen_address_flow2 + + SUCCESS + + N + 3216 + 1120 + + + + error after_error_citizen_address_flow2 + + SUCCESS + + N + 3216 + 1200 + + + + Success after_error_citizen_address_flow3 + + SUCCESS + + N + 3216 + 1280 + + + + error after_error_citizen_address_flow3 + + SUCCESS + + N + 3216 + 1360 + + + + Success after_error_citizen_address_flow4 + + SUCCESS + + N + 3216 + 1440 + + + + error after_error_citizen_address_flow4 + + SUCCESS + + N + 3216 + 1520 + + + + Success after_error_citizen_address_flow5 + + SUCCESS + + N + 3216 + 1600 + + + + error after_error_citizen_address_flow5 + + SUCCESS + + N + 3216 + 1680 + + + + job_recruit_last_update_date.hwf + + WORKFLOW + + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/job_recruit_last_update_date.hwf + Nothing + + Y + + N + local + N + N + Y + N + 2544 + 1792 + + + + delta_citizen_address.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/delta_citizen_address.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + Y + + N + local + N + N + Y + N + 2768 + 1792 + + + + Success delta_citizen_address + + SUCCESS + + N + 3216 + 1792 + + + + state_delta_citizen_address_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "delta_citizen_address", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_delta.json + N + 2960 + 1792 + + + + state_delta_citizen_address_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "delta_citizen_address", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/checkpoints/state_citizen_address_delta.json + N + 2960 + 1872 + + + + error delta_citizen_address + + SUCCESS + + N + 3216 + 1872 + + + + + + Start + Checks if files exist state_job_citizen_address.json + Y + Y + Y + + + Checks if files exist state_job_citizen_address.json + checkpoint_job_citizen_address.hpl (2) + Y + Y + N + + + Checks if files exist state_job_citizen_address.json + recruitment_rows_five_flow_citizen_address.hpl + Y + N + N + + + recruitment_rows_five_flow_citizen_address.hpl + citizen_address_flow1.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_address.hpl + citizen_address_flow2.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_address.hpl + citizen_address_flow3.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_address.hpl + citizen_address_flow4.hpl + Y + Y + N + + + recruitment_rows_five_flow_citizen_address.hpl + citizen_address_flow5.hpl + Y + Y + N + + + citizen_address_flow1.hpl + Write state_citizen_address_flow1 SUCCESS + Y + Y + N + + + citizen_address_flow1.hpl + Write state_citizen_address_flow1 ERROR + Y + N + N + + + citizen_address_flow2.hpl + Write state_citizen_address_flow2 SUCCESS + Y + Y + N + + + citizen_address_flow2.hpl + Write state_citizen_address_flow2 ERROR + Y + N + N + + + citizen_address_flow3.hpl + Write state_citizen_address_flow3 SUCCESS + Y + Y + N + + + citizen_address_flow3.hpl + Write state_citizen_address_flow3 ERROR + Y + N + N + + + citizen_address_flow4.hpl + Write state_citizen_address_flow4 SUCCESS + Y + Y + N + + + citizen_address_flow4.hpl + Write state_citizen_address_flow4 ERROR + Y + N + N + + + citizen_address_flow5.hpl + Write state_citizen_address_flow5 SUCCESS + Y + Y + N + + + citizen_address_flow5.hpl + Write state_citizen_address_flow5 ERROR + Y + N + N + + + recruitment_rows_five_flow_citizen_address.hpl + Abort workflow + Y + N + N + + + Write state_citizen_address_flow1 SUCCESS + checkpoint_job_citizen_address.hpl + Y + N + Y + + + Write state_citizen_address_flow1 ERROR + checkpoint_job_citizen_address.hpl + Y + N + Y + + + Write state_citizen_address_flow2 SUCCESS + checkpoint_job_citizen_address.hpl + Y + N + Y + + + Write state_citizen_address_flow2 ERROR + checkpoint_job_citizen_address.hpl + Y + N + Y + + + Write state_citizen_address_flow3 SUCCESS + checkpoint_job_citizen_address.hpl + Y + N + Y + + + Write state_citizen_address_flow3 ERROR + checkpoint_job_citizen_address.hpl + Y + N + Y + + + Write state_citizen_address_flow4 SUCCESS + checkpoint_job_citizen_address.hpl + Y + N + Y + + + Write state_citizen_address_flow4 ERROR + checkpoint_job_citizen_address.hpl + Y + N + Y + + + Write state_citizen_address_flow5 SUCCESS + checkpoint_job_citizen_address.hpl + Y + N + Y + + + Write state_citizen_address_flow5 ERROR + checkpoint_job_citizen_address.hpl + Y + N + Y + + + state_job_citizen_address_success + Success new citizen + Y + Y + N + + + state_job_citizen_address_error + Success new citizen + Y + Y + N + + + checkpoint_job_citizen_address.hpl + state_job_citizen_address_success + Y + Y + N + + + checkpoint_job_citizen_address.hpl + state_job_citizen_address_error + Y + N + N + + + checkpoint_job_citizen_address.hpl (2) + state_job_citizen_address_success 2 + Y + Y + N + + + checkpoint_job_citizen_address.hpl (2) + state_job_citizen_address_error 2 + Y + N + N + + + state_job_citizen_address_success 2 + branching_citizen_address.hpl + Y + Y + N + + + state_job_citizen_address_error 2 + branching_citizen_address.hpl + Y + Y + N + + + Simple citizen_address WHERE ERROR + checkpoint_citizen_address_error.hpl + Y + N + Y + + + branching_citizen_address.hpl + Simple citizen_address WHERE ERROR + Y + N + N + + + branching_citizen_address.hpl + Simple citizen_address WHERE SUCCESS + Y + Y + N + + + checkpoint_citizen_address_error.hpl + recruitment_rows_five_flow_if_error.hpl + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + Abort workflow 2 + Y + N + N + + + citizen_address_flow1.hpl 2 + Write state_citizen_address_flow1 SUCCESS 2 + Y + Y + N + + + citizen_address_flow1.hpl 2 + Write state_citizen_address_flow1 ERROR 2 + Y + N + N + + + citizen_address_flow2.hpl 2 + Write state_citizen_address_flow2 SUCCESS 2 + Y + Y + N + + + citizen_address_flow2.hpl 2 + Write state_citizen_address_flow2 ERROR 2 + Y + N + N + + + citizen_address_flow3.hpl 2 + Write state_citizen_address_flow3 SUCCESS 2 + Y + Y + N + + + citizen_address_flow3.hpl 2 + Write state_citizen_address_flow3 ERROR 2 + Y + N + N + + + citizen_address_flow4.hpl 2 + Write state_citizen_address_flow4 SUCCESS 2 + Y + Y + N + + + citizen_address_flow4.hpl 2 + Write state_citizen_address_flow4 ERROR 2 + Y + N + N + + + citizen_address_flow5.hpl 2 + Write state_citizen_address_flow5 SUCCESS 2 + Y + Y + N + + + citizen_address_flow5.hpl 2 + Write state_citizen_address_flow5 ERROR 2 + Y + N + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_address_flow3.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_address_flow2.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_address_flow1.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_address_flow4.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + citizen_address_flow5.hpl 2 + Y + Y + N + + + Write state_citizen_address_flow1 SUCCESS 2 + Success after_error_citizen_address_flow1 + Y + Y + N + + + Write state_citizen_address_flow1 ERROR 2 + error after_error_citizen_address_flow1 + Y + Y + N + + + Write state_citizen_address_flow2 SUCCESS 2 + Success after_error_citizen_address_flow2 + Y + Y + N + + + Write state_citizen_address_flow2 ERROR 2 + error after_error_citizen_address_flow2 + Y + Y + N + + + Write state_citizen_address_flow3 SUCCESS 2 + Success after_error_citizen_address_flow3 + Y + Y + N + + + Write state_citizen_address_flow3 ERROR 2 + error after_error_citizen_address_flow3 + Y + Y + N + + + Write state_citizen_address_flow4 SUCCESS 2 + Success after_error_citizen_address_flow4 + Y + Y + N + + + Write state_citizen_address_flow4 ERROR 2 + error after_error_citizen_address_flow4 + Y + Y + N + + + Write state_citizen_address_flow5 SUCCESS 2 + Success after_error_citizen_address_flow5 + Y + Y + N + + + Write state_citizen_address_flow5 ERROR 2 + error after_error_citizen_address_flow5 + Y + Y + N + + + Simple citizen_address WHERE SUCCESS + job_recruit_last_update_date.hwf + Y + Y + N + + + job_recruit_last_update_date.hwf + delta_citizen_address.hpl + Y + Y + N + + + state_delta_citizen_address_success + Success delta_citizen_address + Y + Y + N + + + state_delta_citizen_address_error + error delta_citizen_address + Y + Y + N + + + delta_citizen_address.hpl + state_delta_citizen_address_success + Y + Y + N + + + delta_citizen_address.hpl + state_delta_citizen_address_error + Y + N + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/job_recruit_last_update_date.hwf b/mappings_new/info_recruits/citizen_tables/citizen_address/job_recruit_last_update_date.hwf new file mode 100644 index 0000000..5744d0e --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/job_recruit_last_update_date.hwf @@ -0,0 +1,124 @@ + + + job_recruit_last_update_date + Y + + + + - + 2025/06/02 14:48:05.666 + - + 2025/06/02 14:48:05.666 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 592 + 352 + + + + recruit_update_date_ervu_dashboard.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_address/recruit_update_date_ervu_dashboard.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 784 + 352 + + + + row_last_recruit_update_date.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/row_last_recruit_update_date.hpl + Basic + + Y + + N + local + N + N + Y + N + 1056 + 352 + + + + Success + + SUCCESS + + N + 1232 + 352 + + + + + + Start + recruit_update_date_ervu_dashboard.hpl + Y + Y + Y + + + recruit_update_date_ervu_dashboard.hpl + row_last_recruit_update_date.hpl + Y + Y + N + + + row_last_recruit_update_date.hpl + Success + Y + Y + N + + + + + + diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow1.hpl similarity index 62% rename from mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow1.hpl index 39782d4..091f23b 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow1.hpl @@ -1,7 +1,7 @@ - citizen_spouse_flow1 + citizen_address_flow1 Y @@ -82,63 +82,62 @@ = recruit_id recruit_id - ervu_dashboard - citizen_spouse
+ citizen_address
recruit_id recruit_id N - kinship_type - kinship_type + factual_address + factual_address Y - full_name - full_name + factual_info_expiry_date + factual_info_expiry_date Y - birth_date - birth_date + factual_info_received_date + factual_info_received_date Y - death_date - death_date + place_stay_address + place_stay_address Y - death_az_number - death_az_number + place_stay_deregistration_date + place_stay_deregistration_date Y - marriage_az_number - marriage_az_number + place_stay_registration_date + place_stay_registration_date Y - marriage_date - marriage_date + place_stay_registration_type + place_stay_registration_type Y - divorce_az_number - divorce_az_number + residence_address + residence_address Y - divorce_date - divorce_date + residence_deregistration_date + residence_deregistration_date Y - information_excluded - information_excluded + residence_registration_date + residence_registration_date Y @@ -190,7 +189,7 @@ Table input TableInput - Y + N 1 @@ -200,53 +199,35 @@ 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(' ', - 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 + SELECT + ri.recruit_id::uuid, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateStart')::date END) AS residence_registration_date, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateEnd')::date END) AS residence_deregistration_date, + + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS place_stay_address, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateStart')::date END) AS place_stay_registration_date, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateEnd')::date END) AS place_stay_deregistration_date, + CASE + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '1' THEN 'В жилом помещении, не являющимся местом жительства физического лица' + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '2' THEN 'В учреждении уголовно-исполнительной системы' + ELSE NULL + END AS place_stay_registration_type, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN addr->>'reg' END) AS factual_address, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateStart')::date END) AS factual_info_received_date, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateEnd')::date END) AS factual_info_expiry_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.addresses) AS addr +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 +GROUP BY ri.recruit_id; Y - 448 + 496 288 diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow2.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow2.hpl new file mode 100644 index 0000000..c55ac74 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow2.hpl @@ -0,0 +1,162 @@ + + + + citizen_address_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_address
+ + recruit_id + recruit_id + N + + + factual_address + factual_address + Y + + + factual_info_expiry_date + factual_info_expiry_date + Y + + + factual_info_received_date + factual_info_received_date + Y + + + place_stay_address + place_stay_address + Y + + + place_stay_deregistration_date + place_stay_deregistration_date + Y + + + place_stay_registration_date + place_stay_registration_date + Y + + + place_stay_registration_type + place_stay_registration_type + Y + + + residence_address + residence_address + Y + + + residence_deregistration_date + residence_deregistration_date + Y + + + residence_registration_date + residence_registration_date + Y + +
+ N + + + 960 + 288 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + ri.recruit_id::uuid, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateStart')::date END) AS residence_registration_date, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateEnd')::date END) AS residence_deregistration_date, + + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS place_stay_address, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateStart')::date END) AS place_stay_registration_date, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateEnd')::date END) AS place_stay_deregistration_date, + CASE + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '1' THEN 'В жилом помещении, не являющимся местом жительства физического лица' + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '2' THEN 'В учреждении уголовно-исполнительной системы' + ELSE NULL + END AS place_stay_registration_type, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN addr->>'reg' END) AS factual_address, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateStart')::date END) AS factual_info_received_date, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateEnd')::date END) AS factual_info_expiry_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.addresses) AS addr +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 +GROUP BY ri.recruit_id; + Y + + + 560 + 288 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow3.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow3.hpl new file mode 100644 index 0000000..8bba0a1 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow3.hpl @@ -0,0 +1,162 @@ + + + + citizen_address_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_address
+ + recruit_id + recruit_id + N + + + factual_address + factual_address + Y + + + factual_info_expiry_date + factual_info_expiry_date + Y + + + factual_info_received_date + factual_info_received_date + Y + + + place_stay_address + place_stay_address + Y + + + place_stay_deregistration_date + place_stay_deregistration_date + Y + + + place_stay_registration_date + place_stay_registration_date + Y + + + place_stay_registration_type + place_stay_registration_type + Y + + + residence_address + residence_address + Y + + + residence_deregistration_date + residence_deregistration_date + Y + + + residence_registration_date + residence_registration_date + Y + +
+ N + + + 1104 + 368 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + ri.recruit_id::uuid, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateStart')::date END) AS residence_registration_date, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateEnd')::date END) AS residence_deregistration_date, + + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS place_stay_address, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateStart')::date END) AS place_stay_registration_date, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateEnd')::date END) AS place_stay_deregistration_date, + CASE + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '1' THEN 'В жилом помещении, не являющимся местом жительства физического лица' + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '2' THEN 'В учреждении уголовно-исполнительной системы' + ELSE NULL + END AS place_stay_registration_type, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN addr->>'reg' END) AS factual_address, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateStart')::date END) AS factual_info_received_date, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateEnd')::date END) AS factual_info_expiry_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.addresses) AS addr +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 +GROUP BY ri.recruit_id; + Y + + + 672 + 352 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow4.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow4.hpl new file mode 100644 index 0000000..ff3d081 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow4.hpl @@ -0,0 +1,162 @@ + + + + citizen_address_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_address
+ + recruit_id + recruit_id + N + + + factual_address + factual_address + Y + + + factual_info_expiry_date + factual_info_expiry_date + Y + + + factual_info_received_date + factual_info_received_date + Y + + + place_stay_address + place_stay_address + Y + + + place_stay_deregistration_date + place_stay_deregistration_date + Y + + + place_stay_registration_date + place_stay_registration_date + Y + + + place_stay_registration_type + place_stay_registration_type + Y + + + residence_address + residence_address + Y + + + residence_deregistration_date + residence_deregistration_date + Y + + + residence_registration_date + residence_registration_date + Y + +
+ N + + + 992 + 320 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + ri.recruit_id::uuid, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateStart')::date END) AS residence_registration_date, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateEnd')::date END) AS residence_deregistration_date, + + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS place_stay_address, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateStart')::date END) AS place_stay_registration_date, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateEnd')::date END) AS place_stay_deregistration_date, + CASE + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '1' THEN 'В жилом помещении, не являющимся местом жительства физического лица' + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '2' THEN 'В учреждении уголовно-исполнительной системы' + ELSE NULL + END AS place_stay_registration_type, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN addr->>'reg' END) AS factual_address, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateStart')::date END) AS factual_info_received_date, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateEnd')::date END) AS factual_info_expiry_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.addresses) AS addr +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 +GROUP BY ri.recruit_id; + Y + + + 528 + 320 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow5.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow5.hpl new file mode 100644 index 0000000..970612b --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/parallel/citizen_address_flow5.hpl @@ -0,0 +1,162 @@ + + + + citizen_address_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_address
+ + recruit_id + recruit_id + N + + + factual_address + factual_address + Y + + + factual_info_expiry_date + factual_info_expiry_date + Y + + + factual_info_received_date + factual_info_received_date + Y + + + place_stay_address + place_stay_address + Y + + + place_stay_deregistration_date + place_stay_deregistration_date + Y + + + place_stay_registration_date + place_stay_registration_date + Y + + + place_stay_registration_type + place_stay_registration_type + Y + + + residence_address + residence_address + Y + + + residence_deregistration_date + residence_deregistration_date + Y + + + residence_registration_date + residence_registration_date + Y + +
+ N + + + 1024 + 368 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + ri.recruit_id::uuid, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateStart')::date END) AS residence_registration_date, + MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN (addr->>'regDateEnd')::date END) AS residence_deregistration_date, + + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'reg' END) AS place_stay_address, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateStart')::date END) AS place_stay_registration_date, + MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN (addr->>'regDateEnd')::date END) AS place_stay_deregistration_date, + CASE + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '1' THEN 'В жилом помещении, не являющимся местом жительства физического лица' + WHEN MAX(CASE WHEN addr->>'type' = 'residenceAddress' THEN addr->>'kodTipReg' END) = '2' THEN 'В учреждении уголовно-исполнительной системы' + ELSE NULL + END AS place_stay_registration_type, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN addr->>'reg' END) AS factual_address, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateStart')::date END) AS factual_info_received_date, + MAX(CASE WHEN addr->>'type' = 'residentialAddress' THEN (addr->>'regDateEnd')::date END) AS factual_info_expiry_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.addresses) AS addr +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 +GROUP BY ri.recruit_id; + Y + + + 560 + 368 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/recruit_update_date_ervu_dashboard.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_address/recruit_update_date_ervu_dashboard.hpl index a420549..6f63f21 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_error.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/recruit_update_date_ervu_dashboard.hpl @@ -1,7 +1,7 @@ - change_status_delta_child_flow2_error + recruit_update_date_ervu_dashboard Y @@ -13,63 +13,19 @@ 1000 100 - - 2025/06/16 12:20:06.191 + 2025/06/02 14:50:31.833 - - 2025/06/16 12:20:06.191 + 2025/06/02 14:50:31.833 Table input - Insert / update + Table output 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 @@ -84,14 +40,55 @@ ervu-dashboard N 0 - SELECT - 'delta_child_flow2' as job_name, - 'ERROR' as status, - current_timestamp as record_created + SELECT + created_at AS system_create_date, + updated_at AS system_update_date, + current_timestamp AS record_created, + 'job_recruits_info' AS workflow +FROM ervu_dashboard.recruits_info +WHERE updated_at = (SELECT MAX(updated_at) FROM ervu_dashboard.recruits_info) +limit 1 N - 784 + 896 + 304 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + N + N + N + N + + Y + + N + public + N + recruit_create
+ + N + Y + N + Y + + + 1216 304
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/recruitment_rows_five_flow_if_error.hpl similarity index 99% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_address/recruitment_rows_five_flow_if_error.hpl index e5f247b..e2b0a5a 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/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_address ca on ca.recruit_id = cit.recruit_id ), flow_data AS ( diff --git a/mappings/info_recruits/citizen_tables/child/branching_child.hpl b/mappings_new/info_recruits/citizen_tables/citizen_address/row_last_recruit_update_date.hpl similarity index 60% rename from mappings/info_recruits/citizen_tables/child/branching_child.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_address/row_last_recruit_update_date.hpl index d25a7a0..5597125 100644 --- a/mappings/info_recruits/citizen_tables/child/branching_child.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_address/row_last_recruit_update_date.hpl @@ -1,7 +1,7 @@ - branching_child + row_last_recruit_update_date Y @@ -13,26 +13,43 @@ 1000 100 - - 2025/06/09 09:54:43.724 + 2025/06/02 14:51:59.611 - - 2025/06/09 09:54:43.724 + 2025/06/02 14:51:59.611 - Set variables 2 - Write to log 2 - N + Copy rows to result + Set variables + Y Table input - Set variables 2 + Copy rows to result Y - Set variables 2 + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 992 + 320 + + + + Set variables SetVariable Y @@ -44,21 +61,17 @@
- pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW + + MAX_RECRUIT_UPDATE_DATE + M_R_UP_DATE + GP_WORKFLOW Y - 1056 - 256 + 1232 + 320 @@ -75,47 +88,19 @@ ervu-dashboard N 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_child' + SELECT + system_update_date AS MAX_RECRUIT_UPDATE_DATE--, +--record_created +FROM public.recruit_create +WHERE system_update_date = (select max(system_update_date) from public.recruit_create) +and workflow = 'job_recruits_info' +order by record_created desc +limit 1 N - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 + 688 + 320 diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl similarity index 55% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl index 06f8364..dae18eb 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/branching_citizen_guardianship.hpl @@ -21,18 +21,93 @@ - Set variables 2 - Write to log 2 - N + JSON input state_job_citizen_guardianship.json + Set variables + Y - Table input - Set variables 2 - Y + Set variables + Write to log + N - Set variables 2 + JSON input state_job_citizen_guardianship.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 816 + 448 + + + + Set variables SetVariable Y @@ -57,38 +132,12 @@ Y - 1040 - 416 + 1072 + 448 - 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 + Write to log WriteToLog Y @@ -98,7 +147,12 @@ where job_name = 'job_citizen_guardianship' none + Basic Y + N + 0 + ${PIPE} +${STATUS} pipeline @@ -107,15 +161,10 @@ where job_name = 'job_citizen_guardianship' status - N - 0 - Basic - ${PIPE} -${STATUS} - 1264 - 416 + 1296 + 448 diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl similarity index 98% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl index a1db818..cb265cc 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl @@ -112,7 +112,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 ( SELECT @@ -252,11 +252,14 @@ select * from for_checkpoints N N N + Y + N public N etl_checkpoints
+ N Y N diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl similarity index 79% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl index 0413a04..4805ac7 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl @@ -23,61 +23,31 @@ Filter rows Abort - N + Y - JSON input state_child_flow1.json + JSON input state_citizen_guardianship_flow1.json Filter rows - N + Y - JSON input state_child_flow2.json + JSON input state_citizen_guardianship_flow2.json Filter rows - N + Y - JSON input state_child_flow3.json + JSON input state_citizen_guardianship_flow3.json Filter rows - N + Y - JSON input state_child_flow4.json + JSON input state_citizen_guardianship_flow4.json Filter rows - N + Y - JSON input state_child_flow5.json + JSON input state_citizen_guardianship_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 @@ -127,9 +97,10 @@ N -1 + constant -1 - child_flow1 + citizen_guardianship_flow1 String @@ -175,9 +146,10 @@ N -1 + constant -1 - child_flow2 + citizen_guardianship_flow2 String @@ -223,9 +195,10 @@ N -1 + constant -1 - child_flow3 + citizen_guardianship_flow3 String @@ -271,9 +244,10 @@ N -1 + constant -1 - child_flow4 + citizen_guardianship_flow4 String @@ -319,9 +293,10 @@ N -1 + constant -1 - child_flow5 + citizen_guardianship_flow5 String @@ -378,7 +353,7 @@ - JSON input state_child_flow1.json + JSON input state_citizen_guardianship_flow1.json JsonInput Y @@ -400,7 +375,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json N @@ -453,7 +428,7 @@ - JSON input state_child_flow2.json + JSON input state_citizen_guardianship_flow2.json JsonInput Y @@ -475,7 +450,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json N @@ -528,7 +503,7 @@ - JSON input state_child_flow3.json + JSON input state_citizen_guardianship_flow3.json JsonInput Y @@ -550,7 +525,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json N @@ -603,7 +578,7 @@ - JSON input state_child_flow4.json + JSON input state_citizen_guardianship_flow4.json JsonInput Y @@ -625,7 +600,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json N @@ -678,7 +653,7 @@ - JSON input state_child_flow5.json + JSON input state_citizen_guardianship_flow5.json JsonInput Y @@ -700,7 +675,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json N @@ -752,117 +727,6 @@ 752 - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 336 - 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 - - - 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/child/checkpoints/job_create_files_child.hwf b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf similarity index 70% rename from mappings/info_recruits/citizen_tables/child/checkpoints/job_create_files_child.hwf rename to mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf index b31ca9f..dea1e91 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/job_create_files_child.hwf +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/job_create_files_citizen_guardianship.hwf @@ -1,6 +1,6 @@ - job_create_files_child + job_create_files_citizen_guardianship Y @@ -31,90 +31,90 @@
- state_child_flow2_new + state_citizen_guardianship_flow2_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow2" + "pipeline": "citizen_guardianship_flow2" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json N 848 416 - state_child_flow1_new + state_citizen_guardianship_flow1_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow1" + "pipeline": "citizen_guardianship_flow1" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json N 848 336 - state_child_flow3_new + state_citizen_guardianship_flow3_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow3" + "pipeline": "citizen_guardianship_flow3" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json N 848 496 - state_child_flow4_new + state_citizen_guardianship_flow4_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow4" + "pipeline": "citizen_guardianship_flow4" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json N 848 576 - state_child_flow5_new + state_citizen_guardianship_flow5_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow5" + "pipeline": "citizen_guardianship_flow5" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json N 848 656 @@ -131,12 +131,12 @@ - Delete file state_job_child + Delete file state_job_citizen_guardianship DELETE_FILE N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json N 848 256 @@ -146,69 +146,69 @@ Start - state_child_flow3_new + state_citizen_guardianship_flow3_new Y Y Y Start - state_child_flow2_new + state_citizen_guardianship_flow2_new Y Y Y Start - state_child_flow1_new + state_citizen_guardianship_flow1_new Y Y Y Start - state_child_flow4_new + state_citizen_guardianship_flow4_new Y Y Y Start - state_child_flow5_new + state_citizen_guardianship_flow5_new Y Y Y - state_child_flow5_new + state_citizen_guardianship_flow5_new Success Y Y N - state_child_flow4_new + state_citizen_guardianship_flow4_new Success Y Y N - state_child_flow3_new + state_citizen_guardianship_flow3_new Success Y Y N - state_child_flow2_new + state_citizen_guardianship_flow2_new Success Y Y N - state_child_flow1_new + state_citizen_guardianship_flow1_new Success Y Y @@ -216,13 +216,13 @@ Start - Delete file state_job_child + Delete file state_job_citizen_guardianship Y Y Y - Delete file state_job_child + Delete file state_job_citizen_guardianship Success Y Y diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json new file mode 100644 index 0000000..902aa7c --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json @@ -0,0 +1,6 @@ +{ + "status": "SUCCESS", + "pipeline": "delta_citizen_guardianship", + "max_create_date": "3001-01-01 00:00:00", + "max_update_date": "2025/04/09 00:25:46.935442000" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json new file mode 100644 index 0000000..92c9271 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow1" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json new file mode 100644 index 0000000..c23c438 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow2" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json new file mode 100644 index 0000000..d1a6c97 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow3" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json new file mode 100644 index 0000000..1d934c4 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow4" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json new file mode 100644 index 0000000..fb2c0f4 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow5" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl new file mode 100644 index 0000000..b3c9385 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl @@ -0,0 +1,343 @@ + + + + delta_citizen_guardianship + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 16:10:48.509 + - + 2025/06/03 16:10:48.509 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + Add constants + Update + Y + + + Group by + Add constants + Y + + + Table input + Group by + Y + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 960 + 208 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + first_name + + + full_name + + + snils + + + last_name + + + middle_name + + + guardianship_external_id + + + guardian_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_guardianship ( + recruit_id, + birth_date, + first_name, + full_name, + snils, + last_name, + middle_name, + guardianship_external_id, + guardian_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, guardianship_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + snils = EXCLUDED.snils, + last_name = EXCLUDED.last_name, + middle_name = EXCLUDED.middle_name, + guardian_id_ern = EXCLUDED.guardian_id_ern; + + + 752 + 224 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 848 + 256 + + + + 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 + + + 1168 + 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 + --'${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 + + + 624 + 352 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 1056 + 160 + +
+ + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf similarity index 57% rename from mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf rename to mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf index 3e49ea5..94e6505 100644 --- a/mappings/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_citizen_guardianship.hwf @@ -5,23 +5,12 @@ - 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 @@ -37,10 +26,52 @@ 0 1 N - 416 + 624 400 + + Checks if files exist state_job_citizen_guardianship.json + + FILES_EXIST + + + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + + + N + 848 + 400 + + + + checkpoint_job_citizen_guardianship.hpl (2) + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_job_citizen_guardianship.hpl + Basic + + Y + + N + local + N + N + Y + N + 1136 + 1280 + + recruitment_rows_five_flow_citizen_guardianship.hpl @@ -53,6 +84,8 @@ N N ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl + + Basic Y @@ -63,7 +96,7 @@ N Y Y - 2384 + 1488 400 @@ -93,7 +126,7 @@ N Y N - 2704 + 1808 80
@@ -123,7 +156,7 @@ N Y N - 2704 + 1808 240 @@ -153,7 +186,7 @@ N Y N - 2704 + 1808 400 @@ -183,7 +216,7 @@ N Y N - 2704 + 1808 560 @@ -213,10 +246,180 @@ N Y N - 2704 + 1808 720 + + Write state_citizen_guardianship_flow1 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json + N + 2096 + 80 + + + + Write state_citizen_guardianship_flow1 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json + N + 2096 + 160 + + + + Write state_citizen_guardianship_flow2 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json + N + 2096 + 240 + + + + Write state_citizen_guardianship_flow2 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json + N + 2096 + 320 + + + + Write state_citizen_guardianship_flow3 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json + N + 2096 + 400 + + + + Write state_citizen_guardianship_flow3 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json + N + 2096 + 480 + + + + Write state_citizen_guardianship_flow4 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json + N + 2096 + 560 + + + + Write state_citizen_guardianship_flow4 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json + N + 2096 + 640 + + + + Write state_citizen_guardianship_flow5 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json + N + 2096 + 720 + + + + Write state_citizen_guardianship_flow5 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json + N + 2096 + 800 + + Abort workflow @@ -224,7 +427,7 @@ N N - 2368 + 1472 208 @@ -250,8 +453,8 @@ N Y N - 3424 - 416 + 2496 + 384 @@ -260,8 +463,80 @@ SUCCESS N - 3872 - 416 + 3024 + 384 + + + + state_job_citizen_guardianship_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_guardianship" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + N + 2784 + 384 + + + + state_job_citizen_guardianship_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_guardianship" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + N + 2784 + 480 + + + + state_job_citizen_guardianship_success 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_guardianship" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + N + 1360 + 1280 + + + + state_job_citizen_guardianship_error 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_guardianship" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_job_citizen_guardianship.json + N + 1360 + 1376 @@ -291,7 +566,7 @@ - Simple child WHERE SUCCESS + Simple citizen_guardianship WHERE SUCCESS SIMPLE_EVAL @@ -304,12 +579,12 @@ variable STATUS N - 1888 + 2240 1792 - Simple child WHERE ERROR + Simple citizen_guardianship WHERE ERROR SIMPLE_EVAL @@ -326,6 +601,32 @@ 1280 + + checkpoint_citizen_guardianship_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/checkpoint_citizen_guardianship_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2064 + 1280 + + recruitment_rows_five_flow_if_error.hpl @@ -337,7 +638,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 @@ -363,412 +664,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 - - 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_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 - - 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 - 3024 - 80 - - - - 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 - 3024 - 160 - - - - 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 - 3024 - 240 - - - - 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 - 3024 - 320 - - - - 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 - 3024 - 400 - - - - 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 - 3024 - 480 - - - - 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 - 3024 - 560 - - - - 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 - 3024 - 640 - - - - 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 - 3024 - 720 - - - - 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 - 3024 - 800 - - - - 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 @@ -795,7 +690,7 @@ N Y N - 2704 + 2672 960 @@ -825,7 +720,7 @@ N Y N - 2704 + 2672 1120 @@ -855,7 +750,7 @@ N Y N - 2704 + 2672 1280 @@ -885,7 +780,7 @@ N Y N - 2704 + 2672 1440 @@ -915,345 +810,291 @@ N Y N - 2704 + 2672 1600 - checkpoint_job_citizen_guardianship.hpl 3 + Write state_citizen_guardianship_flow1 SUCCESS 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json 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 - 3024 + 2960 960 - change_status_citizen_guardianship_flow1_error.hpl 2 + Write state_citizen_guardianship_flow1 ERROR 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow1.json N - 3024 + 2960 1040 - change_status_citizen_guardianship_flow2_success.hpl 2 + Write state_citizen_guardianship_flow2 SUCCESS 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json N - 3024 + 2960 1120 - change_status_citizen_guardianship_flow2_error.hpl 2 + Write state_citizen_guardianship_flow2 ERROR 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow2.json N - 3024 + 2960 1200 - change_status_citizen_guardianship_flow3_success.hpl 2 + Write state_citizen_guardianship_flow3 SUCCESS 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json N - 3024 + 2960 1280 - change_status_citizen_guardianship_flow3_error.hpl 2 + Write state_citizen_guardianship_flow3 ERROR 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow3.json N - 3024 + 2960 1360 - change_status_citizen_guardianship_flow4_success.hpl 2 + Write state_citizen_guardianship_flow4 SUCCESS 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json N - 3024 + 2960 1440 - change_status_citizen_guardianship_flow4_error.hpl 2 + Write state_citizen_guardianship_flow4 ERROR 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow4.json N - 3024 + 2960 1520 - change_status_citizen_guardianship_flow5_success.hpl 2 + Write state_citizen_guardianship_flow5 SUCCESS 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "SUCCESS", + "pipeline": "citizen_guardianship_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json N - 3024 + 2960 1600 - change_status_citizen_guardianship_flow5_error.hpl 2 + Write state_citizen_guardianship_flow5 ERROR 2 - PIPELINE + WRITE_TO_FILE - 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 + { + "status": "ERROR", + "pipeline": "citizen_guardianship_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_flow5.json N - 3024 + 2960 1680 - change_status_to_processing.hpl 2 + Success after_error_citizen_guardianship_flow1 - PIPELINE + SUCCESS - 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 - 2096 + 3216 + 960 + + + + error after_error_citizen_guardianship_flow1 + + SUCCESS + + N + 3216 + 1040 + + + + Success after_error_citizen_guardianship_flow2 + + SUCCESS + + N + 3216 + 1120 + + + + error after_error_citizen_guardianship_flow2 + + SUCCESS + + N + 3216 + 1200 + + + + Success after_error_citizen_guardianship_flow3 + + SUCCESS + + N + 3216 1280 - change_status_to_processing_delta.hpl + error after_error_citizen_guardianship_flow3 - PIPELINE + SUCCESS + + N + 3216 + 1360 + + + + Success after_error_citizen_guardianship_flow4 + + SUCCESS + + N + 3216 + 1440 + + + + error after_error_citizen_guardianship_flow4 + + SUCCESS + + N + 3216 + 1520 + + + + Success after_error_citizen_guardianship_flow5 + + SUCCESS + + N + 3216 + 1600 + + + + error after_error_citizen_guardianship_flow5 + + SUCCESS + + N + 3216 + 1680 + + + + job_recruit_last_update_date.hwf + + WORKFLOW N N - N - N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_to_processing_delta.hpl - Basic + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/job_recruit_last_update_date.hwf + Nothing Y @@ -1263,12 +1104,12 @@ N Y N - 2160 + 2544 1792 - change_status_delta_citizen_guardianship_success.hpl + delta_citizen_guardianship.hpl PIPELINE @@ -1278,9 +1119,13 @@ N N N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_success.hpl + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/delta_citizen_guardianship.hpl Basic + + M_R_UP_DATE + ${M_R_UP_DATE} + Y N @@ -1289,38 +1134,93 @@ N Y N - 3024 + 2768 1792 - change_status_delta_citizen_guardianship_error.hpl + Success delta_citizen_guardianship - PIPELINE + SUCCESS - N - N - N - N - N - N - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/change_status_delta_citizen_guardianship_error.hpl - Basic - - Y - - N - local - N - N - Y N - 3024 + 3216 + 1792 + + + + state_delta_citizen_guardianship_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "delta_citizen_guardianship", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json + N + 2960 + 1792 + + + + state_delta_citizen_guardianship_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "delta_citizen_guardianship", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/checkpoints/state_citizen_guardianship_delta.json + N + 2960 + 1872 + + + + error delta_citizen_guardianship + + SUCCESS + + N + 3216 1872 + + Start + Checks if files exist state_job_citizen_guardianship.json + Y + Y + Y + + + Checks if files exist state_job_citizen_guardianship.json + checkpoint_job_citizen_guardianship.hpl (2) + Y + Y + N + + + Checks if files exist state_job_citizen_guardianship.json + recruitment_rows_five_flow_citizen_guardianship.hpl + Y + N + N + recruitment_rows_five_flow_citizen_guardianship.hpl citizen_guardianship_flow1.hpl @@ -1356,6 +1256,76 @@ Y N + + citizen_guardianship_flow1.hpl + Write state_citizen_guardianship_flow1 SUCCESS + Y + Y + N + + + citizen_guardianship_flow1.hpl + Write state_citizen_guardianship_flow1 ERROR + Y + N + N + + + citizen_guardianship_flow2.hpl + Write state_citizen_guardianship_flow2 SUCCESS + Y + Y + N + + + citizen_guardianship_flow2.hpl + Write state_citizen_guardianship_flow2 ERROR + Y + N + N + + + citizen_guardianship_flow3.hpl + Write state_citizen_guardianship_flow3 SUCCESS + Y + Y + N + + + citizen_guardianship_flow3.hpl + Write state_citizen_guardianship_flow3 ERROR + Y + N + N + + + citizen_guardianship_flow4.hpl + Write state_citizen_guardianship_flow4 SUCCESS + Y + Y + N + + + citizen_guardianship_flow4.hpl + Write state_citizen_guardianship_flow4 ERROR + Y + N + N + + + citizen_guardianship_flow5.hpl + Write state_citizen_guardianship_flow5 SUCCESS + Y + Y + N + + + citizen_guardianship_flow5.hpl + Write state_citizen_guardianship_flow5 ERROR + Y + N + N + recruitment_rows_five_flow_citizen_guardianship.hpl Abort workflow @@ -1364,12 +1334,159 @@ N - branching_citizen_guardianship.hpl - Simple child WHERE SUCCESS + Write state_citizen_guardianship_flow1 SUCCESS + checkpoint_job_citizen_guardianship.hpl Y N Y + + Write state_citizen_guardianship_flow1 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow2 SUCCESS + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow2 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow3 SUCCESS + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow3 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow4 SUCCESS + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow4 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow5 SUCCESS + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + Write state_citizen_guardianship_flow5 ERROR + checkpoint_job_citizen_guardianship.hpl + Y + N + Y + + + state_job_citizen_guardianship_success + Success new citizen + Y + Y + N + + + state_job_citizen_guardianship_error + Success new citizen + Y + Y + N + + + checkpoint_job_citizen_guardianship.hpl + state_job_citizen_guardianship_success + Y + Y + N + + + checkpoint_job_citizen_guardianship.hpl + state_job_citizen_guardianship_error + Y + N + N + + + checkpoint_job_citizen_guardianship.hpl (2) + state_job_citizen_guardianship_success 2 + Y + Y + N + + + checkpoint_job_citizen_guardianship.hpl (2) + state_job_citizen_guardianship_error 2 + Y + N + N + + + state_job_citizen_guardianship_success 2 + branching_citizen_guardianship.hpl + Y + Y + N + + + state_job_citizen_guardianship_error 2 + branching_citizen_guardianship.hpl + Y + Y + N + + + Simple citizen_guardianship WHERE ERROR + checkpoint_citizen_guardianship_error.hpl + Y + N + Y + + + branching_citizen_guardianship.hpl + Simple citizen_guardianship WHERE ERROR + Y + N + N + + + branching_citizen_guardianship.hpl + Simple citizen_guardianship WHERE SUCCESS + Y + Y + N + + + checkpoint_citizen_guardianship_error.hpl + recruitment_rows_five_flow_if_error.hpl + Y + Y + N + recruitment_rows_five_flow_if_error.hpl Abort workflow 2 @@ -1378,334 +1495,75 @@ N - check_if_job_citizen_guardianship_exists.hpl - Simple job_citizen_guardianship_exists check NEW - Y - 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 - 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 + citizen_guardianship_flow1.hpl 2 + Write state_citizen_guardianship_flow1 SUCCESS 2 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 + Write state_citizen_guardianship_flow1 ERROR 2 Y N N citizen_guardianship_flow2.hpl 2 - change_status_citizen_guardianship_flow2_success.hpl 2 + Write state_citizen_guardianship_flow2 SUCCESS 2 Y Y N citizen_guardianship_flow2.hpl 2 - change_status_citizen_guardianship_flow2_error.hpl 2 + Write state_citizen_guardianship_flow2 ERROR 2 Y N N citizen_guardianship_flow3.hpl 2 - change_status_citizen_guardianship_flow3_success.hpl 2 + Write state_citizen_guardianship_flow3 SUCCESS 2 Y Y N citizen_guardianship_flow3.hpl 2 - change_status_citizen_guardianship_flow3_error.hpl 2 + Write state_citizen_guardianship_flow3 ERROR 2 Y N N citizen_guardianship_flow4.hpl 2 - change_status_citizen_guardianship_flow4_success.hpl 2 + Write state_citizen_guardianship_flow4 SUCCESS 2 Y Y N citizen_guardianship_flow4.hpl 2 - change_status_citizen_guardianship_flow4_error.hpl 2 + Write state_citizen_guardianship_flow4 ERROR 2 Y N N citizen_guardianship_flow5.hpl 2 - change_status_citizen_guardianship_flow5_success.hpl 2 + Write state_citizen_guardianship_flow5 SUCCESS 2 Y Y N citizen_guardianship_flow5.hpl 2 - change_status_citizen_guardianship_flow5_error.hpl 2 + Write state_citizen_guardianship_flow5 ERROR 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 @@ -1742,64 +1600,113 @@ N - change_status_to_processing.hpl 2 - recruitment_rows_five_flow_if_error.hpl + Write state_citizen_guardianship_flow1 SUCCESS 2 + Success after_error_citizen_guardianship_flow1 Y Y N - Simple child WHERE ERROR - change_status_to_processing.hpl 2 + Write state_citizen_guardianship_flow1 ERROR 2 + error after_error_citizen_guardianship_flow1 Y Y N - branching_citizen_guardianship.hpl - Simple child WHERE ERROR - Y - N - Y - - - Simple child WHERE SUCCESS - change_status_to_processing_delta.hpl + Write state_citizen_guardianship_flow2 SUCCESS 2 + Success after_error_citizen_guardianship_flow2 Y Y N - delta_citizen_guardianship.hpl - change_status_delta_citizen_guardianship_success.hpl + Write state_citizen_guardianship_flow2 ERROR 2 + error after_error_citizen_guardianship_flow2 Y Y N - change_status_delta_citizen_guardianship_success.hpl - Success delta_citizen + Write state_citizen_guardianship_flow3 SUCCESS 2 + Success after_error_citizen_guardianship_flow3 Y Y N - change_status_delta_citizen_guardianship_error.hpl - error delta_citizen + Write state_citizen_guardianship_flow3 ERROR 2 + error after_error_citizen_guardianship_flow3 Y Y N - change_status_to_processing_delta.hpl + Write state_citizen_guardianship_flow4 SUCCESS 2 + Success after_error_citizen_guardianship_flow4 + Y + Y + N + + + Write state_citizen_guardianship_flow4 ERROR 2 + error after_error_citizen_guardianship_flow4 + Y + Y + N + + + Write state_citizen_guardianship_flow5 SUCCESS 2 + Success after_error_citizen_guardianship_flow5 + Y + Y + N + + + Write state_citizen_guardianship_flow5 ERROR 2 + error after_error_citizen_guardianship_flow5 + Y + Y + N + + + Simple citizen_guardianship WHERE SUCCESS + job_recruit_last_update_date.hwf + Y + Y + N + + + job_recruit_last_update_date.hwf delta_citizen_guardianship.hpl Y Y N + + state_delta_citizen_guardianship_success + Success delta_citizen_guardianship + Y + Y + N + + + state_delta_citizen_guardianship_error + error delta_citizen_guardianship + Y + Y + N + delta_citizen_guardianship.hpl - change_status_delta_citizen_guardianship_error.hpl + state_delta_citizen_guardianship_success + Y + Y + N + + + delta_citizen_guardianship.hpl + state_delta_citizen_guardianship_error Y N N diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_recruit_last_update_date.hwf b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_recruit_last_update_date.hwf new file mode 100644 index 0000000..e2dc7c9 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/job_recruit_last_update_date.hwf @@ -0,0 +1,124 @@ + + + job_recruit_last_update_date + Y + + + + - + 2025/06/02 14:48:05.666 + - + 2025/06/02 14:48:05.666 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 592 + 352 + + + + recruit_update_date_ervu_dashboard.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 784 + 352 + + + + row_last_recruit_update_date.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/row_last_recruit_update_date.hpl + Basic + + Y + + N + local + N + N + Y + N + 1056 + 352 + + + + Success + + SUCCESS + + N + 1232 + 352 + + + + + + Start + recruit_update_date_ervu_dashboard.hpl + Y + Y + Y + + + recruit_update_date_ervu_dashboard.hpl + row_last_recruit_update_date.hpl + Y + Y + N + + + row_last_recruit_update_date.hpl + Success + Y + Y + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl new file mode 100644 index 0000000..f41ddc7 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow1.hpl @@ -0,0 +1,429 @@ + + + + citizen_guardianship_flow1 + Y + + + + Normal + 0 + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Select values 4 2 + N + + + Select values 4 2 + Get variables + N + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + Table input + Group by + Y + + + Add constants + Update + Y + + + Group by + Add constants + Y + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 752 + 160 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + first_name + + + full_name + + + snils + + + last_name + + + middle_name + + + guardianship_external_id + + + guardian_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_guardianship ( + recruit_id, + birth_date, + first_name, + full_name, + snils, + last_name, + middle_name, + guardianship_external_id, + guardian_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, guardianship_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + snils = EXCLUDED.snils, + last_name = EXCLUDED.last_name, + middle_name = EXCLUDED.middle_name, + guardian_id_ern = EXCLUDED.guardian_id_ern; + + + 448 + 48 + + + + Get variables + GetVariable + + Y + + 1 + + none + + + + + -1 + recruitment_id + -1 + none + String + ID_F1 + + + + + 976 + 400 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 640 + 208 + + + + 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 + + + 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 + + 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}' + 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 + 112 + +
+ + + Select values 4 2 + Get variables + Y + + + + + + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl new file mode 100644 index 0000000..f1e3d1c --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow2.hpl @@ -0,0 +1,342 @@ + + + + citizen_guardianship_flow2 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + Add constants + Update + Y + + + Group by + Add constants + Y + + + Table input + Group by + Y + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 864 + 160 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + first_name + + + full_name + + + snils + + + last_name + + + middle_name + + + guardianship_external_id + + + guardian_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_guardianship ( + recruit_id, + birth_date, + first_name, + full_name, + snils, + last_name, + middle_name, + guardianship_external_id, + guardian_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, guardianship_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + snils = EXCLUDED.snils, + last_name = EXCLUDED.last_name, + middle_name = EXCLUDED.middle_name, + guardian_id_ern = EXCLUDED.guardian_id_ern; + + + 688 + 144 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 752 + 208 + + + + 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 + + + 1088 + 288 + +
+ + 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_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 + + + 560 + 288 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 960 + 112 + +
+ + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl new file mode 100644 index 0000000..8f99ec3 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow3.hpl @@ -0,0 +1,342 @@ + + + + citizen_guardianship_flow3 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + Add constants + Update + Y + + + Group by + Add constants + Y + + + Table input + Group by + Y + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 992 + 208 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + first_name + + + full_name + + + snils + + + last_name + + + middle_name + + + guardianship_external_id + + + guardian_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_guardianship ( + recruit_id, + birth_date, + first_name, + full_name, + snils, + last_name, + middle_name, + guardianship_external_id, + guardian_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, guardianship_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + snils = EXCLUDED.snils, + last_name = EXCLUDED.last_name, + middle_name = EXCLUDED.middle_name, + guardian_id_ern = EXCLUDED.guardian_id_ern; + + + 784 + 192 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 880 + 256 + + + + 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 + + + 1216 + 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 + '${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 + + + 672 + 352 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 1088 + 160 + +
+ + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl new file mode 100644 index 0000000..11335b4 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow4.hpl @@ -0,0 +1,342 @@ + + + + citizen_guardianship_flow4 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + Add constants + Update + Y + + + Group by + Add constants + Y + + + Table input + Group by + Y + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 832 + 192 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + first_name + + + full_name + + + snils + + + last_name + + + middle_name + + + guardianship_external_id + + + guardian_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_guardianship ( + recruit_id, + birth_date, + first_name, + full_name, + snils, + last_name, + middle_name, + guardianship_external_id, + guardian_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, guardianship_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + snils = EXCLUDED.snils, + last_name = EXCLUDED.last_name, + middle_name = EXCLUDED.middle_name, + guardian_id_ern = EXCLUDED.guardian_id_ern; + + + 640 + 176 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 720 + 240 + + + + 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 + + + 1072 + 320 + +
+ + 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_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 + + + 528 + 320 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 928 + 144 + +
+ + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl new file mode 100644 index 0000000..505f657 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/parallel/citizen_guardianship_flow5.hpl @@ -0,0 +1,342 @@ + + + + citizen_guardianship_flow5 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + Add constants + Update + Y + + + Group by + Add constants + Y + + + Table input + Group by + Y + + + + Add constants + Constant + + Y + + 1 + + none + + + + + -1 + is_guardian + true + -1 + N + Boolean + + + + + 864 + 240 + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + first_name + + + full_name + + + snils + + + last_name + + + middle_name + + + guardianship_external_id + + + guardian_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_guardianship ( + recruit_id, + birth_date, + first_name, + full_name, + snils, + last_name, + middle_name, + guardianship_external_id, + guardian_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, guardianship_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + snils = EXCLUDED.snils, + last_name = EXCLUDED.last_name, + middle_name = EXCLUDED.middle_name, + guardian_id_ern = EXCLUDED.guardian_id_ern; + + + 688 + 240 + + + + Group by + GroupBy + + Y + + 1 + + none + + + N + N + ${java.io.tmpdir} + + + N + + + recruit_id + + + N + grp + + + 752 + 288 + + + + 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 + + + 1040 + 368 + +
+ + 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_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 + + + 560 + 368 + + + + Update + Update + + Y + + 1 + + none + + + 100 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 960 + 192 + +
+ + + +
diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl similarity index 56% rename from mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl index 782c038..6f63f21 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow1_error.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruit_update_date_ervu_dashboard.hpl @@ -1,7 +1,7 @@ - change_status_delta_child_flow1_error + recruit_update_date_ervu_dashboard Y @@ -13,63 +13,19 @@ 1000 100 - - 2025/06/16 12:20:06.191 + 2025/06/02 14:50:31.833 - - 2025/06/16 12:20:06.191 + 2025/06/02 14:50:31.833 Table input - Insert / update + Table output 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 @@ -84,14 +40,55 @@ ervu-dashboard N 0 - SELECT - 'delta_child_flow1' as job_name, - 'ERROR' as status, - current_timestamp as record_created + SELECT + created_at AS system_create_date, + updated_at AS system_update_date, + current_timestamp AS record_created, + 'job_recruits_info' AS workflow +FROM ervu_dashboard.recruits_info +WHERE updated_at = (SELECT MAX(updated_at) FROM ervu_dashboard.recruits_info) +limit 1 N - 784 + 896 + 304 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + N + N + N + N + + Y + + N + public + N + recruit_create
+ + N + Y + N + Y + + + 1216 304
diff --git a/mappings/info_recruits/citizen_tables/prosecution/recruitment_rows_five_flow_if_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl similarity index 98% rename from mappings/info_recruits/citizen_tables/prosecution/recruitment_rows_five_flow_if_error.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_guardianship/recruitment_rows_five_flow_if_error.hpl index 2b2626f..dc89572 100644 --- a/mappings/info_recruits/citizen_tables/prosecution/recruitment_rows_five_flow_if_error.hpl +++ b/mappings_new/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.prosecution ch on ch.recruit_id = cit.recruit_id + join ervu_dashboard.citizen_guardianship cg on cg.recruit_id = cit.recruit_id ), flow_data AS ( diff --git a/mappings/info_recruits/citizen_tables/passport/branching_passport.hpl b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/row_last_recruit_update_date.hpl similarity index 60% rename from mappings/info_recruits/citizen_tables/passport/branching_passport.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_guardianship/row_last_recruit_update_date.hpl index 7828ef8..5597125 100644 --- a/mappings/info_recruits/citizen_tables/passport/branching_passport.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_guardianship/row_last_recruit_update_date.hpl @@ -1,7 +1,7 @@ - branching_passport + row_last_recruit_update_date Y @@ -13,26 +13,43 @@ 1000 100 - - 2025/06/09 09:54:43.724 + 2025/06/02 14:51:59.611 - - 2025/06/09 09:54:43.724 + 2025/06/02 14:51:59.611 - Set variables 2 - Write to log 2 - N + Copy rows to result + Set variables + Y Table input - Set variables 2 + Copy rows to result Y - Set variables 2 + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 992 + 320 + + + + Set variables SetVariable Y @@ -44,21 +61,17 @@ - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW + + MAX_RECRUIT_UPDATE_DATE + M_R_UP_DATE + GP_WORKFLOW Y - 1056 - 256 + 1232 + 320 @@ -75,47 +88,19 @@ ervu-dashboard N 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_passport' + SELECT + system_update_date AS MAX_RECRUIT_UPDATE_DATE--, +--record_created +FROM public.recruit_create +WHERE system_update_date = (select max(system_update_date) from public.recruit_create) +and workflow = 'job_recruits_info' +order by record_created desc +limit 1 N - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 + 688 + 320 diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl similarity index 55% rename from mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl index a4251dd..0987acb 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/branching_citizen_spouse.hpl @@ -21,18 +21,93 @@ - Set variables 2 - Write to log 2 - N + JSON input state_job_citizen_spouse.json + Set variables + Y - Table input - Set variables 2 - Y + Set variables + Write to log + N - Set variables 2 + JSON input state_job_citizen_spouse.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 816 + 448 + + + + Set variables SetVariable Y @@ -44,11 +119,13 @@ + pipeline PIPE PARENT_WORKFLOW + status STATUS PARENT_WORKFLOW @@ -57,38 +134,12 @@ Y - 1056 - 256 + 1072 + 448 - 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 + Write to log WriteToLog Y @@ -98,7 +149,12 @@ where job_name = 'job_citizen_spouse' none + Basic Y + N + 0 + ${PIPE} +${STATUS} pipeline @@ -107,15 +163,10 @@ where job_name = 'job_citizen_spouse' status - N - 0 - Basic - ${PIPE} -${STATUS} - 1280 - 256 + 1296 + 448 diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl new file mode 100644 index 0000000..b1b8e7d --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl @@ -0,0 +1,276 @@ + + + + checkpoint_citizen_spouse_error + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/09 10:01:04.895 + - + 2025/06/09 10:01:04.895 + + + + + + Select values + Table output + N + + + Table input + Select values + N + + + Table input + Table output + Y + + + + Select values + SelectValues + + Y + + 1 + + none + + + + N + + idm_id + idm_id + String + -2 + -2 + + false + + + false + + + + + + + + + + 1008 + 608 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH ordered AS ( + SELECT + idm_id, + created_at, + ROW_NUMBER() OVER (ORDER BY created_at) AS rn, + COUNT(*) OVER () AS total_rows + FROM ervu_dashboard.recruitment +), + splitted AS ( + SELECT *, + CEIL(total_rows / 5.0) AS part_size, + FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num + FROM ordered + ), + flow_ranges AS ( + SELECT + flow_num, + MIN(created_at) AS min_date, + MAX(created_at) AS max_date + FROM splitted + GROUP BY flow_num + ), + recr_inf AS ( + SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id + FROM ervu_dashboard.citizen cit + join ervu_dashboard.citizen_spouse sp ON sp.recruit_id = cit.recruit_id + ), + flow_data AS ( + SELECT + fr.flow_num, + ri.idm_id, + (SELECT r.created_at FROM ervu_dashboard.recruitment r + WHERE r.idm_id = ri.idm_id + AND r.created_at BETWEEN fr.min_date AND fr.max_date + LIMIT 1) AS created_at + FROM recr_inf ri + CROSS JOIN flow_ranges fr + WHERE EXISTS ( + SELECT 1 FROM ervu_dashboard.recruitment r + WHERE r.idm_id = ri.idm_id + ) + ), + result_ma as ( + SELECT + MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1, + (SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1, + + MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2, + (SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2, + + MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3, + (SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3, + + MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4, + (SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4, + + MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5, + (SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5 + FROM flow_data + ), + result_max as ( --костыль + SELECT + CASE + WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp + ELSE cr_flow1 + END AS cr_flow1, + idm_flow1, + CASE + WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp + ELSE cr_flow2 + END AS cr_flow2, + idm_flow2, + CASE + WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp + ELSE cr_flow3 + END AS cr_flow3, + idm_flow3, + CASE + WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp + ELSE cr_flow4 + END AS cr_flow4, + idm_flow4, + CASE + WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp + ELSE cr_flow5 + END AS cr_flow5, + idm_flow5 + FROM result_ma + ), + for_checkpoints as ( + SELECT + 'job_citizen_spouse_flow1' as job_name, + idm_flow1 as last_recruitment_id, + cr_flow1 as recruitment_created_date, + 'ERROR' as status, + current_timestamp as record_created + from result_max + + union all + + SELECT + 'job_citizen_spouse_flow2' as job_name, + idm_flow2 as last_recruitment_id, + cr_flow2 as recruitment_created_date, + 'ERROR' as status, + current_timestamp as record_created + from result_max + + union all + + SELECT + 'job_citizen_spouse_flow3' as job_name, + idm_flow3 as last_recruitment_id, + cr_flow3 as recruitment_created_date, + 'ERROR' as status, + current_timestamp as record_created + from result_max + + union all + + SELECT + 'job_citizen_spouse_flow4' as job_name, + idm_flow4 as last_recruitment_id, + cr_flow4 as recruitment_created_date, + 'ERROR' as status, + current_timestamp as record_created + from result_max + + union all + + SELECT + 'job_citizen_spouse_flow5' as job_name, + idm_flow5 as last_recruitment_id, + cr_flow5 as recruitment_created_date, + 'ERROR' as status, + current_timestamp as record_created + from result_max + ) +select * from for_checkpoints + N + + + 736 + 448 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + N + N + N + N + + Y + + N + public + N + etl_checkpoints
+ + N + Y + N + Y + + + 1248 + 448 + +
+ + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl similarity index 79% rename from mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl index ed32b9f..0b4d1d5 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl @@ -23,62 +23,32 @@ 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 + JSON input state_citizen_spouse_flow1.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow2.json - N + JSON input state_citizen_spouse_flow2.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow3.json - N + JSON input state_citizen_spouse_flow3.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow4.json - N + JSON input state_citizen_spouse_flow4.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow5.json - N + JSON input state_citizen_spouse_flow5.json + Filter rows + Y @@ -101,23 +71,6 @@ 592 - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - Filter rows FilterRows @@ -144,9 +97,10 @@ N -1 + constant -1 - child_flow1 + citizen_spouse_flow1 String @@ -192,9 +146,10 @@ N -1 + constant -1 - child_flow2 + citizen_spouse_flow2 String @@ -240,9 +195,10 @@ N -1 + constant -1 - child_flow3 + citizen_spouse_flow3 String @@ -288,9 +244,10 @@ N -1 + constant -1 - child_flow4 + citizen_spouse_flow4 String @@ -336,9 +293,10 @@ N -1 + constant -1 - child_flow5 + citizen_spouse_flow5 String @@ -395,51 +353,7 @@ - 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 + JSON input state_citizen_spouse_flow1.json JsonInput Y @@ -461,7 +375,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json N @@ -514,7 +428,7 @@ - JSON input state_child_flow2.json + JSON input state_citizen_spouse_flow2.json JsonInput Y @@ -536,7 +450,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json N @@ -589,7 +503,7 @@ - JSON input state_child_flow3.json + JSON input state_citizen_spouse_flow3.json JsonInput Y @@ -611,7 +525,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json N @@ -664,7 +578,7 @@ - JSON input state_child_flow4.json + JSON input state_citizen_spouse_flow4.json JsonInput Y @@ -686,7 +600,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json N @@ -739,7 +653,7 @@ - JSON input state_child_flow5.json + JSON input state_citizen_spouse_flow5.json JsonInput Y @@ -761,7 +675,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json N @@ -813,56 +727,6 @@ 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_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/xxjob_create_files_child.hwf b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/job_create_files_citizen_spouse.hwf similarity index 72% rename from mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/xxjob_create_files_child.hwf rename to mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/job_create_files_citizen_spouse.hwf index b31ca9f..b88bb8f 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/checkpoints/xxjob_create_files_child.hwf +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/job_create_files_citizen_spouse.hwf @@ -1,6 +1,6 @@ - job_create_files_child + job_create_files_citizen_spouse Y @@ -31,90 +31,90 @@ - state_child_flow2_new + state_citizen_spouse_flow2_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow2" + "pipeline": "citizen_spouse_flow2" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json N 848 416 - state_child_flow1_new + state_citizen_spouse_flow1_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow1" + "pipeline": "citizen_spouse_flow1" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json N 848 336 - state_child_flow3_new + state_citizen_spouse_flow3_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow3" + "pipeline": "citizen_spouse_flow3" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json N 848 496 - state_child_flow4_new + state_citizen_spouse_flow4_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow4" + "pipeline": "citizen_spouse_flow4" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json N 848 576 - state_child_flow5_new + state_citizen_spouse_flow5_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow5" + "pipeline": "citizen_spouse_flow5" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json N 848 656 @@ -131,12 +131,12 @@ - Delete file state_job_child + Delete file state_job_citizen_spouse DELETE_FILE N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouset/checkpoints/state_job_citizen_spouse.json N 848 256 @@ -146,69 +146,69 @@ Start - state_child_flow3_new + state_citizen_spouse_flow3_new Y Y Y Start - state_child_flow2_new + state_citizen_spouse_flow2_new Y Y Y Start - state_child_flow1_new + state_citizen_spouse_flow1_new Y Y Y Start - state_child_flow4_new + state_citizen_spouse_flow4_new Y Y Y Start - state_child_flow5_new + state_citizen_spouse_flow5_new Y Y Y - state_child_flow5_new + state_citizen_spouse_flow5_new Success Y Y N - state_child_flow4_new + state_citizen_spouse_flow4_new Success Y Y N - state_child_flow3_new + state_citizen_spouse_flow3_new Success Y Y N - state_child_flow2_new + state_citizen_spouse_flow2_new Success Y Y N - state_child_flow1_new + state_citizen_spouse_flow1_new Success Y Y @@ -216,13 +216,13 @@ Start - Delete file state_job_child + Delete file state_job_citizen_spouse Y Y Y - Delete file state_job_child + Delete file state_job_citizen_spouse Success Y 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 new file mode 100644 index 0000000..8c841ea --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_delta.json @@ -0,0 +1,6 @@ +{ + "status": "SUCCESS", + "pipeline": "delta_citizen_spouse", + "max_create_date": "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 new file mode 100644 index 0000000..2162550 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json @@ -0,0 +1,4 @@ +{ + "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 new file mode 100644 index 0000000..943630e --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json @@ -0,0 +1,4 @@ +{ + "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 new file mode 100644 index 0000000..e7fb9ad --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json @@ -0,0 +1,4 @@ +{ + "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 new file mode 100644 index 0000000..38ad6be --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json @@ -0,0 +1,4 @@ +{ + "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 new file mode 100644 index 0000000..a28f63b --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json @@ -0,0 +1,4 @@ +{ + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow5" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl new file mode 100644 index 0000000..c000182 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/delta_citizen_spouse.hpl @@ -0,0 +1,309 @@ + + + + delta_citizen_spouse + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/06/03 16:10:48.509 + - + 2025/06/03 16:10:48.509 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + death_az_number + + + death_date + + + divorce_az_number + + + first_name + + + full_name + + + information_excluded + + + kinship_type + + + last_name + + + marriage_az_number + + + marriage_date + + + middle_name + + + spouse_external_id + + + spouse_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_spouse ( + recruit_id, + birth_date, + death_az_number, + death_date, + divorce_az_number, + first_name, + full_name, + information_excluded, + kinship_type, + last_name, + marriage_az_number, + marriage_date, + middle_name, + spouse_external_id, + spouse_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, spouse_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + death_az_number = EXCLUDED.death_az_number, + death_date = EXCLUDED.death_date, + divorce_az_number = EXCLUDED.divorce_az_number, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + information_excluded = EXCLUDED.information_excluded, + kinship_type = EXCLUDED.kinship_type, + last_name = EXCLUDED.last_name, + marriage_az_number = EXCLUDED.marriage_az_number, + marriage_date = EXCLUDED.marriage_date, + middle_name = EXCLUDED.middle_name, + spouse_id_ern = EXCLUDED.spouse_id_ern; + + + 816 + 176 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1168 + 352 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf b/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf similarity index 58% rename from mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf rename to mappings_new/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf index c3c8681..15f461a 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_citizen_spouse.hwf @@ -5,23 +5,12 @@ - 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 @@ -37,7 +26,23 @@ 0 1 N - 368 + 624 + 400 + + + + Checks if files exist state_job_citizen_spouse.json + + FILES_EXIST + + + + + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + + + N + 848 400 @@ -89,7 +94,7 @@ N Y Y - 2352 + 1488 400
@@ -105,21 +110,24 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl + + Basic ID_F1 IDM_FLOW1 + Y - Y + N local N N Y N - 2672 + 1808 80 @@ -135,21 +143,24 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl + + Basic ID_F2 IDM_FLOW2 + Y - Y + N local N N Y N - 2672 + 1808 240 @@ -165,21 +176,24 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl + + Basic ID_F3 IDM_FLOW3 + Y - Y + N local N N Y N - 2672 + 1808 400 @@ -195,21 +209,24 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl + + Basic ID_F4 IDM_FLOW4 + Y - Y + N local N N Y N - 2672 + 1808 560 @@ -225,24 +242,197 @@ N Y ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl + + Basic ID_F5 IDM_FLOW5 + Y - Y + N local N N Y N - 2672 + 1808 720 + + Write state_citizen_spouse_flow1 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + N + 2096 + 80 + + + + Write state_citizen_spouse_flow1 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + N + 2096 + 160 + + + + Write state_citizen_spouse_flow2 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + N + 2096 + 240 + + + + Write state_citizen_spouse_flow2 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + N + 2096 + 320 + + + + Write state_citizen_spouse_flow3 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + N + 2096 + 400 + + + + Write state_citizen_spouse_flow3 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + N + 2096 + 480 + + + + Write state_citizen_spouse_flow4 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + N + 2096 + 560 + + + + Write state_citizen_spouse_flow4 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + N + 2096 + 640 + + + + Write state_citizen_spouse_flow5 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + N + 2096 + 720 + + + + Write state_citizen_spouse_flow5 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + N + 2096 + 800 + + Abort workflow @@ -250,18 +440,116 @@ N N - 2336 + 1472 208 - Success new citizen + checkpoint_job_citizen_spouse.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_job_citizen_spouse.hpl + Basic + + Y + + N + local + N + N + Y + N + 2496 + 384 + + + + Success new citizen_spouse SUCCESS N - 3728 - 432 + 3024 + 384 + + + + state_job_citizen_spouse_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_spouse" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + N + 2784 + 384 + + + + state_job_citizen_spouse_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_spouse" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + N + 2784 + 480 + + + + state_job_citizen_spouse_success 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_citizen_spouse" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + N + 1360 + 1280 + + + + state_job_citizen_spouse_error 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_citizen_spouse" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_job_citizen_spouse.json + N + 1360 + 1376 @@ -304,7 +592,7 @@ variable STATUS N - 1840 + 2240 1792 @@ -326,6 +614,32 @@ 1280 + + checkpoint_citizen_spouse_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/checkpoint_citizen_spouse_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2064 + 1280 + + recruitment_rows_five_flow_if_error.hpl @@ -363,6 +677,465 @@ 1040 + + citizen_spouse_flow1.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl + + + Basic + + + ID_F1 + IDM_FLOW1 + + + Y + + N + local + N + N + Y + N + 2672 + 960 + + + + citizen_spouse_flow2.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl + + + Basic + + + ID_F2 + IDM_FLOW2 + + + Y + + N + local + N + N + Y + N + 2672 + 1120 + + + + citizen_spouse_flow3.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl + + + Basic + + + ID_F3 + IDM_FLOW3 + + + Y + + N + local + N + N + Y + N + 2672 + 1280 + + + + citizen_spouse_flow4.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl + + + Basic + + + ID_F4 + IDM_FLOW4 + + + Y + + N + local + N + N + Y + N + 2704 + 1424 + + + + citizen_spouse_flow5.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl + + + Basic + + + ID_F5 + IDM_FLOW5 + + + Y + + N + local + N + N + Y + N + 2672 + 1600 + + + + Write state_citizen_spouse_flow1 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + N + 2960 + 960 + + + + Write state_citizen_spouse_flow1 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow1.json + N + 2960 + 1040 + + + + Write state_citizen_spouse_flow2 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + N + 2960 + 1120 + + + + Write state_citizen_spouse_flow2 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow2.json + N + 2960 + 1200 + + + + Write state_citizen_spouse_flow3 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + N + 2960 + 1280 + + + + Write state_citizen_spouse_flow3 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow3.json + N + 2960 + 1360 + + + + Write state_citizen_spouse_flow4 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + N + 2960 + 1440 + + + + Write state_citizen_spouse_flow4 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow4.json + N + 2960 + 1520 + + + + Write state_citizen_spouse_flow5 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "citizen_spouse_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + N + 2960 + 1600 + + + + Write state_citizen_spouse_flow5 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "citizen_spouse_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_flow5.json + N + 2960 + 1680 + + + + Success after_error_citizen_spouse_flow1 + + SUCCESS + + N + 3216 + 960 + + + + error after_error_citizen_spouse_flow1 + + SUCCESS + + N + 3216 + 1040 + + + + Success after_error_citizen_spouse_flow2 + + SUCCESS + + N + 3216 + 1120 + + + + error after_error_citizen_spouse_flow2 + + SUCCESS + + N + 3216 + 1200 + + + + Success after_error_citizen_spouse_flow3 + + SUCCESS + + N + 3216 + 1280 + + + + error after_error_citizen_spouse_flow3 + + SUCCESS + + N + 3216 + 1360 + + + + Success after_error_citizen_spouse_flow4 + + SUCCESS + + N + 3216 + 1440 + + + + error after_error_citizen_spouse_flow4 + + SUCCESS + + N + 3216 + 1520 + + + + Success after_error_citizen_spouse_flow5 + + SUCCESS + + N + 3216 + 1600 + + + + error after_error_citizen_spouse_flow5 + + SUCCESS + + N + 3216 + 1680 + + + + job_recruit_last_update_date.hwf + + WORKFLOW + + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/job_recruit_last_update_date.hwf + Nothing + + Y + + N + local + N + N + Y + N + 2544 + 1792 + + delta_citizen_spouse.hpl @@ -389,938 +1162,93 @@ N Y N - 2640 + 2768 1792 - Success delta_citizen + Success delta_citizen_spouse SUCCESS N - 3280 + 3216 1792 - error delta_citizen + state_delta_citizen_spouse_success - SUCCESS + WRITE_TO_FILE + N + { + "status": "SUCCESS", + "pipeline": "delta_citizen_spouse", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_delta.json N - 3280 + 2960 + 1792 + + + + state_delta_citizen_spouse_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "delta_citizen_spouse", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/checkpoints/state_citizen_spouse_delta.json + N + 2960 1872 - 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_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 - - 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 - - - - 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 - - PIPELINE - - N - N - N - N - N - Y - ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl - Basic - - - ID_F1 - 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_flow2.hpl - Basic - - - ID_F2 - 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_flow3.hpl - Basic - - - ID_F3 - 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_flow4.hpl - Basic - - - ID_F4 - 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_flow5.hpl - Basic - - - ID_F5 - IDM_FLOW5 - - Y - - Y - local - N - N - Y - N - 2672 - 1600 - - - - Success new citizen 2 + error delta_citizen_spouse 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 + 3216 + 1872 + + Start + Checks if files exist state_job_citizen_spouse.json + Y + Y + Y + + + Checks if files exist state_job_citizen_spouse.json + checkpoint_job_citizen_spouse.hpl (2) + Y + Y + N + + + Checks if files exist state_job_citizen_spouse.json + recruitment_rows_five_flow_citizen_spouse.hpl + Y + N + N + recruitment_rows_five_flow_citizen_spouse.hpl citizen_spouse_flow1.hpl @@ -1356,6 +1284,76 @@ Y N + + citizen_spouse_flow1.hpl + Write state_citizen_spouse_flow1 SUCCESS + Y + Y + N + + + citizen_spouse_flow1.hpl + Write state_citizen_spouse_flow1 ERROR + Y + N + N + + + citizen_spouse_flow2.hpl + Write state_citizen_spouse_flow2 SUCCESS + Y + Y + N + + + citizen_spouse_flow2.hpl + Write state_citizen_spouse_flow2 ERROR + Y + N + N + + + citizen_spouse_flow3.hpl + Write state_citizen_spouse_flow3 SUCCESS + Y + Y + N + + + citizen_spouse_flow3.hpl + Write state_citizen_spouse_flow3 ERROR + Y + N + N + + + citizen_spouse_flow4.hpl + Write state_citizen_spouse_flow4 SUCCESS + Y + Y + N + + + citizen_spouse_flow4.hpl + Write state_citizen_spouse_flow4 ERROR + Y + N + N + + + citizen_spouse_flow5.hpl + Write state_citizen_spouse_flow5 SUCCESS + Y + Y + N + + + citizen_spouse_flow5.hpl + Write state_citizen_spouse_flow5 ERROR + Y + N + N + recruitment_rows_five_flow_citizen_spouse.hpl Abort workflow @@ -1364,18 +1362,158 @@ N - branching_citizen_spouse.hpl - Simple citizen_spouse WHERE ERROR + Write state_citizen_spouse_flow1 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow1 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow2 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow2 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow3 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow3 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow4 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow4 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow5 SUCCESS + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + Write state_citizen_spouse_flow5 ERROR + checkpoint_job_citizen_spouse.hpl + Y + N + Y + + + state_job_citizen_spouse_success + Success new citizen_spouse + Y + Y + N + + + state_job_citizen_spouse_error + Success new citizen_spouse + Y + Y + N + + + checkpoint_job_citizen_spouse.hpl + state_job_citizen_spouse_success + Y + Y + N + + + checkpoint_job_citizen_spouse.hpl + state_job_citizen_spouse_error + Y + N + N + + + checkpoint_job_citizen_spouse.hpl (2) + state_job_citizen_spouse_success 2 + Y + Y + N + + + checkpoint_job_citizen_spouse.hpl (2) + state_job_citizen_spouse_error 2 + Y + N + N + + + state_job_citizen_spouse_success 2 + branching_citizen_spouse.hpl + Y + Y + N + + + state_job_citizen_spouse_error 2 + branching_citizen_spouse.hpl + Y + Y + N + + + Simple citizen_spouse WHERE ERROR + checkpoint_citizen_spouse_error.hpl Y N Y branching_citizen_spouse.hpl - Simple citizen_spouse WHERE SUCCESS + Simple citizen_spouse WHERE ERROR Y N - Y + N + + + branching_citizen_spouse.hpl + Simple citizen_spouse WHERE SUCCESS + Y + Y + N + + + checkpoint_citizen_spouse_error.hpl + recruitment_rows_five_flow_if_error.hpl + Y + Y + N recruitment_rows_five_flow_if_error.hpl @@ -1385,397 +1523,75 @@ 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 - - - 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 - 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 - - - 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 + citizen_spouse_flow1.hpl 2 + Write state_citizen_spouse_flow1 SUCCESS 2 Y Y 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 + Write state_citizen_spouse_flow1 ERROR 2 Y N N citizen_spouse_flow2.hpl 2 - change_status_citizen_spouse_flow2_success.hpl 2 + Write state_citizen_spouse_flow2 SUCCESS 2 Y Y N citizen_spouse_flow2.hpl 2 - change_status_citizen_spouse_flow2_error.hpl 2 + Write state_citizen_spouse_flow2 ERROR 2 Y N N citizen_spouse_flow3.hpl 2 - change_status_citizen_spouse_flow3_success.hpl 2 + Write state_citizen_spouse_flow3 SUCCESS 2 Y Y N citizen_spouse_flow3.hpl 2 - change_status_citizen_spouse_flow3_error.hpl 2 + Write state_citizen_spouse_flow3 ERROR 2 Y N N citizen_spouse_flow4.hpl 2 - change_status_citizen_spouse_flow4_success.hpl 2 + Write state_citizen_spouse_flow4 SUCCESS 2 Y Y N citizen_spouse_flow4.hpl 2 - change_status_citizen_spouse_flow4_error.hpl 2 + Write state_citizen_spouse_flow4 ERROR 2 Y N N citizen_spouse_flow5.hpl 2 - change_status_citizen_spouse_flow5_success.hpl 2 + Write state_citizen_spouse_flow5 SUCCESS 2 Y Y N citizen_spouse_flow5.hpl 2 - change_status_citizen_spouse_flow5_error.hpl 2 + Write state_citizen_spouse_flow5 ERROR 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 @@ -1811,31 +1627,120 @@ Y N + + Write state_citizen_spouse_flow1 SUCCESS 2 + Success after_error_citizen_spouse_flow1 + Y + Y + N + + + Write state_citizen_spouse_flow1 ERROR 2 + error after_error_citizen_spouse_flow1 + Y + Y + N + + + Write state_citizen_spouse_flow2 SUCCESS 2 + Success after_error_citizen_spouse_flow2 + Y + Y + N + + + Write state_citizen_spouse_flow2 ERROR 2 + error after_error_citizen_spouse_flow2 + Y + Y + N + + + Write state_citizen_spouse_flow3 SUCCESS 2 + Success after_error_citizen_spouse_flow3 + Y + Y + N + + + Write state_citizen_spouse_flow3 ERROR 2 + error after_error_citizen_spouse_flow3 + Y + Y + N + + + Write state_citizen_spouse_flow4 SUCCESS 2 + Success after_error_citizen_spouse_flow4 + Y + Y + N + + + Write state_citizen_spouse_flow4 ERROR 2 + error after_error_citizen_spouse_flow4 + Y + Y + N + + + Write state_citizen_spouse_flow5 SUCCESS 2 + Success after_error_citizen_spouse_flow5 + Y + Y + N + + + Write state_citizen_spouse_flow5 ERROR 2 + error after_error_citizen_spouse_flow5 + Y + Y + N + + + Simple citizen_spouse WHERE SUCCESS + job_recruit_last_update_date.hwf + Y + Y + N + + + job_recruit_last_update_date.hwf + delta_citizen_spouse.hpl + Y + Y + N + + + state_delta_citizen_spouse_success + Success delta_citizen_spouse + Y + Y + N + + + state_delta_citizen_spouse_error + error delta_citizen_spouse + Y + Y + N + + + delta_citizen_spouse.hpl + state_delta_citizen_spouse_success + Y + Y + N + + + delta_citizen_spouse.hpl + state_delta_citizen_spouse_error + Y + N + N + - - 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_new/info_recruits/citizen_tables/citizen_spouse/job_recruit_last_update_date.hwf b/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_recruit_last_update_date.hwf new file mode 100644 index 0000000..544c1c7 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/job_recruit_last_update_date.hwf @@ -0,0 +1,124 @@ + + + job_recruit_last_update_date + Y + + + + - + 2025/06/02 14:48:05.666 + - + 2025/06/02 14:48:05.666 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 592 + 352 + + + + recruit_update_date_ervu_dashboard.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/recruit_update_date_ervu_dashboard.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 784 + 352 + + + + row_last_recruit_update_date.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/row_last_recruit_update_date.hpl + Basic + + Y + + N + local + N + N + Y + N + 1056 + 352 + + + + Success + + SUCCESS + + N + 1232 + 352 + + + + + + Start + recruit_update_date_ervu_dashboard.hpl + Y + Y + Y + + + recruit_update_date_ervu_dashboard.hpl + row_last_recruit_update_date.hpl + Y + Y + N + + + row_last_recruit_update_date.hpl + Success + Y + Y + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl new file mode 100644 index 0000000..7de69cd --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl @@ -0,0 +1,395 @@ + + + + citizen_spouse_flow1 + Y + + + + Normal + 0 + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Select values 4 2 + N + + + Select values 4 2 + Get variables + N + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + death_az_number + + + death_date + + + divorce_az_number + + + first_name + + + full_name + + + information_excluded + + + kinship_type + + + last_name + + + marriage_az_number + + + marriage_date + + + middle_name + + + spouse_external_id + + + spouse_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_spouse ( + recruit_id, + birth_date, + death_az_number, + death_date, + divorce_az_number, + first_name, + full_name, + information_excluded, + kinship_type, + last_name, + marriage_az_number, + marriage_date, + middle_name, + spouse_external_id, + spouse_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, spouse_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + death_az_number = EXCLUDED.death_az_number, + death_date = EXCLUDED.death_date, + divorce_az_number = EXCLUDED.divorce_az_number, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + information_excluded = EXCLUDED.information_excluded, + kinship_type = EXCLUDED.kinship_type, + last_name = EXCLUDED.last_name, + marriage_az_number = EXCLUDED.marriage_az_number, + marriage_date = EXCLUDED.marriage_date, + middle_name = EXCLUDED.middle_name, + spouse_id_ern = EXCLUDED.spouse_id_ern; + + + 704 + 144 + + + + Get variables + GetVariable + + Y + + 1 + + none + + + + + -1 + recruitment_id + -1 + none + String + ID_F1 + + + + + 976 + 400 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 944 + 288 + +
+ + Select values 4 2 + SelectValues + + Y + + 1 + + none + + + + N + + ID_F1 + ID_F1 + String + -2 + -2 + + false + + + false + + + + + + + + + + 720 + 400 + + + + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; + Y + + + 448 + 288 + + + + + Select values 4 2 + Get variables + Y + + + + + + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl new file mode 100644 index 0000000..7d8150e --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl @@ -0,0 +1,308 @@ + + + + citizen_spouse_flow2 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + death_az_number + + + death_date + + + divorce_az_number + + + first_name + + + full_name + + + information_excluded + + + kinship_type + + + last_name + + + marriage_az_number + + + marriage_date + + + middle_name + + + spouse_external_id + + + spouse_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_spouse ( + recruit_id, + birth_date, + death_az_number, + death_date, + divorce_az_number, + first_name, + full_name, + information_excluded, + kinship_type, + last_name, + marriage_az_number, + marriage_date, + middle_name, + spouse_external_id, + spouse_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, spouse_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + death_az_number = EXCLUDED.death_az_number, + death_date = EXCLUDED.death_date, + divorce_az_number = EXCLUDED.divorce_az_number, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + information_excluded = EXCLUDED.information_excluded, + kinship_type = EXCLUDED.kinship_type, + last_name = EXCLUDED.last_name, + marriage_az_number = EXCLUDED.marriage_az_number, + marriage_date = EXCLUDED.marriage_date, + middle_name = EXCLUDED.middle_name, + spouse_id_ern = EXCLUDED.spouse_id_ern; + + + 720 + 176 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1088 + 288 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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_F2}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; + Y + + + 560 + 288 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl new file mode 100644 index 0000000..51a6b3d --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl @@ -0,0 +1,308 @@ + + + + citizen_spouse_flow3 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + death_az_number + + + death_date + + + divorce_az_number + + + first_name + + + full_name + + + information_excluded + + + kinship_type + + + last_name + + + marriage_az_number + + + marriage_date + + + middle_name + + + spouse_external_id + + + spouse_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_spouse ( + recruit_id, + birth_date, + death_az_number, + death_date, + divorce_az_number, + first_name, + full_name, + information_excluded, + kinship_type, + last_name, + marriage_az_number, + marriage_date, + middle_name, + spouse_external_id, + spouse_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, spouse_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + death_az_number = EXCLUDED.death_az_number, + death_date = EXCLUDED.death_date, + divorce_az_number = EXCLUDED.divorce_az_number, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + information_excluded = EXCLUDED.information_excluded, + kinship_type = EXCLUDED.kinship_type, + last_name = EXCLUDED.last_name, + marriage_az_number = EXCLUDED.marriage_az_number, + marriage_date = EXCLUDED.marriage_date, + middle_name = EXCLUDED.middle_name, + spouse_id_ern = EXCLUDED.spouse_id_ern; + + + 848 + 208 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1216 + 352 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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_F3}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; + Y + + + 672 + 352 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl new file mode 100644 index 0000000..9e40571 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl @@ -0,0 +1,308 @@ + + + + citizen_spouse_flow4 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + death_az_number + + + death_date + + + divorce_az_number + + + first_name + + + full_name + + + information_excluded + + + kinship_type + + + last_name + + + marriage_az_number + + + marriage_date + + + middle_name + + + spouse_external_id + + + spouse_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_spouse ( + recruit_id, + birth_date, + death_az_number, + death_date, + divorce_az_number, + first_name, + full_name, + information_excluded, + kinship_type, + last_name, + marriage_az_number, + marriage_date, + middle_name, + spouse_external_id, + spouse_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, spouse_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + death_az_number = EXCLUDED.death_az_number, + death_date = EXCLUDED.death_date, + divorce_az_number = EXCLUDED.divorce_az_number, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + information_excluded = EXCLUDED.information_excluded, + kinship_type = EXCLUDED.kinship_type, + last_name = EXCLUDED.last_name, + marriage_az_number = EXCLUDED.marriage_az_number, + marriage_date = EXCLUDED.marriage_date, + middle_name = EXCLUDED.middle_name, + spouse_id_ern = EXCLUDED.spouse_id_ern; + + + 688 + 176 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1072 + 320 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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_F4}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; + Y + + + 528 + 320 + + + + + +
diff --git a/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl new file mode 100644 index 0000000..0f3a748 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl @@ -0,0 +1,308 @@ + + + + citizen_spouse_flow5 + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/05/21 14:05:02.260 + - + 2025/05/21 14:05:02.260 + + + + + + Table input + Insert / update + N + + + Table input + Execute SQL script + Y + + + + Execute SQL script + ExecSql + + Y + + 1 + + none + + + + + recruit_id + + + birth_date + + + death_az_number + + + death_date + + + divorce_az_number + + + first_name + + + full_name + + + information_excluded + + + kinship_type + + + last_name + + + marriage_az_number + + + marriage_date + + + middle_name + + + spouse_external_id + + + spouse_id_ern + + + ervu-dashboard + Y + N + N + Y + N + INSERT INTO ervu_dashboard.citizen_spouse ( + recruit_id, + birth_date, + death_az_number, + death_date, + divorce_az_number, + first_name, + full_name, + information_excluded, + kinship_type, + last_name, + marriage_az_number, + marriage_date, + middle_name, + spouse_external_id, + spouse_id_ern +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, spouse_external_id) +DO UPDATE SET + birth_date = EXCLUDED.birth_date, + death_az_number = EXCLUDED.death_az_number, + death_date = EXCLUDED.death_date, + divorce_az_number = EXCLUDED.divorce_az_number, + first_name = EXCLUDED.first_name, + full_name = EXCLUDED.full_name, + information_excluded = EXCLUDED.information_excluded, + kinship_type = EXCLUDED.kinship_type, + last_name = EXCLUDED.last_name, + marriage_az_number = EXCLUDED.marriage_az_number, + marriage_date = EXCLUDED.marriage_date, + middle_name = EXCLUDED.middle_name, + spouse_id_ern = EXCLUDED.spouse_id_ern; + + + 736 + 192 + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + 100 + ervu-dashboard + + + = + recruit_id + recruit_id + + + = + spouse_external_id + spouse_external_id + + ervu_dashboard + citizen_spouse
+ + recruit_id + recruit_id + N + + + birth_date + birth_date + Y + + + death_az_number + death_az_number + Y + + + death_date + death_date + Y + + + divorce_az_number + divorce_az_number + Y + + + first_name + first_name + Y + + + full_name + full_name + Y + + + information_excluded + information_excluded + Y + + + kinship_type + kinship_type + Y + + + last_name + last_name + Y + + + marriage_az_number + marriage_az_number + Y + + + marriage_date + marriage_date + Y + + + middle_name + middle_name + Y + + + spouse_external_id + spouse_external_id + N + + + spouse_id_ern + spouse_id_ern + Y + +
+ N + + + 1040 + 368 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + 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_F5}' != '' + AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}' + AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date; + Y + + + 560 + 368 + + + + + +
diff --git a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl similarity index 99% rename from mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl index 95a193c..4483bc8 100644 --- a/mappings/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/recruitment_rows_five_flow_if_error.hpl @@ -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_spouse ch on ch.recruit_id = cit.recruit_id + join ervu_dashboard.citizen_spouse sp on sp.recruit_id = cit.recruit_id ), flow_data AS ( diff --git a/mappings/info_recruits/citizen_tables/prosecution/branching_prosecution.hpl b/mappings_new/info_recruits/citizen_tables/citizen_spouse/row_last_recruit_update_date.hpl similarity index 60% rename from mappings/info_recruits/citizen_tables/prosecution/branching_prosecution.hpl rename to mappings_new/info_recruits/citizen_tables/citizen_spouse/row_last_recruit_update_date.hpl index 9d0672e..5597125 100644 --- a/mappings/info_recruits/citizen_tables/prosecution/branching_prosecution.hpl +++ b/mappings_new/info_recruits/citizen_tables/citizen_spouse/row_last_recruit_update_date.hpl @@ -1,7 +1,7 @@ - branching_prosecution + row_last_recruit_update_date Y @@ -13,26 +13,43 @@ 1000 100 - - 2025/06/09 09:54:43.724 + 2025/06/02 14:51:59.611 - - 2025/06/09 09:54:43.724 + 2025/06/02 14:51:59.611 - Set variables 2 - Write to log 2 - N + Copy rows to result + Set variables + Y Table input - Set variables 2 + Copy rows to result Y - Set variables 2 + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 992 + 320 + + + + Set variables SetVariable Y @@ -44,21 +61,17 @@ - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW + + MAX_RECRUIT_UPDATE_DATE + M_R_UP_DATE + GP_WORKFLOW Y - 1056 - 256 + 1232 + 320 @@ -75,47 +88,19 @@ ervu-dashboard N 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_prosecution' + SELECT + system_update_date AS MAX_RECRUIT_UPDATE_DATE--, +--record_created +FROM public.recruit_create +WHERE system_update_date = (select max(system_update_date) from public.recruit_create) +and workflow = 'job_recruits_info' +order by record_created desc +limit 1 N - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 + 688 + 320 diff --git a/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl b/mappings_new/info_recruits/citizen_tables/passport/branching_passport.hpl similarity index 55% rename from mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl rename to mappings_new/info_recruits/citizen_tables/passport/branching_passport.hpl index 382688b..46b95a5 100644 --- a/mappings/info_recruits/citizen_tables/child/branching_child_delta.hpl +++ b/mappings_new/info_recruits/citizen_tables/passport/branching_passport.hpl @@ -1,7 +1,7 @@ - branching_child_delta + branching_passport Y @@ -21,18 +21,93 @@ - Set variables 2 - Write to log 2 - N + JSON input state_job_passport.json + Set variables + Y - Table input - Set variables 2 - Y + Set variables + Write to log + N - Set variables 2 + JSON input state_job_passport.json + JsonInput + + Y + + 1 + + none + + + N + + N + N + N + N + N + Y + Y + Y + + + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + + + N + N + + + + pipeline + $.pipeline + String + + + + + -1 + -1 + none + N + + + status + $.status + String + + + + + -1 + -1 + none + N + + + 0 + N + N + + + + + + + + + + + + 816 + 448 + + + + Set variables SetVariable Y @@ -57,56 +132,12 @@ Y - 1056 - 256 + 1072 + 448 - 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 - - - 816 - 256 - - - - Write to log 2 + Write to log WriteToLog Y @@ -116,7 +147,12 @@ FROM ( none + Basic Y + N + 0 + ${PIPE} +${STATUS} pipeline @@ -125,15 +161,10 @@ FROM ( status - N - 0 - Basic - ${PIPE} -${STATUS} - 1280 - 256 + 1296 + 448 diff --git a/mappings/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl similarity index 79% rename from mappings/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl rename to mappings_new/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl index 4e652f1..b6d0f0a 100644 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl +++ b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl @@ -23,62 +23,32 @@ 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 + JSON input state_passport_flow1.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow2.json - N + JSON input state_passport_flow2.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow3.json - N + JSON input state_passport_flow3.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow4.json - N + JSON input state_passport_flow4.json + Filter rows + Y - Dummy (do nothing) - JSON input state_child_flow5.json - N + JSON input state_passport_flow5.json + Filter rows + Y @@ -101,23 +71,6 @@ 592 - - Dummy (do nothing) - Dummy - - Y - - 1 - - none - - - - - 352 - 592 - - Filter rows FilterRows @@ -146,7 +99,7 @@ -1 constant -1 - child_flow1 + passport_flow1 String @@ -194,7 +147,7 @@ -1 constant -1 - child_flow2 + passport_flow2 String @@ -242,7 +195,7 @@ -1 constant -1 - child_flow3 + passport_flow3 String @@ -290,7 +243,7 @@ -1 constant -1 - child_flow4 + passport_flow4 String @@ -338,7 +291,7 @@ -1 constant -1 - child_flow5 + passport_flow5 String @@ -395,51 +348,7 @@ - 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 + JSON input state_passport_flow1.json JsonInput Y @@ -461,7 +370,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow1.json N @@ -514,7 +423,7 @@ - JSON input state_child_flow2.json + JSON input state_passport_flow2.json JsonInput Y @@ -536,7 +445,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow2.json N @@ -589,7 +498,7 @@ - JSON input state_child_flow3.json + JSON input state_passport_flow3.json JsonInput Y @@ -611,7 +520,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow3.json N @@ -664,7 +573,7 @@ - JSON input state_child_flow4.json + JSON input state_passport_flow4.json JsonInput Y @@ -686,7 +595,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow4.json N @@ -739,7 +648,7 @@ - JSON input state_child_flow5.json + JSON input state_passport_flow5.json JsonInput Y @@ -761,7 +670,7 @@ Y - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow5.json N @@ -813,56 +722,6 @@ 752 - - Table input - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - WITH status_check AS ( - SELECT - bool_or(status = 'ERROR' AND job_name IN ( - 'passport_flow1', - 'passport_flow2', - 'passport_flow3', - 'passport_flow4', - 'passport_flow5' - )) AS has_error, - count(*) FILTER ( - WHERE status = 'SUCCESS' AND job_name IN ( - 'passport_flow1', - 'passport_flow2', - 'passport_flow3', - 'passport_flow4', - 'passport_flow5' - ) - ) = 5 AS all_success - FROM public.etl_checkpoints -) -SELECT - 'job_passport' 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/passport/checkpoints/checkpoint_passport_error.hpl b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/checkpoint_passport_error.hpl similarity index 95% rename from mappings/info_recruits/citizen_tables/passport/checkpoints/checkpoint_passport_error.hpl rename to mappings_new/info_recruits/citizen_tables/passport/checkpoints/checkpoint_passport_error.hpl index afde931..7e0c2b7 100644 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/checkpoint_passport_error.hpl +++ b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/checkpoint_passport_error.hpl @@ -112,7 +112,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.passport ps on ps.recruit_id = cit.recruit_id ), flow_data AS ( SELECT @@ -178,7 +178,7 @@ result_max as ( --костыль ), for_checkpoints as ( SELECT - 'job_child_flow1' as job_name, + 'job_passport_flow1' as job_name, idm_flow1 as last_recruitment_id, cr_flow1 as recruitment_created_date, 'ERROR' as status, @@ -188,7 +188,7 @@ for_checkpoints as ( union all SELECT - 'job_child_flow2' as job_name, + 'job_passport_flow2' as job_name, idm_flow2 as last_recruitment_id, cr_flow2 as recruitment_created_date, 'ERROR' as status, @@ -198,7 +198,7 @@ for_checkpoints as ( union all SELECT - 'job_child_flow3' as job_name, + 'job_passport_flow3' as job_name, idm_flow3 as last_recruitment_id, cr_flow3 as recruitment_created_date, 'ERROR' as status, @@ -208,7 +208,7 @@ for_checkpoints as ( union all SELECT - 'job_child_flow4' as job_name, + 'job_passport_flow4' as job_name, idm_flow4 as last_recruitment_id, cr_flow4 as recruitment_created_date, 'ERROR' as status, @@ -218,7 +218,7 @@ for_checkpoints as ( union all SELECT - 'job_child_flow5' as job_name, + 'job_passport_flow5' as job_name, idm_flow5 as last_recruitment_id, cr_flow5 as recruitment_created_date, 'ERROR' as status, @@ -252,11 +252,14 @@ select * from for_checkpoints N N N + Y + N public N etl_checkpoints
+ N Y N diff --git a/mappings/info_recruits/citizen_tables/passport/checkpoints/xxjob_create_files_child.hwf b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/job_create_files_passport.hwf similarity index 74% rename from mappings/info_recruits/citizen_tables/passport/checkpoints/xxjob_create_files_child.hwf rename to mappings_new/info_recruits/citizen_tables/passport/checkpoints/job_create_files_passport.hwf index b31ca9f..7bdab01 100644 --- a/mappings/info_recruits/citizen_tables/passport/checkpoints/xxjob_create_files_child.hwf +++ b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/job_create_files_passport.hwf @@ -1,6 +1,6 @@ - job_create_files_child + job_create_files_passport Y @@ -31,90 +31,90 @@ - state_child_flow2_new + state_passport_flow2_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow2" + "pipeline": "passport_flow2" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow2.json N 848 416 - state_child_flow1_new + state_passport_flow1_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow1" + "pipeline": "passport_flow1" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow1.json N 848 336 - state_child_flow3_new + state_passport_flow3_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow3" + "pipeline": "passport_flow3" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow3.json N 848 496 - state_child_flow4_new + state_passport_flow4_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow4" + "pipeline": "passport_flow4" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow4.json N 848 576 - state_child_flow5_new + state_passport_flow5_new WRITE_TO_FILE N { "status": "NEW", - "pipeline": "child_flow5" + "pipeline": "passport_flow5" } N UTF-8 - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow5.json N 848 656 @@ -131,12 +131,12 @@ - Delete file state_job_child + Delete file state_job_passport DELETE_FILE N - ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json N 848 256 @@ -146,69 +146,69 @@ Start - state_child_flow3_new + state_passport_flow3_new Y Y Y Start - state_child_flow2_new + state_passport_flow2_new Y Y Y Start - state_child_flow1_new + state_passport_flow1_new Y Y Y Start - state_child_flow4_new + state_passport_flow4_new Y Y Y Start - state_child_flow5_new + state_passport_flow5_new Y Y Y - state_child_flow5_new + state_passport_flow5_new Success Y Y N - state_child_flow4_new + state_passport_flow4_new Success Y Y N - state_child_flow3_new + state_passport_flow3_new Success Y Y N - state_child_flow2_new + state_passport_flow2_new Success Y Y N - state_child_flow1_new + state_passport_flow1_new Success Y Y @@ -216,13 +216,13 @@ Start - Delete file state_job_child + Delete file state_job_passport Y Y Y - Delete file state_job_child + Delete file state_job_passport Success Y Y diff --git a/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_delta.json b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_delta.json new file mode 100644 index 0000000..aba33b0 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_delta.json @@ -0,0 +1,6 @@ +{ + "status": "SUCCESS", + "pipeline": "delta_passport", + "max_create_date": "2025/04/08 20:21:38.528691000", + "max_update_date": "2025/04/09 00:25:46.935442000" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow1.json b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow1.json new file mode 100644 index 0000000..b87517e --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow1.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "passport_flow1" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow2.json b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow2.json new file mode 100644 index 0000000..5dac62f --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow2.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "passport_flow2" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow3.json b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow3.json new file mode 100644 index 0000000..6d7f890 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow3.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "passport_flow3" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow4.json b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow4.json new file mode 100644 index 0000000..170fe36 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow4.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "passport_flow4" +} \ No newline at end of file diff --git a/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow5.json b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow5.json new file mode 100644 index 0000000..e149889 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow5.json @@ -0,0 +1,4 @@ +{ + "status": "NEW", + "pipeline": "passport_flow5" +} \ No newline at end of file diff --git a/mappings/info_recruits/citizen_tables/passport/delta_passport.hpl b/mappings_new/info_recruits/citizen_tables/passport/delta_passport.hpl similarity index 50% rename from mappings/info_recruits/citizen_tables/passport/delta_passport.hpl rename to mappings_new/info_recruits/citizen_tables/passport/delta_passport.hpl index 9eb2ddd..09d97ab 100644 --- a/mappings/info_recruits/citizen_tables/passport/delta_passport.hpl +++ b/mappings_new/info_recruits/citizen_tables/passport/delta_passport.hpl @@ -23,12 +23,17 @@ Table input Insert / update + N + + + Table input + Execute SQL script Y - Table input - TableInput + Execute SQL script + ExecSql Y @@ -37,33 +42,50 @@ none + + + recruit_id + + + passport_number + + + passport_series + + + organization_name + + + unit_code + + + issue_date + + + actual + + ervu-dashboard - N - 0 - SELECT - r.recruit_id AS recruit_id, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'vydDok' AS organization_name, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodVydDok' AS unit_code, - TO_DATE(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'dataDok', 'YYYY-MM-DD') AS issue_date, - CASE - WHEN ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodStatus' = '1' - THEN TRUE ELSE FALSE - END AS actual -FROM ervu_dashboard.recruits_info ri ---join public.recruits r on r.id = ri.recruit_id -join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id - AND '${M_R_CR_DATE}'::timestamp >= ri.created_at - AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp -WHERE ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' IS NOT NULL -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok') = 4 -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') = 6 - Y + Y + N + N + Y + N + INSERT INTO ervu_dashboard.passport ( + recruit_id, passport_number, passport_series, + organization_name, unit_code, issue_date, actual +) VALUES (?, ?, ?, ?, ?, ?, ?) +ON CONFLICT (recruit_id, actual) DO UPDATE +SET + passport_number = EXCLUDED.passport_number, + passport_series = EXCLUDED.passport_series, + organization_name = EXCLUDED.organization_name, + unit_code = EXCLUDED.unit_code, + issue_date = EXCLUDED.issue_date; - 624 - 352 + 880 + 208 @@ -85,6 +107,11 @@ AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') recruit_id recruit_id + + = + actual + actual + ervu_dashboard passport
@@ -92,21 +119,6 @@ AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') recruit_id N - - actual - actual - Y - - - issue_date - issue_date - Y - - - organization_name - organization_name - Y - passport_number passport_number @@ -118,8 +130,8 @@ AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') Y - type_dul - type_dul + organization_name + organization_name Y @@ -127,11 +139,68 @@ AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') unit_code Y + + issue_date + issue_date + Y + + + actual + actual + Y + N - 1088 + 1168 + 352 + +
+ + Table input + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT + ri.recruit_id, + NULLIF(p.passport_data->>'nomDok', '') AS passport_number, + NULLIF(p.passport_data->>'serDok', '') AS passport_series, + NULLIF(p.passport_data->>'vydDok', '') AS organization_name, + NULLIF(p.passport_data->>'kodVydDok', '') AS unit_code, + TO_DATE(NULLIF(p.passport_data->>'dataDok', ''), 'YYYY-MM-DD') AS issue_date, + CASE + WHEN NULLIF(p.passport_data->>'kodStatus', '') = '1' THEN TRUE + ELSE FALSE + END AS actual +FROM 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 passport_data + FROM UNNEST(ARRAY[ + ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF', + ri.info->'svedFL'->'svedBS'->'pasportRF'->'predPasportRF' + ]) AS passport_data + WHERE passport_data IS NOT NULL AND passport_data::text <> 'null' +) AS p ON TRUE + + Y + + + 624 352 diff --git a/mappings_new/info_recruits/citizen_tables/passport/job_passport.hwf b/mappings_new/info_recruits/citizen_tables/passport/job_passport.hwf new file mode 100644 index 0000000..9b432a5 --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/passport/job_passport.hwf @@ -0,0 +1,1720 @@ + + + job_passport + Y + + + + - + 2025/06/05 14:27:15.055 + - + 2025/06/05 14:27:15.055 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 624 + 400 + + + + Checks if files exist state_job_passport.json + + FILES_EXIST + + + + + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + + + N + 848 + 400 + + + + checkpoint_job_passport.hpl (2) + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl + Basic + + Y + + N + local + N + N + Y + N + 1136 + 1280 + + + + recruitment_rows_five_flow_passport.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/supportive_jobs/recruitment_rows_five_flow_passport.hpl + Basic + + Y + + N + local + N + N + Y + Y + 1488 + 400 + + + + passport_flow1.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW1 + + Y + + Y + local + N + N + Y + N + 1808 + 80 + + + + passport_flow2.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW2 + + Y + + Y + local + N + N + Y + N + 1808 + 240 + + + + passport_flow3.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW3 + + Y + + Y + local + N + N + Y + N + 1808 + 400 + + + + passport_flow4.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW4 + + Y + + Y + local + N + N + Y + N + 1808 + 560 + + + + passport_flow5.hpl + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW5 + + Y + + Y + local + N + N + Y + N + 1808 + 720 + + + + Write state_passport_flow1 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow1.json + N + 2096 + 80 + + + + Write state_passport_flow1 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow1.json + N + 2096 + 160 + + + + Write state_passport_flow2 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow2.json + N + 2096 + 240 + + + + Write state_passport_flow2 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow2.json + N + 2096 + 320 + + + + Write state_passport_flow3 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow3.json + N + 2096 + 400 + + + + Write state_passport_flow3 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow3.json + N + 2096 + 480 + + + + Write state_passport_flow4 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow4.json + N + 2096 + 560 + + + + Write state_passport_flow4 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow4.json + N + 2096 + 640 + + + + Write state_passport_flow5 SUCCESS + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow5.json + N + 2096 + 720 + + + + Write state_passport_flow5 ERROR + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow5.json + N + 2096 + 800 + + + + Abort workflow + + ABORT + + N + N + 1472 + 208 + + + + checkpoint_job_passport.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/checkpoint_job_passport.hpl + Basic + + Y + + N + local + N + N + Y + N + 2496 + 384 + + + + Success new passport + + SUCCESS + + N + 3024 + 384 + + + + state_job_passport_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_passport" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + N + 2784 + 384 + + + + state_job_passport_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_passport" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + N + 2784 + 480 + + + + state_job_passport_success 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_passport" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + N + 1360 + 1280 + + + + state_job_passport_error 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "job_passport" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + N + 1360 + 1376 + + + + branching_passport.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/branching_passport.hpl + Basic + + Y + + N + local + N + N + Y + N + 1584 + 1280 + + + + Simple passport WHERE SUCCESS + + SIMPLE_EVAL + + SUCCESS + string + true + equal + equal + N + variable + STATUS + N + 2240 + 1792 + + + + Simple passport WHERE ERROR + + SIMPLE_EVAL + + ERROR + + string + + + + true + equal + equal + N + variable + STATUS + N + 1840 + 1280 + + + + checkpoint_passport_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/checkpoint_passport_error.hpl + Basic + + Y + + N + local + N + N + Y + N + 2064 + 1280 + + + + recruitment_rows_five_flow_if_error.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/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 + + + + passport_flow1.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW1 + + Y + + Y + local + N + N + Y + N + 2672 + 960 + + + + passport_flow2.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW2 + + Y + + Y + local + N + N + Y + N + 2672 + 1120 + + + + passport_flow3.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW3 + + Y + + Y + local + N + N + Y + N + 2672 + 1280 + + + + passport_flow4.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW4 + + Y + + Y + local + N + N + Y + N + 2704 + 1424 + + + + passport_flow5.hpl 2 + + PIPELINE + + N + N + N + N + N + Y + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl + Basic + + + RECRUITMENT_ID + IDM_FLOW5 + + Y + + Y + local + N + N + Y + N + 2672 + 1600 + + + + Write state_passport_flow1 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow1.json + N + 2960 + 960 + + + + Write state_passport_flow1 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow1" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow1.json + N + 2960 + 1040 + + + + Write state_passport_flow2 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow2.json + N + 2960 + 1120 + + + + Write state_passport_flow2 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow2" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow2.json + N + 2960 + 1200 + + + + Write state_passport_flow3 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow3.json + N + 2960 + 1280 + + + + Write state_passport_flow3 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow3" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow3.json + N + 2960 + 1360 + + + + Write state_passport_flow4 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow4.json + N + 2960 + 1440 + + + + Write state_passport_flow4 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow4" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow4.json + N + 2960 + 1520 + + + + Write state_passport_flow5 SUCCESS 2 + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "passport_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow5.json + N + 2960 + 1600 + + + + Write state_passport_flow5 ERROR 2 + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "passport_flow5" +} + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_flow5.json + N + 2960 + 1680 + + + + Success after_error_passport_flow1 + + SUCCESS + + N + 3216 + 960 + + + + error after_error_passport_flow1 + + SUCCESS + + N + 3216 + 1040 + + + + Success after_error_passport_flow2 + + SUCCESS + + N + 3216 + 1120 + + + + error after_error_passport_flow2 + + SUCCESS + + N + 3216 + 1200 + + + + Success after_error_passport_flow3 + + SUCCESS + + N + 3216 + 1280 + + + + error after_error_passport_flow3 + + SUCCESS + + N + 3216 + 1360 + + + + Success after_error_passport_flow4 + + SUCCESS + + N + 3216 + 1440 + + + + error after_error_passport_flow4 + + SUCCESS + + N + 3216 + 1520 + + + + Success after_error_passport_flow5 + + SUCCESS + + N + 3216 + 1600 + + + + error after_error_passport_flow5 + + SUCCESS + + N + 3216 + 1680 + + + + job_recruit_last_update_date.hwf + + WORKFLOW + + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/job_recruit_last_update_date.hwf + Nothing + + Y + + N + local + N + N + Y + N + 2544 + 1792 + + + + delta_passport.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/delta_passport.hpl + Basic + + + M_R_UP_DATE + ${M_R_UP_DATE} + + Y + + N + local + N + N + Y + N + 2768 + 1792 + + + + Success delta_passport + + SUCCESS + + N + 3216 + 1792 + + + + state_delta_passport_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "delta_passport", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_delta.json + N + 2960 + 1792 + + + + state_delta_passport_error + + WRITE_TO_FILE + + N + { + "status": "ERROR", + "pipeline": "delta_passport", + "max_create_date": "${M_R_CR_DATE}", + "max_update_date": "${M_R_UP_DATE}" +} + N + UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_passport_delta.json + N + 2960 + 1872 + + + + error delta_passport + + SUCCESS + + N + 3216 + 1872 + + + + + + Start + Checks if files exist state_job_passport.json + Y + Y + Y + + + Checks if files exist state_job_passport.json + checkpoint_job_passport.hpl (2) + Y + Y + N + + + Checks if files exist state_job_passport.json + recruitment_rows_five_flow_passport.hpl + Y + N + N + + + recruitment_rows_five_flow_passport.hpl + passport_flow1.hpl + Y + Y + N + + + recruitment_rows_five_flow_passport.hpl + passport_flow2.hpl + Y + Y + N + + + recruitment_rows_five_flow_passport.hpl + passport_flow3.hpl + Y + Y + N + + + recruitment_rows_five_flow_passport.hpl + passport_flow4.hpl + Y + Y + N + + + recruitment_rows_five_flow_passport.hpl + passport_flow5.hpl + Y + Y + N + + + passport_flow1.hpl + Write state_passport_flow1 SUCCESS + Y + Y + N + + + passport_flow1.hpl + Write state_passport_flow1 ERROR + Y + N + N + + + passport_flow2.hpl + Write state_passport_flow2 SUCCESS + Y + Y + N + + + passport_flow2.hpl + Write state_passport_flow2 ERROR + Y + N + N + + + passport_flow3.hpl + Write state_passport_flow3 SUCCESS + Y + Y + N + + + passport_flow3.hpl + Write state_passport_flow3 ERROR + Y + N + N + + + passport_flow4.hpl + Write state_passport_flow4 SUCCESS + Y + Y + N + + + passport_flow4.hpl + Write state_passport_flow4 ERROR + Y + N + N + + + passport_flow5.hpl + Write state_passport_flow5 SUCCESS + Y + Y + N + + + passport_flow5.hpl + Write state_passport_flow5 ERROR + Y + N + N + + + recruitment_rows_five_flow_passport.hpl + Abort workflow + Y + N + N + + + Write state_passport_flow1 SUCCESS + checkpoint_job_passport.hpl + Y + N + Y + + + Write state_passport_flow1 ERROR + checkpoint_job_passport.hpl + Y + N + Y + + + Write state_passport_flow2 SUCCESS + checkpoint_job_passport.hpl + Y + N + Y + + + Write state_passport_flow2 ERROR + checkpoint_job_passport.hpl + Y + N + Y + + + Write state_passport_flow3 SUCCESS + checkpoint_job_passport.hpl + Y + N + Y + + + Write state_passport_flow3 ERROR + checkpoint_job_passport.hpl + Y + N + Y + + + Write state_passport_flow4 SUCCESS + checkpoint_job_passport.hpl + Y + N + Y + + + Write state_passport_flow4 ERROR + checkpoint_job_passport.hpl + Y + N + Y + + + Write state_passport_flow5 SUCCESS + checkpoint_job_passport.hpl + Y + N + Y + + + Write state_passport_flow5 ERROR + checkpoint_job_passport.hpl + Y + N + Y + + + state_job_passport_success + Success new passport + Y + Y + N + + + state_job_passport_error + Success new passport + Y + Y + N + + + checkpoint_job_passport.hpl + state_job_passport_success + Y + Y + N + + + checkpoint_job_passport.hpl + state_job_passport_error + Y + N + N + + + checkpoint_job_passport.hpl (2) + state_job_passport_success 2 + Y + Y + N + + + checkpoint_job_passport.hpl (2) + state_job_passport_error 2 + Y + N + N + + + state_job_passport_success 2 + branching_passport.hpl + Y + Y + N + + + state_job_passport_error 2 + branching_passport.hpl + Y + Y + N + + + Simple passport WHERE ERROR + checkpoint_passport_error.hpl + Y + Y + N + + + branching_passport.hpl + Simple passport WHERE ERROR + Y + N + Y + + + branching_passport.hpl + Simple passport WHERE SUCCESS + Y + N + Y + + + checkpoint_passport_error.hpl + recruitment_rows_five_flow_if_error.hpl + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + Abort workflow 2 + Y + N + N + + + passport_flow1.hpl 2 + Write state_passport_flow1 SUCCESS 2 + Y + Y + N + + + passport_flow1.hpl 2 + Write state_passport_flow1 ERROR 2 + Y + N + N + + + passport_flow2.hpl 2 + Write state_passport_flow2 SUCCESS 2 + Y + Y + N + + + passport_flow2.hpl 2 + Write state_passport_flow2 ERROR 2 + Y + N + N + + + passport_flow3.hpl 2 + Write state_passport_flow3 SUCCESS 2 + Y + Y + N + + + passport_flow3.hpl 2 + Write state_passport_flow3 ERROR 2 + Y + N + N + + + passport_flow4.hpl 2 + Write state_passport_flow4 SUCCESS 2 + Y + Y + N + + + passport_flow4.hpl 2 + Write state_passport_flow4 ERROR 2 + Y + N + N + + + passport_flow5.hpl 2 + Write state_passport_flow5 SUCCESS 2 + Y + Y + N + + + passport_flow5.hpl 2 + Write state_passport_flow5 ERROR 2 + Y + N + N + + + recruitment_rows_five_flow_if_error.hpl + passport_flow3.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + passport_flow2.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + passport_flow1.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + passport_flow4.hpl 2 + Y + Y + N + + + recruitment_rows_five_flow_if_error.hpl + passport_flow5.hpl 2 + Y + Y + N + + + Write state_passport_flow1 SUCCESS 2 + Success after_error_passport_flow1 + Y + Y + N + + + Write state_passport_flow1 ERROR 2 + error after_error_passport_flow1 + Y + Y + N + + + Write state_passport_flow2 SUCCESS 2 + Success after_error_passport_flow2 + Y + Y + N + + + Write state_passport_flow2 ERROR 2 + error after_error_passport_flow2 + Y + Y + N + + + Write state_passport_flow3 SUCCESS 2 + Success after_error_passport_flow3 + Y + Y + N + + + Write state_passport_flow3 ERROR 2 + error after_error_passport_flow3 + Y + Y + N + + + Write state_passport_flow4 SUCCESS 2 + Success after_error_passport_flow4 + Y + Y + N + + + Write state_passport_flow4 ERROR 2 + error after_error_passport_flow4 + Y + Y + N + + + Write state_passport_flow5 SUCCESS 2 + Success after_error_passport_flow5 + Y + Y + N + + + Write state_passport_flow5 ERROR 2 + error after_error_passport_flow5 + Y + Y + N + + + Simple passport WHERE SUCCESS + job_recruit_last_update_date.hwf + Y + Y + N + + + job_recruit_last_update_date.hwf + delta_passport.hpl + Y + Y + N + + + state_delta_passport_success + Success delta_passport + Y + Y + N + + + state_delta_passport_error + error delta_passport + Y + Y + N + + + delta_passport.hpl + state_delta_passport_success + Y + Y + N + + + delta_passport.hpl + state_delta_passport_error + Y + N + N + + + + + + diff --git a/mappings_new/info_recruits/citizen_tables/passport/job_recruit_last_update_date.hwf b/mappings_new/info_recruits/citizen_tables/passport/job_recruit_last_update_date.hwf new file mode 100644 index 0000000..f31e86c --- /dev/null +++ b/mappings_new/info_recruits/citizen_tables/passport/job_recruit_last_update_date.hwf @@ -0,0 +1,124 @@ + + + job_recruit_last_update_date + Y + + + + - + 2025/06/02 14:48:05.666 + - + 2025/06/02 14:48:05.666 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 592 + 352 + + + + recruit_update_date_ervu_dashboard.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/recruit_update_date_ervu_dashboard.hpl + + + Basic + + Y + + N + local + N + N + Y + N + 784 + 352 + + + + row_last_recruit_update_date.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/row_last_recruit_update_date.hpl + Basic + + Y + + N + local + N + N + Y + N + 1056 + 352 + + + + Success + + SUCCESS + + N + 1232 + 352 + + + + + + Start + recruit_update_date_ervu_dashboard.hpl + Y + Y + Y + + + recruit_update_date_ervu_dashboard.hpl + row_last_recruit_update_date.hpl + Y + Y + N + + + row_last_recruit_update_date.hpl + Success + Y + Y + N + + + + + + diff --git a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow1.hpl b/mappings_new/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl similarity index 61% rename from mappings/info_recruits/citizen_tables/passport/parallel/passport_flow1.hpl rename to mappings_new/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl index 8e5bde8..e3bf0ed 100644 --- a/mappings/info_recruits/citizen_tables/passport/parallel/passport_flow1.hpl +++ b/mappings_new/info_recruits/citizen_tables/passport/parallel/passport_flow.hpl @@ -1,7 +1,7 @@ - passport_flow1 + passport_flow Y @@ -36,6 +36,11 @@ Insert / update Y
+ + Table input + Table output + N + Get variables @@ -82,7 +87,11 @@ = recruit_id recruit_id - + + + = + actual + actual ervu_dashboard passport
@@ -91,21 +100,6 @@ recruit_id N - - actual - actual - Y - - - issue_date - issue_date - Y - - - organization_name - organization_name - Y - passport_number passport_number @@ -116,16 +110,31 @@ passport_series Y + + organization_name + organization_name + Y + unit_code unit_code Y + + issue_date + issue_date + Y + + + actual + actual + N + N - 944 + 896 288
@@ -180,37 +189,107 @@ ervu-dashboard N 0 - SELECT - r.recruit_id AS recruit_id, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'vydDok' AS organization_name, - ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodVydDok' AS unit_code, - TO_DATE(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'dataDok', 'YYYY-MM-DD') AS issue_date, - CASE - WHEN ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'kodStatus' = '1' - THEN TRUE ELSE FALSE + SELECT + ri.recruit_id, + NULLIF(p.passport_data->>'nomDok', '') AS passport_number, + NULLIF(p.passport_data->>'serDok', '') AS passport_series, + NULLIF(p.passport_data->>'vydDok', '') AS organization_name, + NULLIF(p.passport_data->>'kodVydDok', '') AS unit_code, + TO_DATE(NULLIF(p.passport_data->>'dataDok', ''), 'YYYY-MM-DD') AS issue_date, + CASE + WHEN NULLIF(p.passport_data->>'kodStatus', '') = '1' THEN TRUE + ELSE FALSE END AS actual -FROM ervu_dashboard.recruits_info ri ---join public.recruits r on r.id = ri.recruit_id -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 ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok' IS NOT NULL -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'serDok') = 4 -AND LENGTH(ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF'->>'nomDok') = 6 +FROM recruits_info ri +JOIN ervu_dashboard.citizen r + ON r.recruit_id = ri.recruit_id + 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 +JOIN LATERAL ( + SELECT passport_data + FROM UNNEST(ARRAY[ + ri.info->'svedFL'->'svedBS'->'pasportRF'->'aktPasportRF', + ri.info->'svedFL'->'svedBS'->'pasportRF'->'predPasportRF' + ]) AS passport_data + WHERE passport_data IS NOT NULL AND passport_data::text <> 'null' +) AS p ON TRUE + Y - 448 - 288 + 528 + 272 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + recruit_id + recruit_id + + + actual + actual + + + passport_series + passport_series + + + passport_number + passport_number + + + issue_date + issue_date + + + organization_name + organization_name + + + unit_code + unit_code + + + N + N + N + N + Y + passport_id + Y + ervu_dashboard + Y + passport
+ N + Y + N + N + + + 864 + 192
Select values 4 2 Get variables - Y + N diff --git a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl b/mappings_new/info_recruits/citizen_tables/passport/recruit_update_date_ervu_dashboard.hpl similarity index 57% rename from mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl rename to mappings_new/info_recruits/citizen_tables/passport/recruit_update_date_ervu_dashboard.hpl index 0c50fd3..0236547 100644 --- a/mappings/info_recruits/citizen_tables/child/checkpoints/change_status_delta_child_flow2_success.hpl +++ b/mappings_new/info_recruits/citizen_tables/passport/recruit_update_date_ervu_dashboard.hpl @@ -1,7 +1,7 @@ - change_status_delta_child_flow2_success + recruit_update_date_ervu_dashboard Y @@ -13,63 +13,19 @@ 1000 100 - - 2025/06/16 12:20:06.191 + 2025/06/02 14:50:31.833 - - 2025/06/16 12:20:06.191 + 2025/06/02 14:50:31.833 Table input - Insert / update + Table output 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 @@ -84,16 +40,55 @@ ervu-dashboard N 0 - SELECT - 'delta_child_flow2' as job_name, - 'SUCCESS' as status, - current_timestamp as record_created - - + SELECT + created_at AS system_create_date, + updated_at AS system_update_date, + current_timestamp AS record_created, + 'job_recruits_info' AS workflow +FROM recruits_info +WHERE updated_at = (SELECT MAX(updated_at) FROM recruits_info) +limit 1 N - 784 + 896 + 304 + + + + Table output + TableOutput + + Y + + 1 + + none + + + 1000 + ervu-dashboard + + + N + N + N + N + + Y + + N + public + N + recruit_create
+ + N + Y + N + Y + + + 1216 304
diff --git a/mappings/info_recruits/citizen_tables/passport/recruitment_rows_five_flow_if_error.hpl b/mappings_new/info_recruits/citizen_tables/passport/recruitment_rows_five_flow_if_error.hpl similarity index 99% rename from mappings/info_recruits/citizen_tables/passport/recruitment_rows_five_flow_if_error.hpl rename to mappings_new/info_recruits/citizen_tables/passport/recruitment_rows_five_flow_if_error.hpl index c45bc33..1e43dd3 100644 --- a/mappings/info_recruits/citizen_tables/passport/recruitment_rows_five_flow_if_error.hpl +++ b/mappings_new/info_recruits/citizen_tables/passport/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.passport ch on ch.recruit_id = cit.recruit_id + join ervu_dashboard.passport ps on ps.recruit_id = cit.recruit_id ), flow_data AS ( diff --git a/mappings/info_recruits/citizen_tables/punishment/branching_punishment.hpl b/mappings_new/info_recruits/citizen_tables/passport/row_last_recruit_update_date.hpl similarity index 60% rename from mappings/info_recruits/citizen_tables/punishment/branching_punishment.hpl rename to mappings_new/info_recruits/citizen_tables/passport/row_last_recruit_update_date.hpl index 74f2576..5597125 100644 --- a/mappings/info_recruits/citizen_tables/punishment/branching_punishment.hpl +++ b/mappings_new/info_recruits/citizen_tables/passport/row_last_recruit_update_date.hpl @@ -1,7 +1,7 @@ - branching_punishment + row_last_recruit_update_date Y @@ -13,26 +13,43 @@ 1000 100 - - 2025/06/09 09:54:43.724 + 2025/06/02 14:51:59.611 - - 2025/06/09 09:54:43.724 + 2025/06/02 14:51:59.611 - Set variables 2 - Write to log 2 - N + Copy rows to result + Set variables + Y Table input - Set variables 2 + Copy rows to result Y - Set variables 2 + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 992 + 320 + + + + Set variables SetVariable Y @@ -44,21 +61,17 @@ - pipeline - PIPE - PARENT_WORKFLOW - - - status - STATUS - PARENT_WORKFLOW + + MAX_RECRUIT_UPDATE_DATE + M_R_UP_DATE + GP_WORKFLOW Y - 1056 - 256 + 1232 + 320 @@ -75,47 +88,19 @@ ervu-dashboard N 0 - select - status as STATUS, - job_name AS PIPELINE -from public.etl_checkpoints -where job_name = 'job_citizen_spouse' + SELECT + system_update_date AS MAX_RECRUIT_UPDATE_DATE--, +--record_created +FROM public.recruit_create +WHERE system_update_date = (select max(system_update_date) from public.recruit_create) +and workflow = 'job_recruits_info' +order by record_created desc +limit 1 N - 816 - 256 - - - - Write to log 2 - WriteToLog - - Y - - 1 - - none - - - Y - - - pipeline - - - status - - - N - 0 - Basic - ${PIPE} -${STATUS} - - - 1280 - 256 + 688 + 320 diff --git a/mappings_new/info_recruits/job_info_recruits_from_json.hwf b/mappings_new/info_recruits/job_info_recruits_from_json.hwf index 967cb3a..4ede347 100644 --- a/mappings_new/info_recruits/job_info_recruits_from_json.hwf +++ b/mappings_new/info_recruits/job_info_recruits_from_json.hwf @@ -40,13 +40,10 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/job_child.hwf - - Nothing M_R_CR_DATE - ${M_R_CR_DATE} Y @@ -62,7 +59,7 @@
- Workflow 2 + job_passport.hwf WORKFLOW @@ -70,10 +67,20 @@ N N N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/job_passport.hwf + + + Nothing + + M_R_CR_DATE + + ${M_R_CR_DATE} + Y N + local N N Y @@ -250,8 +257,8 @@
Start - Workflow 2 - N + job_passport.hwf + Y Y Y @@ -326,7 +333,7 @@ N - Workflow 2 + job_passport.hwf Success Y Y diff --git a/mappings_new/info_recruits/raw_data/info_recruits/delta_recruits_info.hpl b/mappings_new/info_recruits/raw_data/info_recruits/delta_recruits_info.hpl index a32fa45..deae1ac 100644 --- a/mappings_new/info_recruits/raw_data/info_recruits/delta_recruits_info.hpl +++ b/mappings_new/info_recruits/raw_data/info_recruits/delta_recruits_info.hpl @@ -99,6 +99,11 @@ info Y + + addresses + addresses + Y + N @@ -125,7 +130,8 @@ r.system_create_date AS created_at, r.system_update_date AS updated_at, ri.recruit_id, - ri.info, + ri.info, + r.addresses, ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, diff --git a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow1.hpl b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow1.hpl index 71a7b98..42a28d1 100644 --- a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow1.hpl +++ b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow1.hpl @@ -131,6 +131,11 @@ full_name Y + + addresses + addresses + Y + N @@ -194,7 +199,8 @@ r.system_create_date AS created_at, r.system_update_date AS updated_at, ri.recruit_id, - ri.info, + ri.info, + r.addresses, ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, diff --git a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow2.hpl b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow2.hpl index 068d2c1..5f0ebdc 100644 --- a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow2.hpl +++ b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow2.hpl @@ -88,6 +88,11 @@ full_name Y + + addresses + addresses + Y + N @@ -112,9 +117,10 @@ 0 SELECT r.system_create_date AS created_at, - r.system_update_date AS updated_at, + r.system_update_date AS updated_at, ri.recruit_id, - ri.info, + ri.info, + r.addresses, ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, diff --git a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow3.hpl b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow3.hpl index 78ca857..0b7e07f 100644 --- a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow3.hpl +++ b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow3.hpl @@ -88,6 +88,11 @@ full_name Y + + addresses + addresses + Y + N @@ -114,7 +119,8 @@ r.system_create_date AS created_at, r.system_update_date AS updated_at, ri.recruit_id, - ri.info, + ri.info, + r.addresses, ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, diff --git a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow4.hpl b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow4.hpl index 1201625..d88b916 100644 --- a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow4.hpl +++ b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow4.hpl @@ -88,6 +88,11 @@ full_name Y + + addresses + addresses + Y + N @@ -114,7 +119,8 @@ r.system_create_date AS created_at, r.system_update_date AS updated_at, ri.recruit_id, - ri.info, + ri.info, + r.addresses, ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, diff --git a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow5.hpl b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow5.hpl index 332bc6e..0b18455 100644 --- a/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow5.hpl +++ b/mappings_new/info_recruits/raw_data/info_recruits/parallel/recruits_info_flow5.hpl @@ -88,6 +88,11 @@ full_name Y + + addresses + addresses + Y + N @@ -112,9 +117,10 @@ 0 SELECT r.system_create_date AS created_at, - r.system_update_date AS updated_at, + r.system_update_date AS updated_at, ri.recruit_id, - ri.info, + ri.info, + r.addresses, ri.gir_import_data_version_id, r.current_recruitment_id, r.target_recruitment_id, diff --git a/mappings_new/info_recruits/supportive_jobs/job_create_files.hwf b/mappings_new/info_recruits/supportive_jobs/job_create_files.hwf index 3e8f21c..ec76164 100644 --- a/mappings_new/info_recruits/supportive_jobs/job_create_files.hwf +++ b/mappings_new/info_recruits/supportive_jobs/job_create_files.hwf @@ -98,6 +98,8 @@ N N ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/job_create_files_child.hwf + + Nothing Y @@ -127,6 +129,32 @@ ${PROJECT_HOME}/info_recruits/checkpoints/state_job_general_info_recruits.json N 944 + 880 + + + + job_create_files_passport.hwf + + WORKFLOW + + N + N + N + N + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/job_create_files_passport.hwf + + + Nothing + + Y + + N + local + N + N + Y + N + 944 768 @@ -188,6 +216,20 @@ Y N + + Start + job_create_files_passport.hwf + Y + Y + Y + + + job_create_files_passport.hwf + Success job_create_files_recruits_info.hwf + Y + Y + N +
diff --git a/mappings_new/info_recruits/supportive_jobs/job_create_files_for_test.hwf b/mappings_new/info_recruits/supportive_jobs/job_create_files_for_test.hwf index 8367208..4a41633 100644 --- a/mappings_new/info_recruits/supportive_jobs/job_create_files_for_test.hwf +++ b/mappings_new/info_recruits/supportive_jobs/job_create_files_for_test.hwf @@ -63,7 +63,7 @@ ${PROJECT_HOME}/info_recruits/raw_data/info_recruits/checkpoints/state_job_recruits_info.json N 752 - 448 + 512 @@ -87,13 +87,31 @@ "pipeline": "job_child" } N - UTF-8 + ${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json N 752 288 + + state_job_passport_success + + WRITE_TO_FILE + + N + { + "status": "SUCCESS", + "pipeline": "job_passport" +} + N + + ${PROJECT_HOME}/info_recruits/citizen_tables/passport/checkpoints/state_job_passport.json + N + 752 + 432 + + @@ -138,6 +156,20 @@ Y N + + Start + state_job_passport_success + Y + Y + Y + + + state_job_passport_success + Success + Y + Y + N + diff --git a/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_address.hpl b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_address.hpl new file mode 100644 index 0000000..d51fed4 --- /dev/null +++ b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_address.hpl @@ -0,0 +1,121 @@ + + + + recruitment_rows_five_flow_child + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 832 + 304 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH ordered AS ( + SELECT + idm_id, + created_at, + ROW_NUMBER() OVER (ORDER BY created_at) AS rn, + COUNT(*) OVER () AS total_rows + from ervu_dashboard.recruitment +), +splitted AS ( + SELECT *, + CEIL(total_rows / 5.0) AS part_size, + FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num, + ((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position + FROM ordered +), +pivoted AS ( + SELECT + position, + + MAX(CASE WHEN flow_num = 1 THEN created_at END) AS cr_flow1, + MAX(CASE WHEN flow_num = 1 THEN idm_id::text END) AS idm_flow1, + + MAX(CASE WHEN flow_num = 2 THEN created_at END) AS cr_flow2, + MAX(CASE WHEN flow_num = 2 THEN idm_id::text END) AS idm_flow2, + + MAX(CASE WHEN flow_num = 3 THEN created_at END) AS cr_flow3, + MAX(CASE WHEN flow_num = 3 THEN idm_id::text END) AS idm_flow3, + + MAX(CASE WHEN flow_num = 4 THEN created_at END) AS cr_flow4, + MAX(CASE WHEN flow_num = 4 THEN idm_id::text END) AS idm_flow4, + + MAX(CASE WHEN flow_num = 5 THEN created_at END) AS cr_flow5, + MAX(CASE WHEN flow_num = 5 THEN idm_id::text END) AS idm_flow5 + + FROM splitted + GROUP BY position + ORDER BY position +) +SELECT + cr_flow1, + IDM_FLOW1::uuid, + cr_flow2, + IDM_FLOW2::uuid, + cr_flow3, + IDM_FLOW3::uuid, + cr_flow4, + IDM_FLOW4::uuid, + cr_flow5, + IDM_FLOW5::uuid +FROM pivoted +limit 3 + N + + + 464 + 304 + + + + + + diff --git a/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl new file mode 100644 index 0000000..d51fed4 --- /dev/null +++ b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_guardianship.hpl @@ -0,0 +1,121 @@ + + + + recruitment_rows_five_flow_child + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 832 + 304 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH ordered AS ( + SELECT + idm_id, + created_at, + ROW_NUMBER() OVER (ORDER BY created_at) AS rn, + COUNT(*) OVER () AS total_rows + from ervu_dashboard.recruitment +), +splitted AS ( + SELECT *, + CEIL(total_rows / 5.0) AS part_size, + FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num, + ((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position + FROM ordered +), +pivoted AS ( + SELECT + position, + + MAX(CASE WHEN flow_num = 1 THEN created_at END) AS cr_flow1, + MAX(CASE WHEN flow_num = 1 THEN idm_id::text END) AS idm_flow1, + + MAX(CASE WHEN flow_num = 2 THEN created_at END) AS cr_flow2, + MAX(CASE WHEN flow_num = 2 THEN idm_id::text END) AS idm_flow2, + + MAX(CASE WHEN flow_num = 3 THEN created_at END) AS cr_flow3, + MAX(CASE WHEN flow_num = 3 THEN idm_id::text END) AS idm_flow3, + + MAX(CASE WHEN flow_num = 4 THEN created_at END) AS cr_flow4, + MAX(CASE WHEN flow_num = 4 THEN idm_id::text END) AS idm_flow4, + + MAX(CASE WHEN flow_num = 5 THEN created_at END) AS cr_flow5, + MAX(CASE WHEN flow_num = 5 THEN idm_id::text END) AS idm_flow5 + + FROM splitted + GROUP BY position + ORDER BY position +) +SELECT + cr_flow1, + IDM_FLOW1::uuid, + cr_flow2, + IDM_FLOW2::uuid, + cr_flow3, + IDM_FLOW3::uuid, + cr_flow4, + IDM_FLOW4::uuid, + cr_flow5, + IDM_FLOW5::uuid +FROM pivoted +limit 3 + N + + + 464 + 304 + + + + + + diff --git a/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl new file mode 100644 index 0000000..d51fed4 --- /dev/null +++ b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_citizen_spouse.hpl @@ -0,0 +1,121 @@ + + + + recruitment_rows_five_flow_child + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 832 + 304 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH ordered AS ( + SELECT + idm_id, + created_at, + ROW_NUMBER() OVER (ORDER BY created_at) AS rn, + COUNT(*) OVER () AS total_rows + from ervu_dashboard.recruitment +), +splitted AS ( + SELECT *, + CEIL(total_rows / 5.0) AS part_size, + FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num, + ((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position + FROM ordered +), +pivoted AS ( + SELECT + position, + + MAX(CASE WHEN flow_num = 1 THEN created_at END) AS cr_flow1, + MAX(CASE WHEN flow_num = 1 THEN idm_id::text END) AS idm_flow1, + + MAX(CASE WHEN flow_num = 2 THEN created_at END) AS cr_flow2, + MAX(CASE WHEN flow_num = 2 THEN idm_id::text END) AS idm_flow2, + + MAX(CASE WHEN flow_num = 3 THEN created_at END) AS cr_flow3, + MAX(CASE WHEN flow_num = 3 THEN idm_id::text END) AS idm_flow3, + + MAX(CASE WHEN flow_num = 4 THEN created_at END) AS cr_flow4, + MAX(CASE WHEN flow_num = 4 THEN idm_id::text END) AS idm_flow4, + + MAX(CASE WHEN flow_num = 5 THEN created_at END) AS cr_flow5, + MAX(CASE WHEN flow_num = 5 THEN idm_id::text END) AS idm_flow5 + + FROM splitted + GROUP BY position + ORDER BY position +) +SELECT + cr_flow1, + IDM_FLOW1::uuid, + cr_flow2, + IDM_FLOW2::uuid, + cr_flow3, + IDM_FLOW3::uuid, + cr_flow4, + IDM_FLOW4::uuid, + cr_flow5, + IDM_FLOW5::uuid +FROM pivoted +limit 3 + N + + + 464 + 304 + + + + + + diff --git a/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_passport.hpl b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_passport.hpl new file mode 100644 index 0000000..7f4eb24 --- /dev/null +++ b/mappings_new/info_recruits/supportive_jobs/recruitment_rows_five_flow_passport.hpl @@ -0,0 +1,121 @@ + + + + recruitment_rows_five_flow_passport + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/18 09:48:01.970 + - + 2025/04/18 09:48:01.970 + + + + + + Table input + Copy rows to result + Y + + + + Copy rows to result + RowsToResult + + Y + + 1 + + none + + + + + 832 + 304 + + + + Table input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH ordered AS ( + SELECT + idm_id, + created_at, + ROW_NUMBER() OVER (ORDER BY created_at) AS rn, + COUNT(*) OVER () AS total_rows + from ervu_dashboard.recruitment +), +splitted AS ( + SELECT *, + CEIL(total_rows / 5.0) AS part_size, + FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num, + ((rn - 1) % CEIL(total_rows / 5.0)) + 1 AS position + FROM ordered +), +pivoted AS ( + SELECT + position, + + MAX(CASE WHEN flow_num = 1 THEN created_at END) AS cr_flow1, + MAX(CASE WHEN flow_num = 1 THEN idm_id::text END) AS idm_flow1, + + MAX(CASE WHEN flow_num = 2 THEN created_at END) AS cr_flow2, + MAX(CASE WHEN flow_num = 2 THEN idm_id::text END) AS idm_flow2, + + MAX(CASE WHEN flow_num = 3 THEN created_at END) AS cr_flow3, + MAX(CASE WHEN flow_num = 3 THEN idm_id::text END) AS idm_flow3, + + MAX(CASE WHEN flow_num = 4 THEN created_at END) AS cr_flow4, + MAX(CASE WHEN flow_num = 4 THEN idm_id::text END) AS idm_flow4, + + MAX(CASE WHEN flow_num = 5 THEN created_at END) AS cr_flow5, + MAX(CASE WHEN flow_num = 5 THEN idm_id::text END) AS idm_flow5 + + FROM splitted + GROUP BY position + ORDER BY position +) +SELECT + cr_flow1, + IDM_FLOW1::uuid, + cr_flow2, + IDM_FLOW2::uuid, + cr_flow3, + IDM_FLOW3::uuid, + cr_flow4, + IDM_FLOW4::uuid, + cr_flow5, + IDM_FLOW5::uuid +FROM pivoted +limit 3 + N + + + 464 + 304 + + + + + +