ervu-dashboard-etl/mappings_old/jobs_once/child_once.hpl

183 lines
5.3 KiB
Text
Raw Permalink Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>child_once</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<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/15 14:02:51.713</created_date>
<modified_user>-</modified_user>
<modified_date>2024/08/15 14:02:51.713</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>N</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>birth_az_number</name>
<rename>birth_az_number</rename>
<update>Y</update>
</value>
<value>
<name>birth_date</name>
<rename>birth_date</rename>
<update>Y</update>
</value>
<value>
<name>death_az_number</name>
<rename>death_az_number</rename>
<update>Y</update>
</value>
<value>
<name>death_date</name>
<rename>death_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>624</xloc>
<yloc>256</yloc>
</GUI>
</transform>
<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 child as
(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch,
ri.recruit_id
from public.recruits_info ri
2025-05-12 14:39:11 +03:00
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'->'svedDeti'->'rebenok') = 'array'
)
select
r.id::uuid recruit_id,
ch->>'naimRodstvSvyazReb' kinship_type,
concat_ws(' ', ch->'svedFLBS'->'fio'->>'familiya',
ch->'svedFLBS'->'fio'->>'imya',
ch->'svedFLBS'->'fio'->>'otchestvo') full_name,
make_date(NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(ch->'svedFLBS'->'dataRozhdDok'->>'den','')::int) birth_date,
make_date(NULLIF(ch->'svedSmert'->'dataSmert'->>'god', '')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'mesyacz','')::int,
NULLIF(ch->'svedSmert'->'dataSmert'->>'den','')::int) death_date,
ch->'svedSmert'->>'nomerZapis' death_az_number,
ch->'svedAZRozhd'->>'nomerZapis' birth_az_number
from public.recruits r
join child on r.id = child.recruit_id</sql>
2025-05-12 14:39:11 +03:00
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>400</xloc>
<yloc>256</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>
2025-05-12 14:39:11 +03:00
<commit>20000</commit>
<connection>ervu-dashboard</connection>
<fields>
</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>
2025-05-12 14:39:11 +03:00
<partitioning_field/>
<partitioning_monthly>Y</partitioning_monthly>
2025-05-12 14:39:11 +03:00
<return_field/>
<return_keys>N</return_keys>
<schema>ervu_dashboard</schema>
<specify_fields>N</specify_fields>
<table>citizen_child</table>
2025-05-12 14:39:11 +03:00
<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>608</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>