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 db1cf32..193be22 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
@@ -36,16 +36,6 @@
Abort
Y
-
- employer_input
- Identify last row in a stream
- Y
-
-
- Identify last row in a stream
- employer_output
- Y
-
employer_output
Change job status on error
@@ -61,16 +51,6 @@
Change job status on success
Y
-
- Identify last row in a stream
- Detect empty stream
- Y
-
-
- Identify last row in a stream
- filter_non_actual_employers
- Y
-
filter_non_actual_employers
Update
@@ -82,18 +62,28 @@
Y
- employer_output
- Block until transforms finish
+ Create job execution record
+ employer_input
Y
- Block until transforms finish
+ employer_output
Filter rows
Y
- Create job execution record
- employer_input
+ employer_input
+ Detect empty stream
+ Y
+
+
+ employer_input
+ filter_non_actual_employers
+ Y
+
+
+ employer_input
+ employer_output
Y
@@ -117,28 +107,6 @@
448
-
- Block until transforms finish
- BlockUntilTransformsFinish
-
- Y
-
- 1
-
- none
-
-
-
-
- Update
-
-
-
-
- 1120
- 288
-
-
Change job status on error
ExecSql
@@ -289,24 +257,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
288
-
- Identify last row in a stream
- DetectLastRow
-
- N
-
- 1
-
- none
-
-
- last_row
-
-
- 528
- 288
-
-
Update
Update
@@ -346,7 +296,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
employer_input
TableInput
- Y
+ N
1
@@ -356,66 +306,70 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
ervu-dashboard
N
0
- with filteredData as (select ri.recruit_id,
- ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as rabotodat,
- true as actual_employer
- from ervu_dashboard.recruits_info ri
- where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'aktRabotodat' != 'null'
- AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
+ with filteredData as (
+ select ri.recruit_id,
+ ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as rabotodat,
+ true as actual_employer,
+ ctid
+ from ervu_dashboard.recruits_info ri
+ where COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
+ and (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'aktRabotodat') <> 'null'
- union all
+ union all
- select ri.recruit_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}'))
+ select ri.recruit_id,
+ ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as rabotodat,
+ false as actual_employer,
+ ctid
+ from ervu_dashboard.recruits_info ri
+ where COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
+ and (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat') <> 'null'
)
select
- fd.recruit_id,
- 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,
- case
- when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null'
- then 'Индивидуальный предприниматель'
- when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо'
- when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ'
- when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо'
- end as employer_category_name,
- rabotodat -> 'svedYUL' -> 'naimOrg' as name,
- case
- when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null'
- then rabotodat -> 'svedIP' ->> 'innfl'
- when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null'
- then rabotodat -> 'svedYUL' ->> 'innyul'
- when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null'
- then rabotodat -> 'svedGlKFH' ->> 'innfl'
- when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null'
- then rabotodat -> 'svedPlatFL' ->> 'innfl'
- end as inn,
- case
- when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null'
- then rabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn'
- when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null'
- then rabotodat -> 'svedIP' ->> 'ogrnip'
- end as ogrn,
- case
- when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null'
- then rabotodat -> 'extend' -> 'svedYUL' ->> 'kpp'
- end as kpp,
- coalesce(rabotodat -> 'svedYUL' -> 'extend' ->> 'priznakOpk', '0') = '1' as is_opk_org,
- actual_employer,
- coalesce(rabotodat -> 'extend' ->> 'statusRabotodat', '0') = '1' as status
+ fd.recruit_id,
+ 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,
+ case
+ when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null'
+ then 'Индивидуальный предприниматель'
+ when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо'
+ when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ'
+ when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо'
+ end as employer_category_name,
+ rabotodat -> 'svedYUL' ->> 'naimOrg' as name,
+ case
+ when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null'
+ then rabotodat -> 'svedIP' ->> 'innfl'
+ when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null'
+ then rabotodat -> 'svedYUL' ->> 'innyul'
+ when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null'
+ then rabotodat -> 'svedGlKFH' ->> 'innfl'
+ when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null'
+ then rabotodat -> 'svedPlatFL' ->> 'innfl'
+ end as inn,
+ case
+ when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null'
+ then rabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn'
+ when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null'
+ then rabotodat -> 'svedIP' ->> 'ogrnip'
+ end as ogrn,
+ case
+ when rabotodat ->> 'svedYUL' is not null and rabotodat ->> 'svedYUL' != 'null'
+ then rabotodat -> 'extend' -> 'svedYUL' ->> 'kpp'
+ end as kpp,
+ coalesce(rabotodat -> 'svedYUL' -> 'extend' ->> 'priznakOpk', '0') = '1' as is_opk_org,
+ actual_employer,
+ coalesce(rabotodat -> 'extend' ->> 'statusRabotodat', '0') = '1' as status,
+ fd.ctid = (select max(ctid) from filteredData) as last_row
from filteredData fd;
Y
- 352
+ 528
288