diff --git a/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_decision_service.hpl b/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_decision_service.hpl index 4d07f7d..200733c 100644 --- a/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_decision_service.hpl +++ b/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_decision_service.hpl @@ -21,116 +21,12 @@ - - Table input отчрочки из decisions - Insert / update (main_dashboard.recruitment_campaign) - N - Table input отчрочки из decisions Update Y - - Insert / update (main_dashboard.recruitment_campaign) - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruitment_id - recruitment_id - - - = - recording_date - recording_date - - - = - spring_autumn - spring_autumn - - main_dashboard - recruitment_campaign
- - subpoenas_sent - count_subpoena - Y - - - appeared_on_subpoenas - count_appeared - Y - - - not_appeared_on_subpoenas - count_not_appeared - Y - - - new_recruits - new_recruits - Y - - - postponement_have_right - postponement_have_right - Y - - - postponement_granted - postponement_granted - Y - - - appeared_on_subpoenas_percent - appeared_on_subpoenas_percent - Y - - - not_appeared_on_subpoenas_percent - not_appeared_on_subpoenas_percent - Y - - - postponement_have_right_percent - postponement_have_right_percent - Y - - - postponement_granted_percent - postponement_granted_percent - Y - - - recruitment_id - recruitment_id - N - - - spring_autumn - spring_autumn - N - -
- N - - - 992 - 608 - -
Table input отчрочки из decisions TableInput @@ -170,19 +66,23 @@ last_status AS( 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'), 0) AS postponement_have_right, + COALESCE(COUNT(ls.postponement) FILTER (WHERE ls.postponement = 'false'), 0) 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 'Осень' + WHEN (ls.postponement_date BETWEEN DATE_TRUNC('year', ls.postponement_date) + INTERVAL '3 months' + INTERVAL '1 day' + AND DATE_TRUNC('year', ls.postponement_date) + INTERVAL '6 months' + INTERVAL '15 days') + THEN 'Весна' + WHEN (ls.postponement_date BETWEEN DATE_TRUNC('year', ls.postponement_date) + INTERVAL '9 months' + INTERVAL '1 day' + AND DATE_TRUNC('year', ls.postponement_date) + INTERVAL '12 months' + INTERVAL '31 days') + 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) + --AND ls.postponement_date >= DATE_TRUNC('year', CURRENT_DATE) GROUP BY spring_autumn, ls.recruitment_id Y @@ -205,21 +105,25 @@ GROUP BY spring_autumn, ls.recruitment_id 100 ervu-dashboard Y + = recruitment_id recruitment_id + = spring_autumn spring_autumn + = recording_date recording_date + main_dashboard recruitment_campaign
diff --git a/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_person_registry_uniq.hpl b/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_person_registry_uniq.hpl index 174c14f..7b7ecd2 100644 --- a/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_person_registry_uniq.hpl +++ b/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_person_registry_uniq.hpl @@ -24,6 +24,11 @@ Table input (person_registry) регион/осень Insert / update (main_dashboard.recruitment_campaign) + N + + + Table input (person_registry) регион/осень + Update Y @@ -45,19 +50,16 @@ = recruitment_id recruitment_id - = recording_date recording_date - = spring_autumn spring_autumn - main_dashboard recruitment_campaign
@@ -81,7 +83,7 @@ 1008 - 320 + 512
@@ -121,6 +123,31 @@ CROSS JOIN season_separations ss 320 + + Update + Update + + Y + + 1 + + none + + + 100 + N + + + lookup table
+
+ N + N + + + 1024 + 320 + +
diff --git a/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_subpoena_registry.hpl b/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_subpoena_registry.hpl index 3f08e26..d89748d 100644 --- a/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_subpoena_registry.hpl +++ b/v1_apache-hop dash mapping/mil_com/main_dashboard.recruitment_campaign(m_c)/m_d.rec_cam(m_c)_to_subpoena_registry.hpl @@ -21,116 +21,12 @@ - - Table input (subpoena) регион/осень - Insert / update (main_dashboard.recruitment_campaign) - N - Table input (subpoena) регион/осень Update Y - - Insert / update (main_dashboard.recruitment_campaign) - InsertUpdate - - Y - - 1 - - none - - - 100 - ervu-dashboard - - - = - recruitment_id - recruitment_id - - - = - recording_date - recording_date - - - = - spring_autumn - spring_autumn - - main_dashboard - recruitment_campaign
- - subpoenas_sent - count_subpoena - Y - - - appeared_on_subpoenas - count_appeared - Y - - - not_appeared_on_subpoenas - count_not_appeared - Y - - - new_recruits - new_recruits - Y - - - postponement_have_right - postponement_have_right - Y - - - postponement_granted - postponement_granted - Y - - - appeared_on_subpoenas_percent - appeared_on_subpoenas_percent - Y - - - not_appeared_on_subpoenas_percent - not_appeared_on_subpoenas_percent - Y - - - postponement_have_right_percent - postponement_have_right_percent - Y - - - postponement_granted_percent - postponement_granted_percent - Y - - - recruitment_id - recruitment_id - N - - - spring_autumn - spring_autumn - N - -
- N - - - 928 - 544 - -
Table input (subpoena) регион/осень TableInput @@ -189,7 +85,7 @@ last_status AS ( WHERE rn = 1 ), season_separations AS ( - SELECT distinct + SELECT DISTINCT ls.recruitment_id, ls.create_date, ls.sub_stat_hist, @@ -202,8 +98,12 @@ season_separations AS ( ls.act_number, ls.rdi_id, CASE - WHEN EXTRACT(MONTH FROM ls.create_date) BETWEEN 1 AND 6 THEN 'Весна' - WHEN EXTRACT(MONTH FROM ls.create_date) BETWEEN 7 AND 12 THEN 'Осень' + WHEN (ls.create_date BETWEEN DATE_TRUNC('year', ls.create_date) + INTERVAL '3 months' + INTERVAL '1 day' + AND DATE_TRUNC('year', ls.create_date) + INTERVAL '6 months' + INTERVAL '15 days') + THEN 'Весна' + WHEN (ls.create_date BETWEEN DATE_TRUNC('year', ls.create_date) + INTERVAL '9 months' + INTERVAL '1 day' + AND DATE_TRUNC('year', ls.create_date) + INTERVAL '12 months' + INTERVAL '31 days') + THEN 'Осень' END AS spring_autumn FROM last_status ls --WHERE ls.create_date >= DATE_TRUNC('year', CURRENT_DATE) @@ -255,7 +155,7 @@ SELECT FROM season_separations_clean ss LEFT JOIN t1 ON ss.recruitment_id = t1.recruitment_id AND ss.spring_autumn = t1.spring_autumn LEFT JOIN t2 ON ss.recruitment_id = t2.recruitment_id AND ss.spring_autumn = t2.spring_autumn -LEFT JOIN t3 ON ss.recruitment_id = t3.recruitment_id AND ss.spring_autumn = t3.spring_autumn; +LEFT JOIN t3 ON ss.recruitment_id = t3.recruitment_id AND ss.spring_autumn = t3.spring_autumn Y