ERVU-504: Переделал все по женам и мужьям в mappings
This commit is contained in:
parent
cb3393a6f8
commit
712c1db585
17 changed files with 283 additions and 877 deletions
|
|
@ -236,6 +236,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -335,7 +340,7 @@ SELECT
|
|||
r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
|
|
|
|||
|
|
@ -193,6 +193,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -255,7 +260,7 @@ SELECT
|
|||
r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
|
|
|
|||
|
|
@ -193,6 +193,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -255,7 +260,7 @@ SELECT
|
|||
r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
|
|
|
|||
|
|
@ -193,6 +193,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -255,7 +260,7 @@ SELECT
|
|||
r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
|
|
|
|||
|
|
@ -193,6 +193,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -255,7 +260,7 @@ SELECT
|
|||
r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
|
|
@ -192,6 +193,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -255,10 +261,10 @@ SELECT
|
|||
--r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
r.system_create_date AS recruit_create_date,
|
||||
r.system_update_date AS update_date,
|
||||
CASE
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
|
|
@ -192,6 +193,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -255,10 +261,10 @@ SELECT
|
|||
--r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
r.system_create_date AS recruit_create_date,
|
||||
r.system_update_date AS update_date,
|
||||
CASE
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
|
|
@ -192,6 +193,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -255,10 +261,10 @@ SELECT
|
|||
--r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
r.system_create_date AS recruit_create_date,
|
||||
r.system_update_date AS update_date,
|
||||
CASE
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
|
|
@ -192,6 +193,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -255,10 +261,10 @@ SELECT
|
|||
--r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
r.system_create_date AS recruit_create_date,
|
||||
r.system_update_date AS update_date,
|
||||
CASE
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
|
|
@ -192,6 +193,11 @@
|
|||
<rename>id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>marital_status</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
|
|
@ -255,10 +261,10 @@ SELECT
|
|||
--r.vu_current_info,
|
||||
r.military_registration_date AS date_registration,
|
||||
r.vu_unset_date AS date_deregistration,
|
||||
--ri.info->'svedFL'->'svedSemPolozh'->>'semPolozhNaim' AS marital_status,
|
||||
NULLIF(ri.info->'svedFL'->'svedSemPolozh'->>'semPolozh','')::int AS marital_status,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'nomDok' AS passport_number,
|
||||
--ri.info->'svedFL'->'pasportRF'->'aktPasportRF'->>'serDok' AS passport_series,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
--ri.info->'svedFL'->'svedVoin'->'voin'->>'dataReg' AS issue_date,
|
||||
r.system_create_date AS recruit_create_date,
|
||||
r.system_update_date AS update_date,
|
||||
CASE
|
||||
|
|
|
|||
|
|
@ -40,50 +40,46 @@
|
|||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<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 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 >= ri.created_at
|
||||
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
||||
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.recruit_id AS recruit_id,
|
||||
supr->>'rodstvSvyazSuprugNaim' AS kinship_type,
|
||||
CONCAT_WS(' ',
|
||||
<sql>SELECT
|
||||
r.recruit_id,
|
||||
supr->>'id' AS spouse_external_id,
|
||||
NULLIF(supr->>'idERN', '') AS spouse_id_ern,
|
||||
NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type,
|
||||
supr->'svedFLBS'->'fio'->>'familiya' AS last_name,
|
||||
supr->'svedFLBS'->'fio'->>'imya' AS first_name,
|
||||
supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
|
||||
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
|
||||
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::date,
|
||||
divorce_az_number,
|
||||
divorce_date::date,
|
||||
information_excluded
|
||||
supr->'svedSmert'->>'nomerZapis' AS death_az_number,
|
||||
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number,
|
||||
(ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date,
|
||||
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number,
|
||||
(ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date,
|
||||
CASE
|
||||
WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true
|
||||
ELSE false
|
||||
END AS information_excluded
|
||||
FROM ervu_dashboard.citizen r
|
||||
JOIN suprug ON r.recruit_id = suprug.recruit_id</sql>
|
||||
JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id
|
||||
CROSS JOIN LATERAL (
|
||||
SELECT supri
|
||||
FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri
|
||||
WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array'
|
||||
) AS supr(supr)
|
||||
WHERE
|
||||
--'${ID_F1}' != ''
|
||||
--AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
|
||||
'${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
|
||||
AND r.update_date >= '${M_R_UP_DATE}'::timestamp;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
@ -110,6 +106,11 @@ JOIN suprug ON r.recruit_id = suprug.recruit_id</sql>
|
|||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spouse_external_id</field>
|
||||
<name>spouse_external_id</name>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen_spouse</table>
|
||||
<value>
|
||||
|
|
@ -117,29 +118,49 @@ JOIN suprug ON r.recruit_id = suprug.recruit_id</sql>
|
|||
<rename>recruit_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>kinship_type</name>
|
||||
<rename>kinship_type</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>full_name</name>
|
||||
<rename>full_name</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>death_az_number</name>
|
||||
<rename>death_az_number</rename>
|
||||
<name>divorce_az_number</name>
|
||||
<rename>divorce_az_number</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>first_name</name>
|
||||
<rename>first_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>full_name</name>
|
||||
<rename>full_name</rename>
|
||||
<update>Y</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>last_name</name>
|
||||
<rename>last_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
|
|
@ -153,18 +174,18 @@ JOIN suprug ON r.recruit_id = suprug.recruit_id</sql>
|
|||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>divorce_az_number</name>
|
||||
<rename>divorce_az_number</rename>
|
||||
<name>middle_name</name>
|
||||
<rename>middle_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>divorce_date</name>
|
||||
<rename>divorce_date</rename>
|
||||
<update>Y</update>
|
||||
<name>spouse_external_id</name>
|
||||
<rename>spouse_external_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>information_excluded</name>
|
||||
<rename>information_excluded</rename>
|
||||
<name>spouse_id_ern</name>
|
||||
<rename>spouse_id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
|
|
|
|||
|
|
@ -104,12 +104,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F1</name>
|
||||
<name>RECRUITMENT_ID</name>
|
||||
<stream_name>IDM_FLOW1</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -134,12 +137,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F2</name>
|
||||
<name>RECRUITMENT_ID</name>
|
||||
<stream_name>IDM_FLOW2</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -164,12 +170,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F3</name>
|
||||
<name>RECRUITMENT_ID</name>
|
||||
<stream_name>IDM_FLOW3</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -194,12 +203,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F4</name>
|
||||
<name>RECRUITMENT_ID</name>
|
||||
<stream_name>IDM_FLOW4</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -224,12 +236,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F5</name>
|
||||
<name>RECRUITMENT_ID</name>
|
||||
<stream_name>IDM_FLOW5</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -884,12 +899,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow1.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F1</name>
|
||||
<stream_name>IDM_FLOW1</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -914,12 +932,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow2.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F2</name>
|
||||
<name>RECRUITMENT_ID</name>
|
||||
<stream_name>IDM_FLOW2</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -944,12 +965,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow3.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F3</name>
|
||||
<name>RECRUITMENT_ID</name>
|
||||
<stream_name>IDM_FLOW3</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -974,12 +998,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow4.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F4</name>
|
||||
<name>RECRUITMENT_ID</name>
|
||||
<stream_name>IDM_FLOW4</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -1004,12 +1031,15 @@
|
|||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow5.hpl</filename>
|
||||
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_spouse/parallel/citizen_spouse_flow.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ID_F5</name>
|
||||
<name>RECRUITMENT_ID</name>
|
||||
<stream_name>IDM_FLOW5</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>citizen_spouse_flow1</name>
|
||||
<name>citizen_spouse_flow</name>
|
||||
<name_sync_with_filename>Y</name_sync_with_filename>
|
||||
<description/>
|
||||
<extended_description/>
|
||||
|
|
@ -21,11 +21,6 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input</from>
|
||||
<to>Select values 4 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 4 2</from>
|
||||
<to>Get variables</to>
|
||||
|
|
@ -33,9 +28,14 @@
|
|||
</hop>
|
||||
<hop>
|
||||
<from>Table input</from>
|
||||
<to>Insert / update</to>
|
||||
<to>Insert / update </to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input</from>
|
||||
<to>Select values 4 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Get variables</name>
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update</name>
|
||||
<name>Insert / update </name>
|
||||
<type>InsertUpdate</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
|
|
@ -82,7 +82,11 @@
|
|||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spouse_external_id</field>
|
||||
<name>spouse_external_id</name>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen_spouse</table>
|
||||
|
|
@ -91,29 +95,49 @@
|
|||
<rename>recruit_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>kinship_type</name>
|
||||
<rename>kinship_type</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>full_name</name>
|
||||
<rename>full_name</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>death_az_number</name>
|
||||
<rename>death_az_number</rename>
|
||||
<name>divorce_az_number</name>
|
||||
<rename>divorce_az_number</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>first_name</name>
|
||||
<rename>first_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>full_name</name>
|
||||
<rename>full_name</rename>
|
||||
<update>Y</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>last_name</name>
|
||||
<rename>last_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
|
|
@ -127,26 +151,26 @@
|
|||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>divorce_az_number</name>
|
||||
<rename>divorce_az_number</rename>
|
||||
<name>middle_name</name>
|
||||
<rename>middle_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>divorce_date</name>
|
||||
<rename>divorce_date</rename>
|
||||
<update>Y</update>
|
||||
<name>spouse_external_id</name>
|
||||
<rename>spouse_external_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>information_excluded</name>
|
||||
<rename>information_excluded</rename>
|
||||
<name>spouse_id_ern</name>
|
||||
<rename>spouse_id_ern</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>944</xloc>
|
||||
<yloc>288</yloc>
|
||||
<xloc>976</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -190,7 +214,7 @@
|
|||
<name>Table input</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
|
|
@ -200,54 +224,50 @@
|
|||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<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 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 >= ri.created_at
|
||||
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.recruit_id AS recruit_id,
|
||||
supr->>'rodstvSvyazSuprugNaim' AS kinship_type,
|
||||
CONCAT_WS(' ',
|
||||
<sql>SELECT
|
||||
r.recruit_id,
|
||||
supr->>'id' AS spouse_external_id,
|
||||
NULLIF(supr->>'idERN', '') AS spouse_id_ern,
|
||||
NULLIF(supr->>'rodstvSvyazSuprug', '')::int AS kinship_type,
|
||||
supr->'svedFLBS'->'fio'->>'familiya' AS last_name,
|
||||
supr->'svedFLBS'->'fio'->>'imya' AS first_name,
|
||||
supr->'svedFLBS'->'fio'->>'otchestvo' AS middle_name,
|
||||
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
|
||||
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::date,
|
||||
divorce_az_number,
|
||||
divorce_date::date,
|
||||
information_excluded
|
||||
supr->'svedSmert'->>'nomerZapis' AS death_az_number,
|
||||
ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'nomerZapis' AS marriage_az_number,
|
||||
(ri.info->'svedFL'->'svedSemPolozh'->'svedAZBrak'->>'dataBrakKalend')::date AS marriage_date,
|
||||
ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'nomerZapis' AS divorce_az_number,
|
||||
(ri.info->'svedFL'->'svedSemPolozh'->'svedAZRazvod'->>'dataRastBrakKalend')::date AS divorce_date,
|
||||
CASE
|
||||
WHEN ri.info->'svedFL'->'svedSemPolozh'->>'svedSuprIskl' = '1' THEN true
|
||||
ELSE false
|
||||
END AS information_excluded
|
||||
FROM ervu_dashboard.citizen r
|
||||
JOIN suprug ON r.recruit_id = suprug.recruit_id</sql>
|
||||
JOIN ervu_dashboard.recruits_info ri ON ri.recruit_id = r.recruit_id
|
||||
CROSS JOIN LATERAL (
|
||||
SELECT supri
|
||||
FROM jsonb_array_elements(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') AS supri
|
||||
WHERE jsonb_typeof(ri.info->'svedFL'->'svedSemPolozh'->'suprugi') = 'array'
|
||||
) AS supr(supr)
|
||||
WHERE
|
||||
'${RECRUITMENT_ID}' != ''
|
||||
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${RECRUITMENT_ID}'
|
||||
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>448</xloc>
|
||||
<yloc>288</yloc>
|
||||
<xloc>480</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>citizen_spouse_flow2</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>2025/05/21 14:05:02.260</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2025/05/21 14:05:02.260</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input</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>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen_spouse</table>
|
||||
<value>
|
||||
<name>recruit_id</name>
|
||||
<rename>recruit_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>kinship_type</name>
|
||||
<rename>kinship_type</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>full_name</name>
|
||||
<rename>full_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>birth_date</name>
|
||||
<rename>birth_date</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>death_date</name>
|
||||
<rename>death_date</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>death_az_number</name>
|
||||
<rename>death_az_number</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>
|
||||
<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>information_excluded</name>
|
||||
<rename>information_excluded</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1280</xloc>
|
||||
<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 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 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
|
||||
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.recruit_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::date,
|
||||
divorce_az_number,
|
||||
divorce_date::date,
|
||||
information_excluded
|
||||
FROM ervu_dashboard.citizen r
|
||||
JOIN suprug ON r.recruit_id = suprug.recruit_id</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>784</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>citizen_spouse_flow3</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>2025/05/21 14:05:02.260</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2025/05/21 14:05:02.260</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input</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>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen_spouse</table>
|
||||
<value>
|
||||
<name>recruit_id</name>
|
||||
<rename>recruit_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>kinship_type</name>
|
||||
<rename>kinship_type</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>full_name</name>
|
||||
<rename>full_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>birth_date</name>
|
||||
<rename>birth_date</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>death_date</name>
|
||||
<rename>death_date</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>death_az_number</name>
|
||||
<rename>death_az_number</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>
|
||||
<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>information_excluded</name>
|
||||
<rename>information_excluded</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1152</xloc>
|
||||
<yloc>336</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 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 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
|
||||
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.recruit_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::date,
|
||||
divorce_az_number,
|
||||
divorce_date::date,
|
||||
information_excluded
|
||||
FROM ervu_dashboard.citizen r
|
||||
JOIN suprug ON r.recruit_id = suprug.recruit_id</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>656</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>citizen_spouse_flow4</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>2025/05/21 14:05:02.260</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2025/05/21 14:05:02.260</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input</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>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen_spouse</table>
|
||||
<value>
|
||||
<name>recruit_id</name>
|
||||
<rename>recruit_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>kinship_type</name>
|
||||
<rename>kinship_type</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>full_name</name>
|
||||
<rename>full_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>birth_date</name>
|
||||
<rename>birth_date</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>death_date</name>
|
||||
<rename>death_date</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>death_az_number</name>
|
||||
<rename>death_az_number</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>
|
||||
<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>information_excluded</name>
|
||||
<rename>information_excluded</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1184</xloc>
|
||||
<yloc>384</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 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 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
|
||||
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.recruit_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::date,
|
||||
divorce_az_number,
|
||||
divorce_date::date,
|
||||
information_excluded
|
||||
FROM ervu_dashboard.citizen r
|
||||
JOIN suprug ON r.recruit_id = suprug.recruit_id</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>688</xloc>
|
||||
<yloc>384</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>citizen_spouse_flow5</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>2025/05/21 14:05:02.260</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2025/05/21 14:05:02.260</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input</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>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen_spouse</table>
|
||||
<value>
|
||||
<name>recruit_id</name>
|
||||
<rename>recruit_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>kinship_type</name>
|
||||
<rename>kinship_type</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>full_name</name>
|
||||
<rename>full_name</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>birth_date</name>
|
||||
<rename>birth_date</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>death_date</name>
|
||||
<rename>death_date</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>death_az_number</name>
|
||||
<rename>death_az_number</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>
|
||||
<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>information_excluded</name>
|
||||
<rename>information_excluded</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1152</xloc>
|
||||
<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 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 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
|
||||
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.recruit_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::date,
|
||||
divorce_az_number,
|
||||
divorce_date::date,
|
||||
information_excluded
|
||||
FROM ervu_dashboard.citizen r
|
||||
JOIN suprug ON r.recruit_id = suprug.recruit_id</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>656</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
Loading…
Add table
Add a link
Reference in a new issue