ervu-dashboard-etl/mappings/info_recruits/temporary_measure.hpl

139 lines
4.6 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<pipeline>
<info>
<name>temporary_measure</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<directory>/</directory>
<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>
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Table input</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>postgres.subpoena</connection>
<sql>SELECT
rd.subpoena_id,
rd.vk_id AS recruitment_id,
s.recruit_id,
rds.name AS status_measure, -- статус временной меры
rd.recruitment_name, -- наименоване ВК
rdi.cancel_date, -- дата, с которой отменена временная мера
rn.name AS restriction_name, -- наименование ограничения (тип временной меры)
CASE
WHEN rd.type='CREATE' THEN 'Применение временной меры'
WHEN rd.type='CANCEL' THEN 'Отмена временной меры'
END AS type, -- тип документа ограничения
CASE
WHEN rd.type='CREATE' THEN rd.decision_number
ELSE NULL
END AS decision_number_create, -- номер решения о применении временной меры
CASE
WHEN rd.type='CANCEL' THEN rd.decision_number
ELSE NULL
END AS decision_number_cancel, -- номер решения об отмене временной меры
CASE
WHEN rd.type='CREATE' THEN rd.decision_date
ELSE NULL
END AS decision_date_create, -- дата решения о применении временной меры
CASE
WHEN rd.type='CANCEL' THEN rd.decision_date
ELSE NULL
END AS decision_date_cancel, -- дата решения об отмене временной меры
CASE
WHEN rdi.applied_fact = 'true' THEN 'Временная мера применена'
WHEN rdi.applied_fact = 'false' THEN 'Временная мера не применена'
ELSE 'Нет информации'
END AS applied_fact -- факт применения временной меры
FROM public.restriction_document AS rd
LEFT JOIN public.restriction_document_item AS rdi
ON rdi.restriction_document_create_id = rd.id
LEFT JOIN public.restriction AS rn
ON rn.id = rdi.restriction_id
LEFT JOIN public.restriction_document_status AS rds
ON rds.code = rd.status
LEFT JOIN public.subpoena AS s
ON s.id = rd.subpoena_id</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>N</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>208</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</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>
<connection>ervu-dashboard</connection>
<schema>ervu_dashboard</schema>
<table>temporary_measures</table>
<commit>1000</commit>
<truncate>N</truncate>
<ignore_errors>N</ignore_errors>
<use_batch>Y</use_batch>
<specify_fields>N</specify_fields>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_daily>N</partitioning_daily>
<partitioning_monthly>Y</partitioning_monthly>
<tablename_in_field>N</tablename_in_field>
<tablename_field/>
<tablename_in_table>Y</tablename_in_table>
<return_keys>N</return_keys>
<return_field/>
<fields>
</fields>
<attributes/>
<cluster_schema/>
<GUI>
<xloc>416</xloc>
<yloc>208</yloc>
<draw>Y</draw>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>