change input script in border_crossing
This commit is contained in:
parent
193a38cc97
commit
c197189cb6
6 changed files with 123 additions and 299 deletions
|
|
@ -33,8 +33,8 @@
|
|||
<fontname>Segoe UI</fontname>
|
||||
<fontsize>9</fontsize>
|
||||
<height>294</height>
|
||||
<xloc>160</xloc>
|
||||
<yloc>704</yloc>
|
||||
<xloc>176</xloc>
|
||||
<yloc>576</yloc>
|
||||
<note>+
|
||||
|
||||
|
||||
|
|
@ -92,29 +92,24 @@
|
|||
<to>Update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table output</from>
|
||||
<to>Filter rows</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input</from>
|
||||
<to>Identify last row in a stream</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Identify last row in a stream</from>
|
||||
<to>Table output</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Identify last row in a stream</from>
|
||||
<to>Detect empty stream</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Identify last row in a stream</from>
|
||||
<from>Table input</from>
|
||||
<to>sort_by_recruit_id</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table output</from>
|
||||
<to>Filter rows</to>
|
||||
<from>Table input</from>
|
||||
<to>Table output</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
|
|
@ -134,7 +129,7 @@
|
|||
<row_threshold>0</row_threshold>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1536</xloc>
|
||||
<xloc>1200</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -170,7 +165,7 @@ and recruitment_id = '${IDM_ID}';
|
|||
</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1328</xloc>
|
||||
<xloc>1024</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -202,8 +197,8 @@ and recruitment_id = '${IDM_ID}';
|
|||
</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>160</yloc>
|
||||
<xloc>1200</xloc>
|
||||
<yloc>192</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -248,8 +243,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
|||
</partitioning>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>688</xloc>
|
||||
<yloc>160</yloc>
|
||||
<xloc>496</xloc>
|
||||
<yloc>192</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -284,25 +279,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
|||
<send_true_to>Change job status on success</send_true_to>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Identify last row in a stream</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>688</xloc>
|
||||
<xloc>1200</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -310,7 +287,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
|||
<name>Table input</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
|
|
@ -320,34 +297,19 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
|
|||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit/>
|
||||
<sql>SELECT
|
||||
ri.recruit_id,
|
||||
CASE
|
||||
WHEN elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVyezd')::date
|
||||
ELSE NULL
|
||||
END as date_crossing,
|
||||
CASE
|
||||
WHEN elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVozvrashh')::date
|
||||
ELSE NULL
|
||||
END as return_date,
|
||||
true as border_crossed
|
||||
<sql>WITH filteredData AS (SELECT ri.recruit_id,
|
||||
ri.info->'svedFL'->'extend'->'svedPeresechGran' as border_cross_arr,
|
||||
ctid
|
||||
FROM ervu_dashboard.recruits_info ri
|
||||
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 '${M_R_CR_DATE}'::timestamp >= ri.created_at
|
||||
JOIN LATERAL (
|
||||
SELECT elem
|
||||
FROM jsonb_array_elements(
|
||||
CASE
|
||||
WHEN jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
|
||||
THEN ri.info->'svedFL'->'extend'->'svedPeresechGran'
|
||||
ELSE '[]'::jsonb
|
||||
END
|
||||
) as elem
|
||||
WHERE (elem->>'dataVyezd' IS NOT NULL AND elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$')
|
||||
OR (elem->>'dataVozvrashh' IS NOT NULL AND elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$')
|
||||
) AS filtered_elems ON true</sql>
|
||||
WHERE jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
|
||||
AND coalesce(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||
)
|
||||
SELECT to_date(border_cross_elem->>'dataVyezd' , 'YYYY-MM-DD') as date_crossing,
|
||||
to_date(border_cross_elem->>'dataVozvrashh' , 'YYYY-MM-DD') as return_date,
|
||||
true as border_crossed,
|
||||
fd.ctid = (select max(ctid) from filteredData) as last_row
|
||||
FROM filteredData fd
|
||||
CROSS JOIN LATERAL jsonb_array_elements(border_cross_arr) AS border_cross_elem;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
@ -397,7 +359,7 @@ JOIN LATERAL (
|
|||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>976</xloc>
|
||||
<xloc>784</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -432,7 +394,7 @@ JOIN LATERAL (
|
|||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>976</xloc>
|
||||
<xloc>784</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -466,7 +428,7 @@ JOIN LATERAL (
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>688</xloc>
|
||||
<xloc>496</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
|
|||
|
|
@ -18,32 +18,6 @@
|
|||
<modified_date>2025/08/11 13:22:56.048</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
<notepad>
|
||||
<backgroundcolorblue>251</backgroundcolorblue>
|
||||
<backgroundcolorgreen>232</backgroundcolorgreen>
|
||||
<backgroundcolorred>201</backgroundcolorred>
|
||||
<bordercolorblue>90</bordercolorblue>
|
||||
<bordercolorgreen>58</bordercolorgreen>
|
||||
<bordercolorred>14</bordercolorred>
|
||||
<fontbold>N</fontbold>
|
||||
<fontcolorblue>90</fontcolorblue>
|
||||
<fontcolorgreen>58</fontcolorgreen>
|
||||
<fontcolorred>14</fontcolorred>
|
||||
<fontitalic>N</fontitalic>
|
||||
<fontname>Segoe UI</fontname>
|
||||
<fontsize>9</fontsize>
|
||||
<height>120</height>
|
||||
<xloc>288</xloc>
|
||||
<yloc>640</yloc>
|
||||
<note>+
|
||||
|
||||
1. Перенести решение проблем описанных в ревью по первичному flow.
|
||||
2. Как планируется не дублировать данные по рекруту(допустим на первичке были скопированы 2 даты, мы обновли запись и добавили еще пересечение) в новом запуске мы заного добавим 2 новые даты, + задублируем уже добавленные?
|
||||
3. Insert/update нет error_description для error_handling
|
||||
4. Update нет error_description для error_handling
|
||||
</note>
|
||||
<width>1349</width>
|
||||
</notepad>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
|
|
@ -82,28 +56,23 @@
|
|||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input</from>
|
||||
<to>Identify last row in a stream</to>
|
||||
<from>Insert / update</from>
|
||||
<to>Filter rows</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Identify last row in a stream</from>
|
||||
<from>Table input</from>
|
||||
<to>sort_by_recruit_id</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Identify last row in a stream</from>
|
||||
<to>Insert / update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Identify last row in a stream</from>
|
||||
<from>Table input</from>
|
||||
<to>Detect empty stream</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Insert / update</from>
|
||||
<to>Filter rows</to>
|
||||
<from>Table input</from>
|
||||
<to>Insert / update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
|
|
@ -123,8 +92,8 @@
|
|||
<row_threshold>0</row_threshold>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1520</xloc>
|
||||
<yloc>544</yloc>
|
||||
<xloc>1328</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -159,8 +128,8 @@ and recruitment_id = '${IDM_ID}';
|
|||
</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1248</xloc>
|
||||
<yloc>544</yloc>
|
||||
<xloc>1056</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -191,8 +160,8 @@ and recruitment_id = '${IDM_ID}';
|
|||
</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1408</xloc>
|
||||
<yloc>160</yloc>
|
||||
<xloc>1056</xloc>
|
||||
<yloc>208</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -240,8 +209,8 @@ and recruitment_id = '${IDM_ID}';</sql>
|
|||
</partitioning>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>752</xloc>
|
||||
<yloc>160</yloc>
|
||||
<xloc>560</xloc>
|
||||
<yloc>208</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -276,25 +245,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
|||
<send_true_to>Change job status on success</send_true_to>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1408</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Identify last row in a stream</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>752</xloc>
|
||||
<xloc>1056</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -316,16 +267,13 @@ and recruitment_id = '${IDM_ID}';</sql>
|
|||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>date_crossing</field>
|
||||
<name>date_crossing</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>return_date</field>
|
||||
<name>return_date</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>border_crossing</table>
|
||||
|
|
@ -348,7 +296,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
|||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>960</xloc>
|
||||
<xloc>768</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -356,7 +304,7 @@ and recruitment_id = '${IDM_ID}';</sql>
|
|||
<name>Table input</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
|
|
@ -365,35 +313,20 @@ and recruitment_id = '${IDM_ID}';</sql>
|
|||
</partitioning>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<sql>SELECT
|
||||
ri.recruit_id,
|
||||
CASE
|
||||
WHEN elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVyezd')::date
|
||||
ELSE NULL
|
||||
END as date_crossing,
|
||||
CASE
|
||||
WHEN elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVozvrashh')::date
|
||||
ELSE NULL
|
||||
END as return_date,
|
||||
true as border_crossed
|
||||
<limit/>
|
||||
<sql>WITH filteredData AS (SELECT ri.recruit_id,
|
||||
ri.info->'svedFL'->'extend'->'svedPeresechGran' as border_cross_arr,
|
||||
ctid
|
||||
FROM ervu_dashboard.recruits_info ri
|
||||
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 ri.updated_at >= '${M_R_UP_DATE}'::timestamp
|
||||
--AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
|
||||
JOIN LATERAL (
|
||||
SELECT elem
|
||||
FROM jsonb_array_elements(
|
||||
CASE
|
||||
WHEN jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
|
||||
THEN ri.info->'svedFL'->'extend'->'svedPeresechGran'
|
||||
ELSE '[]'::jsonb
|
||||
END
|
||||
) as elem
|
||||
WHERE (elem->>'dataVyezd' IS NOT NULL AND elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$')
|
||||
OR (elem->>'dataVozvrashh' IS NOT NULL AND elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$')
|
||||
) AS filtered_elems ON true</sql>
|
||||
WHERE jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
|
||||
AND coalesce(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||
)
|
||||
SELECT to_date(border_cross_elem->>'dataVyezd' , 'YYYY-MM-DD') as date_crossing,
|
||||
to_date(border_cross_elem->>'dataVozvrashh' , 'YYYY-MM-DD') as return_date,
|
||||
true as border_crossed,
|
||||
fd.ctid = (select max(ctid) from filteredData) as last_row
|
||||
FROM filteredData fd
|
||||
CROSS JOIN LATERAL jsonb_array_elements(border_cross_arr) AS border_cross_elem;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
@ -415,16 +348,13 @@ JOIN LATERAL (
|
|||
<commit>10000</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<error_ignored>Y</error_ignored>
|
||||
<ignore_flag_field/>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition><></condition>
|
||||
<field>border_crossed</field>
|
||||
<name>border_crossed</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>citizen</table>
|
||||
|
|
@ -437,8 +367,8 @@ JOIN LATERAL (
|
|||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>960</xloc>
|
||||
<yloc>544</yloc>
|
||||
<xloc>768</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -471,8 +401,8 @@ JOIN LATERAL (
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>752</xloc>
|
||||
<yloc>544</yloc>
|
||||
<xloc>560</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@
|
|||
<fontname>Segoe UI</fontname>
|
||||
<fontsize>9</fontsize>
|
||||
<height>73</height>
|
||||
<xloc>176</xloc>
|
||||
<yloc>400</yloc>
|
||||
<xloc>96</xloc>
|
||||
<yloc>592</yloc>
|
||||
<note>+
|
||||
|
||||
1.Перенести решение проблем по ревью из первичного флоу
|
||||
|
|
@ -79,28 +79,23 @@
|
|||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input</from>
|
||||
<to>Identify last row in a stream</to>
|
||||
<from>Insert / update</from>
|
||||
<to>Filter rows</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Identify last row in a stream</from>
|
||||
<from>Table input</from>
|
||||
<to>Insert / update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Identify last row in a stream</from>
|
||||
<to>sort_by_recruit_id</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Identify last row in a stream</from>
|
||||
<from>Table input</from>
|
||||
<to>Detect empty stream</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Insert / update</from>
|
||||
<to>Filter rows</to>
|
||||
<from>Table input</from>
|
||||
<to>sort_by_recruit_id</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
|
|
@ -120,8 +115,8 @@
|
|||
<row_threshold>0</row_threshold>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1408</xloc>
|
||||
<yloc>416</yloc>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -156,8 +151,8 @@ and recruitment_id = '${IDM_ID}';
|
|||
</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1184</xloc>
|
||||
<yloc>416</yloc>
|
||||
<xloc>944</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -188,7 +183,7 @@ and recruitment_id = '${IDM_ID}';
|
|||
</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1568</xloc>
|
||||
<xloc>944</xloc>
|
||||
<yloc>48</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -252,7 +247,7 @@ DO UPDATE SET
|
|||
</partitioning>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>672</xloc>
|
||||
<xloc>480</xloc>
|
||||
<yloc>48</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -288,25 +283,7 @@ DO UPDATE SET
|
|||
<send_true_to>Change job status on success</send_true_to>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1568</xloc>
|
||||
<yloc>208</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Identify last row in a stream</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>672</xloc>
|
||||
<xloc>944</xloc>
|
||||
<yloc>208</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -328,19 +305,11 @@ DO UPDATE SET
|
|||
<condition>=</condition>
|
||||
<field>recruit_id</field>
|
||||
<name>recruit_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>date_crossing</field>
|
||||
<name>date_crossing</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>return_date</field>
|
||||
<name>return_date</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>ervu_dashboard</schema>
|
||||
<table>border_crossing</table>
|
||||
|
|
@ -363,7 +332,7 @@ DO UPDATE SET
|
|||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>944</xloc>
|
||||
<xloc>736</xloc>
|
||||
<yloc>208</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -371,7 +340,7 @@ DO UPDATE SET
|
|||
<name>Table input</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
|
|
@ -380,34 +349,19 @@ DO UPDATE SET
|
|||
</partitioning>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<sql>SELECT
|
||||
ri.recruit_id,
|
||||
CASE
|
||||
WHEN elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVyezd')::date
|
||||
ELSE NULL
|
||||
END as date_crossing,
|
||||
CASE
|
||||
WHEN elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVozvrashh')::date
|
||||
ELSE NULL
|
||||
END as return_date,
|
||||
true as border_crossed
|
||||
<sql>WITH filteredData AS (SELECT ri.recruit_id,
|
||||
ri.info->'svedFL'->'extend'->'svedPeresechGran' as border_cross_arr,
|
||||
ctid
|
||||
FROM ervu_dashboard.recruits_info ri
|
||||
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 '${M_R_CR_DATE}'::timestamp >= ri.created_at
|
||||
JOIN LATERAL (
|
||||
SELECT elem
|
||||
FROM jsonb_array_elements(
|
||||
CASE
|
||||
WHEN jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
|
||||
THEN ri.info->'svedFL'->'extend'->'svedPeresechGran'
|
||||
ELSE '[]'::jsonb
|
||||
END
|
||||
) as elem
|
||||
WHERE (elem->>'dataVyezd' IS NOT NULL AND elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$')
|
||||
OR (elem->>'dataVozvrashh' IS NOT NULL AND elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$')
|
||||
) AS filtered_elems ON true</sql>
|
||||
WHERE jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
|
||||
AND coalesce(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
|
||||
)
|
||||
SELECT to_date(border_cross_elem->>'dataVyezd' , 'YYYY-MM-DD') as date_crossing,
|
||||
to_date(border_cross_elem->>'dataVozvrashh' , 'YYYY-MM-DD') as return_date,
|
||||
true as border_crossed,
|
||||
fd.ctid = (select max(ctid) from filteredData) as last_row
|
||||
FROM filteredData fd
|
||||
CROSS JOIN LATERAL jsonb_array_elements(border_cross_arr) AS border_cross_elem;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
|
|
@ -451,8 +405,8 @@ JOIN LATERAL (
|
|||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>896</xloc>
|
||||
<yloc>416</yloc>
|
||||
<xloc>736</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -485,8 +439,8 @@ JOIN LATERAL (
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>672</xloc>
|
||||
<yloc>416</yloc>
|
||||
<xloc>480</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING')
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>656</xloc>
|
||||
<xloc>640</xloc>
|
||||
<yloc>240</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -260,7 +260,7 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING')
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>672</xloc>
|
||||
<xloc>640</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -311,8 +311,8 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING')
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>672</xloc>
|
||||
<yloc>384</yloc>
|
||||
<xloc>640</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -362,8 +362,8 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING')
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>672</xloc>
|
||||
<yloc>464</yloc>
|
||||
<xloc>640</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
|
|
@ -18,28 +18,6 @@
|
|||
<modified_date>2025/08/05 12:54:50.126</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
<notepad>
|
||||
<backgroundcolorblue>251</backgroundcolorblue>
|
||||
<backgroundcolorgreen>232</backgroundcolorgreen>
|
||||
<backgroundcolorred>201</backgroundcolorred>
|
||||
<bordercolorblue>90</bordercolorblue>
|
||||
<bordercolorgreen>58</bordercolorgreen>
|
||||
<bordercolorred>14</bordercolorred>
|
||||
<fontbold>N</fontbold>
|
||||
<fontcolorblue>90</fontcolorblue>
|
||||
<fontcolorgreen>58</fontcolorgreen>
|
||||
<fontcolorred>14</fontcolorred>
|
||||
<fontitalic>N</fontitalic>
|
||||
<fontname>Segoe UI</fontname>
|
||||
<fontsize>9</fontsize>
|
||||
<height>57</height>
|
||||
<xloc>256</xloc>
|
||||
<yloc>656</yloc>
|
||||
<note>+
|
||||
|
||||
1.Заменить зашитое название джобы в input на переменную JOB_NAME?</note>
|
||||
<width>414</width>
|
||||
</notepad>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
|
|
@ -347,7 +325,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING');</sql>
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>560</xloc>
|
||||
<xloc>544</xloc>
|
||||
<yloc>544</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
|
|||
|
|
@ -118,8 +118,8 @@ FROM ervu_dashboard.recruitment
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>736</xloc>
|
||||
<yloc>144</yloc>
|
||||
<xloc>672</xloc>
|
||||
<yloc>160</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -169,7 +169,7 @@ FROM ervu_dashboard.recruitment
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>736</xloc>
|
||||
<xloc>672</xloc>
|
||||
<yloc>240</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -220,8 +220,8 @@ FROM ervu_dashboard.recruitment
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>752</xloc>
|
||||
<yloc>336</yloc>
|
||||
<xloc>672</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -271,8 +271,8 @@ FROM ervu_dashboard.recruitment
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>768</xloc>
|
||||
<yloc>416</yloc>
|
||||
<xloc>672</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -322,8 +322,8 @@ FROM ervu_dashboard.recruitment
|
|||
<executors_output_transform/>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>752</xloc>
|
||||
<yloc>512</yloc>
|
||||
<xloc>672</xloc>
|
||||
<yloc>480</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue