This commit is contained in:
Fusionshh 2025-08-19 15:46:52 +03:00
parent 699732fc14
commit e3e79bd30a

View file

@ -325,11 +325,14 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_monthly>Y</partitioning_monthly>
<return_field/>
<return_keys>N</return_keys>
<schema>ervu_dashboard</schema>
<specify_fields>Y</specify_fields>
<table>employer</table>
<tablename_field/>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
@ -355,8 +358,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with filteredData as (
select ri.recruit_id::text,
(ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id')::text as source_id,
select ri.recruit_id,
(ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id')::uuid as source_id,
ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as aktRabotodat,
ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as predRabotodat
from recruits_info ri
@ -364,8 +367,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
--and COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
)
select
fd.recruit_id::text,
fd.source_id::text,
fd.recruit_id,
fd.source_id::uuid,
-- aktRabotodat
aktRabotodat -> 'dataSved' as akt_source_update_date,
aktRabotodat -> 'extend' ->> 'adresRabotodat' as akt_address,
@ -373,7 +376,7 @@ select
aktRabotodat -> 'extend' ->> 'adresPodrazdRabotodat' as akt_separate_unit_address,
case
when aktRabotodat ->> 'svedIP' != 'null' then 'Индивидуальный предприниматель'
when aktRabotodat ->> 'svedYUL' != 'null' then 'Юридическое лицо'
when aktRabotodat ->&gt; 'svedYUL' != 'null' then 'Юридическое лицо'
when aktRabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ'
when aktRabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо'
END