+ERVU-414, ERVU-396
This commit is contained in:
parent
c9bcaa0b03
commit
3059d6bf74
5 changed files with 691 additions and 77 deletions
|
|
@ -20,7 +20,271 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input</from>
|
||||
<to>Table output</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table output</from>
|
||||
<to>Update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Table input</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu_person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH trud_info AS (
|
||||
SELECT
|
||||
ri.info,
|
||||
ri.recruit_id::uuid,
|
||||
case when ri.info->'svedFL'->'svedTrud'->'trudDeyat' IS NULL THEN NULL
|
||||
WHEN jsonb_typeof(ri.info->'svedFL'->'svedTrud'->'trudDeyat') = 'array' THEN
|
||||
(ri.info->'svedFL'->'svedTrud'->'trudDeyat'->0) end as trud_deyat,
|
||||
case when ri.info->'svedFL'->'svedTrud'->'trudDeyat' IS NULL THEN NULL
|
||||
WHEN jsonb_typeof(ri.info->'svedFL'->'svedTrud'->'trudDeyat'->0->'svedUhodReb') = 'array'
|
||||
then ri.info->'svedFL'->'svedTrud'->'trudDeyat'->0->'svedUhodReb'->0 end AS parental_leave_info,
|
||||
coalesce(
|
||||
ri.info->'svedFL'->'svedRabotodat'->'rabotodat'->'aktRabotodat',
|
||||
ri.info->'svedFL'->'svedRabotodat'->'rabotodat'->'predRabotodat'
|
||||
) AS employer,
|
||||
(CASE
|
||||
WHEN info->'svedFL'->'svedRegIP'->'regIP' IS NULL THEN NULL
|
||||
WHEN jsonb_typeof(info->'svedFL'->'svedRegIP'->'regIP'->'aktRegIP') = 'array' THEN
|
||||
(info->'svedFL'->'svedRegIP'->'regIP'->'aktRegIP'->0)
|
||||
ELSE
|
||||
info->'svedFL'->'svedRegIP'->'regIP'->'predRegIP'
|
||||
END) AS reg_ip,
|
||||
COALESCE(
|
||||
ri.info->'svedFL'->'svedNPD'->'npd'->'aktNPD',
|
||||
ri.info->'svedFL'->'svedNPD'->'npd'->'predNPD'
|
||||
) AS self_employment
|
||||
FROM public.recruits_info ri
|
||||
join public.recruits r
|
||||
ON r.id = ri.recruit_id
|
||||
AND (r.target_recruitment_id= '${RCRT_C}' or r.current_recruitment_id = '${RCRT_C}')
|
||||
)
|
||||
SELECT
|
||||
ti.recruit_id::uuid,
|
||||
(ti.trud_deyat->>'dataMeropr')::date AS personnel_event_date,
|
||||
ti.trud_deyat->>'naimTipKadrMeropr' AS personnel_event_type,
|
||||
case when ti.trud_deyat->>'prAktMestRab' = '1' then true else false end AS current_workplace,
|
||||
ti.trud_deyat->>'trudFunkcziya' AS position,
|
||||
ti.trud_deyat->'svedOrg'->>'naimOrg' AS employer_name,
|
||||
ti.employer->'svedYUL'->>'kpp' AS employer_kpp,
|
||||
CASE
|
||||
WHEN ti.employer->>'svedYUL' != 'null' THEN 'Юридическое лицо'
|
||||
WHEN ti.employer->>'svedIP' != 'null' THEN 'Индивидуальный предприниматель'
|
||||
END AS employer_category,
|
||||
COALESCE(
|
||||
ti.employer->'svedYUL'->>'innyul',
|
||||
ti.employer->'svedIP'->>'innyfl'
|
||||
) AS employer_inn,
|
||||
ti.employer->'svedYUL'->'svedOPK'->>'region' AS employer_address,
|
||||
COALESCE(
|
||||
ti.employer->'svedIP'->>'ogrnip',
|
||||
ti.employer->'svedYUL'->'extend'->>'ogrn'
|
||||
) AS employer_ogrnip,
|
||||
ti.employer->'extend'->>'tipPodrazdRabotodat' as employer_unit_type,
|
||||
ti.employer->'extend'->>'adresPodrazdRabotodat' as employer_unit_address,
|
||||
(ti.parental_leave_info->>'dataNachUhodReb')::date as parental_leave_start_date,
|
||||
(ti.parental_leave_info->>'dataKonUhodReb')::date as parental_leave_end_date,
|
||||
case when (ti.parental_leave_info->>'dataNachUhodReb')::date <= current_date
|
||||
and ((ti.parental_leave_info->>'dataKonUhodReb')::date is null
|
||||
or (ti.parental_leave_info->>'dataKonUhodReb')::date > current_date)
|
||||
then true
|
||||
else false end as parental_leave_active,
|
||||
(ti.reg_ip->>'dataRegIP')::date as reg_ip_date,
|
||||
(ti.reg_ip->>'dataINNNed')::date as dereg_ip_date,
|
||||
ti.reg_ip->>'ogrnip' as ogrnip_ip,
|
||||
case when ti.reg_ip != 'null'
|
||||
then true else false end as active_ip,
|
||||
ti.self_employment->>'dataUchNPD' as reg_self_employment_date,
|
||||
ti.self_employment->>'dataSnUchNPD' as dereg_self_employment_date,
|
||||
case when ti.self_employment != 'null'
|
||||
then true else false end as active_self_employment
|
||||
FROM trud_info ti
|
||||
</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>0</xloc>
|
||||
<yloc>0</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table output</name>
|
||||
<type>TableOutput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<fields>
|
||||
<field>
|
||||
<column_name>recruit_id</column_name>
|
||||
<stream_name>recruit_id</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>employer_category</column_name>
|
||||
<stream_name>employer_category</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>organization_name</column_name>
|
||||
<stream_name>employer_name</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>inn</column_name>
|
||||
<stream_name>employer_inn</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>ogrn</column_name>
|
||||
<stream_name>employer_ogrnip</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>kpp</column_name>
|
||||
<stream_name>employer_kpp</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>organization_address</column_name>
|
||||
<stream_name>employer_address</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>type_separate_division</column_name>
|
||||
<stream_name>employer_unit_type</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>address_separate_division</column_name>
|
||||
<stream_name>employer_unit_address</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>type_hr_event</column_name>
|
||||
<stream_name>personnel_event_type</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>date_hr_event</column_name>
|
||||
<stream_name>personnel_event_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>job_title</column_name>
|
||||
<stream_name>position</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>start_date_parental_leave</column_name>
|
||||
<stream_name>parental_leave_start_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>end_date_parental_leave</column_name>
|
||||
<stream_name>parental_leave_end_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>ogrn_ip</column_name>
|
||||
<stream_name>ogrnip_ip</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>date_reg_ip</column_name>
|
||||
<stream_name>reg_ip_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>date_dereg_ip</column_name>
|
||||
<stream_name>dereg_ip_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>date_reg_self</column_name>
|
||||
<stream_name>reg_self_employment_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>date_dereg_self</column_name>
|
||||
<stream_name>dereg_self_employment_date</stream_name>
|
||||
</field>
|
||||
</fields>
|
||||
<ignore_errors>N</ignore_errors>
|
||||
<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>citizen_work_activity</table>
|
||||
<tablename_field/>
|
||||
<tablename_in_field>N</tablename_in_field>
|
||||
<tablename_in_table>Y</tablename_in_table>
|
||||
<truncate>N</truncate>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>144</xloc>
|
||||
<yloc>0</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Update</name>
|
||||
<type>Update</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<error_ignored>Y</error_ignored>
|
||||
<ignore_flag_field/>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
<value>
|
||||
<name>employed</name>
|
||||
<rename>current_workplace</rename>
|
||||
</value>
|
||||
<value>
|
||||
<name>active_reg_ip</name>
|
||||
<rename>active_ip</rename>
|
||||
</value>
|
||||
<value>
|
||||
<name>active_parental_leave</name>
|
||||
<rename>parental_leave_active</rename>
|
||||
</value>
|
||||
<value>
|
||||
<name>self_employed</name>
|
||||
<rename>active_self_employment</rename>
|
||||
</value>
|
||||
</lookup>
|
||||
<skip_lookup>N</skip_lookup>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>320</xloc>
|
||||
<yloc>0</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,16 @@
|
|||
<to>Table output 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table output 2</from>
|
||||
<to>Update 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table output</from>
|
||||
<to>Update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Table input</name>
|
||||
|
|
@ -46,7 +56,7 @@
|
|||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>select
|
||||
r.id recruit_id,
|
||||
recruit_id,
|
||||
case when ri.info->'svedFL'->'svedInvalid'->'invalid'->>'gruppa'='1' then 'I группа'
|
||||
when ri.info->'svedFL'->'svedInvalid'->'invalid'->>'gruppa'='2' then 'II группа'
|
||||
when ri.info->'svedFL'->'svedInvalid'->'invalid'->>'gruppa'='3' then 'III группа'
|
||||
|
|
@ -58,8 +68,11 @@
|
|||
to_date(ri.info->'svedFL'->'svedInvalid'->'invalid'->'ustanInvalid'->>'dataPodtverzhdPlan', 'YYYY-MM-DD') confirmation_date,
|
||||
true disability
|
||||
from public.recruits_info ri
|
||||
join public.recruits r ON r.id = ri.recruit_id AND (r.target_recruitment_id= '${RCRT_C}' or r.current_recruitment_id = '${RCRT_C}')
|
||||
where ri.info->'svedFL'->'svedInvalid'->'invalid'->>'gruppa' is not null;</sql>
|
||||
join public.recruits r
|
||||
ON r.id = ri.recruit_id
|
||||
AND (r.target_recruitment_id = '${RCRT_C}' or
|
||||
r.current_recruitment_id = '${RCRT_C}')
|
||||
where ri.info->'svedFL'->'svedInvalid'->>'invalid' != 'null';</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
@ -82,13 +95,18 @@ where ri.info->'svedFL'->'svedInvalid'->'invalid'->>'gruppa' is not null;</sql>
|
|||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>select
|
||||
r.id recruit_id,
|
||||
ri.info->'svedNedeesp'->'nedeesposob'->>'naimSud' organization_name,
|
||||
recruit_id,
|
||||
ri.info->'svedNedeesp'->'nedeesposob'->>'naimOrg' organization_name,
|
||||
to_date(ri.info->'svedNedeesp'->'nedeesposob'->>'dataPrisv', 'YYYY-MM-DD') start_date,
|
||||
to_date(ri.info->'svedNedeesp'->'nedeesposob'->>'dataOtmeny', 'YYYY-MM-DD') close_date
|
||||
to_date(ri.info->'svedNedeesp'->'nedeesposob'->>'dataOtmeny', 'YYYY-MM-DD') close_date,
|
||||
false disability,
|
||||
true is_incompetent
|
||||
from public.recruits_info ri
|
||||
join public.recruits r ON r.id = ri.recruit_id AND (r.target_recruitment_id= '${RCRT_C}' or r.current_recruitment_id = '${RCRT_C}')
|
||||
where ri.info->'svedNedeesp'->'nedeesposob'->>'naimSud' is not null;</sql>
|
||||
join public.recruits r
|
||||
ON r.id = ri.recruit_id
|
||||
AND (r.target_recruitment_id = '${RCRT_C}' or
|
||||
r.current_recruitment_id = '${RCRT_C}')
|
||||
where ri.info->'svedNedeesp'->>'nedeesposob' != 'null';</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
@ -110,16 +128,47 @@ where ri.info->'svedNedeesp'->'nedeesposob'->>'naimSud' is not null;</sql>
|
|||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<fields>
|
||||
<field>
|
||||
<column_name>recruit_id</column_name>
|
||||
<stream_name>recruit_id</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>disability_group</column_name>
|
||||
<stream_name>disability_group</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>organization_name</column_name>
|
||||
<stream_name>organization_name</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>start_date</column_name>
|
||||
<stream_name>start_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>close_date</column_name>
|
||||
<stream_name>close_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>confirmation_date</column_name>
|
||||
<stream_name>confirmation_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>disability</column_name>
|
||||
<stream_name>disability</stream_name>
|
||||
</field>
|
||||
</fields>
|
||||
<ignore_errors>N</ignore_errors>
|
||||
<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>N</specify_fields>
|
||||
<specify_fields>Y</specify_fields>
|
||||
<table>disability</table>
|
||||
<tablename_field/>
|
||||
<tablename_in_field>N</tablename_in_field>
|
||||
<tablename_in_table>Y</tablename_in_table>
|
||||
<truncate>N</truncate>
|
||||
|
|
@ -144,6 +193,26 @@ where ri.info->'svedNedeesp'->'nedeesposob'->>'naimSud' is not null;</sql>
|
|||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<fields>
|
||||
<field>
|
||||
<column_name>recruit_id</column_name>
|
||||
<stream_name>recruit_id</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>organization_name</column_name>
|
||||
<stream_name>organization_name</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>start_date</column_name>
|
||||
<stream_name>start_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>close_date</column_name>
|
||||
<stream_name>close_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>disability</column_name>
|
||||
<stream_name>disability</stream_name>
|
||||
</field>
|
||||
</fields>
|
||||
<ignore_errors>N</ignore_errors>
|
||||
<only_when_have_rows>N</only_when_have_rows>
|
||||
|
|
@ -152,7 +221,7 @@ where ri.info->'svedNedeesp'->'nedeesposob'->>'naimSud' is not null;</sql>
|
|||
<partitioning_monthly>Y</partitioning_monthly>
|
||||
<return_keys>N</return_keys>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<specify_fields>N</specify_fields>
|
||||
<specify_fields>Y</specify_fields>
|
||||
<table>disability</table>
|
||||
<tablename_in_field>N</tablename_in_field>
|
||||
<tablename_in_table>Y</tablename_in_table>
|
||||
|
|
@ -164,6 +233,78 @@ where ri.info->'svedNedeesp'->'nedeesposob'->>'naimSud' is not null;</sql>
|
|||
<yloc>304</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Update</name>
|
||||
<type>Update</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<error_ignored>Y</error_ignored>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
<value>
|
||||
<name>has_disability</name>
|
||||
<rename>disability</rename>
|
||||
</value>
|
||||
</lookup>
|
||||
<skip_lookup>N</skip_lookup>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>576</xloc>
|
||||
<yloc>208</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Update 2</name>
|
||||
<type>Update</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<error_ignored>Y</error_ignored>
|
||||
<ignore_flag_field/>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
<value>
|
||||
<name>is_incompetent</name>
|
||||
<rename>is_incompetent</rename>
|
||||
</value>
|
||||
</lookup>
|
||||
<skip_lookup>N</skip_lookup>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>576</xloc>
|
||||
<yloc>304</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@
|
|||
<to>Table output</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table output</from>
|
||||
<to>Update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Table input</name>
|
||||
|
|
@ -40,21 +45,28 @@
|
|||
<connection>ervu_person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>with zdorov as
|
||||
(select
|
||||
jsonb_array_elements(ri.info->'svedFL'->'svedSostZdorov'->'svedZdorov'->'sostZdorov') z,
|
||||
ri.recruit_id
|
||||
<sql>with zdorov as (select ri.recruit_id,
|
||||
jsonb_array_elements(
|
||||
ri.info -> 'svedFL' -> 'svedSostZdorov' -> 'svedZdorov' ->
|
||||
'sostZdorov') z,
|
||||
case
|
||||
when ri.info -> 'svedFL' -> 'svedSostZdorov' -> 'svedZdorov' ->>
|
||||
'priznakNalichSved' = '1'
|
||||
then true
|
||||
else false end as has_disease
|
||||
from public.recruits_info ri
|
||||
join public.recruits r ON r.id = ri.recruit_id AND (r.target_recruitment_id= '${RCRT_C}' or r.current_recruitment_id = '${RCRT_C}')
|
||||
where jsonb_typeof(ri.info->'svedFL'->'svedSostZdorov'->'svedZdorov'->'sostZdorov') = 'array'
|
||||
)
|
||||
select
|
||||
r.id recruit_id,
|
||||
join public.recruits r
|
||||
ON r.id = ri.recruit_id
|
||||
AND (r.target_recruitment_id = '${RCRT_C}' or
|
||||
r.current_recruitment_id = '${RCRT_C}')
|
||||
where jsonb_typeof(ri.info -> 'svedFL' -> 'svedSostZdorov' -> 'svedZdorov' ->
|
||||
'sostZdorov') = 'array')
|
||||
select recruit_id,
|
||||
z ->> 'kodZabol' code,
|
||||
z ->> 'naimZabol' name,
|
||||
has_disease,
|
||||
to_date(z ->> 'dataDiagn', 'YYYY-MM-DD') reg_date
|
||||
from public.recruits r
|
||||
join zdorov on r.id = zdorov.recruit_id;</sql>
|
||||
from zdorov;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
@ -76,6 +88,22 @@ join zdorov on r.id = zdorov.recruit_id;</sql>
|
|||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<fields>
|
||||
<field>
|
||||
<column_name>recruit_id</column_name>
|
||||
<stream_name>recruit_id</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>code</column_name>
|
||||
<stream_name>code</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>name</column_name>
|
||||
<stream_name>name</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>reg_date</column_name>
|
||||
<stream_name>reg_date</stream_name>
|
||||
</field>
|
||||
</fields>
|
||||
<ignore_errors>N</ignore_errors>
|
||||
<only_when_have_rows>N</only_when_have_rows>
|
||||
|
|
@ -84,7 +112,7 @@ join zdorov on r.id = zdorov.recruit_id;</sql>
|
|||
<partitioning_monthly>Y</partitioning_monthly>
|
||||
<return_keys>N</return_keys>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<specify_fields>N</specify_fields>
|
||||
<specify_fields>Y</specify_fields>
|
||||
<table>disease</table>
|
||||
<tablename_in_field>N</tablename_in_field>
|
||||
<tablename_in_table>Y</tablename_in_table>
|
||||
|
|
@ -96,6 +124,43 @@ join zdorov on r.id = zdorov.recruit_id;</sql>
|
|||
<yloc>208</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Update</name>
|
||||
<type>Update</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<error_ignored>Y</error_ignored>
|
||||
<ignore_flag_field/>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
<value>
|
||||
<name>has_disease</name>
|
||||
<rename>has_disease</rename>
|
||||
</value>
|
||||
</lookup>
|
||||
<skip_lookup>N</skip_lookup>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>592</xloc>
|
||||
<yloc>208</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
|
|
|
|||
|
|
@ -1183,11 +1183,14 @@
|
|||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/jobs_once_a_day/citizen_education_diplomas_received_once.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>RCRT_C</name>
|
||||
<stream_name>RECRUITMENT_CITIZEN</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -1209,15 +1212,22 @@
|
|||
<add_date>N</add_date>
|
||||
<add_time>N</add_time>
|
||||
<clear_files>N</clear_files>
|
||||
<clear_rows>Y</clear_rows>
|
||||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>N</exec_per_row>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/jobs_once_a_day/citizen_work_activity_once.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>RCRT_C</name>
|
||||
<stream_name>RECRUITMENT_CITIZEN</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
<params_from_previous>N</params_from_previous>
|
||||
<params_from_previous>Y</params_from_previous>
|
||||
<run_configuration>local</run_configuration>
|
||||
<set_append_logfile>N</set_append_logfile>
|
||||
<set_logfile>N</set_logfile>
|
||||
|
|
@ -2097,6 +2107,13 @@
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>recruitment_rows.hpl</from>
|
||||
<to>SQL.citizen_work_activity</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
</hops>
|
||||
<notepads>
|
||||
<notepad>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,16 @@
|
|||
<to>Table output 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table output</from>
|
||||
<to>Update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table output 2</from>
|
||||
<to>Update 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Table input 2</name>
|
||||
|
|
@ -46,20 +56,24 @@
|
|||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>with uchet as
|
||||
(select
|
||||
jsonb_array_elements(ri.info->'svedFL'->'svedPND'->'svedUchetDisp'->'svedUchet') u,
|
||||
ri.recruit_id
|
||||
(select ri.recruit_id,
|
||||
jsonb_array_elements(ri.info -> 'svedFL' -> 'svedPND' -> 'svedUchetDisp' ->
|
||||
'svedUchet') u,
|
||||
ri.info -> 'svedFL' -> 'svedPND' -> 'svedUchetDisp' -> 'svedUchet' ->>
|
||||
'priznakNalichSved' = '1' as registered_in_pnd
|
||||
from public.recruits_info ri
|
||||
join public.recruits r ON r.id = ri.recruit_id AND (r.target_recruitment_id= '${RCRT_C}' or r.current_recruitment_id = '${RCRT_C}')
|
||||
where jsonb_typeof(ri.info->'svedFL'->'svedPND'->'svedUchetDisp'->'svedUchet') = 'array'
|
||||
)
|
||||
select
|
||||
r.id recruit_id,
|
||||
join public.recruits r
|
||||
ON r.id = ri.recruit_id
|
||||
AND (r.target_recruitment_id = '${RCRT_C}' or
|
||||
r.current_recruitment_id = '${RCRT_C}')
|
||||
where jsonb_typeof(ri.info -> 'svedFL' -> 'svedPND' -> 'svedUchetDisp' -> 'svedUchet') =
|
||||
'array')
|
||||
select recruit_id,
|
||||
u ->> 'dataPostUchet' start_date,
|
||||
u ->> 'dataSnyatUchet' close_date,
|
||||
u->>'dataPlan' change_date
|
||||
from public.recruits r
|
||||
join uchet on r.id = uchet.recruit_id;</sql>
|
||||
u ->> 'dataPlan' change_date,
|
||||
registered_in_pnd
|
||||
from uchet;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
@ -82,20 +96,21 @@ join uchet on r.id = uchet.recruit_id;</sql>
|
|||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>with uchet as
|
||||
(select
|
||||
(select ri.recruit_id,
|
||||
jsonb_array_elements(ri.info->'svedFL'->'svedUchetVICH'->'uchetVICH') u,
|
||||
ri.recruit_id
|
||||
ri.info->'svedFL'->'svedUchetVICH'->>'priznakNalichSved' = '1' has_vich
|
||||
from public.recruits_info ri
|
||||
join public.recruits r ON r.id = ri.recruit_id AND (r.target_recruitment_id= '${RCRT_C}' or r.current_recruitment_id = '${RCRT_C}')
|
||||
where jsonb_typeof(ri.info->'svedFL'->'svedUchetVICH'->'uchetVICH') = 'array'
|
||||
)
|
||||
join public.recruits r
|
||||
ON r.id = ri.recruit_id
|
||||
AND (r.target_recruitment_id = '${RCRT_C}' or
|
||||
r.current_recruitment_id = '${RCRT_C}')
|
||||
where jsonb_typeof(ri.info->'svedFL'->'svedUchetVICH'->'uchetVICH') = 'array')
|
||||
select
|
||||
r.id recruit_id,
|
||||
recruit_id,
|
||||
to_date(u->>'dataPostUchet', 'YYYY-MM-DD') start_date,
|
||||
to_date(u->>'dataSnyat', 'YYYY-MM-DD') close_date,
|
||||
true HIV
|
||||
from public.recruits r
|
||||
join uchet on r.id = uchet.recruit_id;</sql>
|
||||
from uchet;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
@ -117,16 +132,35 @@ join uchet on r.id = uchet.recruit_id;</sql>
|
|||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<fields>
|
||||
<field>
|
||||
<column_name>recruit_id</column_name>
|
||||
<stream_name>recruit_id</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>start_date</column_name>
|
||||
<stream_name>start_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>close_date</column_name>
|
||||
<stream_name>close_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>hiv</column_name>
|
||||
<stream_name>has_vich</stream_name>
|
||||
</field>
|
||||
</fields>
|
||||
<ignore_errors>N</ignore_errors>
|
||||
<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>N</specify_fields>
|
||||
<specify_fields>Y</specify_fields>
|
||||
<table>medical_authorities</table>
|
||||
<tablename_field/>
|
||||
<tablename_in_field>N</tablename_in_field>
|
||||
<tablename_in_table>Y</tablename_in_table>
|
||||
<truncate>N</truncate>
|
||||
|
|
@ -151,16 +185,35 @@ join uchet on r.id = uchet.recruit_id;</sql>
|
|||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<fields>
|
||||
<field>
|
||||
<column_name>recruit_id</column_name>
|
||||
<stream_name>recruit_id</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>start_date</column_name>
|
||||
<stream_name>start_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>close_date</column_name>
|
||||
<stream_name>close_date</stream_name>
|
||||
</field>
|
||||
<field>
|
||||
<column_name>change_date</column_name>
|
||||
<stream_name>change_date</stream_name>
|
||||
</field>
|
||||
</fields>
|
||||
<ignore_errors>N</ignore_errors>
|
||||
<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>N</specify_fields>
|
||||
<specify_fields>Y</specify_fields>
|
||||
<table>medical_authorities</table>
|
||||
<tablename_field/>
|
||||
<tablename_in_field>N</tablename_in_field>
|
||||
<tablename_in_table>Y</tablename_in_table>
|
||||
<truncate>N</truncate>
|
||||
|
|
@ -171,6 +224,80 @@ join uchet on r.id = uchet.recruit_id;</sql>
|
|||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Update</name>
|
||||
<type>Update</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<error_ignored>Y</error_ignored>
|
||||
<ignore_flag_field/>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
<value>
|
||||
<name>has_vich</name>
|
||||
<rename>has_vich</rename>
|
||||
</value>
|
||||
</lookup>
|
||||
<skip_lookup>N</skip_lookup>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>576</xloc>
|
||||
<yloc>208</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Update 2</name>
|
||||
<type>Update</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>1000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<error_ignored>Y</error_ignored>
|
||||
<ignore_flag_field/>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
<value>
|
||||
<name>registered_in_pnd</name>
|
||||
<rename>registered_in_pnd</rename>
|
||||
</value>
|
||||
</lookup>
|
||||
<skip_lookup>N</skip_lookup>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>576</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue