108 lines
3.7 KiB
XML
108 lines
3.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<pipeline>
|
|
<info>
|
|
<name>punishment_once</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>2024/08/15 14:02:51.713</created_date>
|
|
<modified_user>-</modified_user>
|
|
<modified_date>2024/08/15 14:02:51.713</modified_date>
|
|
</info>
|
|
<notepads>
|
|
</notepads>
|
|
<order>
|
|
<hop>
|
|
<from>Table input 2</from>
|
|
<to>Table output</to>
|
|
<enabled>Y</enabled>
|
|
</hop>
|
|
</order>
|
|
<transform>
|
|
<name>Table input 2</name>
|
|
<type>TableInput</type>
|
|
<description/>
|
|
<distribute>Y</distribute>
|
|
<custom_distribution/>
|
|
<copies>1</copies>
|
|
<partitioning>
|
|
<method>none</method>
|
|
<schema_name/>
|
|
</partitioning>
|
|
<connection>ervu_person_registry</connection>
|
|
<execute_each_row>N</execute_each_row>
|
|
<limit>0</limit>
|
|
<sql>WITH ugol AS (SELECT ri.recruit_id,
|
|
jsonb_array_elements(ri.info -> 'svedFL' -> 'svedNakaz' -> 'nakaz') AS nakaz
|
|
FROM public.recruits_info ri
|
|
JOIN public.recruits r ON r.id = ri.recruit_id
|
|
WHERE ri.info -> 'svedFL' -> 'svedNakaz' ->> 'nakaz' != 'null'
|
|
AND '${RCRT_C}' IN (r.target_recruitment_id, r.current_recruitment_id))
|
|
SELECT recruit_id,
|
|
nakaz ->> 'naimSud' AS authority_name,
|
|
nakaz ->> 'srokNakaz' AS sentence,
|
|
nakaz ->> 'adresOrg' AS sentence_place,
|
|
-- nakaz->>'vidNakaz' AS punishment_code,
|
|
nakaz ->> 'naimIzmSrokNakaz' AS sentence_changed,
|
|
nakaz ->> 'vidNakaz' AS punishment_type,
|
|
TO_DATE(nakaz ->> 'dataNachSrok', 'YYYY-MM-DD') AS start_date,
|
|
TO_DATE(nakaz ->> 'dataOsvob', 'YYYY-MM-DD') AS release_date,
|
|
TO_DATE(nakaz ->> 'dataOsuzhd', 'YYYY-MM-DD') AS sentense_date,
|
|
string_agg(statiuk_elem, ', ') AS law_point,
|
|
nakaz ->> 'osnOsvob' AS release_reason
|
|
FROM ugol
|
|
LEFT JOIN LATERAL jsonb_array_elements_text(nakaz -> 'statiUK') AS statiuk_elem ON true
|
|
GROUP BY recruit_id, nakaz;</sql>
|
|
<variables_active>Y</variables_active>
|
|
<attributes/>
|
|
<GUI>
|
|
<xloc>464</xloc>
|
|
<yloc>304</yloc>
|
|
</GUI>
|
|
</transform>
|
|
<transform>
|
|
<name>Table output</name>
|
|
<type>TableOutput</type>
|
|
<description/>
|
|
<distribute>Y</distribute>
|
|
<custom_distribution/>
|
|
<copies>1</copies>
|
|
<partitioning>
|
|
<method>none</method>
|
|
<schema_name/>
|
|
</partitioning>
|
|
<commit>50000</commit>
|
|
<connection>ervu-dashboard</connection>
|
|
<fields>
|
|
</fields>
|
|
<ignore_errors>N</ignore_errors>
|
|
<only_when_have_rows>N</only_when_have_rows>
|
|
<partitioning_daily>N</partitioning_daily>
|
|
<partitioning_enabled>N</partitioning_enabled>
|
|
<partitioning_monthly>Y</partitioning_monthly>
|
|
<return_keys>N</return_keys>
|
|
<schema>ervu_dashboard</schema>
|
|
<specify_fields>N</specify_fields>
|
|
<table>punishment</table>
|
|
<tablename_in_field>N</tablename_in_field>
|
|
<tablename_in_table>Y</tablename_in_table>
|
|
<truncate>N</truncate>
|
|
<use_batch>Y</use_batch>
|
|
<attributes/>
|
|
<GUI>
|
|
<xloc>736</xloc>
|
|
<yloc>304</yloc>
|
|
</GUI>
|
|
</transform>
|
|
<transform_error_handling>
|
|
</transform_error_handling>
|
|
<attributes/>
|
|
</pipeline>
|