diff --git a/v1_apache-hop dash mapping/jobs_once_a_day/children_flags.hpl b/v1_apache-hop dash mapping/jobs_once_a_day/children_flags.hpl new file mode 100644 index 0000000..f628ad7 --- /dev/null +++ b/v1_apache-hop dash mapping/jobs_once_a_day/children_flags.hpl @@ -0,0 +1,106 @@ + + + + children_flags + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/25 13:09:28.624 + - + 2025/04/25 13:09:28.624 + + + + + + children_flags + Update_children_flags + Y + + + + Update_children_flags + Update + + Y + + 1 + + none + + + 1000 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_dead_child + has_dead_child + + + has_minor_child + has_minor_child + + + minors_count + minors + +
+ N + Y + + + 512 + 128 + +
+ + children_flags + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + WITH age_threshold AS ( + SELECT current_date - interval '18 years' AS cutoff +) +select + recruit_id, + COUNT(*) FILTER (WHERE birth_date > cutoff) AS minors, + bool_or(death_date is not null) as has_dead_child, + bool_or(birth_date > cutoff) as has_minor_child +from citizen_child, age_threshold +group by recruit_id; + N + + + 336 + 128 + + + + + +
diff --git a/v1_apache-hop dash mapping/jobs_once_a_day/citizenship_flags.hpl b/v1_apache-hop dash mapping/jobs_once_a_day/citizenship_flags.hpl new file mode 100644 index 0000000..5ebf506 --- /dev/null +++ b/v1_apache-hop dash mapping/jobs_once_a_day/citizenship_flags.hpl @@ -0,0 +1,104 @@ + + + + citizenship_flags + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/25 13:12:27.341 + - + 2025/04/25 13:12:27.341 + + + + + + citizenship_flag_output + Update_citizenship_flag + Y + + + + Update_citizenship_flag + Update + + Y + + 1 + + none + + + 1000 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_russian_citizenship + has_russian_citizenship + + + has_foreign_citizenship + has_foreign_citizenship + +
+ N + Y + + + 720 + 208 + +
+ + citizenship_flag_output + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + with foreign_citizenship as ( + select recruit_id, true as has_foreign_citizenship + from citizenship_foreign +) +select + citizenship.recruit_id, + true as has_russian_citizenship, + coalesce(has_foreign_citizenship, false) as has_foreign_citizenship + from citizenship + left join foreign_citizenship + on foreign_citizenship.recruit_id = citizenship.recruit_id +where renunciation_number is null; + N + + + 544 + 208 + + + + + +
diff --git a/v1_apache-hop dash mapping/jobs_once_a_day/copy_punishment_and_deferment_once.hwf b/v1_apache-hop dash mapping/jobs_once_a_day/copy_punishment_and_deferment_once.hwf index b382915..8f54ec9 100644 --- a/v1_apache-hop dash mapping/jobs_once_a_day/copy_punishment_and_deferment_once.hwf +++ b/v1_apache-hop dash mapping/jobs_once_a_day/copy_punishment_and_deferment_once.hwf @@ -1,6 +1,6 @@ - copy_prosec_and_deferment_once + copy_punishment_and_deferment_once Y @@ -356,7 +356,17 @@ delete from ervu_dashboard.citizen_deferment; - citizen_flags.hpl + Success sitizen_flags + + SUCCESS + + N + 1888 + 1296 + + + + children_flags.hpl PIPELINE @@ -366,7 +376,7 @@ delete from ervu_dashboard.citizen_deferment; N N N - ${PROJECT_HOME}/jobs_once_a_day/citizen_flags.hpl + C:\WORK\ervu-dashboard-etl-RT\v1_apache-hop dash mapping\jobs_once_a_day\children_flags.hpl Basic Y @@ -378,17 +388,189 @@ delete from ervu_dashboard.citizen_deferment; Y N 640 - 1280 + 1296 - Success sitizen_flags + opekun_flags.hpl - SUCCESS + PIPELINE + N + N + N + N + N + N + C:\WORK\ervu-dashboard-etl-RT\v1_apache-hop dash mapping\jobs_once_a_day\opekun_flags.hpl + Basic + + Y + + N + local + N + N + Y N - 832 - 1280 + 784 + 1296 + + + + driver_licenses_flags.hpl + + PIPELINE + + N + N + N + N + N + N + C:\WORK\ervu-dashboard-etl-RT\v1_apache-hop dash mapping\jobs_once_a_day\driver_licenses_flags.hpl + Basic + + Y + + N + local + N + N + Y + N + 928 + 1296 + + + + citizenship_flags.hpl + + PIPELINE + + N + N + N + N + N + N + C:\WORK\ervu-dashboard-etl-RT\v1_apache-hop dash mapping\jobs_once_a_day\citizenship_flags.hpl + Basic + + Y + + N + local + N + N + Y + N + 1088 + 1296 + + + + property_flags.hpl + + PIPELINE + + N + N + N + N + N + N + C:\WORK\ervu-dashboard-etl-RT\v1_apache-hop dash mapping\jobs_once_a_day\property_flags.hpl + Basic + + Y + + N + local + N + N + Y + N + 1232 + 1296 + + + + deputy_flags.hpl + + PIPELINE + + N + N + N + N + N + N + C:\WORK\ervu-dashboard-etl-RT\v1_apache-hop dash mapping\jobs_once_a_day\deputy_flags.hpl + Basic + + Y + + N + local + N + N + Y + N + 1360 + 1296 + + + + criminal_prosecution_flags.hpl + + PIPELINE + + N + N + N + N + N + N + C:\WORK\ervu-dashboard-etl-RT\v1_apache-hop dash mapping\jobs_once_a_day\criminal_prosecution_flags.hpl + Basic + + Y + + N + local + N + N + Y + N + 1520 + 1296 + + + + criminal_record_flags.hpl + + PIPELINE + + N + N + N + N + N + N + C:\WORK\ervu-dashboard-etl-RT\v1_apache-hop dash mapping\jobs_once_a_day\criminal_record_flags.hpl + Basic + + Y + + N + local + N + N + Y + N + 1712 + 1296 @@ -513,15 +695,64 @@ delete from ervu_dashboard.citizen_deferment; Y - citizen_flags.hpl + children_flags.hpl + opekun_flags.hpl + Y + N + Y + + + opekun_flags.hpl + driver_licenses_flags.hpl + Y + N + Y + + + driver_licenses_flags.hpl + citizenship_flags.hpl + Y + N + Y + + + citizenship_flags.hpl + property_flags.hpl + Y + N + Y + + + property_flags.hpl + deputy_flags.hpl + Y + N + Y + + + deputy_flags.hpl + criminal_prosecution_flags.hpl + Y + N + Y + + + criminal_prosecution_flags.hpl + criminal_record_flags.hpl + Y + N + Y + + + criminal_record_flags.hpl Success sitizen_flags Y - Y - N + N + Y Start - citizen_flags.hpl + children_flags.hpl N Y Y diff --git a/v1_apache-hop dash mapping/jobs_once_a_day/criminal_prosecution_flags.hpl b/v1_apache-hop dash mapping/jobs_once_a_day/criminal_prosecution_flags.hpl new file mode 100644 index 0000000..f2363a1 --- /dev/null +++ b/v1_apache-hop dash mapping/jobs_once_a_day/criminal_prosecution_flags.hpl @@ -0,0 +1,95 @@ + + + + criminal_prosecution_flags + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/25 13:19:11.456 + - + 2025/04/25 13:19:11.456 + + + + + + has_criminal_prosecution + Update_has_criminal_prosecution + Y + + + + Update_has_criminal_prosecution + Update + + Y + + 1 + + none + + + 1000 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_criminal_prosecution + has_criminal_prosecution + +
+ N + Y + + + 592 + 208 + +
+ + has_criminal_prosecution + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + +SELECT +distinct +recruit_id, +true as has_criminal_prosecution +FROM prosecution +where close_date is null; + N + + + 368 + 208 + + + + + +
diff --git a/v1_apache-hop dash mapping/jobs_once_a_day/criminal_record_flags.hpl b/v1_apache-hop dash mapping/jobs_once_a_day/criminal_record_flags.hpl new file mode 100644 index 0000000..4bc529f --- /dev/null +++ b/v1_apache-hop dash mapping/jobs_once_a_day/criminal_record_flags.hpl @@ -0,0 +1,103 @@ + + + + criminal_record_flags + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/25 13:20:20.487 + - + 2025/04/25 13:20:20.487 + + + + + + criminal_record + Update_criminal_record + Y + + + + Update_criminal_record + Update + + Y + + 1 + + none + + + 1000 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + serving_sentence + serving_sentence + + + has_sentence + has_sentence + + + has_criminal_record + has_criminal_record + +
+ N + Y + + + 816 + 208 + +
+ + criminal_record + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + SELECT +recruit_id, +bool_or(start_date < current_date and (release_date isnull or release_date > current_date)) as serving_sentence, +true as has_sentence, +true as has_criminal_record +FROM ervu_dashboard.punishment +group by recruit_id; + N + + + 592 + 208 + + + + + +
diff --git a/v1_apache-hop dash mapping/jobs_once_a_day/deputy_flags.hpl b/v1_apache-hop dash mapping/jobs_once_a_day/deputy_flags.hpl new file mode 100644 index 0000000..4822243 --- /dev/null +++ b/v1_apache-hop dash mapping/jobs_once_a_day/deputy_flags.hpl @@ -0,0 +1,98 @@ + + + + deputy_flags + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/25 13:15:05.259 + - + 2025/04/25 13:15:05.259 + + + + + + deputy_input + Update_deputy_flag + Y + + + + Update_deputy_flag + Update + + Y + + 1 + + none + + + 1000 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_deputy + is_deputy + + + is_deputy_candidate + is_deputy_candidate + +
+ N + Y + + + 560 + 240 + +
+ + deputy_input + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + +SELECT + recruit_id, + COALESCE(deputy.deputy, false) AS is_deputy, + NOT COALESCE(deputy.deputy, false) AS is_deputy_candidate +FROM deputy; + N + + + 384 + 240 + + + + + +
diff --git a/v1_apache-hop dash mapping/jobs_once_a_day/driver_licenses_flags.hpl b/v1_apache-hop dash mapping/jobs_once_a_day/driver_licenses_flags.hpl new file mode 100644 index 0000000..e8fae90 --- /dev/null +++ b/v1_apache-hop dash mapping/jobs_once_a_day/driver_licenses_flags.hpl @@ -0,0 +1,98 @@ + + + + driver_licenses_flags + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/25 13:11:28.008 + - + 2025/04/25 13:11:28.008 + + + + + + driver_licence_output + Update_driver_licence_flag + Y + + + + Update_driver_licence_flag + Update + + Y + + 1 + + none + + + 1000 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + tractor_license + has_tractor_licence + + + has_driver_license + has_driver_license + +
+ N + Y + + + 464 + 320 + +
+ + driver_licence_output + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + select + recruit_id, + bool_or(not tractor_driver) as has_driver_license, + bool_or(tractor_driver) as has_tractor_licence +from drivers_licence +group by recruit_id; + N + + + 288 + 320 + + + + + +
diff --git a/v1_apache-hop dash mapping/jobs_once_a_day/opekun_flags.hpl b/v1_apache-hop dash mapping/jobs_once_a_day/opekun_flags.hpl new file mode 100644 index 0000000..cee18f7 --- /dev/null +++ b/v1_apache-hop dash mapping/jobs_once_a_day/opekun_flags.hpl @@ -0,0 +1,92 @@ + + + + opekun_flags + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/25 13:10:21.355 + - + 2025/04/25 13:10:21.355 + + + + + + opekun_flag + Update_opekun_flag + Y + + + + Update_opekun_flag + Update + + Y + + 1 + + none + + + 1000 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + is_guardian + is_guardian + +
+ N + Y + + + 688 + 208 + +
+ + opekun_flag + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + select distinct + recruit_id, + true as is_guardian + from citizen_guardianship; + N + + + 512 + 208 + + + + + +
diff --git a/v1_apache-hop dash mapping/jobs_once_a_day/property_flags.hpl b/v1_apache-hop dash mapping/jobs_once_a_day/property_flags.hpl new file mode 100644 index 0000000..b77d3cd --- /dev/null +++ b/v1_apache-hop dash mapping/jobs_once_a_day/property_flags.hpl @@ -0,0 +1,104 @@ + + + + property_flags + Y + + + + Normal + + + N + 1000 + 100 + - + 2025/04/25 13:13:44.087 + - + 2025/04/25 13:13:44.087 + + + + + + citizenship_flag_output + Update_citizenship_flag + Y + + + + Update_citizenship_flag + Update + + Y + + 1 + + none + + + 1000 + ervu-dashboard + Y + + + = + recruit_id + recruit_id + + ervu_dashboard + citizen
+ + has_russian_citizenship + has_russian_citizenship + + + has_foreign_citizenship + has_foreign_citizenship + +
+ N + Y + + + 704 + 176 + +
+ + citizenship_flag_output + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + with foreign_citizenship as ( + select recruit_id, true as has_foreign_citizenship + from citizenship_foreign +) +select + citizenship.recruit_id, + true as has_russian_citizenship, + coalesce(has_foreign_citizenship, false) as has_foreign_citizenship + from citizenship + left join foreign_citizenship + on foreign_citizenship.recruit_id = citizenship.recruit_id +where renunciation_number is null; + N + + + 528 + 176 + + + + + +