ervu-dashboard-etl/apache-hop mapping/country/total_registered.marital_status.hpl

470 lines
13 KiB
Text
Raw Normal View History

2024-10-16 10:38:29 +03:00
<pipeline>
<info>
<name>total_registered.marital_status</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<pipeline_status>0</pipeline_status>
<directory>/</directory>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2024/08/02 11:56:22.507</created_date>
<modified_user>-</modified_user>
<modified_date>2024/08/02 11:56:22.507</modified_date>
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input (person_registry) РФ/все</from>
<to>Insert / update (total_registered.marital_status) </to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input (person_registry) РФ/мужчины</from>
<to>Insert / update (total_registered.marital_status) 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input (person_registry) РФ/женщины</from>
<to>Insert / update (total_registered.marital_status) 3</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update (total_registered.marital_status) </name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<commit>100</commit>
<update_bypassed>Y</update_bypassed>
<lookup>
<schema>total_registered</schema>
<table>marital_status</table>
<key>
<name>recruitment_id</name>
<field>recruitment_id</field>
<condition>=</condition>
<name2/>
</key>
<key>
<name>gender</name>
<field>"all_M_W"</field>
<condition>=</condition>
<name2/>
</key>
<value>
<name>married</name>
<rename>married</rename>
<update>Y</update>
</value>
<value>
<name>not_married</name>
<rename>not_married</rename>
<update>Y</update>
</value>
<value>
<name>married_percent</name>
<rename>married_percent</rename>
<update>Y</update>
</value>
<value>
<name>not_married_percent</name>
<rename>not_married_percent</rename>
<update>Y</update>
</value>
<value>
<name>"all_M_W"</name>
<rename>gender</rename>
<update>N</update>
</value>
<value>
<name>recruitment_id</name>
<rename>recruitment_id</rename>
<update>N</update>
</value>
<value>
<name>marital_status</name>
<rename>total</rename>
<update>Y</update>
</value>
</lookup>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>1216</xloc>
<yloc>176</yloc>
<draw>Y</draw>
</GUI>
</transform>
<transform>
<name>Insert / update (total_registered.marital_status) 2</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<commit>100</commit>
<update_bypassed>Y</update_bypassed>
<lookup>
<schema>total_registered</schema>
<table>marital_status</table>
<key>
<name>recruitment_id</name>
<field>recruitment_id</field>
<condition>=</condition>
<name2/>
</key>
<key>
<name>gender</name>
<field>"all_M_W"</field>
<condition>=</condition>
<name2/>
</key>
<value>
<name>married</name>
<rename>married</rename>
<update>Y</update>
</value>
<value>
<name>not_married</name>
<rename>not_married</rename>
<update>Y</update>
</value>
<value>
<name>married_percent</name>
<rename>married_percent</rename>
<update>Y</update>
</value>
<value>
<name>not_married_percent</name>
<rename>not_married_percent</rename>
<update>Y</update>
</value>
<value>
<name>"all_M_W"</name>
<rename>gender</rename>
<update>N</update>
</value>
<value>
<name>recruitment_id</name>
<rename>recruitment_id</rename>
<update>N</update>
</value>
<value>
<name>marital_status</name>
<rename>total</rename>
<update>Y</update>
</value>
</lookup>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>1216</xloc>
<yloc>272</yloc>
<draw>Y</draw>
</GUI>
</transform>
<transform>
<name>Insert / update (total_registered.marital_status) 3</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<commit>100</commit>
<update_bypassed>Y</update_bypassed>
<lookup>
<schema>total_registered</schema>
<table>marital_status</table>
<key>
<name>recruitment_id</name>
<field>recruitment_id</field>
<condition>=</condition>
<name2/>
</key>
<key>
<name>gender</name>
<field>"all_M_W"</field>
<condition>=</condition>
<name2/>
</key>
<value>
<name>married</name>
<rename>married</rename>
<update>Y</update>
</value>
<value>
<name>not_married</name>
<rename>not_married</rename>
<update>Y</update>
</value>
<value>
<name>married_percent</name>
<rename>married_percent</rename>
<update>Y</update>
</value>
<value>
<name>not_married_percent</name>
<rename>not_married_percent</rename>
<update>Y</update>
</value>
<value>
<name>"all_M_W"</name>
<rename>gender</rename>
<update>N</update>
</value>
<value>
<name>recruitment_id</name>
<rename>recruitment_id</rename>
<update>N</update>
</value>
<value>
<name>marital_status</name>
<rename>total</rename>
<update>Y</update>
</value>
</lookup>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>1216</xloc>
<yloc>368</yloc>
<draw>Y</draw>
</GUI>
</transform>
<transform>
<name>Table input (person_registry) РФ/все</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>
<sql>SELECT
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
) AS not_married,
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
) AS married,
COUNT(*) AS total,
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND(
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
) * 100.0 / COUNT(*), 2
) END AS not_married_percent,
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND(
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
) * 100.0 / COUNT(*), 2
) END AS married_percent,
'ALL' as gender,
'00' as recruitment_id
FROM
public.recruits r
JOIN
public.recruits_info ri ON ri.recruit_id = r.id
WHERE
r.current_recruitment_id IS NOT NULL
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null and r.target_recruitment_id is not null</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>N</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>592</xloc>
<yloc>176</yloc>
<draw>Y</draw>
</GUI>
</transform>
<transform>
<name>Table input (person_registry) РФ/женщины</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>
<sql> SELECT
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
) AS not_married,
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
) AS married,
COUNT(*) AS total,
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND(
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
) * 100.0 / COUNT(*), 2
) END AS not_married_percent,
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND(
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
) * 100.0 / COUNT(*), 2
) END AS married_percent,
'W' as gender,
'00' as recruitment_id
FROM
public.recruits r
JOIN
public.recruits_info ri ON ri.recruit_id = r.id
WHERE
r.current_recruitment_id IS NOT NULL
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null and r.target_recruitment_id is not null
AND r.gender = 'FEMALE';
</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>N</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>592</xloc>
<yloc>368</yloc>
<draw>Y</draw>
</GUI>
</transform>
<transform>
<name>Table input (person_registry) РФ/мужчины</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>
<sql>SELECT
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
) AS not_married,
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
) AS married,
COUNT(*) AS total,
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND(
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
) * 100.0 / COUNT(*), 2
) END AS not_married_percent,
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND(
COUNT(*) FILTER (
WHERE
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
) * 100.0 / COUNT(*), 2
) END AS married_percent,
'M' as gender,
'00' as recruitment_id
FROM
public.recruits r
JOIN
public.recruits_info ri ON ri.recruit_id = r.id
WHERE
r.current_recruitment_id IS NOT NULL
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null and r.target_recruitment_id is not null
AND r.gender = 'MALE';
</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>N</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>592</xloc>
<yloc>272</yloc>
<draw>Y</draw>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>