Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
fee1f124b8
27 changed files with 120 additions and 106 deletions
|
|
@ -333,6 +333,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id AS recruit_id,
|
ri.recruit_id AS recruit_id,
|
||||||
(ch->>'id')::uuid AS child_external_id,
|
(ch->>'id')::uuid AS child_external_id,
|
||||||
|
|
@ -378,7 +379,7 @@ CROSS JOIN LATERAL (
|
||||||
) AS dates
|
) AS dates
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array';</sql>
|
AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array';</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
<attributes/>
|
<attributes/>
|
||||||
|
|
|
||||||
|
|
@ -449,6 +449,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id AS recruit_id,
|
ri.recruit_id AS recruit_id,
|
||||||
(ch->>'id')::uuid AS child_external_id,
|
(ch->>'id')::uuid AS child_external_id,
|
||||||
|
|
@ -494,7 +495,7 @@ CROSS JOIN LATERAL (
|
||||||
) AS dates
|
) AS dates
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp,
|
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp,
|
||||||
AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array';</sql>
|
AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array';</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
|
|
|
||||||
|
|
@ -465,6 +465,7 @@ DO UPDATE SET
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id AS recruit_id,
|
ri.recruit_id AS recruit_id,
|
||||||
(ch->>'id')::uuid AS child_external_id,
|
(ch->>'id')::uuid AS child_external_id,
|
||||||
|
|
@ -510,7 +511,7 @@ CROSS JOIN LATERAL (
|
||||||
) AS dates
|
) AS dates
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array';</sql>
|
AND jsonb_typeof(ri.info->'svedFL'->'svedDeti'->'rebenok') = 'array';</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
<attributes/>
|
<attributes/>
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id::uuid,
|
ri.recruit_id::uuid,
|
||||||
MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address,
|
MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address,
|
||||||
|
|
@ -290,7 +291,7 @@ FROM ervu_dashboard.recruits_info ri
|
||||||
CROSS JOIN LATERAL jsonb_array_elements(ri.addresses) AS addr
|
CROSS JOIN LATERAL jsonb_array_elements(ri.addresses) AS addr
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
GROUP BY ri.recruit_id;</sql>
|
GROUP BY ri.recruit_id;</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
<attributes/>
|
<attributes/>
|
||||||
|
|
|
||||||
|
|
@ -355,6 +355,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id::uuid,
|
ri.recruit_id::uuid,
|
||||||
MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address,
|
MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address,
|
||||||
|
|
@ -377,7 +378,7 @@ FROM ervu_dashboard.recruits_info ri
|
||||||
CROSS JOIN LATERAL jsonb_array_elements(ri.addresses) AS addr
|
CROSS JOIN LATERAL jsonb_array_elements(ri.addresses) AS addr
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
||||||
GROUP BY ri.recruit_id;</sql>
|
GROUP BY ri.recruit_id;</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
|
|
|
||||||
|
|
@ -369,6 +369,7 @@ DO UPDATE SET
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id::uuid,
|
ri.recruit_id::uuid,
|
||||||
MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address,
|
MAX(CASE WHEN addr->>'type' = 'actualAddress' THEN addr->>'reg' END) AS residence_address,
|
||||||
|
|
@ -391,7 +392,7 @@ FROM ervu_dashboard.recruits_info ri
|
||||||
CROSS JOIN LATERAL jsonb_array_elements(ri.addresses) AS addr
|
CROSS JOIN LATERAL jsonb_array_elements(ri.addresses) AS addr
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
GROUP BY ri.recruit_id;</sql>
|
GROUP BY ri.recruit_id;</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
<attributes/>
|
<attributes/>
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id AS recruit_id,
|
ri.recruit_id AS recruit_id,
|
||||||
(ch->>'id')::uuid AS guardianship_external_id,
|
(ch->>'id')::uuid AS guardianship_external_id,
|
||||||
|
|
@ -341,7 +342,7 @@ JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id
|
||||||
CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch
|
CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array';</sql>
|
AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array';</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
<attributes/>
|
<attributes/>
|
||||||
|
|
|
||||||
|
|
@ -401,6 +401,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id AS recruit_id,
|
ri.recruit_id AS recruit_id,
|
||||||
(ch->>'id')::uuid AS guardianship_external_id,
|
(ch->>'id')::uuid AS guardianship_external_id,
|
||||||
|
|
@ -425,7 +426,7 @@ JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id
|
||||||
CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch
|
CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'
|
AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array'
|
||||||
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp;</sql>
|
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp;</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
|
|
|
||||||
|
|
@ -417,6 +417,7 @@ DO UPDATE SET
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id AS recruit_id,
|
ri.recruit_id AS recruit_id,
|
||||||
(ch->>'id')::uuid AS guardianship_external_id,
|
(ch->>'id')::uuid AS guardianship_external_id,
|
||||||
|
|
@ -441,7 +442,7 @@ JOIN ervu_dashboard.citizen c ON c.recruit_id = ri.recruit_id
|
||||||
CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch
|
CROSS JOIN LATERAL jsonb_array_elements(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') AS ch
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array';</sql>
|
AND jsonb_typeof(ri.info->'svedFL'->'svedOpekun'->'svedSoczPod') = 'array';</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
<attributes/>
|
<attributes/>
|
||||||
|
|
|
||||||
|
|
@ -278,6 +278,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>
|
<sql>
|
||||||
SELECT
|
SELECT
|
||||||
ri.recruit_id,
|
ri.recruit_id,
|
||||||
|
|
@ -291,7 +292,7 @@ SELECT
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
||||||
WHERE'${IDM_ID}' != ''
|
WHERE'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND jsonb_typeof(ri.info->'svedFL'->'extend'->'rozysk') = 'object'
|
AND jsonb_typeof(ri.info->'svedFL'->'extend'->'rozysk') = 'object'
|
||||||
</sql>
|
</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
|
|
|
||||||
|
|
@ -345,6 +345,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>
|
<sql>
|
||||||
SELECT
|
SELECT
|
||||||
ri.recruit_id,
|
ri.recruit_id,
|
||||||
|
|
@ -358,7 +359,7 @@ SELECT
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
||||||
WHERE'${IDM_ID}' != ''
|
WHERE'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
||||||
AND jsonb_typeof(ri.info->'svedFL'->'extend'->'rozysk') = 'object'
|
AND jsonb_typeof(ri.info->'svedFL'->'extend'->'rozysk') = 'object'
|
||||||
</sql>
|
</sql>
|
||||||
|
|
|
||||||
|
|
@ -359,6 +359,7 @@ DO UPDATE SET
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>
|
<sql>
|
||||||
SELECT
|
SELECT
|
||||||
ri.recruit_id,
|
ri.recruit_id,
|
||||||
|
|
@ -372,7 +373,7 @@ SELECT
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
||||||
WHERE'${IDM_ID}' != ''
|
WHERE'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND jsonb_typeof(ri.info->'svedFL'->'extend'->'rozysk') = 'object'
|
AND jsonb_typeof(ri.info->'svedFL'->'extend'->'rozysk') = 'object'
|
||||||
</sql>
|
</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id AS recruit_id,
|
ri.recruit_id AS recruit_id,
|
||||||
(supr->>'id')::uuid AS spouse_external_id,
|
(supr->>'id')::uuid AS spouse_external_id,
|
||||||
|
|
@ -354,7 +355,7 @@ CROSS JOIN LATERAL (
|
||||||
) AS supr(supr)
|
) AS supr(supr)
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'));</sql>
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}';</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
<attributes/>
|
<attributes/>
|
||||||
<GUI>
|
<GUI>
|
||||||
|
|
|
||||||
|
|
@ -470,6 +470,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id AS recruit_id,
|
ri.recruit_id AS recruit_id,
|
||||||
(supr->>'id')::uuid AS spouse_external_id,
|
(supr->>'id')::uuid AS spouse_external_id,
|
||||||
|
|
@ -507,7 +508,7 @@ CROSS JOIN LATERAL (
|
||||||
) AS supr(supr)
|
) AS supr(supr)
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND ri.update_date >= '${M_R_UP_DATE}'::timestamp;
|
AND ri.update_date >= '${M_R_UP_DATE}'::timestamp;
|
||||||
</sql>
|
</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
|
|
|
||||||
|
|
@ -514,6 +514,7 @@ DO UPDATE SET
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id AS recruit_id,
|
ri.recruit_id AS recruit_id,
|
||||||
(supr->>'id')::uuid AS spouse_external_id,
|
(supr->>'id')::uuid AS spouse_external_id,
|
||||||
|
|
@ -551,7 +552,7 @@ CROSS JOIN LATERAL (
|
||||||
) AS supr(supr)
|
) AS supr(supr)
|
||||||
WHERE
|
WHERE
|
||||||
'${IDM_ID}' != ''
|
'${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'));</sql>
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}';</sql>
|
||||||
<variables_active>Y</variables_active>
|
<variables_active>Y</variables_active>
|
||||||
<attributes/>
|
<attributes/>
|
||||||
<GUI>
|
<GUI>
|
||||||
|
|
|
||||||
|
|
@ -290,7 +290,7 @@ base AS (
|
||||||
ri.info
|
ri.info
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
WHERE jsonb_typeof(ri.info->'svedFL'->'svedVoditUdost'->'voditUdost'->'svedKat') = 'array'
|
WHERE jsonb_typeof(ri.info->'svedFL'->'svedVoditUdost'->'voditUdost'->'svedKat') = 'array'
|
||||||
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'aktUTM' IS NOT NULL
|
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'aktUTM' IS NOT NULL
|
||||||
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'predUTM' IS NOT NULL
|
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'predUTM' IS NOT NULL
|
||||||
|
|
@ -431,14 +431,11 @@ FROM all_data</sql>
|
||||||
<only_when_have_rows>N</only_when_have_rows>
|
<only_when_have_rows>N</only_when_have_rows>
|
||||||
<partitioning_daily>N</partitioning_daily>
|
<partitioning_daily>N</partitioning_daily>
|
||||||
<partitioning_enabled>N</partitioning_enabled>
|
<partitioning_enabled>N</partitioning_enabled>
|
||||||
<partitioning_field/>
|
|
||||||
<partitioning_monthly>Y</partitioning_monthly>
|
<partitioning_monthly>Y</partitioning_monthly>
|
||||||
<return_field/>
|
|
||||||
<return_keys>N</return_keys>
|
<return_keys>N</return_keys>
|
||||||
<schema>ervu_dashboard</schema>
|
<schema>ervu_dashboard</schema>
|
||||||
<specify_fields>Y</specify_fields>
|
<specify_fields>Y</specify_fields>
|
||||||
<table>drivers_licence</table>
|
<table>drivers_licence</table>
|
||||||
<tablename_field/>
|
|
||||||
<tablename_in_field>N</tablename_in_field>
|
<tablename_in_field>N</tablename_in_field>
|
||||||
<tablename_in_table>Y</tablename_in_table>
|
<tablename_in_table>Y</tablename_in_table>
|
||||||
<truncate>N</truncate>
|
<truncate>N</truncate>
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,24 @@ and recruitment_id = '${IDM_ID}';</sql>
|
||||||
<yloc>352</yloc>
|
<yloc>352</yloc>
|
||||||
</GUI>
|
</GUI>
|
||||||
</transform>
|
</transform>
|
||||||
|
<transform>
|
||||||
|
<name>Identify last row in a stream 2</name>
|
||||||
|
<type>DetectLastRow</type>
|
||||||
|
<description/>
|
||||||
|
<distribute>N</distribute>
|
||||||
|
<custom_distribution/>
|
||||||
|
<copies>1</copies>
|
||||||
|
<partitioning>
|
||||||
|
<method>none</method>
|
||||||
|
<schema_name/>
|
||||||
|
</partitioning>
|
||||||
|
<resultfieldname>last_row</resultfieldname>
|
||||||
|
<attributes/>
|
||||||
|
<GUI>
|
||||||
|
<xloc>1056</xloc>
|
||||||
|
<yloc>352</yloc>
|
||||||
|
</GUI>
|
||||||
|
</transform>
|
||||||
<transform>
|
<transform>
|
||||||
<name>Insert / update</name>
|
<name>Insert / update</name>
|
||||||
<type>InsertUpdate</type>
|
<type>InsertUpdate</type>
|
||||||
|
|
@ -356,6 +374,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>WITH
|
<sql>WITH
|
||||||
base AS (
|
base AS (
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -375,7 +394,7 @@ base AS (
|
||||||
END as pred_update_date
|
END as pred_update_date
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
--AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
--AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
||||||
WHERE jsonb_typeof(ri.info->'svedFL'->'svedVoditUdost'->'voditUdost'->'svedKat') = 'array'
|
WHERE jsonb_typeof(ri.info->'svedFL'->'svedVoditUdost'->'voditUdost'->'svedKat') = 'array'
|
||||||
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'aktUTM' IS NOT NULL
|
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'aktUTM' IS NOT NULL
|
||||||
|
|
@ -530,24 +549,6 @@ FROM all_data</sql>
|
||||||
<yloc>352</yloc>
|
<yloc>352</yloc>
|
||||||
</GUI>
|
</GUI>
|
||||||
</transform>
|
</transform>
|
||||||
<transform>
|
|
||||||
<name>Identify last row in a stream 2</name>
|
|
||||||
<type>DetectLastRow</type>
|
|
||||||
<description/>
|
|
||||||
<distribute>N</distribute>
|
|
||||||
<custom_distribution/>
|
|
||||||
<copies>1</copies>
|
|
||||||
<partitioning>
|
|
||||||
<method>none</method>
|
|
||||||
<schema_name/>
|
|
||||||
</partitioning>
|
|
||||||
<resultfieldname>last_row</resultfieldname>
|
|
||||||
<attributes/>
|
|
||||||
<GUI>
|
|
||||||
<xloc>1056</xloc>
|
|
||||||
<yloc>352</yloc>
|
|
||||||
</GUI>
|
|
||||||
</transform>
|
|
||||||
<transform_error_handling>
|
<transform_error_handling>
|
||||||
<error>
|
<error>
|
||||||
<source_transform>Insert / update</source_transform>
|
<source_transform>Insert / update</source_transform>
|
||||||
|
|
|
||||||
|
|
@ -270,6 +270,24 @@ DO UPDATE SET
|
||||||
<yloc>208</yloc>
|
<yloc>208</yloc>
|
||||||
</GUI>
|
</GUI>
|
||||||
</transform>
|
</transform>
|
||||||
|
<transform>
|
||||||
|
<name>Identify last row in a stream 2</name>
|
||||||
|
<type>DetectLastRow</type>
|
||||||
|
<description/>
|
||||||
|
<distribute>N</distribute>
|
||||||
|
<custom_distribution/>
|
||||||
|
<copies>1</copies>
|
||||||
|
<partitioning>
|
||||||
|
<method>none</method>
|
||||||
|
<schema_name/>
|
||||||
|
</partitioning>
|
||||||
|
<resultfieldname>last_row</resultfieldname>
|
||||||
|
<attributes/>
|
||||||
|
<GUI>
|
||||||
|
<xloc>1056</xloc>
|
||||||
|
<yloc>208</yloc>
|
||||||
|
</GUI>
|
||||||
|
</transform>
|
||||||
<transform>
|
<transform>
|
||||||
<name>Insert / update</name>
|
<name>Insert / update</name>
|
||||||
<type>InsertUpdate</type>
|
<type>InsertUpdate</type>
|
||||||
|
|
@ -372,6 +390,7 @@ DO UPDATE SET
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>WITH
|
<sql>WITH
|
||||||
base AS (
|
base AS (
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -379,7 +398,7 @@ base AS (
|
||||||
ri.info
|
ri.info
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
WHERE jsonb_typeof(ri.info->'svedFL'->'svedVoditUdost'->'voditUdost'->'svedKat') = 'array'
|
WHERE jsonb_typeof(ri.info->'svedFL'->'svedVoditUdost'->'voditUdost'->'svedKat') = 'array'
|
||||||
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'aktUTM' IS NOT NULL
|
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'aktUTM' IS NOT NULL
|
||||||
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'predUTM' IS NOT NULL
|
OR ri.info->'svedFL'->'svedUdostTraktMash'->'udostTraktMash'->'predUTM' IS NOT NULL
|
||||||
|
|
@ -530,24 +549,6 @@ FROM all_data</sql>
|
||||||
<yloc>208</yloc>
|
<yloc>208</yloc>
|
||||||
</GUI>
|
</GUI>
|
||||||
</transform>
|
</transform>
|
||||||
<transform>
|
|
||||||
<name>Identify last row in a stream 2</name>
|
|
||||||
<type>DetectLastRow</type>
|
|
||||||
<description/>
|
|
||||||
<distribute>N</distribute>
|
|
||||||
<custom_distribution/>
|
|
||||||
<copies>1</copies>
|
|
||||||
<partitioning>
|
|
||||||
<method>none</method>
|
|
||||||
<schema_name/>
|
|
||||||
</partitioning>
|
|
||||||
<resultfieldname>last_row</resultfieldname>
|
|
||||||
<attributes/>
|
|
||||||
<GUI>
|
|
||||||
<xloc>1056</xloc>
|
|
||||||
<yloc>208</yloc>
|
|
||||||
</GUI>
|
|
||||||
</transform>
|
|
||||||
<transform_error_handling>
|
<transform_error_handling>
|
||||||
<error>
|
<error>
|
||||||
<source_transform>Insert / update</source_transform>
|
<source_transform>Insert / update</source_transform>
|
||||||
|
|
|
||||||
|
|
@ -136,11 +136,8 @@ and recruitment_id = '${IDM_ID}';
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<delete_field/>
|
|
||||||
<execute_each_row>Y</execute_each_row>
|
<execute_each_row>Y</execute_each_row>
|
||||||
<insert_field/>
|
|
||||||
<quoteString>N</quoteString>
|
<quoteString>N</quoteString>
|
||||||
<read_field/>
|
|
||||||
<replace_variables>Y</replace_variables>
|
<replace_variables>Y</replace_variables>
|
||||||
<set_params>N</set_params>
|
<set_params>N</set_params>
|
||||||
<single_statement>N</single_statement>
|
<single_statement>N</single_statement>
|
||||||
|
|
@ -152,7 +149,6 @@ and recruitment_id = '${IDM_ID}'
|
||||||
and status = 'PROCESSING';
|
and status = 'PROCESSING';
|
||||||
|
|
||||||
</sql>
|
</sql>
|
||||||
<update_field/>
|
|
||||||
<attributes/>
|
<attributes/>
|
||||||
<GUI>
|
<GUI>
|
||||||
<xloc>1264</xloc>
|
<xloc>1264</xloc>
|
||||||
|
|
@ -272,6 +268,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id,
|
ri.recruit_id,
|
||||||
NULLIF(p.passport_data->>'nomDok', '') AS passport_number,
|
NULLIF(p.passport_data->>'nomDok', '') AS passport_number,
|
||||||
|
|
@ -287,7 +284,7 @@ FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r
|
JOIN ervu_dashboard.citizen r
|
||||||
ON r.recruit_id = ri.recruit_id
|
ON r.recruit_id = ri.recruit_id
|
||||||
AND '${IDM_ID}' != ''
|
AND '${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
JOIN LATERAL (
|
JOIN LATERAL (
|
||||||
SELECT passport_data
|
SELECT passport_data
|
||||||
FROM UNNEST(ARRAY[
|
FROM UNNEST(ARRAY[
|
||||||
|
|
|
||||||
|
|
@ -340,6 +340,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>SELECT
|
<sql>SELECT
|
||||||
ri.recruit_id,
|
ri.recruit_id,
|
||||||
NULLIF(p.passport_data->>'nomDok', '') AS passport_number,
|
NULLIF(p.passport_data->>'nomDok', '') AS passport_number,
|
||||||
|
|
@ -355,7 +356,7 @@ FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r
|
JOIN ervu_dashboard.citizen r
|
||||||
ON r.recruit_id = ri.recruit_id
|
ON r.recruit_id = ri.recruit_id
|
||||||
AND '${IDM_ID}' != ''
|
AND '${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
|
AND '${M_R_CR_DATE}'::timestamp >= r.recruit_create_date
|
||||||
AND r.update_date >= '${M_R_UP_DATE}'::timestamp
|
AND r.update_date >= '${M_R_UP_DATE}'::timestamp
|
||||||
JOIN LATERAL (
|
JOIN LATERAL (
|
||||||
|
|
|
||||||
|
|
@ -370,7 +370,7 @@ FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r
|
JOIN ervu_dashboard.citizen r
|
||||||
ON r.recruit_id = ri.recruit_id
|
ON r.recruit_id = ri.recruit_id
|
||||||
AND '${IDM_ID}' != ''
|
AND '${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
JOIN LATERAL (
|
JOIN LATERAL (
|
||||||
SELECT passport_data
|
SELECT passport_data
|
||||||
FROM UNNEST(ARRAY[
|
FROM UNNEST(ARRAY[
|
||||||
|
|
|
||||||
|
|
@ -270,6 +270,40 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
||||||
<yloc>32</yloc>
|
<yloc>32</yloc>
|
||||||
</GUI>
|
</GUI>
|
||||||
</transform>
|
</transform>
|
||||||
|
<transform>
|
||||||
|
<name>Sort rows</name>
|
||||||
|
<type>SortRows</type>
|
||||||
|
<description/>
|
||||||
|
<distribute>Y</distribute>
|
||||||
|
<custom_distribution/>
|
||||||
|
<copies>1</copies>
|
||||||
|
<partitioning>
|
||||||
|
<method>none</method>
|
||||||
|
<schema_name/>
|
||||||
|
</partitioning>
|
||||||
|
<directory>${java.io.tmpdir}</directory>
|
||||||
|
<prefix>out</prefix>
|
||||||
|
<sort_size>1000000</sort_size>
|
||||||
|
<free_memory/>
|
||||||
|
<compress>N</compress>
|
||||||
|
<compress_variable/>
|
||||||
|
<unique_rows>Y</unique_rows>
|
||||||
|
<fields>
|
||||||
|
<field>
|
||||||
|
<name>recruit_id</name>
|
||||||
|
<ascending>Y</ascending>
|
||||||
|
<case_sensitive>N</case_sensitive>
|
||||||
|
<collator_enabled>N</collator_enabled>
|
||||||
|
<collator_strength>0</collator_strength>
|
||||||
|
<presorted>N</presorted>
|
||||||
|
</field>
|
||||||
|
</fields>
|
||||||
|
<attributes/>
|
||||||
|
<GUI>
|
||||||
|
<xloc>832</xloc>
|
||||||
|
<yloc>224</yloc>
|
||||||
|
</GUI>
|
||||||
|
</transform>
|
||||||
<transform>
|
<transform>
|
||||||
<name>Table input</name>
|
<name>Table input</name>
|
||||||
<type>TableInput</type>
|
<type>TableInput</type>
|
||||||
|
|
@ -292,7 +326,7 @@ ugolov_presl AS (
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
||||||
AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
|
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -494,40 +528,6 @@ GROUP BY r.recruit_id, up;</sql>
|
||||||
<yloc>32</yloc>
|
<yloc>32</yloc>
|
||||||
</GUI>
|
</GUI>
|
||||||
</transform>
|
</transform>
|
||||||
<transform>
|
|
||||||
<name>Sort rows</name>
|
|
||||||
<type>SortRows</type>
|
|
||||||
<description/>
|
|
||||||
<distribute>Y</distribute>
|
|
||||||
<custom_distribution/>
|
|
||||||
<copies>1</copies>
|
|
||||||
<partitioning>
|
|
||||||
<method>none</method>
|
|
||||||
<schema_name/>
|
|
||||||
</partitioning>
|
|
||||||
<directory>${java.io.tmpdir}</directory>
|
|
||||||
<prefix>out</prefix>
|
|
||||||
<sort_size>1000000</sort_size>
|
|
||||||
<free_memory/>
|
|
||||||
<compress>N</compress>
|
|
||||||
<compress_variable/>
|
|
||||||
<unique_rows>Y</unique_rows>
|
|
||||||
<fields>
|
|
||||||
<field>
|
|
||||||
<name>recruit_id</name>
|
|
||||||
<ascending>Y</ascending>
|
|
||||||
<case_sensitive>N</case_sensitive>
|
|
||||||
<collator_enabled>N</collator_enabled>
|
|
||||||
<collator_strength>0</collator_strength>
|
|
||||||
<presorted>N</presorted>
|
|
||||||
</field>
|
|
||||||
</fields>
|
|
||||||
<attributes/>
|
|
||||||
<GUI>
|
|
||||||
<xloc>832</xloc>
|
|
||||||
<yloc>224</yloc>
|
|
||||||
</GUI>
|
|
||||||
</transform>
|
|
||||||
<transform_error_handling>
|
<transform_error_handling>
|
||||||
<error>
|
<error>
|
||||||
<source_transform>Table output</source_transform>
|
<source_transform>Table output</source_transform>
|
||||||
|
|
|
||||||
|
|
@ -469,7 +469,7 @@ ugolov_presl AS (
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
||||||
AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
||||||
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
|
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -473,6 +473,7 @@ DO UPDATE SET
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>WITH
|
<sql>WITH
|
||||||
ugolov_presl AS (
|
ugolov_presl AS (
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -481,7 +482,7 @@ ugolov_presl AS (
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
||||||
AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
AND '${IDM_ID}' != '' -- Проверка на пустую строку
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
|
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
|
|
@ -324,11 +324,11 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
||||||
AND '${IDM_ID}' != ''
|
AND '${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null'
|
WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null'
|
||||||
)
|
)
|
||||||
SELECT recruit_id,
|
SELECT recruit_id,
|
||||||
(punishment_info ->> 'id')::uuid AS punishment_external_id,
|
(punishment_info ->> 'id')::uuid AS punishment_external_id,
|
||||||
-- Блок "Сведения о вынесенном приговоре"
|
-- Блок "Сведения о вынесенном приговоре"
|
||||||
punishment_info ->> 'vidNakaz' AS punishment_type, -- Вид наказания
|
punishment_info ->> 'vidNakaz' AS punishment_type, -- Вид наказания
|
||||||
punishment_info ->> 'kodVidNakaz' AS punishment_code, -- Код вида наказания
|
punishment_info ->> 'kodVidNakaz' AS punishment_code, -- Код вида наказания
|
||||||
|
|
@ -347,7 +347,7 @@ SELECT recruit_id,
|
||||||
punishment_info ->> 'naimOrg' AS facility_name, -- Название учреждения
|
punishment_info ->> 'naimOrg' AS facility_name, -- Название учреждения
|
||||||
punishment_info ->> 'adresOrg' AS facility_address, -- Адрес учреждения
|
punishment_info ->> 'adresOrg' AS facility_address, -- Адрес учреждения
|
||||||
punishment_info ->> 'nomerUD' AS criminal_case_number, -- Номер уголовного дела
|
punishment_info ->> 'nomerUD' AS criminal_case_number, -- Номер уголовного дела
|
||||||
TO_DATE(punishment_info ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, -- Дата начала срока
|
TO_DATE(punishment_info ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date, -- Дата начала срока
|
||||||
TO_DATE(punishment_info ->> 'dataOkonchSrok', 'YYYY-MM-DD') AS planned_date, -- Планируемая дата освобождения
|
TO_DATE(punishment_info ->> 'dataOkonchSrok', 'YYYY-MM-DD') AS planned_date, -- Планируемая дата освобождения
|
||||||
CASE
|
CASE
|
||||||
WHEN punishment_info ->> 'kodPerekvalif' = '1' THEN 'Изменений статьи не было'
|
WHEN punishment_info ->> 'kodPerekvalif' = '1' THEN 'Изменений статьи не было'
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
||||||
AND '${IDM_ID}' != ''
|
AND '${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
||||||
WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null'
|
WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null'
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -463,13 +463,14 @@ DO UPDATE SET
|
||||||
</partitioning>
|
</partitioning>
|
||||||
<connection>ervu-dashboard</connection>
|
<connection>ervu-dashboard</connection>
|
||||||
<execute_each_row>N</execute_each_row>
|
<execute_each_row>N</execute_each_row>
|
||||||
|
<limit/>
|
||||||
<sql>WITH punishment_data AS (
|
<sql>WITH punishment_data AS (
|
||||||
SELECT ri.recruit_id,
|
SELECT ri.recruit_id,
|
||||||
jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS punishment_info
|
jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS punishment_info
|
||||||
FROM ervu_dashboard.recruits_info ri
|
FROM ervu_dashboard.recruits_info ri
|
||||||
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
|
||||||
AND '${IDM_ID}' != ''
|
AND '${IDM_ID}' != ''
|
||||||
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
|
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||||
WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null'
|
WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null'
|
||||||
)
|
)
|
||||||
SELECT recruit_id,
|
SELECT recruit_id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue