This commit is contained in:
r.gaztdinov 2025-06-17 16:25:57 +03:00
parent 79beb60b69
commit 79903256f4
22 changed files with 1244 additions and 1244 deletions

View file

@ -107,11 +107,11 @@
<sql>with child as
(select jsonb_array_elements(ri.info->'svedFL'->'svedDeti'->'rebenok') ch,
ri.recruit_id
from ervu_person_registry_raw.recruits_info ri
from ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id --AND '${ID_F1}' != '' -- Проверка на пустую строку
--AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select

View file

@ -21,93 +21,18 @@
</notepads>
<order>
<hop>
<from>JSON input state_job_child.json</from>
<to>Set variables</to>
<enabled>Y</enabled>
<from>Set variables 2</from>
<to>Write to log 2</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Set variables</from>
<to>Write to log</to>
<enabled>N</enabled>
<from>Table input</from>
<to>Set variables 2</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>JSON input state_job_child.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>816</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform>
<name>Set variables</name>
<name>Set variables 2</name>
<type>SetVariable</type>
<description/>
<distribute>Y</distribute>
@ -132,12 +57,38 @@
<use_formatting>Y</use_formatting>
<attributes/>
<GUI>
<xloc>1072</xloc>
<yloc>448</yloc>
<xloc>1040</xloc>
<yloc>416</yloc>
</GUI>
</transform>
<transform>
<name>Write to log</name>
<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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>select
status as STATUS,
job_name AS PIPELINE
from public.etl_checkpoints
where job_name = 'job_citizen_guardianship'</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>800</xloc>
<yloc>416</yloc>
</GUI>
</transform>
<transform>
<name>Write to log 2</name>
<type>WriteToLog</type>
<description/>
<distribute>Y</distribute>
@ -163,8 +114,8 @@
${STATUS}</logmessage>
<attributes/>
<GUI>
<xloc>1296</xloc>
<yloc>448</yloc>
<xloc>1264</xloc>
<yloc>416</yloc>
</GUI>
</transform>
<transform_error_handling>

View file

@ -85,14 +85,14 @@
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql> SELECT
'delta_child' as job_name,
'delta_citizen_guardianship' as job_name,
'ERROR' as status,
current_timestamp as record_created
union all
SELECT
'job_child' as job_name,
'job_citizen_guardianship' as job_name,
'ERROR' as status,
current_timestamp as record_created

View file

@ -85,14 +85,14 @@
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql> SELECT
'delta_child' as job_name,
'delta_citizen_guardianship' as job_name,
'SUCCESS' as status,
current_timestamp as record_created
union all
SELECT
'job_child' as job_name,
'job_citizen_guardianship' as job_name,
'SUCCESS' as status,
current_timestamp as record_created

View file

@ -46,47 +46,32 @@
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<table>citizen_guardianship</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>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1168</xloc>
<xloc>1072</xloc>
<yloc>352</yloc>
</GUI>
</transform>
@ -104,32 +89,26 @@
<connection>ervu-dashboard</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 ervu_person_registry_raw.recruits_info ri
<sql>with person as
(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') ch,
ri.recruit_id
from ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id --AND '${ID_F1}' != '' -- Проверка на пустую строку
--AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
AND r.system_update_date >= '${M_R_UP_DATE}'::timestamp
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
where jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array')
select
r.recruit_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
r.recruit_id AS recruit_id,
concat_ws(' ', ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo') full_name,
make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date,
ch->>'snils' snils
from ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
join person on r.recruit_id = person.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>

View file

@ -19,6 +19,26 @@
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontname>Segoe UI</fontname>
<fontsize>9</fontsize>
<height>26</height>
<xloc>560</xloc>
<yloc>208</yloc>
<note>сведения о лице опекаемом или находящемся на попечении</note>
<width>349</width>
</notepad>
</notepads>
<order>
<hop>
@ -109,7 +129,7 @@
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>944</xloc>
<xloc>960</xloc>
<yloc>288</yloc>
</GUI>
</transform>

View file

@ -18,62 +18,36 @@
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontname>Segoe UI</fontname>
<fontsize>9</fontsize>
<height>26</height>
<xloc>656</xloc>
<yloc>208</yloc>
<note>сведения о лице опекаемом или находящемся на попечении</note>
<width>349</width>
</notepad>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<to>Insert / update 2</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-dashboard</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 ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_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 ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<name>Insert / update 2</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
@ -92,47 +66,72 @@ join child on r.recruit_id = child.recruit_id</sql>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<table>citizen_guardianship</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>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1088</xloc>
<xloc>1056</xloc>
<yloc>288</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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with person as
(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') ch,
ri.recruit_id
from ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
where jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array')
select
r.recruit_id AS recruit_id,
concat_ws(' ', ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo') full_name,
make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date,
ch->>'snils' snils
from ervu_dashboard.citizen r
join person on r.recruit_id = person.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>288</yloc>
</GUI>
</transform>

View file

@ -18,6 +18,26 @@
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontname>Segoe UI</fontname>
<fontsize>9</fontsize>
<height>26</height>
<xloc>800</xloc>
<yloc>256</yloc>
<note>сведения о лице опекаемом или находящемся на попечении</note>
<width>349</width>
</notepad>
</notepads>
<order>
<hop>
@ -26,52 +46,6 @@
<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-dashboard</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 ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_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 ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>672</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
@ -92,40 +66,25 @@ join child on r.recruit_id = child.recruit_id</sql>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<table>citizen_guardianship</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>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
@ -136,6 +95,46 @@ join child on r.recruit_id = child.recruit_id</sql>
<yloc>352</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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with person as
(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') ch,
ri.recruit_id
from ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
where jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array')
select
r.recruit_id AS recruit_id,
concat_ws(' ', ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo') full_name,
make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date,
ch->>'snils' snils
from ervu_dashboard.citizen r
join person on r.recruit_id = person.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>672</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>

View file

@ -18,6 +18,26 @@
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontname>Segoe UI</fontname>
<fontsize>9</fontsize>
<height>26</height>
<xloc>640</xloc>
<yloc>240</yloc>
<note>сведения о лице опекаемом или находящемся на попечении</note>
<width>349</width>
</notepad>
</notepads>
<order>
<hop>
@ -26,52 +46,6 @@
<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-dashboard</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 ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_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 ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>528</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
@ -92,47 +66,72 @@ join child on r.recruit_id = child.recruit_id</sql>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<table>citizen_guardianship</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>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1072</xloc>
<xloc>1088</xloc>
<yloc>320</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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with person as
(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') ch,
ri.recruit_id
from ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
where jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array')
select
r.recruit_id AS recruit_id,
concat_ws(' ', ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo') full_name,
make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date,
ch->>'snils' snils
from ervu_dashboard.citizen r
join person on r.recruit_id = person.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>528</xloc>
<yloc>320</yloc>
</GUI>
</transform>

View file

@ -18,6 +18,26 @@
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontname>Segoe UI</fontname>
<fontsize>9</fontsize>
<height>26</height>
<xloc>704</xloc>
<yloc>256</yloc>
<note>сведения о лице опекаемом или находящемся на попечении</note>
<width>349</width>
</notepad>
</notepads>
<order>
<hop>
@ -26,52 +46,6 @@
<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-dashboard</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 ervu_person_registry_raw.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}'
AND '${M_R_CR_DATE}'::timestamp >= r.system_create_date
where jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array'
)
select
r.recruit_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 ervu_dashboard.citizen r
join child on r.recruit_id = child.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
@ -92,47 +66,72 @@ join child on r.recruit_id = child.recruit_id</sql>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen_child</table>
<table>citizen_guardianship</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>
<name>snils</name>
<rename>snils</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1040</xloc>
<xloc>1024</xloc>
<yloc>368</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-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with person as
(select jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') ch,
ri.recruit_id
from ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
where jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array')
select
r.recruit_id AS recruit_id,
concat_ws(' ', ch->'fioOpek'->>'familiya',
ch->'fioOpek'->>'imya',
ch->'fioOpek'->>'otchestvo') full_name,
make_date(NULLIF(ch->'dataRozhdDok'->>'god', '')::int,
NULLIF(ch->'dataRozhdDok'->>'mesyacz','')::int,
NULLIF(ch->'dataRozhdDok'->>'den','')::int) birth_date,
ch->>'snils' snils
from ervu_dashboard.citizen r
join person on r.recruit_id = person.recruit_id</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>560</xloc>
<yloc>368</yloc>
</GUI>
</transform>

View file

@ -187,7 +187,7 @@ result_max as ( --костыль
),
for_checkpoints as (
SELECT
'job_recruits_info_flow1' as job_name,
'recruits_info_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'ERROR' as status,

View file

@ -187,7 +187,7 @@ result_max as ( --костыль
),
for_checkpoints as (
SELECT
'job_recruits_info_flow1' as job_name,
'recruits_info_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,

View file

@ -201,7 +201,7 @@ for_checkpoints as (
union all
*/
SELECT
'job_recruits_info_flow2' as job_name,
'recruits_info_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'ERROR' as status,

View file

@ -201,7 +201,7 @@ for_checkpoints as (
union all
*/
SELECT
'job_recruits_info_flow2' as job_name,
'recruits_info_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,

View file

@ -212,7 +212,7 @@ for_checkpoints as (
union all
*/
SELECT
'job_recruits_info_flow3' as job_name,
'recruits_info_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'ERROR' as status,

View file

@ -212,7 +212,7 @@ for_checkpoints as (
union all
*/
SELECT
'job_recruits_info_flow3' as job_name,
'recruits_info_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,

View file

@ -223,7 +223,7 @@ for_checkpoints as (
union all
*/
SELECT
'job_recruits_info_flow4' as job_name,
'recruits_info_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'ERROR' as status,

View file

@ -223,7 +223,7 @@ for_checkpoints as (
union all
*/
SELECT
'job_recruits_info_flow4' as job_name,
'recruits_info_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,

View file

@ -233,7 +233,7 @@ for_checkpoints as (
union all
*/
SELECT
'job_recruits_info_flow5' as job_name,
'recruits_info_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'ERROR' as status,

View file

@ -233,7 +233,7 @@ for_checkpoints as (
union all
*/
SELECT
'job_recruits_info_flow5' as job_name,
'recruits_info_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,

View file

@ -935,7 +935,7 @@
FROM public.etl_checkpoints
)
SELECT
'recruits_info' as job_name,
'job_recruits_info' as job_name,
CASE
WHEN has_error THEN 'ERROR'
WHEN all_success THEN 'SUCCESS'