diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl index 1b01d78..8681f8b 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow.hpl @@ -7,7 +7,18 @@ Normal + 0 + + IDM_ID + 0e0535ab-5303-43ea-b36a-8c0a2a8d0ed5 + + + + JOB_NAME + employer_job + + N 1000 @@ -20,11 +31,6 @@ - - Create job execution record - employer_input - Y - Change job status on error Abort @@ -85,6 +91,11 @@ Filter rows Y + + Create job execution record + employer_input + Y + Abort @@ -196,35 +207,6 @@ and recruitment_id = '${IDM_ID}'; 112 - - 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}'); - - - - - 176 - 288 - - Detect empty stream DetectEmptyStream @@ -342,11 +324,10 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - ervu-dashboard + ervu-dashboard-118 N 0 with filteredData as (select ri.recruit_id, - (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as rabotodat, true as actual_employer from ervu_dashboard.recruits_info ri @@ -356,17 +337,17 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); union all select ri.recruit_id, - (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as rabotodat, false as actual_employer from ervu_dashboard.recruits_info ri - where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat' != 'null' + where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat' != 'null' AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}')) ) -select fd.source_id, +select fd.recruit_id, - to_date(rabotodat ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, - COALESCE(rabotodat -> 'extend' ->> 'status', '0') = '1' AS status, + to_date(rabotodat ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, + rabotodat ->> 'id' as source_id, + COALESCE(rabotodat -> 'extend' ->> 'status', '0') = '1' as status, rabotodat -> 'extend' ->> 'adresRabotodat' as address, rabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as separate_unit_type, rabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as separate_unit_address, @@ -535,6 +516,35 @@ from filteredData fd; 448 + + 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}'); + + + + + 192 + 288 + + Update diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl index 66e13ba..c1bf0e6 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_delta.hpl @@ -428,7 +428,6 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard N - WITH fd AS (SELECT ri.recruit_id, (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') AS source_id, ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' AS akt_rabotodat, @@ -444,7 +443,7 @@ and recruitment_id = '${IDM_ID}'; AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}')) ) SELECT fd.recruit_id, - fd.source_id, + pred_rabotodat ->> 'id' as pred_source_id, to_date(pred_rabotodat ->> 'dataSved', 'YYYY-MM-DD') as pred_source_update_date, COALESCE(pred_rabotodat -> 'extend' ->> 'statusRabotodat' = '1', false) as pred_status, pred_rabotodat -> 'extend' ->> 'adresRabotodat' as pred_address, @@ -467,7 +466,7 @@ SELECT fd.recruit_id, then pred_rabotodat -> 'svedYUL' ->> 'innyul' when pred_rabotodat ->> 'svedGlKFH' is not null and pred_rabotodat ->> 'svedGlKFH' != 'null' then pred_rabotodat -> 'svedGlKFH' ->> 'innfl' - when pred_rabotodat ->> 'svedPlatFL' is not null and pred_rabotodat ->> 'svedPlatFL' != 'null' + when pred_rabotodat ->> 'svedPlatFL' is not null and pred_rabotodat ->> 'svedPlatFL' != 'null' then pred_rabotodat -> 'svedPlatFL' ->> 'innfl' end as pred_inn, case @@ -484,6 +483,7 @@ SELECT fd.recruit_id, to_date(fd.pred_rabotodat ->> 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' AS pred_need_update, + akt_rabotodat ->> 'id' as akt_source_id, to_date(akt_rabotodat ->> 'dataSved', 'YYYY-MM-DD') as akt_source_update_date, COALESCE(akt_rabotodat -> 'extend' ->> 'statusRabotodat' = '1', false) as akt_status, akt_rabotodat -> 'extend' ->> 'adresRabotodat' as akt_address, @@ -737,11 +737,6 @@ FROM fd; source_id source_id - - = - actual_employer - akt_need_update - ervu_dashboard employer
@@ -751,7 +746,7 @@ FROM fd; source_id - source_id + akt_source_id N @@ -841,11 +836,6 @@ FROM fd; source_id source_id - - <> - actual_employer - pred_need_update - ervu_dashboard employer
@@ -855,7 +845,7 @@ FROM fd; source_id - source_id + pred_source_id N diff --git a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl index 28699ba..a28091c 100644 --- a/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/employer/parallel/employer_flow_repeat.hpl @@ -350,7 +350,6 @@ SET status = 'PROCESSING', N 0 with filteredData as (select ri.recruit_id, - (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as rabotodat, true as actual_employer from ervu_dashboard.recruits_info ri @@ -360,22 +359,22 @@ SET status = 'PROCESSING', union all select ri.recruit_id, - (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id') as source_id, ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as rabotodat, false as actual_employer from ervu_dashboard.recruits_info ri - where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat' != 'null' - AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}')) + where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat' != 'null' + AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}')) ) -select fd.source_id, +select fd.recruit_id, to_date(rabotodat ->> 'dataSved', 'YYYY-MM-DD') as source_update_date, - COALESCE(rabotodat -> 'extend' ->> 'status', '0') = '1' AS status, + rabotodat ->> 'id' as source_id, + COALESCE(rabotodat -> 'extend' ->> 'status', '0') = '1' as status, rabotodat -> 'extend' ->> 'adresRabotodat' as address, rabotodat -> 'extend' ->> 'tipPodrazdRabotodat' as separate_unit_type, rabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as separate_unit_address, case - when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' + when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель' when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо' when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ'