свежая версия со стенда

This commit is contained in:
Булат Хайруллин 2025-04-07 20:31:30 +03:00
parent d288a7519e
commit 13aeb606dc
280 changed files with 75366 additions and 20884 deletions

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>spouse</name>
@ -6,7 +7,6 @@
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<directory>/</directory>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
@ -16,8 +16,6 @@
<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>
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
</notepads>
@ -25,14 +23,108 @@
<hop>
<from>Select values</from>
<to>Table output</to>
<enabled>Y</enabled>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Select values</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Select values</from>
<to>Insert / update</to>
<enabled>Y</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>
<key>
<condition>=</condition>
<field>full_name</field>
<name>full_name</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_spouse</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</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>divorce_az_number</name>
<rename>divorce_az_number</rename>
<update>Y</update>
</value>
<value>
<name>divorce_date</name>
<rename>divorce_date</rename>
<update>Y</update>
</value>
<value>
<name>full_name</name>
<rename>full_name</rename>
<update>N</update>
</value>
<value>
<name>information_excluded</name>
<rename>information_excluded</rename>
<update>Y</update>
</value>
<value>
<name>kinship_type</name>
<rename>kinship_type</rename>
<update>Y</update>
</value>
<value>
<name>marriage_az_number</name>
<rename>marriage_az_number</rename>
<update>Y</update>
</value>
<value>
<name>marriage_date</name>
<rename>marriage_date</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>704</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform>
<name>Select values</name>
<type>SelectValues</type>
@ -82,11 +174,9 @@
</meta>
</fields>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>448</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>
</transform>
<transform>
@ -101,48 +191,56 @@
<schema_name/>
</partitioning>
<connection>ervu_person_registry</connection>
<sql>with suprug as
(select jsonb_array_elements(ri.info->'svedSemPolozh'->'suprugi') supr,
ri.info->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' marriage_az_number,
ri.info->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend' marriage_date,
ri.info->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' divorce_az_number,
ri.info->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend' divorce_date,
case when (ri.info->'svedSemPolozh'->>'svedSuprIskl' = '1') then true
else false
end information_excluded,
ri.recruit_id
from public.recruits_info ri)
select
r.id recruit_id,
supr->>'rodstvSvyazSuprugNaim' kinship_type,
concat_ws(' ', supr->'svedFLBS'->'fio'->>'familiya',
supr->'svedFLBS'->'fio'->>'imya',
supr->'svedFLBS'->'fio'->>'otchestvo') full_name,
make_date(NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int) birth_date,
make_date(NULLIF(supr->'svedSmert'->>'god', '')::int,
NULLIF(supr->'svedSmert'->>'mesyacz','')::int,
NULLIF(supr->'svedSmert'->>'den','')::int) death_date,
supr->'svedSmert'->>'nomerZapis' death_az_number,
marriage_az_number,
marriage_date,
divorce_az_number,
divorce_date,
information_excluded
from public.recruits r
join suprug on r.id = suprug.recruit_id</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>N</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<limit>0</limit>
<sql>WITH suprug AS (
SELECT
supr.supri AS supr,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend' AS marriage_date,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number,
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend' AS divorce_date,
CASE
WHEN (ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1') THEN true
ELSE false
END AS information_excluded,
ri.recruit_id
FROM public.recruits_info ri
join public.recruits r ON r.id = ri.recruit_id AND r.system_update_date >= '${UP_D}'
JOIN LATERAL (
SELECT jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri
WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array'
) AS supr ON true
)
SELECT
r.id AS recruit_id,
supr->>'rodstvSvyazSuprugNaim' AS kinship_type,
CONCAT_WS(' ',
supr->'svedFLBS'->'fio'->>'familiya',
supr->'svedFLBS'->'fio'->>'imya',
supr->'svedFLBS'->'fio'->>'otchestvo'
) AS full_name,
MAKE_DATE(
NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'god', '')::int,
NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(supr->'svedFLBS'->'dataRozhdDok'->>'den','')::int
) AS birth_date,
(supr->'svedSmert'->'extend'->>'dataSmert')::date AS death_date,
supr->'svedSmert'->>'nomerZapis' AS death_az_number,
marriage_az_number,
marriage_date,
divorce_az_number,
divorce_date,
information_excluded
FROM public.recruits r
JOIN suprug ON r.id = suprug.recruit_id
</sql>
<variables_active>Y</variables_active>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>192</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>
</transform>
<transform>
@ -156,31 +254,27 @@ join suprug on r.id = suprug.recruit_id</sql>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu-dashboard</connection>
<schema>ervu_dashboard</schema>
<table>citizen_spouse</table>
<commit>1000</commit>
<truncate>N</truncate>
<ignore_errors>N</ignore_errors>
<use_batch>Y</use_batch>
<specify_fields>N</specify_fields>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_daily>N</partitioning_daily>
<partitioning_monthly>Y</partitioning_monthly>
<tablename_in_field>N</tablename_in_field>
<tablename_field/>
<tablename_in_table>Y</tablename_in_table>
<return_keys>N</return_keys>
<return_field/>
<connection>ervu-dashboard</connection>
<fields>
</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>
<partitioning_monthly>Y</partitioning_monthly>
<return_keys>N</return_keys>
<schema>ervu_dashboard</schema>
<specify_fields>N</specify_fields>
<table>citizen_spouse</table>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>704</xloc>
<yloc>208</yloc>
<draw>Y</draw>
<xloc>688</xloc>
<yloc>64</yloc>
</GUI>
</transform>
<transform_error_handling>