+main_dashboard.recruitment_campaign(m_c) загрузка данных из 3х бд
This commit is contained in:
parent
d8594e4276
commit
5659bc4afa
5 changed files with 636 additions and 103 deletions
|
|
@ -140,8 +140,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1248</xloc>
|
||||
<yloc>800</yloc>
|
||||
<xloc>1392</xloc>
|
||||
<yloc>640</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -962,15 +962,36 @@ WHERE recording_date = current_date
|
|||
<yloc>1840</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>main_dashboard.recruitment_campaign(m_c).hwf</name>
|
||||
<description/>
|
||||
<type>WORKFLOW</type>
|
||||
<attributes/>
|
||||
<add_date>N</add_date>
|
||||
<add_time>N</add_time>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/mil_com/main_dashboard.recruitment_campaign(m_c).hwf</filename>
|
||||
<loglevel>Nothing</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ARR_MC</name>
|
||||
<stream_name>ARRAY_MIL_COM</stream_name>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
<params_from_previous>Y</params_from_previous>
|
||||
<run_configuration>local</run_configuration>
|
||||
<set_append_logfile>N</set_append_logfile>
|
||||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1248</xloc>
|
||||
<yloc>800</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
</actions>
|
||||
<hops>
|
||||
<hop>
|
||||
<from>main_dashboard.recruitment_campaign(m_c).hpl</from>
|
||||
<to>Success 2</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>main_dashboard.total_registered(m_c).hpl</from>
|
||||
<to>Success 3</to>
|
||||
|
|
@ -1118,13 +1139,6 @@ WHERE recording_date = current_date
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL main_dashboard.recruitment_campaign</from>
|
||||
<to>main_dashboard.recruitment_campaign(m_c).hpl</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>array_recruitments.hpl</from>
|
||||
<to>SQL main_dashboard.total_registered</to>
|
||||
|
|
@ -1293,6 +1307,20 @@ WHERE recording_date = current_date
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL main_dashboard.recruitment_campaign</from>
|
||||
<to>main_dashboard.recruitment_campaign(m_c).hwf</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>main_dashboard.recruitment_campaign(m_c).hwf</from>
|
||||
<to>Success 2</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
</hops>
|
||||
<notepads>
|
||||
<notepad>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,167 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<workflow>
|
||||
<name>main_dashboard.recruitment_campaign(m_c)</name>
|
||||
<name_sync_with_filename>Y</name_sync_with_filename>
|
||||
<description/>
|
||||
<extended_description/>
|
||||
<workflow_version/>
|
||||
<created_user>-</created_user>
|
||||
<created_date>2025/03/19 10:26:06.313</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2025/03/19 10:26:06.313</modified_date>
|
||||
<parameters>
|
||||
</parameters>
|
||||
<actions>
|
||||
<action>
|
||||
<name>Start</name>
|
||||
<description/>
|
||||
<type>SPECIAL</type>
|
||||
<attributes/>
|
||||
<DayOfMonth>1</DayOfMonth>
|
||||
<hour>12</hour>
|
||||
<intervalMinutes>60</intervalMinutes>
|
||||
<intervalSeconds>0</intervalSeconds>
|
||||
<minutes>0</minutes>
|
||||
<repeat>N</repeat>
|
||||
<schedulerType>0</schedulerType>
|
||||
<weekDay>1</weekDay>
|
||||
<parallel>N</parallel>
|
||||
<xloc>272</xloc>
|
||||
<yloc>256</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>Success</name>
|
||||
<description/>
|
||||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1376</xloc>
|
||||
<yloc>256</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>m_d.rec_cam(m_c)_to_person_registry.hpl</name>
|
||||
<description/>
|
||||
<type>PIPELINE</type>
|
||||
<attributes/>
|
||||
<add_date>N</add_date>
|
||||
<add_time>N</add_time>
|
||||
<clear_files>N</clear_files>
|
||||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_person_registry.hpl</filename>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ARR_MC</name>
|
||||
<stream_name>ARRAY_MIL_COM</stream_name>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
<params_from_previous>Y</params_from_previous>
|
||||
<run_configuration>local</run_configuration>
|
||||
<set_append_logfile>N</set_append_logfile>
|
||||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>512</xloc>
|
||||
<yloc>256</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>m_d.rec_cam(m_c)_to_subpoena_registry.hpl</name>
|
||||
<description/>
|
||||
<type>PIPELINE</type>
|
||||
<attributes/>
|
||||
<add_date>N</add_date>
|
||||
<add_time>N</add_time>
|
||||
<clear_files>N</clear_files>
|
||||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_subpoena_registry.hpl</filename>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ARR_MC</name>
|
||||
<stream_name>ARRAY_MIL_COM</stream_name>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
<params_from_previous>Y</params_from_previous>
|
||||
<run_configuration>local</run_configuration>
|
||||
<set_append_logfile>N</set_append_logfile>
|
||||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>832</xloc>
|
||||
<yloc>256</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>m_d.rec_cam(m_c)_to_decision_service.hpl</name>
|
||||
<description/>
|
||||
<type>PIPELINE</type>
|
||||
<attributes/>
|
||||
<add_date>N</add_date>
|
||||
<add_time>N</add_time>
|
||||
<clear_files>N</clear_files>
|
||||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_decision_service.hpl</filename>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ARR_MC</name>
|
||||
<stream_name>ARRAY_MIL_COM</stream_name>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
<params_from_previous>Y</params_from_previous>
|
||||
<run_configuration>local</run_configuration>
|
||||
<set_append_logfile>N</set_append_logfile>
|
||||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>256</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
</actions>
|
||||
<hops>
|
||||
<hop>
|
||||
<from>Start</from>
|
||||
<to>m_d.rec_cam(m_c)_to_person_registry.hpl</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>m_d.rec_cam(m_c)_to_person_registry.hpl</from>
|
||||
<to>m_d.rec_cam(m_c)_to_subpoena_registry.hpl</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>m_d.rec_cam(m_c)_to_subpoena_registry.hpl</from>
|
||||
<to>m_d.rec_cam(m_c)_to_decision_service.hpl</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>m_d.rec_cam(m_c)_to_decision_service.hpl</from>
|
||||
<to>Success</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
</hops>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<attributes/>
|
||||
</workflow>
|
||||
|
|
@ -0,0 +1,246 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>m_d.rec_cam(m_c)_to_decision_service</name>
|
||||
<name_sync_with_filename>Y</name_sync_with_filename>
|
||||
<description/>
|
||||
<extended_description/>
|
||||
<pipeline_version/>
|
||||
<pipeline_type>Normal</pipeline_type>
|
||||
<pipeline_status>0</pipeline_status>
|
||||
<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/02 11:56:22.507</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2024/08/02 11:56:22.507</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input отчрочки из decisions</from>
|
||||
<to>Insert / update (main_dashboard.recruitment_campaign)</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input отчрочки из decisions</from>
|
||||
<to>Update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Insert / update (main_dashboard.recruitment_campaign)</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>recruitment_id</field>
|
||||
<name>recruitment_id</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recording_date</field>
|
||||
<name>recording_date</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
</key>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>recruitment_campaign</table>
|
||||
<value>
|
||||
<name>subpoenas_sent</name>
|
||||
<rename>count_subpoena</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared_on_subpoenas</name>
|
||||
<rename>count_appeared</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared_on_subpoenas</name>
|
||||
<rename>count_not_appeared</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>new_recruits</name>
|
||||
<rename>new_recruits</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>postponement_have_right</name>
|
||||
<rename>postponement_have_right</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>postponement_granted</name>
|
||||
<rename>postponement_granted</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared_on_subpoenas_percent</name>
|
||||
<rename>appeared_on_subpoenas_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared_on_subpoenas_percent</name>
|
||||
<rename>not_appeared_on_subpoenas_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>postponement_have_right_percent</name>
|
||||
<rename>postponement_have_right_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>postponement_granted_percent</name>
|
||||
<rename>postponement_granted_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>spring_autumn</name>
|
||||
<rename>spring_autumn</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>992</xloc>
|
||||
<yloc>608</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input отчрочки из decisions</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.decision-document-service</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH
|
||||
ids AS (
|
||||
SELECT unnest(string_to_array(trim(both '{}' from '${ARR_MC}'), ','))::uuid AS recruitment_id
|
||||
),
|
||||
vse AS(
|
||||
SELECT
|
||||
CASE
|
||||
WHEN dd.hidden is true THEN 'true'
|
||||
ELSE 'false'
|
||||
END AS postponement,
|
||||
COALESCE(dd.updated_at, dd.created_at) AS postponement_date,
|
||||
dd.recruit_id,
|
||||
COALESCE(r.current_recruitment, r.target_recruitment) AS recruitment_id,
|
||||
ROW_NUMBER() OVER (PARTITION BY dd.recruit_id ORDER BY COALESCE(dd.updated_at, dd.created_at) DESC) AS rn
|
||||
FROM recruit r
|
||||
JOIN deferment_decision dd ON dd.recruit_id = r.id
|
||||
JOIN deferment_decision_type ddt on ddt.id = dd.type_id AND ddt.code = '1'
|
||||
WHERE COALESCE(r.current_recruitment, r.target_recruitment)::uuid IN (SELECT recruitment_id FROM ids)
|
||||
),
|
||||
last_status AS(
|
||||
SELECT *
|
||||
FROM vse
|
||||
WHERE rn = 1
|
||||
)
|
||||
SELECT
|
||||
COUNT(ls.postponement) FILTER (WHERE ls.postponement = 'true') AS postponement_have_right,
|
||||
COUNT(ls.postponement) FILTER (WHERE ls.postponement = 'false') AS postponement_granted,
|
||||
--COALESCE((COUNT(ls.postponement) FILTER (WHERE ls.postponement = 'true') * 100 / NULLIF(COUNT(ls.postponement), 0)), 0) AS postponement_have_right_percent,
|
||||
--COALESCE((COUNT(ls.postponement) FILTER (WHERE ls.postponement = 'false') * 100 / NULLIF(COUNT(ls.postponement), 0)), 0) AS postponement_granted_percent,
|
||||
CASE
|
||||
WHEN EXTRACT(MONTH FROM ls.postponement_date) BETWEEN 1 AND 6 THEN 'Весна'
|
||||
WHEN EXTRACT(MONTH FROM ls.postponement_date) BETWEEN 7 AND 12 THEN 'Осень'
|
||||
END AS spring_autumn,
|
||||
ls.recruitment_id,
|
||||
current_date AS recording_date
|
||||
FROM last_status ls
|
||||
WHERE ls.recruitment_id IS NOT NULL
|
||||
AND ls.postponement_date >= DATE_TRUNC('year', CURRENT_DATE)
|
||||
GROUP BY spring_autumn, ls.recruitment_id</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>400</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Update</name>
|
||||
<type>Update</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>100</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<error_ignored>Y</error_ignored>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>recruitment_id</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recording_date</field>
|
||||
<name>recording_date</name>
|
||||
</key>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>recruitment_campaign</table>
|
||||
<value>
|
||||
<name>postponement_have_right</name>
|
||||
<rename>postponement_have_right</rename>
|
||||
</value>
|
||||
<value>
|
||||
<name>postponement_granted</name>
|
||||
<rename>postponement_granted</rename>
|
||||
</value>
|
||||
</lookup>
|
||||
<skip_lookup>N</skip_lookup>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1024</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>m_d.rec_cam(m_c)_to_person_registry</name>
|
||||
<name_sync_with_filename>Y</name_sync_with_filename>
|
||||
<description/>
|
||||
<extended_description/>
|
||||
<pipeline_version/>
|
||||
<pipeline_type>Normal</pipeline_type>
|
||||
<pipeline_status>0</pipeline_status>
|
||||
<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/02 11:56:22.507</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2024/08/02 11:56:22.507</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (person_registry) регион/осень</from>
|
||||
<to>Insert / update (main_dashboard.recruitment_campaign)</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Insert / update (main_dashboard.recruitment_campaign)</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>recruitment_id</field>
|
||||
<name>recruitment_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recording_date</field>
|
||||
<name>recording_date</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>recruitment_campaign</table>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>spring_autumn</name>
|
||||
<rename>spring_autumn</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recording_date</name>
|
||||
<rename>recording_date</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1008</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) регион/осень</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH
|
||||
ids AS (
|
||||
-- Преобразуем строковый массив в таблицу UUID
|
||||
SELECT unnest(string_to_array(trim(both '{}' from '${ARR_MC}'), ','))::uuid AS recruitment_id
|
||||
),
|
||||
season_separations AS (
|
||||
SELECT 'Весна' AS spring_autumn
|
||||
UNION ALL
|
||||
SELECT 'Осень' AS spring_autumn
|
||||
)
|
||||
SELECT
|
||||
current_date AS recording_date,
|
||||
i.recruitment_id AS recruitment_id,
|
||||
ss.spring_autumn
|
||||
FROM ids i
|
||||
CROSS JOIN season_separations ss</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>464</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>main_dashboard.recruitment_campaign(m_c)</name>
|
||||
<name>m_d.rec_cam(m_c)_to_subpoena_registry</name>
|
||||
<name_sync_with_filename>Y</name_sync_with_filename>
|
||||
<description/>
|
||||
<extended_description/>
|
||||
|
|
@ -23,22 +23,12 @@
|
|||
<order>
|
||||
<hop>
|
||||
<from>Table input (subpoena) регион/осень</from>
|
||||
<to>Merge join</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input отчрочки из decisions</from>
|
||||
<to>Merge join</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Merge join</from>
|
||||
<to>Insert / update (main_dashboard.recruitment_campaign)</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (subpoena) регион/осень</from>
|
||||
<to>Insert / update (main_dashboard.recruitment_campaign)</to>
|
||||
<to>Update</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
|
|
@ -137,36 +127,8 @@
|
|||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1008</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Merge join</name>
|
||||
<type>MergeJoin</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<join_type>LEFT OUTER</join_type>
|
||||
<keys_1>
|
||||
<key>recruitment_id</key>
|
||||
<key>spring_autumn</key>
|
||||
</keys_1>
|
||||
<keys_2>
|
||||
<key>recruitment_id</key>
|
||||
<key>spring_autumn</key>
|
||||
</keys_2>
|
||||
<transform1>Table input (subpoena) регион/осень</transform1>
|
||||
<transform2>Table input отчрочки из decisions</transform2>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>624</xloc>
|
||||
<yloc>496</yloc>
|
||||
<xloc>928</xloc>
|
||||
<yloc>544</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -244,7 +206,7 @@ season_separations AS (
|
|||
WHEN EXTRACT(MONTH FROM ls.create_date) BETWEEN 7 AND 12 THEN 'Осень'
|
||||
END AS spring_autumn
|
||||
FROM last_status ls
|
||||
WHERE ls.create_date >= DATE_TRUNC('year', CURRENT_DATE)
|
||||
--WHERE ls.create_date >= DATE_TRUNC('year', CURRENT_DATE)
|
||||
),
|
||||
season_separations_clean AS (
|
||||
SELECT DISTINCT recruitment_id, spring_autumn FROM season_separations
|
||||
|
|
@ -302,8 +264,8 @@ LEFT JOIN t3 ON ss.recruitment_id = t3.recruitment_id AND ss.spring_autumn = t3.
|
|||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input отчрочки из decisions</name>
|
||||
<type>TableInput</type>
|
||||
<name>Update</name>
|
||||
<type>Update</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
|
|
@ -312,51 +274,54 @@ LEFT JOIN t3 ON ss.recruitment_id = t3.recruitment_id AND ss.spring_autumn = t3.
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>100</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH
|
||||
ids AS (
|
||||
SELECT unnest(string_to_array(trim(both '{}' from '${ARR_MC}'), ','))::uuid AS recruitment_id
|
||||
),
|
||||
vse AS(
|
||||
SELECT
|
||||
CASE
|
||||
WHEN dd.hidden is true THEN 'true'
|
||||
ELSE 'false'
|
||||
END AS postponement,
|
||||
COALESCE(dd.updated_at, dd.created_at) AS postponement_date,
|
||||
dd.recruit_id,
|
||||
COALESCE(r.current_recruitment, r.target_recruitment) AS recruitment_id,
|
||||
ROW_NUMBER() OVER (PARTITION BY dd.recruit_id ORDER BY COALESCE(dd.updated_at, dd.created_at) DESC) AS rn
|
||||
FROM recruit r
|
||||
JOIN deferment_decision dd ON dd.recruit_id = r.id
|
||||
JOIN deferment_decision_type ddt on ddt.id = dd.type_id AND ddt.code = '1'
|
||||
WHERE COALESCE(r.current_recruitment, r.target_recruitment)::uuid IN (SELECT recruitment_id FROM ids)
|
||||
),
|
||||
last_status AS(
|
||||
SELECT *
|
||||
FROM vse
|
||||
WHERE rn = 1
|
||||
)
|
||||
SELECT
|
||||
COUNT(ls.postponement) FILTER (WHERE ls.postponement = 'true') AS postponement_have_right,
|
||||
COUNT(ls.postponement) FILTER (WHERE ls.postponement = 'false') AS postponement_granted,
|
||||
CASE
|
||||
WHEN EXTRACT(MONTH FROM ls.postponement_date) BETWEEN 1 AND 6 THEN 'Весна'
|
||||
WHEN EXTRACT(MONTH FROM ls.postponement_date) BETWEEN 7 AND 12 THEN 'Осень'
|
||||
END AS spring_autumn,
|
||||
ls.recruitment_id,
|
||||
current_date AS recording_date
|
||||
FROM last_status ls
|
||||
WHERE ls.recruitment_id IS NOT NULL
|
||||
AND ls.postponement_date >= DATE_TRUNC('year', CURRENT_DATE)
|
||||
GROUP BY spring_autumn, ls.recruitment_id</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<error_ignored>Y</error_ignored>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>recruitment_id</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recording_date</field>
|
||||
<name>recording_date</name>
|
||||
</key>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>recruitment_campaign</table>
|
||||
<value>
|
||||
<name>subpoenas_sent</name>
|
||||
<rename>count_subpoena</rename>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared_on_subpoenas</name>
|
||||
<rename>count_appeared</rename>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared_on_subpoenas</name>
|
||||
<rename>count_not_appeared</rename>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared_on_subpoenas_percent</name>
|
||||
<rename>appeared_on_subpoenas_percent</rename>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared_on_subpoenas_percent</name>
|
||||
<rename>not_appeared_on_subpoenas_percent</rename>
|
||||
</value>
|
||||
</lookup>
|
||||
<skip_lookup>N</skip_lookup>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>288</xloc>
|
||||
<yloc>416</yloc>
|
||||
<xloc>928</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
Loading…
Add table
Add a link
Reference in a new issue