diff --git a/mappings/country/job_recruitments_country.kjb b/mappings/country/job_recruitments_country.kjb index aab3e6b..fb8ebe6 100644 --- a/mappings/country/job_recruitments_country.kjb +++ b/mappings/country/job_recruitments_country.kjb @@ -11,12 +11,7 @@ - 2024/08/15 16:02:12.821 - - LOAD_DATE - 20241230 - - - + @@ -354,7 +349,7 @@ Y 0 704 - 16 + 48 @@ -366,7 +361,7 @@ Y 0 880 - 16 + 48 @@ -409,7 +404,7 @@ Y 0 704 - 96 + 128 @@ -421,7 +416,7 @@ Y 0 880 - 96 + 128 @@ -739,7 +734,7 @@ Y 0 704 - 608 + 576 @@ -751,7 +746,167 @@ Y 0 880 - 608 + 576 + + + + total_registered.driver_license + + TRANS + + filename + + ${Internal.Entry.Current.Directory}/total_registered.driver_license.ktr + + N + Y + N + N + N + N + + + N + N + Basic + N + + N + Y + N + N + N + Pentaho local + + Y + + LOAD_DATE + + ${LOAD_DATE} + + + N + Y + 0 + 704 + 640 + + + + Success 10 + + SUCCESS + + N + Y + 0 + 880 + 640 + + + + total_registered.child_minor + + TRANS + + filename + + ${Internal.Entry.Current.Directory}/total_registered.child_minor.ktr + + N + Y + N + N + N + N + + + N + N + Basic + N + + N + Y + N + N + N + Pentaho local + + Y + + LOAD_DATE + + ${LOAD_DATE} + + + N + Y + 0 + 704 + 720 + + + + Success 11 + + SUCCESS + + N + Y + 0 + 880 + 720 + + + + total_registered.age + + TRANS + + filename + + ${Internal.Entry.Current.Directory}/total_registered.age.ktr + + N + Y + N + N + N + N + + + N + N + Basic + N + + N + Y + N + N + N + Pentaho local + + Y + + N + Y + 0 + 704 + 800 + + + + Success 12 + + SUCCESS + + N + Y + 0 + 880 + 800 @@ -900,6 +1055,60 @@ Y Y + + total_registered.driver_license + Success 10 + 0 + 0 + N + Y + N + + + Start + total_registered.driver_license + 0 + 0 + N + Y + Y + + + total_registered.child_minor + Success 11 + 0 + 0 + N + Y + N + + + Start + total_registered.child_minor + 0 + 0 + N + Y + Y + + + total_registered.age + Success 12 + 0 + 0 + N + Y + N + + + Start + total_registered.age + 0 + 0 + N + Y + Y + diff --git a/mappings/country/main_dashboard.appeals.ktr b/mappings/country/main_dashboard.appeals.ktr index a90f03f..99aade2 100644 --- a/mappings/country/main_dashboard.appeals.ktr +++ b/mappings/country/main_dashboard.appeals.ktr @@ -9,11 +9,6 @@ 0 / - - LOAD_DATE - 20240809 - - @@ -630,61 +625,56 @@ main_dashboard appeals
- LOAD_DATE - recording_date + recruitment_id + recruitment_id = total_appeals total_appeals - N + Y average_consideration average_consideration - N + Y resolved resolved - N + Y average_rating average_rating - N + Y average_to_face average_to_face - N + Y "average_EPGU" average_epgu - N + Y average_to_face_percent average_to_face_percent - N + Y "average_EPGU_percent" average_epgu_percent - N + Y recruitment_id recruitment_id N - - recording_date - LOAD_DATE - N - diff --git a/mappings/country/main_dashboard.recruitment_campaign.ktr b/mappings/country/main_dashboard.recruitment_campaign.ktr index db1efaf..6191c51 100644 --- a/mappings/country/main_dashboard.recruitment_campaign.ktr +++ b/mappings/country/main_dashboard.recruitment_campaign.ktr @@ -9,11 +9,6 @@ 0 / - - LOAD_DATE - 20240809 - - @@ -612,18 +607,6 @@ -1 none - - spring_autumn - - String - - - - - -1 - -1 - none - @@ -663,18 +646,6 @@ -1 none - - spring_autumn - - String - - - - - -1 - -1 - none - @@ -708,66 +679,66 @@ main_dashboard recruitment_campaign
- LOAD_DATE - recording_date + spring_autumn + spring_autumn = - spring_autumn - spring_autumn + recruitment_id + recruitment_id = subpoenas_sent subpoenas_sent - N + Y appeared_on_subpoenas appeared_on_subpoenas - N + Y not_appeared_on_subpoenas not_appeared_on_subpoenas - N + Y new_recruits new_recruits - N + Y postponement_have_right postponement_have_right - N + Y postponement_granted postponement_granted - N + Y appeared_on_subpoenas_percent appeared_on_subpoenas_percent - N + Y not_appeared_on_subpoenas_percent not_appeared_on_subpoenas_percent - N + Y postponement_have_right_percent postponement_have_right_percent - N + Y postponement_granted_percent postponement_granted_percent - N + Y recruitment_id @@ -779,11 +750,6 @@ spring_autumn N - - recording_date - LOAD_DATE - N - @@ -817,60 +783,66 @@ main_dashboard recruitment_campaign
- LOAD_DATE - recording_date + spring_autumn + spring_autumn + = + + + + recruitment_id + recruitment_id = subpoenas_sent subpoenas_sent - N + Y appeared_on_subpoenas appeared_on_subpoenas - N + Y not_appeared_on_subpoenas not_appeared_on_subpoenas - N + Y new_recruits new_recruits - N + Y postponement_have_right postponement_have_right - N + Y postponement_granted postponement_granted - N + Y appeared_on_subpoenas_percent appeared_on_subpoenas_percent - N + Y not_appeared_on_subpoenas_percent not_appeared_on_subpoenas_percent - N + Y postponement_have_right_percent postponement_have_right_percent - N + Y postponement_granted_percent postponement_granted_percent - N + Y recruitment_id @@ -882,11 +854,6 @@ spring_autumn N - - recording_date - LOAD_DATE - N - @@ -932,23 +899,6 @@ - - spring_autumn - spring_autumn - String - -2 - -2 - - false - - - false - - - - - - @@ -994,23 +944,6 @@ - - spring_autumn - spring_autumn - String - -2 - -2 - - false - - - false - - - - - - diff --git a/mappings/country/main_dashboard.total_registered.ktr b/mappings/country/main_dashboard.total_registered.ktr index 225d6a8..094efb2 100644 --- a/mappings/country/main_dashboard.total_registered.ktr +++ b/mappings/country/main_dashboard.total_registered.ktr @@ -9,11 +9,6 @@ 0 / - - LOAD_DATE - 20240809 - - @@ -607,8 +602,8 @@ - 352 - 80 + 400 + 240 Y @@ -630,66 +625,61 @@ main_dashboard total_registered
- LOAD_DATE - recording_date + recruitment_id + recruitment_id = total_registered total_count - N + Y "total_registered_M" male_count - N + Y "total_registered_W" female_count - N + Y mobilization_criterion mobilization_criterion - N + Y volunteer_criterion volunteer_criterion - N + Y contract_criterion contract_criterion - N + Y mobilization_criterion_percent mobilization_criterion_percent - N + Y volunteer_criterion_percent volunteer_criterion_percent - N + Y contract_criterion_percent contract_criterion_percent - N + Y recruitment_id recruitment_id N - - recording_date - LOAD_DATE - N - @@ -700,8 +690,8 @@ - 864 - 80 + 912 + 240 Y @@ -745,8 +735,8 @@ - 560 - 80 + 608 + 240 Y @@ -788,8 +778,8 @@ from t1 full outer join t2 on 1 = 1 full outer join t3 on 1 = 1 - 144 - 80 + 192 + 240 Y diff --git a/mappings/country/main_dashboard.waiting_registration.ktr b/mappings/country/main_dashboard.waiting_registration.ktr index e3b5b9c..9165aa0 100644 --- a/mappings/country/main_dashboard.waiting_registration.ktr +++ b/mappings/country/main_dashboard.waiting_registration.ktr @@ -9,11 +9,6 @@ 0 / - - LOAD_DATE - 20240809 - - @@ -630,66 +625,61 @@ main_dashboard waiting_registration
- LOAD_DATE - recording_date + recruitment_id + recruitment_id = waiting_registration waiting_count - N + Y "waiting_registration_M" male_count - N + Y "waiting_registration_W" female_count - N + Y mobilization_criterion mobilization_criterion - N + Y volunteer_criterion volunteer_criterion - N + Y contract_criterion contract_criterion - N + Y mobilization_criterion_percent mobilization_criterion_percent - N + Y volunteer_criterion_percent volunteer_criterion_percent - N + Y contract_criterion_percent contract_criterion_percent - N + Y recruitment_id recruitment_id N - - recording_date - LOAD_DATE - N - diff --git a/mappings/country/recruitment_campaign.subpoenas.ktr b/mappings/country/recruitment_campaign.subpoenas.ktr index eefc04b..7c4a403 100644 --- a/mappings/country/recruitment_campaign.subpoenas.ktr +++ b/mappings/country/recruitment_campaign.subpoenas.ktr @@ -9,11 +9,6 @@ 0 / - - LOAD_DATE - 20240809 - - @@ -671,75 +666,81 @@ recruitment_campaign subpoenas
- LOAD_DATE - recording_date + recruitment_id + recruitment_id + = + + + + spring_autumn + spring_autumn = subpoena subpoena - N + Y appeared appeared - N + Y not_appeared not_appeared - N + Y not_ap_good_reason not_ap_good_reason - N + Y introduced_measures introduced_measures - N + Y ap_not_required ap_not_required - N + Y restrictions_applied restrictions_applied - N + Y appeared_percent appeared_percent - N + Y not_appeared_percent not_appeared_percent - N + Y not_ap_good_reason_percent not_ap_good_reason_percent - N + Y ap_not_required_percent ap_not_required_percent - N + Y restrictions_applied_percent restrictions_applied_percent - N + Y introduced_measures_percent introduced_measures_percent - N + Y recruitment_id @@ -749,18 +750,13 @@ rest rest - N + Y spring_autumn spring_autumn N - - recording_date - LOAD_DATE - N - @@ -794,75 +790,81 @@ recruitment_campaign subpoenas
- LOAD_DATE - recording_date + spring_autumn + spring_autumn + = + + + + recruitment_id + recruitment_id = subpoena subpoena - N + Y appeared appeared - N + Y not_appeared not_appeared - N + Y not_ap_good_reason not_ap_good_reason - N + Y introduced_measures introduced_measures - N + Y ap_not_required ap_not_required - N + Y restrictions_applied restrictions_applied - N + Y appeared_percent appeared_percent - N + Y not_appeared_percent not_appeared_percent - N + Y not_ap_good_reason_percent not_ap_good_reason_percent - N + Y ap_not_required_percent ap_not_required_percent - N + Y restrictions_applied_percent restrictions_applied_percent - N + Y introduced_measures_percent introduced_measures_percent - N + Y recruitment_id @@ -872,18 +874,13 @@ rest rest - N + Y spring_autumn spring_autumn N - - recording_date - LOAD_DATE - N - @@ -929,23 +926,6 @@ - - mil_reg - mil_reg - Boolean - -2 - -2 - - false - - - false - - - - - normal - @@ -991,23 +971,6 @@ - - mil_reg - mil_reg - Boolean - -2 - -2 - - false - - - false - - - - - normal - diff --git a/mappings/country/total_registered.age.ktr b/mappings/country/total_registered.age.ktr new file mode 100644 index 0000000..48a15f3 --- /dev/null +++ b/mappings/country/total_registered.age.ktr @@ -0,0 +1,1537 @@ + + + + total_registered.age + + + + Normal + 0 + / + + + + + + + + + + + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + TRANSNAME + Y + TRANSNAME + + + STATUS + Y + STATUS + + + LINES_READ + Y + LINES_READ + + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + + LINES_UPDATED + Y + LINES_UPDATED + + + + LINES_INPUT + Y + LINES_INPUT + + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + + LINES_REJECTED + Y + LINES_REJECTED + + + + ERRORS + Y + ERRORS + + + STARTDATE + Y + STARTDATE + + + ENDDATE + Y + ENDDATE + + + LOGDATE + Y + LOGDATE + + + DEPDATE + Y + DEPDATE + + + REPLAYDATE + Y + REPLAYDATE + + + LOG_FIELD + Y + LOG_FIELD + + + EXECUTING_SERVER + N + EXECUTING_SERVER + + + EXECUTING_USER + N + EXECUTING_USER + + + CLIENT + N + CLIENT + + + + + +
+ + + + ID_BATCH + Y + ID_BATCH + + + SEQ_NR + Y + SEQ_NR + + + LOGDATE + Y + LOGDATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + INPUT_BUFFER_ROWS + Y + INPUT_BUFFER_ROWS + + + OUTPUT_BUFFER_ROWS + Y + OUTPUT_BUFFER_ROWS + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + LOGGING_OBJECT_TYPE + Y + LOGGING_OBJECT_TYPE + + + OBJECT_NAME + Y + OBJECT_NAME + + + OBJECT_COPY + Y + OBJECT_COPY + + + REPOSITORY_DIRECTORY + Y + REPOSITORY_DIRECTORY + + + FILENAME + Y + FILENAME + + + OBJECT_ID + Y + OBJECT_ID + + + OBJECT_REVISION + Y + OBJECT_REVISION + + + PARENT_CHANNEL_ID + Y + PARENT_CHANNEL_ID + + + ROOT_CHANNEL_ID + Y + ROOT_CHANNEL_ID + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + LOG_FIELD + N + LOG_FIELD + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + METRICS_DATE + Y + METRICS_DATE + + + METRICS_CODE + Y + METRICS_CODE + + + METRICS_DESCRIPTION + Y + METRICS_DESCRIPTION + + + METRICS_SUBJECT + Y + METRICS_SUBJECT + + + METRICS_TYPE + Y + METRICS_TYPE + + + METRICS_VALUE + Y + METRICS_VALUE + + + + + +
+ + 0.0 + 0.0 + + 10000 + 50 + 50 + N + Y + 50000 + Y + + N + 1000 + 100 + + + + + + + local + localhost + 8888 + + cluster + Encrypted 2be98afc86aa7f2e4cb1aa265cd86aac8 + + + + Y + N + + + + + - + 2024/08/02 11:56:22.507 + - + 2024/08/02 11:56:22.507 + H4sIAAAAAAAAAAMAAAAAAAAAAAA= + N + + + + + ervu-dashboard + dashboard-dbhost + POSTGRESQL + Native + dashboard-dbname + 1111 + dashboard-dbuser + Encrypted 2daf9dca008c89396af54aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 1111 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + ervu_person_registry + person-dbhost + POSTGRESQL + Native + person-dbname + 4444 + person-dbuser + Encrypted 2be98afb80fd5818ba554aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 4444 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + + Get variables + Select values + Y + + + Table input (person_registry) РФ/все + Get variables + Y + + + Select values + Insert / update (total_registered.age) + Y + + + Get variables 2 + Select values 2 + Y + + + Table input (person_registry) РФ/мужчины + Get variables 2 + Y + + + Get variables 2 2 + Select values 2 2 + Y + + + Table input (person_registry) РФ/женщины + Get variables 2 2 + Y + + + Select values 2 + Insert / update (total_registered.age) 2 + Y + + + Select values 2 2 + Insert / update (total_registered.age) 3 + Y + + + + Get variables + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + + + + + + + + + + 640 + 224 + Y + + + + Get variables 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + + + + + + + + + + 640 + 320 + Y + + + + Get variables 2 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + + + + + + + + + + 640 + 416 + Y + + + + Insert / update (total_registered.age) + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered +
age
+ + recruitment_id + recruitment_id + = + + + + gender + "all_M_W" + = + + + + registered + registered + = + + + + "17_yaers" + 17_year_count + Y + + + "18-26_years" + 18-26_year_count + Y + + + "27-30_years" + 27-30_year_count + Y + + + "31-35_years" + 31-35_year_count + Y + + + "36-40_years" + 36-40_year_count + Y + + + "41-45_years" + 41-45_year_count + Y + + + "51+_years" + 41-45_year_count + Y + + + "all_M_W" + gender + N + + + "46-50_years" + 46-50_year_count + Y + + + "17_yaers_percent" + 17_year_percent + Y + + + "18-26_years_percent" + 18-26_year_percent + Y + + + "27-30_years_percent" + 27-30_year_percent + Y + + + "31-35_years_percent" + 31-35_year_percent + Y + + + "36-40_years_percent" + 36-40_year_percent + Y + + + "41-45_years_percent" + 41-45_year_percent + Y + + + "46-50_years_percent" + 46-50_year_percent + Y + + + "51+_years_percent" + 51+_year_percent + Y + + + recruitment_id + recruitment_id + N + + + registered + registered + N + + + + + + + + + + + + 1024 + 224 + Y + + + + Insert / update (total_registered.age) 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered + age
+ + recruitment_id + recruitment_id + = + + + + gender + "all_M_W" + = + + + + registered + registered + = + + + + "17_yaers" + 17_year_count + Y + + + "18-26_years" + 18-26_year_count + Y + + + "27-30_years" + 27-30_year_count + Y + + + "31-35_years" + 31-35_year_count + Y + + + "36-40_years" + 36-40_year_count + Y + + + "41-45_years" + 41-45_year_count + Y + + + "51+_years" + 41-45_year_count + Y + + + "all_M_W" + gender + N + + + "46-50_years" + 46-50_year_count + Y + + + "17_yaers_percent" + 17_year_percent + Y + + + "18-26_years_percent" + 18-26_year_percent + Y + + + "27-30_years_percent" + 27-30_year_percent + Y + + + "31-35_years_percent" + 31-35_year_percent + Y + + + "36-40_years_percent" + 36-40_year_percent + Y + + + "41-45_years_percent" + 41-45_year_percent + Y + + + "46-50_years_percent" + 46-50_year_percent + Y + + + "51+_years_percent" + 51+_year_percent + Y + + + recruitment_id + recruitment_id + N + + + registered + registered + N + +
+ + + + + + + + + + 1024 + 320 + Y + +
+ + Insert / update (total_registered.age) 3 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered + age
+ + recruitment_id + recruitment_id + = + + + + gender + "all_M_W" + = + + + + registered + registered + = + + + + "17_yaers" + 17_year_count + Y + + + "18-26_years" + 18-26_year_count + Y + + + "27-30_years" + 27-30_year_count + Y + + + "31-35_years" + 31-35_year_count + Y + + + "36-40_years" + 36-40_year_count + Y + + + "41-45_years" + 41-45_year_count + Y + + + "51+_years" + 41-45_year_count + Y + + + "all_M_W" + gender + N + + + "46-50_years" + 46-50_year_count + Y + + + "17_yaers_percent" + 17_year_percent + Y + + + "18-26_years_percent" + 18-26_year_percent + Y + + + "27-30_years_percent" + 27-30_year_percent + Y + + + "31-35_years_percent" + 31-35_year_percent + Y + + + "36-40_years_percent" + 36-40_year_percent + Y + + + "41-45_years_percent" + 41-45_year_percent + Y + + + "46-50_years_percent" + 46-50_year_percent + Y + + + "51+_years_percent" + 51+_year_percent + Y + + + recruitment_id + recruitment_id + N + + + registered + registered + N + +
+ + + + + + + + + + 1024 + 416 + Y + +
+ + Select values + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + + + + + + + + + + 784 + 224 + Y + + + + Select values 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + + + + + + + + + + 784 + 320 + Y + + + + Select values 2 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + + + + + + + + + + 784 + 416 + Y + + + + Table input (person_registry) РФ/все + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH total_count AS ( + SELECT COUNT(*) AS total + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' +), +age_counts AS ( + SELECT + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) = 17) AS "17_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 18 AND 26) AS "18-26_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 27 AND 30) AS "27-30_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 31 AND 35) AS "31-35_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 36 AND 40) AS "36-40_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 41 AND 45) AS "41-45_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 46 AND 50) AS "46-50_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) >= 51) AS "51+_year_count" + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' +) +SELECT + age_counts."17_year_count", + ROUND((age_counts."17_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "17_year_percent", + + age_counts."18-26_year_count", + ROUND((age_counts."18-26_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "18-26_year_percent", + + age_counts."27-30_year_count", + ROUND((age_counts."27-30_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "27-30_year_percent", + + age_counts."31-35_year_count", + ROUND((age_counts."31-35_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "31-35_year_percent", + + age_counts."36-40_year_count", + ROUND((age_counts."36-40_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "36-40_year_percent", + + age_counts."41-45_year_count", + ROUND((age_counts."41-45_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "41-45_year_percent", + + age_counts."46-50_year_count", + ROUND((age_counts."46-50_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "46-50_year_percent", + + age_counts."51+_year_count", + ROUND((age_counts."51+_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "51+_year_percent", + + '00' as recruitment_id, + 'ALL' as gender, + 'true' as registered + +FROM age_counts, total_count; + 0 + + N + N + N + + + + + + + + + + 400 + 224 + Y + + + + Table input (person_registry) РФ/женщины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH total_count AS ( + SELECT COUNT(*) AS total + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.gender = 'FEMALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' +), +age_counts AS ( + SELECT + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) = 17) AS "17_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 18 AND 26) AS "18-26_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 27 AND 30) AS "27-30_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 31 AND 35) AS "31-35_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 36 AND 40) AS "36-40_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 41 AND 45) AS "41-45_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 46 AND 50) AS "46-50_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) >= 51) AS "51+_year_count" + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.gender = 'FEMALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' +) +SELECT + age_counts."17_year_count", + ROUND((age_counts."17_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "17_year_percent", + + age_counts."18-26_year_count", + ROUND((age_counts."18-26_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "18-26_year_percent", + + age_counts."27-30_year_count", + ROUND((age_counts."27-30_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "27-30_year_percent", + + age_counts."31-35_year_count", + ROUND((age_counts."31-35_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "31-35_year_percent", + + age_counts."36-40_year_count", + ROUND((age_counts."36-40_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "36-40_year_percent", + + age_counts."41-45_year_count", + ROUND((age_counts."41-45_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "41-45_year_percent", + + age_counts."46-50_year_count", + ROUND((age_counts."46-50_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "46-50_year_percent", + + age_counts."51+_year_count", + ROUND((age_counts."51+_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "51+_year_percent", + + '00' as recruitment_id, + 'W' as gender, + 'true' as registered + +FROM age_counts, total_count; + 0 + + N + N + N + + + + + + + + + + 400 + 416 + Y + + + + Table input (person_registry) РФ/мужчины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH total_count AS ( + SELECT COUNT(*) AS total + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.gender = 'MALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' +), +age_counts AS ( + SELECT + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) = 17) AS "17_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 18 AND 26) AS "18-26_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 27 AND 30) AS "27-30_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 31 AND 35) AS "31-35_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 36 AND 40) AS "36-40_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 41 AND 45) AS "41-45_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 46 AND 50) AS "46-50_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) >= 51) AS "51+_year_count" + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.gender = 'MALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' +) +SELECT + age_counts."17_year_count", + ROUND((age_counts."17_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "17_year_percent", + + age_counts."18-26_year_count", + ROUND((age_counts."18-26_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "18-26_year_percent", + + age_counts."27-30_year_count", + ROUND((age_counts."27-30_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "27-30_year_percent", + + age_counts."31-35_year_count", + ROUND((age_counts."31-35_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "31-35_year_percent", + + age_counts."36-40_year_count", + ROUND((age_counts."36-40_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "36-40_year_percent", + + age_counts."41-45_year_count", + ROUND((age_counts."41-45_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "41-45_year_percent", + + age_counts."46-50_year_count", + ROUND((age_counts."46-50_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "46-50_year_percent", + + age_counts."51+_year_count", + ROUND((age_counts."51+_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "51+_year_percent", + + '00' as recruitment_id, + 'М' as gender, + 'true' as registered + +FROM age_counts, total_count; + 0 + + N + N + N + + + + + + + + + + 400 + 320 + Y + + + + + + + N + +
diff --git a/mappings/country/total_registered.child_minor.ktr b/mappings/country/total_registered.child_minor.ktr new file mode 100644 index 0000000..f945d73 --- /dev/null +++ b/mappings/country/total_registered.child_minor.ktr @@ -0,0 +1,1449 @@ + + + + total_registered.child_minor + + + + Normal + 0 + / + + + + + + + + + + + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + TRANSNAME + Y + TRANSNAME + + + STATUS + Y + STATUS + + + LINES_READ + Y + LINES_READ + + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + + LINES_UPDATED + Y + LINES_UPDATED + + + + LINES_INPUT + Y + LINES_INPUT + + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + + LINES_REJECTED + Y + LINES_REJECTED + + + + ERRORS + Y + ERRORS + + + STARTDATE + Y + STARTDATE + + + ENDDATE + Y + ENDDATE + + + LOGDATE + Y + LOGDATE + + + DEPDATE + Y + DEPDATE + + + REPLAYDATE + Y + REPLAYDATE + + + LOG_FIELD + Y + LOG_FIELD + + + EXECUTING_SERVER + N + EXECUTING_SERVER + + + EXECUTING_USER + N + EXECUTING_USER + + + CLIENT + N + CLIENT + + + + + +
+ + + + ID_BATCH + Y + ID_BATCH + + + SEQ_NR + Y + SEQ_NR + + + LOGDATE + Y + LOGDATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + INPUT_BUFFER_ROWS + Y + INPUT_BUFFER_ROWS + + + OUTPUT_BUFFER_ROWS + Y + OUTPUT_BUFFER_ROWS + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + LOGGING_OBJECT_TYPE + Y + LOGGING_OBJECT_TYPE + + + OBJECT_NAME + Y + OBJECT_NAME + + + OBJECT_COPY + Y + OBJECT_COPY + + + REPOSITORY_DIRECTORY + Y + REPOSITORY_DIRECTORY + + + FILENAME + Y + FILENAME + + + OBJECT_ID + Y + OBJECT_ID + + + OBJECT_REVISION + Y + OBJECT_REVISION + + + PARENT_CHANNEL_ID + Y + PARENT_CHANNEL_ID + + + ROOT_CHANNEL_ID + Y + ROOT_CHANNEL_ID + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + LOG_FIELD + N + LOG_FIELD + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + METRICS_DATE + Y + METRICS_DATE + + + METRICS_CODE + Y + METRICS_CODE + + + METRICS_DESCRIPTION + Y + METRICS_DESCRIPTION + + + METRICS_SUBJECT + Y + METRICS_SUBJECT + + + METRICS_TYPE + Y + METRICS_TYPE + + + METRICS_VALUE + Y + METRICS_VALUE + + + + + +
+ + 0.0 + 0.0 + + 10000 + 50 + 50 + N + Y + 50000 + Y + + N + 1000 + 100 + + + + + + + local + localhost + 8888 + + cluster + Encrypted 2be98afc86aa7f2e4cb1aa265cd86aac8 + + + + Y + N + + + + + - + 2024/08/02 11:56:22.507 + - + 2024/08/02 11:56:22.507 + H4sIAAAAAAAAAAMAAAAAAAAAAAA= + N + + + + + ervu-dashboard + dashboard-dbhost + POSTGRESQL + Native + dashboard-dbname + 1111 + dashboard-dbuser + Encrypted 2daf9dca008c89396af54aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 1111 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + ervu_person_registry + person-dbhost + POSTGRESQL + Native + person-dbname + 4444 + person-dbuser + Encrypted 2be98afb80fd5818ba554aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 4444 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + + Get variables 4 + Select values 4 + Y + + + Table input (person_registry)РФ/все + Get variables 4 + Y + + + Select values 4 + Insert / update (total_registered.child_minor) + Y + + + Get variables 4 2 + Select values 4 2 + Y + + + Table input (person_registry)РФ/мужчины + Get variables 4 2 + Y + + + Get variables 4 2 2 + Select values 4 2 2 + Y + + + Table input (person_registry)РФ/женщины + Get variables 4 2 2 + Y + + + Select values 4 2 2 + Insert / update (total_registered.child_minor) 3 + Y + + + Select values 4 2 + Insert / update (total_registered.child_minor) 2 + Y + + + + Get variables 4 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + + + + + + + + + + 544 + 240 + Y + + + + Get variables 4 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + + + + + + + + + + 560 + 336 + Y + + + + Get variables 4 2 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + + + + + + + + + + 624 + 416 + Y + + + + Insert / update (total_registered.child_minor) + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + N + + total_registered +
child_minor
+ + recruitment_id + recruitment_id + = + + + + gender + "all_M_W" + = + + + + no_child + no_children + Y + + + "1_child" + one_child + Y + + + "2_child" + two_children + Y + + + "3_child" + three_children + Y + + + "4_more_child" + four_or_more_children + Y + + + "all_M_W" + gender + N + + + no_child_percent + no_children_percent + Y + + + "1_child_percent" + one_child_percent + Y + + + "2_child_percent" + two_children_percent + Y + + + "3_child_percent" + three_children_percent + Y + + + "4_more_child_percent" + four_or_more_children_percent + Y + + + recruitment_id + recruitment_id + N + + + + + + + + + + + + 960 + 240 + Y + + + + Insert / update (total_registered.child_minor) 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + N + + total_registered + child_minor
+ + recruitment_id + recruitment_id + = + + + + gender + "all_M_W" + = + + + + no_child + no_children + Y + + + "1_child" + one_child + Y + + + "2_child" + two_children + Y + + + "3_child" + three_children + Y + + + "4_more_child" + four_or_more_children + Y + + + "all_M_W" + gender + N + + + no_child_percent + no_children_percent + Y + + + "1_child_percent" + one_child_percent + Y + + + "2_child_percent" + two_children_percent + Y + + + "3_child_percent" + three_children_percent + Y + + + "4_more_child_percent" + four_or_more_children_percent + Y + + + recruitment_id + recruitment_id + N + +
+ + + + + + + + + + 976 + 336 + Y + +
+ + Insert / update (total_registered.child_minor) 3 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + N + + total_registered + child_minor
+ + recruitment_id + recruitment_id + = + + + + gender + "all_M_W" + = + + + + no_child + no_children + Y + + + "1_child" + one_child + Y + + + "2_child" + two_children + Y + + + "3_child" + three_children + Y + + + "4_more_child" + four_or_more_children + Y + + + "all_M_W" + gender + N + + + no_child_percent + no_children_percent + Y + + + "1_child_percent" + one_child_percent + Y + + + "2_child_percent" + two_children_percent + Y + + + "3_child_percent" + three_children_percent + Y + + + "4_more_child_percent" + four_or_more_children_percent + Y + + + recruitment_id + recruitment_id + N + +
+ + + + + + + + + + 1040 + 416 + Y + +
+ + Select values 4 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + + + + + + + + + + 736 + 240 + Y + + + + Select values 4 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + + + + + + + + + + 752 + 336 + Y + + + + Select values 4 2 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + + + + + + + + + + 800 + 416 + Y + + + + Table input (person_registry)РФ/все + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH extracted_children AS ( + SELECT + ri.recruit_id, + jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child + FROM + public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + WHERE + jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array' + AND r.vu_current_info->>'isMilitaryRegistered' = 'true' +), +children_birth_dates AS ( + SELECT + recruit_id, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year + FROM + extracted_children +), +children_count AS ( + SELECT + recruit_id, + COUNT(*) AS children_under_18 + FROM + children_birth_dates + WHERE + AGE(make_date(year, month, day)) < interval '18 years' + GROUP BY + recruit_id +), +final_counts AS ( + SELECT + COALESCE(children_under_18, 0) AS children_count, + COUNT(*) AS num_people + FROM + public.recruits_info ri + LEFT JOIN + children_count cc ON ri.recruit_id = cc.recruit_id + GROUP BY + COALESCE(children_under_18, 0) +), +total_people AS ( + SELECT SUM(num_people) AS total_count + FROM final_counts +) +SELECT + 'ALL' AS gender, + '00' as recruitment_id, + COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children, + COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child, + COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children, + COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children, + COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children, + ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS no_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS one_child_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS two_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS three_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS four_or_more_children_percent +FROM + final_counts; + 0 + + N + N + N + + + + + + + + + + 352 + 240 + Y + + + + Table input (person_registry)РФ/женщины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH extracted_children AS ( + SELECT + ri.recruit_id, + jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child + FROM + public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + WHERE + jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array' + AND r.vu_current_info->>'isMilitaryRegistered' = 'true' + AND gender = 'FEMALE' +), +children_birth_dates AS ( + SELECT + recruit_id, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year + FROM + extracted_children +), +children_count AS ( + SELECT + recruit_id, + COUNT(*) AS children_under_18 + FROM + children_birth_dates + WHERE + AGE(make_date(year, month, day)) < interval '18 years' + GROUP BY + recruit_id +), +final_counts AS ( + SELECT + COALESCE(children_under_18, 0) AS children_count, + COUNT(*) AS num_people + FROM + public.recruits_info ri + LEFT JOIN + children_count cc ON ri.recruit_id = cc.recruit_id + GROUP BY + COALESCE(children_under_18, 0) +), +total_people AS ( + SELECT SUM(num_people) AS total_count + FROM final_counts +) +SELECT + 'W' AS gender, + '00' as recruitment_id, + COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children, + COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child, + COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children, + COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children, + COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children, + ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS no_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS one_child_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS two_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS three_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS four_or_more_children_percent +FROM + final_counts; + 0 + + N + N + N + + + + + + + + + + 352 + 416 + Y + + + + Table input (person_registry)РФ/мужчины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH extracted_children AS ( + SELECT + ri.recruit_id, + jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child + FROM + public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + WHERE + jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array' + AND r.vu_current_info->>'isMilitaryRegistered' = 'true' + AND gender = 'MALE' +), +children_birth_dates AS ( + SELECT + recruit_id, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year + FROM + extracted_children +), +children_count AS ( + SELECT + recruit_id, + COUNT(*) AS children_under_18 + FROM + children_birth_dates + WHERE + AGE(make_date(year, month, day)) < interval '18 years' + GROUP BY + recruit_id +), +final_counts AS ( + SELECT + COALESCE(children_under_18, 0) AS children_count, + COUNT(*) AS num_people + FROM + public.recruits_info ri + LEFT JOIN + children_count cc ON ri.recruit_id = cc.recruit_id + GROUP BY + COALESCE(children_under_18, 0) +), +total_people AS ( + SELECT SUM(num_people) AS total_count + FROM final_counts +) +SELECT + 'M' AS gender, + '00' as recruitment_id, + COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children, + COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child, + COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children, + COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children, + COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children, + ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS no_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS one_child_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS two_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS three_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS four_or_more_children_percent +FROM + final_counts; + 0 + + N + N + N + + + + + + + + + + 352 + 336 + Y + + + + + + + N + +
diff --git a/mappings/country/total_registered.driver_license.ktr b/mappings/country/total_registered.driver_license.ktr new file mode 100644 index 0000000..6ff001c --- /dev/null +++ b/mappings/country/total_registered.driver_license.ktr @@ -0,0 +1,1386 @@ + + + + total_registered.driver_license + + + + Normal + 0 + / + + + LOAD_DATE + 20240812 + + + + + + + + + + + + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + TRANSNAME + Y + TRANSNAME + + + STATUS + Y + STATUS + + + LINES_READ + Y + LINES_READ + + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + + LINES_UPDATED + Y + LINES_UPDATED + + + + LINES_INPUT + Y + LINES_INPUT + + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + + LINES_REJECTED + Y + LINES_REJECTED + + + + ERRORS + Y + ERRORS + + + STARTDATE + Y + STARTDATE + + + ENDDATE + Y + ENDDATE + + + LOGDATE + Y + LOGDATE + + + DEPDATE + Y + DEPDATE + + + REPLAYDATE + Y + REPLAYDATE + + + LOG_FIELD + Y + LOG_FIELD + + + EXECUTING_SERVER + N + EXECUTING_SERVER + + + EXECUTING_USER + N + EXECUTING_USER + + + CLIENT + N + CLIENT + + + + + +
+ + + + ID_BATCH + Y + ID_BATCH + + + SEQ_NR + Y + SEQ_NR + + + LOGDATE + Y + LOGDATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + INPUT_BUFFER_ROWS + Y + INPUT_BUFFER_ROWS + + + OUTPUT_BUFFER_ROWS + Y + OUTPUT_BUFFER_ROWS + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + LOGGING_OBJECT_TYPE + Y + LOGGING_OBJECT_TYPE + + + OBJECT_NAME + Y + OBJECT_NAME + + + OBJECT_COPY + Y + OBJECT_COPY + + + REPOSITORY_DIRECTORY + Y + REPOSITORY_DIRECTORY + + + FILENAME + Y + FILENAME + + + OBJECT_ID + Y + OBJECT_ID + + + OBJECT_REVISION + Y + OBJECT_REVISION + + + PARENT_CHANNEL_ID + Y + PARENT_CHANNEL_ID + + + ROOT_CHANNEL_ID + Y + ROOT_CHANNEL_ID + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + LOG_FIELD + N + LOG_FIELD + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + METRICS_DATE + Y + METRICS_DATE + + + METRICS_CODE + Y + METRICS_CODE + + + METRICS_DESCRIPTION + Y + METRICS_DESCRIPTION + + + METRICS_SUBJECT + Y + METRICS_SUBJECT + + + METRICS_TYPE + Y + METRICS_TYPE + + + METRICS_VALUE + Y + METRICS_VALUE + + + + + +
+ + 0.0 + 0.0 + + 10000 + 50 + 50 + N + Y + 50000 + Y + + N + 1000 + 100 + + + + + + + local + localhost + 8888 + + cluster + Encrypted 2be98afc86aa7f2e4cb1aa265cd86aac8 + + + + Y + N + + + + + - + 2024/08/02 11:56:22.507 + - + 2024/08/02 11:56:22.507 + H4sIAAAAAAAAAAMAAAAAAAAAAAA= + N + + + + + ervu-dashboard + dashboard-dbhost + POSTGRESQL + Native + dashboard-dbname + 1111 + dashboard-dbuser + Encrypted 2daf9dca008c89396af54aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 1111 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + postgres.person_registry + person-dbhost + POSTGRESQL + Native + person-dbname + 4444 + person-dbuser + Encrypted 2be98afb80fd5818ba554aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 4444 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + + Get variables + Select values + Y + + + Table input (person_registry) РФ/все + Get variables + Y + + + Select values + Insert / update (total_registered.driver_license) 2 + Y + + + Get variables 2 + Select values 2 + Y + + + Select values 2 + Insert / update (total_registered.driver_license) 2 2 + Y + + + Table input (person_registry) РФ/мужчины + Get variables 2 + Y + + + Get variables 2 2 + Select values 2 2 + Y + + + Select values 2 2 + Insert / update (total_registered.driver_license) 2 2 2 + Y + + + Table input (person_registry) РФ/женщины + Get variables 2 2 + Y + + + + Get variables + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + + + + + + + + + + 832 + 176 + Y + + + + Get variables 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + + + + + + + + + + 832 + 272 + Y + + + + Get variables 2 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + + + + + + + + + + 832 + 368 + Y + + + + Insert / update (total_registered.driver_license) 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered +
driver_license
+ + recruitment_id + recruitment_id + = + + + + gender + "all_M_W" + = + + + + "A" + a + Y + + + "B" + b + Y + + + "C" + c + Y + + + "D" + d + Y + + + "E" + e + Y + + + nope + nope + Y + + + "A_repcent" + a_percent + Y + + + "B_repcent" + b_percent + Y + + + "C_repcent" + c_percent + Y + + + "D_repcent" + d_percent + Y + + + "E_repcent" + e_percent + Y + + + "all_M_W" + gender + N + + + recruitment_id + recruitment_id + N + + + + + + + + + + + + 1216 + 176 + Y + + + + Insert / update (total_registered.driver_license) 2 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered + driver_license
+ + recruitment_id + recruitment_id + = + + + + gender + "all_M_W" + = + + + + "A" + a + Y + + + "B" + b + Y + + + "C" + c + Y + + + "D" + d + Y + + + "E" + e + Y + + + nope + nope + Y + + + "A_repcent" + a_percent + Y + + + "B_repcent" + b_percent + Y + + + "C_repcent" + c_percent + Y + + + "D_repcent" + d_percent + Y + + + "E_repcent" + e_percent + Y + + + "all_M_W" + gender + N + + + recruitment_id + recruitment_id + N + +
+ + + + + + + + + + 1216 + 272 + Y + +
+ + Insert / update (total_registered.driver_license) 2 2 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered + driver_license
+ + recruitment_id + recruitment_id + = + + + + gender + "all_M_W" + = + + + + "A" + a + Y + + + "B" + b + Y + + + "C" + c + Y + + + "D" + d + Y + + + "E" + e + Y + + + nope + nope + Y + + + "A_repcent" + a_percent + Y + + + "B_repcent" + b_percent + Y + + + "C_repcent" + c_percent + Y + + + "D_repcent" + d_percent + Y + + + "E_repcent" + e_percent + Y + + + "all_M_W" + gender + N + + + recruitment_id + recruitment_id + N + +
+ + + + + + + + + + 1216 + 368 + Y + +
+ + Select values + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + + + + + + + + + + 976 + 176 + Y + + + + Select values 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + + + + + + + + + + 976 + 272 + Y + + + + Select values 2 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + + + + + + + + + + 976 + 368 + Y + + + + Table input (person_registry) РФ/все + TableInput + + Y + + 1 + + none + + + postgres.person_registry + WITH categorized AS ( + SELECT + r.id, + r.gender, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "A")') AS has_A, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "B")') AS has_B, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "C")') AS has_C, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "D")') AS has_D, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "E")') AS has_E + FROM public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + where r.vu_current_info -> 'isMilitaryRegistered' = 'true' +), +aggregated AS ( + SELECT + 'ALL' AS gender, + '00' as recruitment_id, + COUNT(*) FILTER (WHERE NOT has_A AND NOT has_B AND NOT has_C AND NOT has_D AND NOT has_E) AS nope, + COUNT(*) FILTER (WHERE has_A) AS a, + COUNT(*) FILTER (WHERE has_B) AS b, + COUNT(*) FILTER (WHERE has_C) AS c, + COUNT(*) FILTER (WHERE has_D) AS d, + COUNT(*) FILTER (WHERE has_E) AS e, + COUNT(*) AS total + FROM categorized +) +SELECT *, + ROUND((nope * 100.0) / NULLIF(total, 0), 2) AS nope_percent, + ROUND((a * 100.0) / NULLIF(total, 0), 2) AS a_percent, + ROUND((b * 100.0) / NULLIF(total, 0), 2) AS b_percent, + ROUND((c * 100.0) / NULLIF(total, 0), 2) AS c_percent, + ROUND((d * 100.0) / NULLIF(total, 0), 2) AS d_percent, + ROUND((e * 100.0) / NULLIF(total, 0), 2) AS e_percent +FROM aggregated; + 0 + + N + N + N + + + + + + + + + + 592 + 176 + Y + + + + Table input (person_registry) РФ/женщины + TableInput + + Y + + 1 + + none + + + postgres.person_registry + WITH categorized AS ( + SELECT + r.id, + r.gender, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "A")') AS has_A, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "B")') AS has_B, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "C")') AS has_C, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "D")') AS has_D, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "E")') AS has_E + FROM public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and gender = 'FEMALE' +), +aggregated AS ( + SELECT + 'W' AS gender, + '00' as recruitment_id, + COUNT(*) FILTER (WHERE NOT has_A AND NOT has_B AND NOT has_C AND NOT has_D AND NOT has_E) AS nope, + COUNT(*) FILTER (WHERE has_A) AS a, + COUNT(*) FILTER (WHERE has_B) AS b, + COUNT(*) FILTER (WHERE has_C) AS c, + COUNT(*) FILTER (WHERE has_D) AS d, + COUNT(*) FILTER (WHERE has_E) AS e, + COUNT(*) AS total + FROM categorized +) +SELECT *, + ROUND((nope * 100.0) / NULLIF(total, 0), 2) AS nope_percent, + ROUND((a * 100.0) / NULLIF(total, 0), 2) AS a_percent, + ROUND((b * 100.0) / NULLIF(total, 0), 2) AS b_percent, + ROUND((c * 100.0) / NULLIF(total, 0), 2) AS c_percent, + ROUND((d * 100.0) / NULLIF(total, 0), 2) AS d_percent, + ROUND((e * 100.0) / NULLIF(total, 0), 2) AS e_percent +FROM aggregated; + 0 + + N + N + N + + + + + + + + + + 592 + 368 + Y + + + + Table input (person_registry) РФ/мужчины + TableInput + + Y + + 1 + + none + + + postgres.person_registry + WITH categorized AS ( + SELECT + r.id, + r.gender, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "A")') AS has_A, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "B")') AS has_B, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "C")') AS has_C, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "D")') AS has_D, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "E")') AS has_E + FROM public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and gender = 'MALE' +), +aggregated AS ( + SELECT + 'M' AS gender, + '00' as recruitment_id, + COUNT(*) FILTER (WHERE NOT has_A AND NOT has_B AND NOT has_C AND NOT has_D AND NOT has_E) AS nope, + COUNT(*) FILTER (WHERE has_A) AS a, + COUNT(*) FILTER (WHERE has_B) AS b, + COUNT(*) FILTER (WHERE has_C) AS c, + COUNT(*) FILTER (WHERE has_D) AS d, + COUNT(*) FILTER (WHERE has_E) AS e, + COUNT(*) AS total + FROM categorized +) +SELECT *, + ROUND((nope * 100.0) / NULLIF(total, 0), 2) AS nope_percent, + ROUND((a * 100.0) / NULLIF(total, 0), 2) AS a_percent, + ROUND((b * 100.0) / NULLIF(total, 0), 2) AS b_percent, + ROUND((c * 100.0) / NULLIF(total, 0), 2) AS c_percent, + ROUND((d * 100.0) / NULLIF(total, 0), 2) AS d_percent, + ROUND((e * 100.0) / NULLIF(total, 0), 2) AS e_percent +FROM aggregated; + 0 + + N + N + N + + + + + + + + + + 592 + 272 + Y + + + + + + + N + +
diff --git a/mappings/country/total_registered.reg_mil_cat.ktr b/mappings/country/total_registered.reg_mil_cat.ktr index 9568865..4903bb0 100644 --- a/mappings/country/total_registered.reg_mil_cat.ktr +++ b/mappings/country/total_registered.reg_mil_cat.ktr @@ -630,25 +630,31 @@ total_registered reg_mil_cat
- LOAD_DATE - recording_date + recruitment_id + recruitment_id + = + + + + mil_reg + mil_reg = first_reg_17 first_reg_17 - N + Y first_reg_18 first_reg_18 - N + Y "mil_spec_W" mil_spec_w - N + Y recruitment_id @@ -658,58 +664,53 @@ returned_dep_liberty returned_dep_liberty - N + Y punished punished - N + Y received_citizenship received_citizenship - N + Y first_reg_17_percent first_reg_17_percent - N + Y first_reg_18_percent first_reg_18_percent - N + Y returned_dep_liberty_percent returned_dep_liberty_percent - N + Y "mil_spec_W_percent" mil_spec_w_percent - N + Y punished_percent punished_percent - N + Y received_citizenship_percent received_citizenship_percent - N + Y mil_reg mil_reg N - - recording_date - LOAD_DATE - N - diff --git a/mappings/country/total_registered.removed_registry.ktr b/mappings/country/total_registered.removed_registry.ktr index f273276..2cfccdc 100644 --- a/mappings/country/total_registered.removed_registry.ktr +++ b/mappings/country/total_registered.removed_registry.ktr @@ -701,86 +701,81 @@ total_registered removed_registry
- LOAD_DATE - recording_date + recruitment_id + recruitment_id = age_limit age_limit - N + Y death death - N + Y removed_registry removed_registry - N + Y deprivation_citizenship deprivation_citizenship - N + Y travel_abroad travel_abroad - N + Y living_abroad travel_abroad - N + Y other other - N + Y deprivation_citizen_percents deprivation_citizen_percents - N + Y age_limit_percent age_limit_percent - N + Y death_percent death_percent - N + Y travel_abroad_percent travel_abroad_percent - N + Y living_abroad_percent living_abroad_percent - N + Y other_percent other_percent - N + Y recruitment_id recruitment_id N - - recording_date - LOAD_DATE - N - diff --git a/mappings/country/total_registered.subpoenas.ktr b/mappings/country/total_registered.subpoenas.ktr index be22c92..de0f343 100644 --- a/mappings/country/total_registered.subpoenas.ktr +++ b/mappings/country/total_registered.subpoenas.ktr @@ -612,18 +612,6 @@ -1 none - - mil_reg - - Integer - - - - - -1 - -1 - none - @@ -663,18 +651,6 @@ -1 none - - mil_reg - - Integer - - - - - -1 - -1 - none - @@ -708,8 +684,8 @@ total_registered subpoenas
- LOAD_DATE - recording_date + recruitment_id + recruitment_id = @@ -722,52 +698,52 @@ subpoena subpoena - N + Y appeared appeared - N + Y average_appeared average_appeared - N + Y not_appeared not_appeared - N + Y not_ap_good_reason not_ap_good_reason - N + Y introduced_measures introduced_measures - N + Y ap_not_required ap_not_required - N + Y electron electron - N + Y paper paper - N + Y restrictions_applied restrictions_applied - N + Y recruitment_id @@ -782,47 +758,42 @@ appeared_percent appeared_percent - N + Y not_appeared_percent not_appeared_percent - N + Y not_ap_good_reason_percent not_ap_good_reason_percent - N + Y ap_not_required_percent ap_not_required_percent - N + Y electron_percent electron_percent - N + Y paper_percent paper_percent - N + Y restrictions_applied_percent restrictions_applied_percent - N + Y introduced_measures_percent introduced_measures_percent - N - - - recording_date - LOAD_DATE - N + Y @@ -857,8 +828,8 @@ total_registered subpoenas
- LOAD_DATE - recording_date + recruitment_id + recruitment_id = @@ -871,52 +842,52 @@ subpoena subpoena - N + Y appeared appeared - N + Y average_appeared average_appeared - N + Y not_appeared not_appeared - N + Y not_ap_good_reason not_ap_good_reason - N + Y introduced_measures introduced_measures - N + Y ap_not_required ap_not_required - N + Y electron electron - N + Y paper paper - N + Y restrictions_applied restrictions_applied - N + Y recruitment_id @@ -931,47 +902,42 @@ appeared_percent appeared_percent - N + Y not_appeared_percent not_appeared_percent - N + Y not_ap_good_reason_percent not_ap_good_reason_percent - N + Y ap_not_required_percent ap_not_required_percent - N + Y electron_percent electron_percent - N + Y paper_percent paper_percent - N + Y restrictions_applied_percent restrictions_applied_percent - N + Y introduced_measures_percent introduced_measures_percent - N - - - recording_date - LOAD_DATE - N + Y @@ -1018,23 +984,6 @@ - - mil_reg - mil_reg - Integer - -2 - -2 - - false - - - false - - - - - - @@ -1080,23 +1029,6 @@ - - mil_reg - mil_reg - Integer - -2 - -2 - - false - - - false - - - - - - diff --git a/mappings/job_general.kjb b/mappings/job_general.kjb index c819674..d4b9b73 100644 --- a/mappings/job_general.kjb +++ b/mappings/job_general.kjb @@ -11,57 +11,6 @@ 2024/08/21 17:23:33.592 - - ervu-dashboard - dashboard-dbhost - POSTGRESQL - Native - dashboard-dbname - 1111 - dashboard-dbuser - Encrypted 2daf9dca008c89396af54aa72ce93bcc9 - - - - - - FORCE_IDENTIFIERS_TO_LOWERCASE - N - - - FORCE_IDENTIFIERS_TO_UPPERCASE - N - - - IS_CLUSTERED - N - - - PORT_NUMBER - 1111 - - - PRESERVE_RESERVED_WORD_CASE - Y - - - QUOTE_ALL_FIELDS - N - - - SUPPORTS_BOOLEAN_DATA_TYPE - N - - - SUPPORTS_TIMESTAMP_DATA_TYPE - N - - - USE_POOLING - N - - - @@ -355,7 +304,7 @@ N Y 0 - 176 + 336 240 @@ -367,7 +316,7 @@ N Y 0 - 832 + 864 240 @@ -404,50 +353,18 @@ N Y 0 - 336 + 528 240 - SQL - - SQL - - DELETE FROM main_dashboard.appeals; - -DELETE FROM main_dashboard.recruitment_campaign; - -DELETE FROM main_dashboard.total_registered; - -DELETE FROM main_dashboard.waiting_registration; - -DELETE FROM recruitment_campaign.subpoenas; - -DELETE FROM total_registered.reg_mil_cat; - -DELETE FROM total_registered.removed_registry; - -DELETE FROM total_registered.subpoenas; - F - F - - F - ervu-dashboard - N - Y - 0 - 448 - 240 - - - - Jobcountry + job_recruitments_all JOB filename - ${Internal.Entry.Current.Directory}/\country\job_recruitments_country.kjb + ${Internal.Entry.Current.Directory}/job_recruitments_all.kjb N @@ -468,54 +385,40 @@ DELETE FROM total_registered.subpoenas; Pentaho local Y + + LOAD_DATE + + ${LOAD_DATE} + N N Y 0 - 560 - 240 - - - - Jobregion - - JOB - - filename - - ${Internal.Entry.Current.Directory}/\region\job_recruitments_region.kjb - - - N - N - N - N - - - N - N - Nothing - - Y - N - N - N - N - Pentaho local - - Y - - N - N - Y - 0 - 672 + 704 240 + + job_pack.pub_recruitment + job_recruitments_all + 0 + 0 + Y + Y + N + + + job_recruitments_all + Success + 0 + 0 + Y + Y + N + Start job_pack.pub_recruitment @@ -525,42 +428,6 @@ DELETE FROM total_registered.subpoenas; Y Y - - job_pack.pub_recruitment - SQL - 0 - 0 - Y - Y - N - - - SQL - Jobcountry - 0 - 0 - Y - Y - N - - - Jobcountry - Jobregion - 0 - 0 - Y - Y - N - - - Jobregion - Success - 0 - 0 - Y - Y - N - diff --git a/mappings/job_recruitments_all.kjb b/mappings/job_recruitments_all.kjb new file mode 100644 index 0000000..0896478 --- /dev/null +++ b/mappings/job_recruitments_all.kjb @@ -0,0 +1,574 @@ + + + job_recruitments_all + + + + / + - + 2024/08/21 15:46:54.029 + - + 2024/08/21 15:46:54.029 + + + + + + + + + + + + + ID_JOB + Y + ID_JOB + + + CHANNEL_ID + Y + CHANNEL_ID + + + JOBNAME + Y + JOBNAME + + + STATUS + Y + STATUS + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + STARTDATE + Y + STARTDATE + + + ENDDATE + Y + ENDDATE + + + LOGDATE + Y + LOGDATE + + + DEPDATE + Y + DEPDATE + + + REPLAYDATE + Y + REPLAYDATE + + + LOG_FIELD + Y + LOG_FIELD + + + EXECUTING_SERVER + N + EXECUTING_SERVER + + + EXECUTING_USER + N + EXECUTING_USER + + + START_JOB_ENTRY + N + START_JOB_ENTRY + + + CLIENT + N + CLIENT + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + JOBNAME + Y + TRANSNAME + + + JOBENTRYNAME + Y + STEPNAME + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + RESULT + Y + RESULT + + + NR_RESULT_ROWS + Y + NR_RESULT_ROWS + + + NR_RESULT_FILES + Y + NR_RESULT_FILES + + + LOG_FIELD + N + LOG_FIELD + + + COPY_NR + N + COPY_NR + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + LOGGING_OBJECT_TYPE + Y + LOGGING_OBJECT_TYPE + + + OBJECT_NAME + Y + OBJECT_NAME + + + OBJECT_COPY + Y + OBJECT_COPY + + + REPOSITORY_DIRECTORY + Y + REPOSITORY_DIRECTORY + + + FILENAME + Y + FILENAME + + + OBJECT_ID + Y + OBJECT_ID + + + OBJECT_REVISION + Y + OBJECT_REVISION + + + PARENT_CHANNEL_ID + Y + PARENT_CHANNEL_ID + + + ROOT_CHANNEL_ID + Y + ROOT_CHANNEL_ID + + + N + + + + Start + + SPECIAL + + Y + N + N + 0 + 0 + 60 + 12 + 0 + 1 + 1 + N + Y + 0 + 112 + 240 + + + + job_recruitments_region + + JOB + + filename + + ${Internal.Entry.Current.Directory}/\region\job_recruitments_region.kjb + + + N + N + N + N + + + N + N + Nothing + + Y + N + N + N + N + Pentaho local + + Y + + LOAD_DATE + + ${LOAD_DATE} + + + N + N + Y + 0 + 560 + 144 + + + + job_recruitments_country + + JOB + + filename + + ${Internal.Entry.Current.Directory}/\country\job_recruitments_country.kjb + + + N + N + N + N + + + N + N + Nothing + + Y + N + N + N + N + Pentaho local + + Y + + LOAD_DATE + + ${LOAD_DATE} + + + N + N + Y + 0 + 560 + 240 + + + + Success + + SUCCESS + + N + Y + 0 + 768 + 240 + + + + job_recruitments_mil_com + + JOB + + filename + + ${Internal.Entry.Current.Directory}/\mil_com\job_recruitments_mil_com.kjb + + + N + N + N + N + + + N + N + Nothing + + Y + N + N + N + N + Pentaho local + + Y + + N + N + Y + 0 + 560 + 336 + + + + job_recruitment_mil_district + + JOB + + filename + + + + + N + N + N + N + + + N + N + Nothing + + Y + N + N + N + N + Pentaho local + + Y + + N + N + Y + 0 + 560 + 416 + + + + + + job_recruitments_country + Success + 0 + 0 + Y + Y + N + + + job_recruitments_region + Success + 0 + 0 + Y + Y + N + + + Start + job_recruitments_mil_com + 0 + 0 + N + Y + Y + + + job_recruitments_mil_com + Success + 0 + 0 + N + Y + N + + + Start + job_recruitment_mil_district + 0 + 0 + N + Y + Y + + + job_recruitment_mil_district + Success + 0 + 0 + N + Y + N + + + Start + job_recruitments_region + 0 + 0 + Y + Y + Y + + + Start + job_recruitments_country + 0 + 0 + Y + Y + Y + + + + + + + METASTORE.pentaho + + Default Run Configuration + {"namespace":"pentaho","id":"Default Run Configuration","name":"Default Run Configuration","description":"Defines a default run configuration","metaStoreName":null} + + + + {"_":"Embedded MetaStore Elements","namespace":"pentaho","type":"Default Run Configuration"} + + Pentaho local + {"children":[{"children":[],"id":"server","value":null},{"children":[],"id":"clustered","value":"N"},{"children":[],"id":"name","value":"Pentaho local"},{"children":[],"id":"description","value":null},{"children":[],"id":"pentaho","value":"N"},{"children":[],"id":"readOnly","value":"Y"},{"children":[],"id":"sendResources","value":"N"},{"children":[],"id":"logRemoteExecutionLocally","value":"N"},{"children":[],"id":"remote","value":"N"},{"children":[],"id":"local","value":"Y"},{"children":[],"id":"showTransformations","value":"N"}],"id":"Pentaho local","value":null,"name":"Pentaho local","owner":null,"ownerPermissionsList":[]} + + + + diff --git a/mappings/region/job_recruitments_region.kjb b/mappings/region/job_recruitments_region.kjb index 99ec691..8c2004c 100644 --- a/mappings/region/job_recruitments_region.kjb +++ b/mappings/region/job_recruitments_region.kjb @@ -13,7 +13,7 @@ LOAD_DATE - 20241230 + @@ -27,6 +27,57 @@ + + ervu-dashboard + dashboard-dbhost + POSTGRESQL + Native + dashboard-dbname + 1111 + dashboard-dbuser + Encrypted 2daf9dca008c89396af54aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 1111 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + @@ -320,8 +371,8 @@ N Y 0 - 96 - 192 + 176 + 304 @@ -338,9 +389,9 @@ Y N N - N - - + Y + ${Internal.Entry.Current.Directory}/\logs\appeals + txt N N Basic @@ -373,8 +424,8 @@ N Y 0 - 704 - 16 + 880 + 112 @@ -407,17 +458,12 @@ Pentaho local Y - - LOAD_DATE - - ${LOAD_DATE} - N Y 0 - 288 - 192 + 416 + 304 @@ -428,8 +474,8 @@ N Y 0 - 880 - 16 + 1088 + 112 @@ -481,8 +527,8 @@ N Y 0 - 704 - 96 + 880 + 176 @@ -493,8 +539,8 @@ N Y 0 - 912 - 96 + 1088 + 176 @@ -546,8 +592,8 @@ N Y 0 - 704 - 192 + 880 + 240 @@ -558,8 +604,8 @@ N Y 0 - 880 - 192 + 1088 + 240 @@ -611,8 +657,8 @@ N Y 0 - 704 - 272 + 880 + 304 @@ -623,8 +669,8 @@ N Y 0 - 880 - 272 + 1088 + 304 @@ -676,8 +722,8 @@ N Y 0 - 704 - 352 + 880 + 368 @@ -688,8 +734,8 @@ N Y 0 - 880 - 352 + 1088 + 368 @@ -741,7 +787,7 @@ N Y 0 - 704 + 880 432 @@ -753,7 +799,7 @@ N Y 0 - 880 + 1088 432 @@ -806,8 +852,8 @@ N Y 0 - 704 - 512 + 880 + 496 @@ -818,8 +864,8 @@ N Y 0 - 880 - 512 + 1088 + 496 @@ -871,8 +917,8 @@ N Y 0 - 704 - 608 + 880 + 560 @@ -883,8 +929,401 @@ N Y 0 + 1088 + 560 + + + + SQL.md.appeals + + SQL + + DELETE FROM main_dashboard.appeals where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 112 + + + + SQL.md.rec_cam + + SQL + + DELETE FROM main_dashboard.recruitment_campaign where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 176 + + + + SQL.md.tot_reg + + SQL + + DELETE FROM main_dashboard.total_registered where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 240 + + + + SQL.md.wait_reg + + SQL + + DELETE FROM main_dashboard.waiting_registration where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 304 + + + + SQL.rcam.subpoenas + + SQL + + DELETE FROM recruitment_campaign.subpoenas where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 368 + + + + SQL.totreg.mrc + + SQL + + DELETE FROM total_registered.reg_mil_cat where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 432 + + + + SQL.totreg.remreg + + SQL + + DELETE FROM total_registered.removed_registry where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 496 + + + + SQL.totreg.sub + + SQL + + DELETE FROM total_registered.subpoenas where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 560 + + + + total_registered.driver_license(reg) + + TRANS + + filename + + ${Internal.Entry.Current.Directory}/total_registered.driver_license(reg) .ktr + + N + Y + Y + N + N + N + + + N + N + Basic + N + + N + Y + N + N + N + Pentaho local + + Y + + LOAD_DATE + + ${LOAD_DATE} + + + VK_ARRAY + VK_ARRAY_ID + + + + REG_ID + RECRUITMENT_REG_ID + + + + N + Y + 0 880 - 608 + 640 + + + + Success 10 + + SUCCESS + + N + Y + 0 + 1088 + 640 + + + + SQL.totreg.drlic + + SQL + + DELETE FROM total_registered.driver_license where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 640 + + + + total_registered.child_minor(reg) + + TRANS + + filename + + ${Internal.Entry.Current.Directory}/total_registered.child_minor(reg).ktr + + N + Y + Y + N + N + N + + + N + N + Basic + N + + N + Y + N + N + N + Pentaho local + + Y + + LOAD_DATE + + ${LOAD_DATE} + + + VK_ARRAY + VK_ARRAY_ID + + + + REG_ID + RECRUITMENT_REG_ID + + + + N + Y + 0 + 880 + 736 + + + + Success 11 + + SUCCESS + + N + Y + 0 + 1088 + 736 + + + + SQL.totreg.chmi 2 + + SQL + + DELETE FROM total_registered.child_minor where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 736 + + + + total_registered.age(reg) + + TRANS + + filename + + ${Internal.Entry.Current.Directory}/total_registered.age(reg).ktr + + N + Y + Y + N + N + N + + + N + N + Basic + N + + N + Y + N + N + N + Pentaho local + + Y + + LOAD_DATE + + ${LOAD_DATE} + + + VK_ARRAY + VK_ARRAY_ID + + + + REG_ID + RECRUITMENT_REG_ID + + + + N + Y + 0 + 880 + 816 + + + + Success 12 + + SUCCESS + + N + Y + 0 + 1088 + 816 + + + + SQL.totreg.age + + SQL + + DELETE FROM total_registered.age where recruitment_id in ('48', '62', '65') and recording_date = current_date + F + F + + F + ervu-dashboard + N + Y + 0 + 656 + 816 @@ -961,6 +1400,150 @@ Y N + + select_recruitments_region(reg) + SQL.md.appeals + 0 + 0 + Y + Y + N + + + SQL.md.appeals + main_dashboard.appeals(reg) + 0 + 0 + Y + Y + N + + + select_recruitments_region(reg) + SQL.md.rec_cam + 0 + 0 + Y + Y + N + + + SQL.md.rec_cam + main_dashboard.recruitment_campaign(reg) + 0 + 0 + Y + Y + N + + + select_recruitments_region(reg) + SQL.md.tot_reg + 0 + 0 + Y + Y + N + + + SQL.md.tot_reg + main_dashboard.total_registered(reg) + 0 + 0 + Y + Y + N + + + select_recruitments_region(reg) + SQL.md.wait_reg + 0 + 0 + Y + Y + N + + + SQL.md.wait_reg + main_dashboard.waiting_registration(reg) + 0 + 0 + Y + Y + N + + + select_recruitments_region(reg) + SQL.rcam.subpoenas + 0 + 0 + Y + Y + N + + + SQL.rcam.subpoenas + recruitment_campaign.subpoenas(reg) + 0 + 0 + Y + Y + N + + + select_recruitments_region(reg) + SQL.totreg.mrc + 0 + 0 + Y + Y + N + + + SQL.totreg.mrc + total_registered.reg_mil_cat(reg) + 0 + 0 + Y + Y + N + + + select_recruitments_region(reg) + SQL.totreg.remreg + 0 + 0 + Y + Y + N + + + SQL.totreg.remreg + total_registered.removed_registry(reg) + 0 + 0 + Y + Y + N + + + select_recruitments_region(reg) + SQL.totreg.sub + 0 + 0 + Y + Y + N + + + SQL.totreg.sub + total_registered.subpoenas(reg) + 0 + 0 + Y + Y + N + Start select_recruitments_region(reg) @@ -972,73 +1555,82 @@ select_recruitments_region(reg) - main_dashboard.appeals(reg) + SQL.totreg.drlic 0 0 - Y + N + Y + N + + + SQL.totreg.drlic + total_registered.driver_license(reg) + 0 + 0 + N + Y + N + + + total_registered.driver_license(reg) + Success 10 + 0 + 0 + N Y N select_recruitments_region(reg) - main_dashboard.recruitment_campaign(reg) + SQL.totreg.chmi 2 0 0 - Y + N + Y + N + + + SQL.totreg.chmi 2 + total_registered.child_minor(reg) + 0 + 0 + N + Y + N + + + total_registered.child_minor(reg) + Success 11 + 0 + 0 + N Y N select_recruitments_region(reg) - main_dashboard.total_registered(reg) + SQL.totreg.age 0 0 - Y + N Y N - select_recruitments_region(reg) - main_dashboard.waiting_registration(reg) + SQL.totreg.age + total_registered.age(reg) 0 0 - Y + N Y N - select_recruitments_region(reg) - recruitment_campaign.subpoenas(reg) + total_registered.age(reg) + Success 12 0 0 - Y - Y - N - - - select_recruitments_region(reg) - total_registered.reg_mil_cat(reg) - 0 - 0 - Y - Y - N - - - select_recruitments_region(reg) - total_registered.removed_registry(reg) - 0 - 0 - Y - Y - N - - - select_recruitments_region(reg) - total_registered.subpoenas(reg) - 0 - 0 - Y + N Y N diff --git a/mappings/region/logs/appeals.txt b/mappings/region/logs/appeals.txt new file mode 100644 index 0000000..9aef3cb --- /dev/null +++ b/mappings/region/logs/appeals.txt @@ -0,0 +1,24 @@ +2024/08/30 15:28:29 - main_dashboard.appeals(reg) - Using run configuration [Pentaho local] +2024/08/30 15:28:29 - main_dashboard.appeals(reg) - Using legacy execution engine +2024/08/30 15:28:29 - main_dashboard.appeals(reg) - Dispatching started for transformation [main_dashboard.appeals(reg)] +2024/08/30 15:28:30 - Table input (appeal_document) .0 - Finished reading query, closing connection. +2024/08/30 15:28:30 - Get variables 3 2.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0) +2024/08/30 15:28:30 - Table input (appeal_document) .0 - Finished processing (I=1, O=0, R=0, W=1, U=0, E=0) +2024/08/30 15:28:30 - Select values 3 2.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0) +2024/08/30 15:28:30 - Insert / update (main_dashboard.appeals) 2.0 - Finished processing (I=1, O=1, R=1, W=1, U=0, E=0) +2024/08/30 15:28:30 - main_dashboard.appeals(reg) - Using run configuration [Pentaho local] +2024/08/30 15:28:30 - main_dashboard.appeals(reg) - Using legacy execution engine +2024/08/30 15:28:30 - main_dashboard.appeals(reg) - Dispatching started for transformation [main_dashboard.appeals(reg)] +2024/08/30 15:28:30 - Table input (appeal_document) .0 - Finished reading query, closing connection. +2024/08/30 15:28:30 - Get variables 3 2.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0) +2024/08/30 15:28:30 - Select values 3 2.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0) +2024/08/30 15:28:30 - Table input (appeal_document) .0 - Finished processing (I=1, O=0, R=0, W=1, U=0, E=0) +2024/08/30 15:28:30 - Insert / update (main_dashboard.appeals) 2.0 - Finished processing (I=1, O=1, R=1, W=1, U=0, E=0) +2024/08/30 15:28:30 - main_dashboard.appeals(reg) - Using run configuration [Pentaho local] +2024/08/30 15:28:30 - main_dashboard.appeals(reg) - Using legacy execution engine +2024/08/30 15:28:30 - main_dashboard.appeals(reg) - Dispatching started for transformation [main_dashboard.appeals(reg)] +2024/08/30 15:28:30 - Table input (appeal_document) .0 - Finished reading query, closing connection. +2024/08/30 15:28:30 - Get variables 3 2.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0) +2024/08/30 15:28:30 - Select values 3 2.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0) +2024/08/30 15:28:30 - Table input (appeal_document) .0 - Finished processing (I=1, O=0, R=0, W=1, U=0, E=0) +2024/08/30 15:28:30 - Insert / update (main_dashboard.appeals) 2.0 - Finished processing (I=1, O=1, R=1, W=1, U=0, E=0) diff --git a/mappings/region/main_dashboard.appeals(reg).ktr b/mappings/region/main_dashboard.appeals(reg).ktr index 5181c01..1804152 100644 --- a/mappings/region/main_dashboard.appeals(reg).ktr +++ b/mappings/region/main_dashboard.appeals(reg).ktr @@ -11,7 +11,7 @@ LOAD_DATE - 20240809 + @@ -631,8 +631,8 @@ - 464 - 400 + 672 + 192 Y @@ -649,16 +649,10 @@ ervu-dashboard 100 - N + Y main_dashboard
appeals
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -668,53 +662,48 @@ total_appeals total_appeals - N + Y average_consideration average_consideration - N + Y resolved resolved - N + Y average_rating average_rating - N + Y average_to_face average_to_face - N + Y "average_EPGU" average_epgu - N + Y average_to_face_percent average_to_face_percent - N + Y "average_EPGU_percent" average_epgu_percent - N + Y recruitment_id recruitment_id N - - recording_date - LOAD_DATE - N - @@ -725,8 +714,8 @@ - 832 - 400 + 1024 + 192 Y @@ -804,8 +793,8 @@ - 608 - 400 + 816 + 192 Y @@ -841,8 +830,8 @@ from t1 full outer join t2 on 1 = 1 - 224 - 400 + 448 + 192 Y diff --git a/mappings/region/main_dashboard.recruitment_campaign(reg).ktr b/mappings/region/main_dashboard.recruitment_campaign(reg).ktr index 6d9023d..c48b9f2 100644 --- a/mappings/region/main_dashboard.recruitment_campaign(reg).ktr +++ b/mappings/region/main_dashboard.recruitment_campaign(reg).ktr @@ -731,12 +731,6 @@ main_dashboard recruitment_campaign
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -803,11 +797,6 @@ spring_autumn N
- - recording_date - LOAD_DATE - N - @@ -840,12 +829,6 @@ main_dashboard recruitment_campaign
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -912,11 +895,6 @@ spring_autumn N
- - recording_date - LOAD_DATE - N - diff --git a/mappings/region/main_dashboard.total_registered(reg).ktr b/mappings/region/main_dashboard.total_registered(reg).ktr index 6de5aea..4ab496e 100644 --- a/mappings/region/main_dashboard.total_registered(reg).ktr +++ b/mappings/region/main_dashboard.total_registered(reg).ktr @@ -653,12 +653,6 @@ main_dashboard total_registered
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -668,58 +662,53 @@ total_registered total_count - N + Y "total_registered_M" male_count - N + Y "total_registered_W" female_count - N + Y mobilization_criterion mobilization_criterion - N + Y volunteer_criterion volunteer_criterion - N + Y contract_criterion contract_criterion - N + Y mobilization_criterion_percent mobilization_criterion_percent - N + Y volunteer_criterion_percent volunteer_criterion_percent - N + Y contract_criterion_percent contract_criterion_percent - N + Y recruitment_id recruitment_id N - - recording_date - LOAD_DATE - N -
diff --git a/mappings/region/main_dashboard.waiting_registration(reg).ktr b/mappings/region/main_dashboard.waiting_registration(reg).ktr index 7db4bf5..6559d87 100644 --- a/mappings/region/main_dashboard.waiting_registration(reg).ktr +++ b/mappings/region/main_dashboard.waiting_registration(reg).ktr @@ -653,12 +653,6 @@ main_dashboard waiting_registration
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -668,58 +662,53 @@ waiting_registration waiting_count - N + Y "waiting_registration_M" male_count - N + Y "waiting_registration_W" female_count - N + Y mobilization_criterion mobilization_criterion - N + Y volunteer_criterion volunteer_criterion - N + Y contract_criterion contract_criterion - N + Y mobilization_criterion_percent mobilization_criterion_percent - N + Y volunteer_criterion_percent volunteer_criterion_percent - N + Y contract_criterion_percent contract_criterion_percent - N + Y recruitment_id recruitment_id N - - recording_date - LOAD_DATE - N -
diff --git a/mappings/region/recruitment_campaign.subpoenas(reg).ktr b/mappings/region/recruitment_campaign.subpoenas(reg).ktr index c8d5952..45cfd28 100644 --- a/mappings/region/recruitment_campaign.subpoenas(reg).ktr +++ b/mappings/region/recruitment_campaign.subpoenas(reg).ktr @@ -441,6 +441,57 @@ + + ervu-dashboard + dashboard-dbhost + POSTGRESQL + Native + dashboard-dbname + 1111 + dashboard-dbuser + Encrypted 2daf9dca008c89396af54aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 1111 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + postgres.subpoena subpoena-dbhost @@ -661,18 +712,12 @@ none - postgres.subpoena + ervu-dashboard 100 N recruitment_campaign subpoenas
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -682,67 +727,67 @@ subpoena subpoena - N + Y appeared appeared - N + Y not_appeared not_appeared - N + Y not_ap_good_reason not_ap_good_reason - N + Y introduced_measures introduced_measures - N + Y ap_not_required ap_not_required - N + Y restrictions_applied restrictions_applied - N + Y appeared_percent appeared_percent - N + Y not_appeared_percent not_appeared_percent - N + Y not_ap_good_reason_percent not_ap_good_reason_percent - N + Y ap_not_required_percent ap_not_required_percent - N + Y restrictions_applied_percent restrictions_applied_percent - N + Y introduced_measures_percent introduced_measures_percent - N + Y recruitment_id @@ -752,18 +797,13 @@ rest rest - N + Y spring_autumn spring_autumn N - - recording_date - LOAD_DATE - N -
@@ -790,18 +830,12 @@ none - postgres.subpoena + ervu-dashboard 100 N recruitment_campaign subpoenas
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -811,67 +845,67 @@ subpoena subpoena - N + Y appeared appeared - N + Y not_appeared not_appeared - N + Y not_ap_good_reason not_ap_good_reason - N + Y introduced_measures introduced_measures - N + Y ap_not_required ap_not_required - N + Y restrictions_applied restrictions_applied - N + Y appeared_percent appeared_percent - N + Y not_appeared_percent not_appeared_percent - N + Y not_ap_good_reason_percent not_ap_good_reason_percent - N + Y ap_not_required_percent ap_not_required_percent - N + Y restrictions_applied_percent restrictions_applied_percent - N + Y introduced_measures_percent introduced_measures_percent - N + Y recruitment_id @@ -881,18 +915,13 @@ rest rest - N + Y spring_autumn spring_autumn N - - recording_date - LOAD_DATE - N -
@@ -903,7 +932,7 @@ - 880 + 896 480 Y @@ -953,7 +982,7 @@ - normal + VK_ARRAY @@ -1032,7 +1061,7 @@ - normal + VK_ARRAY diff --git a/mappings/region/total_registered.age(reg).ktr b/mappings/region/total_registered.age(reg).ktr new file mode 100644 index 0000000..a932791 --- /dev/null +++ b/mappings/region/total_registered.age(reg).ktr @@ -0,0 +1,1675 @@ + + + + total_registered.age(reg) + + + + Normal + 0 + / + + + + + + + + + + + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + TRANSNAME + Y + TRANSNAME + + + STATUS + Y + STATUS + + + LINES_READ + Y + LINES_READ + + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + + LINES_UPDATED + Y + LINES_UPDATED + + + + LINES_INPUT + Y + LINES_INPUT + + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + + LINES_REJECTED + Y + LINES_REJECTED + + + + ERRORS + Y + ERRORS + + + STARTDATE + Y + STARTDATE + + + ENDDATE + Y + ENDDATE + + + LOGDATE + Y + LOGDATE + + + DEPDATE + Y + DEPDATE + + + REPLAYDATE + Y + REPLAYDATE + + + LOG_FIELD + Y + LOG_FIELD + + + EXECUTING_SERVER + N + EXECUTING_SERVER + + + EXECUTING_USER + N + EXECUTING_USER + + + CLIENT + N + CLIENT + + + + + +
+ + + + ID_BATCH + Y + ID_BATCH + + + SEQ_NR + Y + SEQ_NR + + + LOGDATE + Y + LOGDATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + INPUT_BUFFER_ROWS + Y + INPUT_BUFFER_ROWS + + + OUTPUT_BUFFER_ROWS + Y + OUTPUT_BUFFER_ROWS + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + LOGGING_OBJECT_TYPE + Y + LOGGING_OBJECT_TYPE + + + OBJECT_NAME + Y + OBJECT_NAME + + + OBJECT_COPY + Y + OBJECT_COPY + + + REPOSITORY_DIRECTORY + Y + REPOSITORY_DIRECTORY + + + FILENAME + Y + FILENAME + + + OBJECT_ID + Y + OBJECT_ID + + + OBJECT_REVISION + Y + OBJECT_REVISION + + + PARENT_CHANNEL_ID + Y + PARENT_CHANNEL_ID + + + ROOT_CHANNEL_ID + Y + ROOT_CHANNEL_ID + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + LOG_FIELD + N + LOG_FIELD + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + METRICS_DATE + Y + METRICS_DATE + + + METRICS_CODE + Y + METRICS_CODE + + + METRICS_DESCRIPTION + Y + METRICS_DESCRIPTION + + + METRICS_SUBJECT + Y + METRICS_SUBJECT + + + METRICS_TYPE + Y + METRICS_TYPE + + + METRICS_VALUE + Y + METRICS_VALUE + + + + + +
+ + 0.0 + 0.0 + + 10000 + 50 + 50 + N + Y + 50000 + Y + + N + 1000 + 100 + + + + + + + local + localhost + 8888 + + cluster + Encrypted 2be98afc86aa7f2e4cb1aa265cd86aac8 + + + + Y + N + + + + + - + 2024/08/02 11:56:22.507 + - + 2024/08/02 11:56:22.507 + H4sIAAAAAAAAAAMAAAAAAAAAAAA= + N + + + + + ervu-dashboard + dashboard-dbhost + POSTGRESQL + Native + dashboard-dbname + 1111 + dashboard-dbuser + Encrypted 2daf9dca008c89396af54aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 1111 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + ervu_person_registry + person-dbhost + POSTGRESQL + Native + person-dbname + 4444 + person-dbuser + Encrypted 2be98afb80fd5818ba554aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 4444 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + + Get variables 3 2 + Select values 3 2 + Y + + + Get variables 3 2 2 + Select values 3 2 2 + Y + + + Get variables 3 2 2 2 + Select values 3 2 2 2 + Y + + + Table input (person_registry) регион/все + Get variables 3 2 + Y + + + Select values 3 2 + Insert / update (total_registered.age) + Y + + + Table input (person_registry) регион/мужчины + Get variables 3 2 2 + Y + + + Select values 3 2 2 + Insert / update (total_registered.age) 2 + Y + + + Table input (person_registry) регион/женщины + Get variables 3 2 2 2 + Y + + + Select values 3 2 2 2 + Insert / update (total_registered.age) 3 + Y + + + + Get variables 3 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + REG_ID + + String + + + + + -1 + -1 + none + + + VK_ARRAY + + String + + + + + -1 + -1 + none + + + + + + + + + + + + 672 + 192 + Y + + + + Get variables 3 2 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + REG_ID + + String + + + + + -1 + -1 + none + + + VK_ARRAY + + String + + + + + -1 + -1 + none + + + + + + + + + + + + 672 + 352 + Y + + + + Get variables 3 2 2 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + REG_ID + + String + + + + + -1 + -1 + none + + + VK_ARRAY + + String + + + + + -1 + -1 + none + + + + + + + + + + + + 672 + 512 + Y + + + + Insert / update (total_registered.age) + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered +
age
+ + REG_ID + recruitment_id + = + + + + "17_yaers" + 17_year_count + Y + + + "18-26_years" + 18-26_year_count + Y + + + "27-30_years" + 27-30_year_count + Y + + + "31-35_years" + 31-35_year_count + Y + + + "36-40_years" + 36-40_year_count + Y + + + "41-45_years" + 41-45_year_count + Y + + + "51+_years" + 41-45_year_count + Y + + + "all_M_W" + gender + N + + + "46-50_years" + 46-50_year_count + Y + + + "17_yaers_percent" + 17_year_percent + Y + + + "18-26_years_percent" + 18-26_year_percent + Y + + + "27-30_years_percent" + 27-30_year_percent + Y + + + "31-35_years_percent" + 31-35_year_percent + Y + + + "36-40_years_percent" + 36-40_year_percent + Y + + + "41-45_years_percent" + 41-45_year_percent + Y + + + "46-50_years_percent" + 46-50_year_percent + Y + + + "51+_years_percent" + 51+_year_percent + Y + + + recruitment_id + recruitment_id + N + + + registered + registered + N + + + + + + + + + + + + 1056 + 192 + Y + + + + Insert / update (total_registered.age) 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered + age
+ + REG_ID + recruitment_id + = + + + + "17_yaers" + 17_year_count + Y + + + "18-26_years" + 18-26_year_count + Y + + + "27-30_years" + 27-30_year_count + Y + + + "31-35_years" + 31-35_year_count + Y + + + "36-40_years" + 36-40_year_count + Y + + + "41-45_years" + 41-45_year_count + Y + + + "51+_years" + 41-45_year_count + Y + + + "all_M_W" + gender + N + + + "46-50_years" + 46-50_year_count + Y + + + "17_yaers_percent" + 17_year_percent + Y + + + "18-26_years_percent" + 18-26_year_percent + Y + + + "27-30_years_percent" + 27-30_year_percent + Y + + + "31-35_years_percent" + 31-35_year_percent + Y + + + "36-40_years_percent" + 36-40_year_percent + Y + + + "41-45_years_percent" + 41-45_year_percent + Y + + + "46-50_years_percent" + 46-50_year_percent + Y + + + "51+_years_percent" + 51+_year_percent + Y + + + recruitment_id + recruitment_id + N + + + registered + registered + N + +
+ + + + + + + + + + 1056 + 352 + Y + +
+ + Insert / update (total_registered.age) 3 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered + age
+ + REG_ID + recruitment_id + = + + + + "17_yaers" + 17_year_count + Y + + + "18-26_years" + 18-26_year_count + Y + + + "27-30_years" + 27-30_year_count + Y + + + "31-35_years" + 31-35_year_count + Y + + + "36-40_years" + 36-40_year_count + Y + + + "41-45_years" + 41-45_year_count + Y + + + "51+_years" + 41-45_year_count + Y + + + "all_M_W" + gender + N + + + "46-50_years" + 46-50_year_count + Y + + + "17_yaers_percent" + 17_year_percent + Y + + + "18-26_years_percent" + 18-26_year_percent + Y + + + "27-30_years_percent" + 27-30_year_percent + Y + + + "31-35_years_percent" + 31-35_year_percent + Y + + + "36-40_years_percent" + 36-40_year_percent + Y + + + "41-45_years_percent" + 41-45_year_percent + Y + + + "46-50_years_percent" + 46-50_year_percent + Y + + + "51+_years_percent" + 51+_year_percent + Y + + + recruitment_id + recruitment_id + N + + + registered + registered + N + +
+ + + + + + + + + + 1072 + 512 + Y + +
+ + Select values 3 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + REG_ID + REG_ID + String + -2 + -2 + + false + + + false + + + + + + + + VK_ARRAY + VK_ARRAY + String + -2 + -2 + + false + + + false + + + + + + + + + + + + + + + + + 816 + 192 + Y + + + + Select values 3 2 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + REG_ID + REG_ID + String + -2 + -2 + + false + + + false + + + + + + + + VK_ARRAY + VK_ARRAY + String + -2 + -2 + + false + + + false + + + + + + + + + + + + + + + + + 816 + 352 + Y + + + + Select values 3 2 2 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + REG_ID + REG_ID + String + -2 + -2 + + false + + + false + + + + + + + + VK_ARRAY + VK_ARRAY + String + -2 + -2 + + false + + + false + + + + + + + + + + + + + + + + + 816 + 512 + Y + + + + Table input (person_registry) регион/все + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH total_count AS ( + SELECT COUNT(*) AS total + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') +), +age_counts AS ( + SELECT + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) = 17) AS "17_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 18 AND 26) AS "18-26_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 27 AND 30) AS "27-30_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 31 AND 35) AS "31-35_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 36 AND 40) AS "36-40_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 41 AND 45) AS "41-45_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 46 AND 50) AS "46-50_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) >= 51) AS "51+_year_count" + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') +) +SELECT + age_counts."17_year_count", + ROUND((age_counts."17_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "17_year_percent", + + age_counts."18-26_year_count", + ROUND((age_counts."18-26_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "18-26_year_percent", + + age_counts."27-30_year_count", + ROUND((age_counts."27-30_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "27-30_year_percent", + + age_counts."31-35_year_count", + ROUND((age_counts."31-35_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "31-35_year_percent", + + age_counts."36-40_year_count", + ROUND((age_counts."36-40_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "36-40_year_percent", + + age_counts."41-45_year_count", + ROUND((age_counts."41-45_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "41-45_year_percent", + + age_counts."46-50_year_count", + ROUND((age_counts."46-50_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "46-50_year_percent", + + age_counts."51+_year_count", + ROUND((age_counts."51+_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "51+_year_percent", + + '${REG_ID}' as recruitment_id, + 'ALL' as gender, + 'true' as registered + +FROM age_counts, total_count; + 0 + + N + Y + N + + + + + + + + + + 432 + 192 + Y + + + + Table input (person_registry) регион/женщины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH total_count AS ( + SELECT COUNT(*) AS total + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.gender = 'FEMALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') +), +age_counts AS ( + SELECT + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) = 17) AS "17_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 18 AND 26) AS "18-26_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 27 AND 30) AS "27-30_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 31 AND 35) AS "31-35_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 36 AND 40) AS "36-40_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 41 AND 45) AS "41-45_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 46 AND 50) AS "46-50_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) >= 51) AS "51+_year_count" + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.gender = 'FEMALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') +) +SELECT + age_counts."17_year_count", + ROUND((age_counts."17_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "17_year_percent", + + age_counts."18-26_year_count", + ROUND((age_counts."18-26_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "18-26_year_percent", + + age_counts."27-30_year_count", + ROUND((age_counts."27-30_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "27-30_year_percent", + + age_counts."31-35_year_count", + ROUND((age_counts."31-35_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "31-35_year_percent", + + age_counts."36-40_year_count", + ROUND((age_counts."36-40_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "36-40_year_percent", + + age_counts."41-45_year_count", + ROUND((age_counts."41-45_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "41-45_year_percent", + + age_counts."46-50_year_count", + ROUND((age_counts."46-50_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "46-50_year_percent", + + age_counts."51+_year_count", + ROUND((age_counts."51+_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "51+_year_percent", + + '${REG_ID}' as recruitment_id, + 'W' as gender, + 'true' as registered + +FROM age_counts, total_count; + 0 + + N + Y + N + + + + + + + + + + 416 + 512 + Y + + + + Table input (person_registry) регион/мужчины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH total_count AS ( + SELECT COUNT(*) AS total + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.gender = 'MALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') +), +age_counts AS ( + SELECT + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) = 17) AS "17_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 18 AND 26) AS "18-26_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 27 AND 30) AS "27-30_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 31 AND 35) AS "31-35_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 36 AND 40) AS "36-40_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 41 AND 45) AS "41-45_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) BETWEEN 46 AND 50) AS "46-50_year_count", + COUNT(*) FILTER (WHERE EXTRACT(YEAR FROM AGE(birth_date)) >= 51) AS "51+_year_count" + FROM public.recruits r + join public.recruits_info ri on ri.recruit_id=r.id + WHERE r.gender = 'MALE' AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') +) +SELECT + age_counts."17_year_count", + ROUND((age_counts."17_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "17_year_percent", + + age_counts."18-26_year_count", + ROUND((age_counts."18-26_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "18-26_year_percent", + + age_counts."27-30_year_count", + ROUND((age_counts."27-30_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "27-30_year_percent", + + age_counts."31-35_year_count", + ROUND((age_counts."31-35_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "31-35_year_percent", + + age_counts."36-40_year_count", + ROUND((age_counts."36-40_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "36-40_year_percent", + + age_counts."41-45_year_count", + ROUND((age_counts."41-45_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "41-45_year_percent", + + age_counts."46-50_year_count", + ROUND((age_counts."46-50_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "46-50_year_percent", + + age_counts."51+_year_count", + ROUND((age_counts."51+_year_count" * 100.0) / NULLIF(total_count.total, 0),2) AS "51+_year_percent", + + '${REG_ID}' as recruitment_id, + 'М' as gender, + 'true' as registered + +FROM age_counts, total_count; + 0 + + N + Y + N + + + + + + + + + + 432 + 352 + Y + + + + + + + N + +
diff --git a/mappings/region/total_registered.child_minor(reg).ktr b/mappings/region/total_registered.child_minor(reg).ktr new file mode 100644 index 0000000..a034b5f --- /dev/null +++ b/mappings/region/total_registered.child_minor(reg).ktr @@ -0,0 +1,1613 @@ + + + + total_registered.child_minor(reg) + + + + Normal + 0 + / + + + LOAD_DATE + 20240812 + + + + + + + + + + + + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + TRANSNAME + Y + TRANSNAME + + + STATUS + Y + STATUS + + + LINES_READ + Y + LINES_READ + + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + + LINES_UPDATED + Y + LINES_UPDATED + + + + LINES_INPUT + Y + LINES_INPUT + + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + + LINES_REJECTED + Y + LINES_REJECTED + + + + ERRORS + Y + ERRORS + + + STARTDATE + Y + STARTDATE + + + ENDDATE + Y + ENDDATE + + + LOGDATE + Y + LOGDATE + + + DEPDATE + Y + DEPDATE + + + REPLAYDATE + Y + REPLAYDATE + + + LOG_FIELD + Y + LOG_FIELD + + + EXECUTING_SERVER + N + EXECUTING_SERVER + + + EXECUTING_USER + N + EXECUTING_USER + + + CLIENT + N + CLIENT + + + + + +
+ + + + ID_BATCH + Y + ID_BATCH + + + SEQ_NR + Y + SEQ_NR + + + LOGDATE + Y + LOGDATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + INPUT_BUFFER_ROWS + Y + INPUT_BUFFER_ROWS + + + OUTPUT_BUFFER_ROWS + Y + OUTPUT_BUFFER_ROWS + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + LOGGING_OBJECT_TYPE + Y + LOGGING_OBJECT_TYPE + + + OBJECT_NAME + Y + OBJECT_NAME + + + OBJECT_COPY + Y + OBJECT_COPY + + + REPOSITORY_DIRECTORY + Y + REPOSITORY_DIRECTORY + + + FILENAME + Y + FILENAME + + + OBJECT_ID + Y + OBJECT_ID + + + OBJECT_REVISION + Y + OBJECT_REVISION + + + PARENT_CHANNEL_ID + Y + PARENT_CHANNEL_ID + + + ROOT_CHANNEL_ID + Y + ROOT_CHANNEL_ID + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + LOG_FIELD + N + LOG_FIELD + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + METRICS_DATE + Y + METRICS_DATE + + + METRICS_CODE + Y + METRICS_CODE + + + METRICS_DESCRIPTION + Y + METRICS_DESCRIPTION + + + METRICS_SUBJECT + Y + METRICS_SUBJECT + + + METRICS_TYPE + Y + METRICS_TYPE + + + METRICS_VALUE + Y + METRICS_VALUE + + + + + +
+ + 0.0 + 0.0 + + 10000 + 50 + 50 + N + Y + 50000 + Y + + N + 1000 + 100 + + + + + + + local + localhost + 8888 + + cluster + Encrypted 2be98afc86aa7f2e4cb1aa265cd86aac8 + + + + Y + N + + + + + - + 2024/08/02 11:56:22.507 + - + 2024/08/02 11:56:22.507 + H4sIAAAAAAAAAAMAAAAAAAAAAAA= + N + + + + + ervu-dashboard + dashboard-dbhost + POSTGRESQL + Native + dashboard-dbname + 1111 + dashboard-dbuser + Encrypted 2daf9dca008c89396af54aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 1111 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + ervu_person_registry + person-dbhost + POSTGRESQL + Native + person-dbname + 4444 + person-dbuser + Encrypted 2be98afb80fd5818ba554aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 4444 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + + Get variables 4 2 + Select values 4 2 + Y + + + Table input (person_registry)регион/все + Get variables 4 2 + Y + + + Select values 4 2 + Insert / update (total_registered.child_minor) + Y + + + Get variables 4 2 2 + Select values 4 2 2 + Y + + + Select values 4 2 2 + Insert / update (total_registered.child_minor) 2 + Y + + + Table input (person_registry)регион/мужчины + Get variables 4 2 2 + Y + + + Get variables 4 2 2 2 + Select values 4 2 2 2 + Y + + + Select values 4 2 2 2 + Insert / update (total_registered.child_minor) 2 2 + Y + + + Table input (person_registry)регион/женщины + Get variables 4 2 2 2 + Y + + + + Get variables 4 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + VK_ARRAY + + String + + + + + -1 + -1 + none + + + REG_ID + + String + + + + + -1 + -1 + none + + + + + + + + + + + + 496 + 96 + Y + + + + Get variables 4 2 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + VK_ARRAY + + String + + + + + -1 + -1 + none + + + REG_ID + + String + + + + + -1 + -1 + none + + + + + + + + + + + + 496 + 192 + Y + + + + Get variables 4 2 2 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + VK_ARRAY + + String + + + + + -1 + -1 + none + + + REG_ID + + String + + + + + -1 + -1 + none + + + + + + + + + + + + 496 + 288 + Y + + + + Insert / update (total_registered.child_minor) + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + N + + total_registered +
child_minor
+ + REG_ID + recruitment_id + = + + + + no_child + no_children + Y + + + "1_child" + one_child + Y + + + "2_child" + two_children + Y + + + "3_child" + three_children + Y + + + "4_more_child" + four_or_more_children + Y + + + "all_M_W" + gender + N + + + no_child_percent + no_children_percent + Y + + + "1_child_percent" + one_child_percent + Y + + + "2_child_percent" + two_children_percent + Y + + + "3_child_percent" + three_children_percent + Y + + + "4_more_child_percent" + four_or_more_children_percent + Y + + + recruitment_id + recruitment_id + N + + + + + + + + + + + + 944 + 96 + Y + + + + Insert / update (total_registered.child_minor) 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + N + + total_registered + child_minor
+ + REG_ID + recruitment_id + = + + + + no_child + no_children + Y + + + "1_child" + one_child + Y + + + "2_child" + two_children + Y + + + "3_child" + three_children + Y + + + "4_more_child" + four_or_more_children + Y + + + "all_M_W" + gender + N + + + no_child_percent + no_children_percent + Y + + + "1_child_percent" + one_child_percent + Y + + + "2_child_percent" + two_children_percent + Y + + + "3_child_percent" + three_children_percent + Y + + + "4_more_child_percent" + four_or_more_children_percent + Y + + + recruitment_id + recruitment_id + N + +
+ + + + + + + + + + 944 + 192 + Y + +
+ + Insert / update (total_registered.child_minor) 2 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + N + + total_registered + child_minor
+ + REG_ID + recruitment_id + = + + + + no_child + no_children + Y + + + "1_child" + one_child + Y + + + "2_child" + two_children + Y + + + "3_child" + three_children + Y + + + "4_more_child" + four_or_more_children + Y + + + "all_M_W" + gender + N + + + no_child_percent + no_children_percent + Y + + + "1_child_percent" + one_child_percent + Y + + + "2_child_percent" + two_children_percent + Y + + + "3_child_percent" + three_children_percent + Y + + + "4_more_child_percent" + four_or_more_children_percent + Y + + + recruitment_id + recruitment_id + N + +
+ + + + + + + + + + 944 + 288 + Y + +
+ + Select values 4 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + REG_ID + REG_ID + String + -2 + -2 + + false + + + false + + + + + + + + VK_ARRAY + VK_ARRAY + String + -2 + -2 + + false + + + false + + + + + + + + + + + + + + + + + 688 + 96 + Y + + + + Select values 4 2 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + REG_ID + REG_ID + String + -2 + -2 + + false + + + false + + + + + + + + VK_ARRAY + VK_ARRAY + String + -2 + -2 + + false + + + false + + + + + + + + + + + + + + + + + 688 + 192 + Y + + + + Select values 4 2 2 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + REG_ID + REG_ID + String + -2 + -2 + + false + + + false + + + + + + + + VK_ARRAY + VK_ARRAY + String + -2 + -2 + + false + + + false + + + + + + + + + + + + + + + + + 688 + 288 + Y + + + + Table input (person_registry)регион/все + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH extracted_children AS ( + SELECT + ri.recruit_id, + jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child + FROM + public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + WHERE + jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array' + AND r.vu_current_info->>'isMilitaryRegistered' = 'true' + AND target_recruitment_id = any('${VK_ARRAY}') +), +children_birth_dates AS ( + SELECT + recruit_id, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year + FROM + extracted_children +), +children_count AS ( + SELECT + recruit_id, + COUNT(*) AS children_under_18 + FROM + children_birth_dates + WHERE + AGE(make_date(year, month, day)) < interval '18 years' + GROUP BY + recruit_id +), +final_counts AS ( + SELECT + COALESCE(children_under_18, 0) AS children_count, + COUNT(*) AS num_people + FROM + public.recruits_info ri + LEFT JOIN + children_count cc ON ri.recruit_id = cc.recruit_id + GROUP BY + COALESCE(children_under_18, 0) +), +total_people AS ( + SELECT SUM(num_people) AS total_count + FROM final_counts +) +SELECT + 'ALL' AS gender, + '${REG_ID}' as recruitment_id, + COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children, + COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child, + COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children, + COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children, + COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children, + ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS no_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS one_child_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS two_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS three_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS four_or_more_children_percent +FROM + final_counts; + 0 + + N + Y + N + + + + + + + + + + 256 + 96 + Y + + + + Table input (person_registry)регион/женщины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH extracted_children AS ( + SELECT + ri.recruit_id, + jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child + FROM + public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + WHERE + jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array' + AND r.vu_current_info->>'isMilitaryRegistered' = 'true' + AND r.gender = 'FEMALE' + AND target_recruitment_id = any('${VK_ARRAY}') +), +children_birth_dates AS ( + SELECT + recruit_id, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year + FROM + extracted_children +), +children_count AS ( + SELECT + recruit_id, + COUNT(*) AS children_under_18 + FROM + children_birth_dates + WHERE + AGE(make_date(year, month, day)) < interval '18 years' + GROUP BY + recruit_id +), +final_counts AS ( + SELECT + COALESCE(children_under_18, 0) AS children_count, + COUNT(*) AS num_people + FROM + public.recruits_info ri + LEFT JOIN + children_count cc ON ri.recruit_id = cc.recruit_id + GROUP BY + COALESCE(children_under_18, 0) +), +total_people AS ( + SELECT SUM(num_people) AS total_count + FROM final_counts +) +SELECT + 'W' AS gender, + '${REG_ID}' as recruitment_id, + COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children, + COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child, + COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children, + COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children, + COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children, + ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS no_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS one_child_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS two_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS three_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS four_or_more_children_percent +FROM + final_counts; + 0 + + N + Y + N + + + + + + + + + + 256 + 288 + Y + + + + Table input (person_registry)регион/мужчины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH extracted_children AS ( + SELECT + ri.recruit_id, + jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child + FROM + public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + WHERE + jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array' + AND r.vu_current_info->>'isMilitaryRegistered' = 'true' + AND r.gender = 'MALE' + AND target_recruitment_id = any('${VK_ARRAY}') +), +children_birth_dates AS ( + SELECT + recruit_id, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month, + (child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year + FROM + extracted_children +), +children_count AS ( + SELECT + recruit_id, + COUNT(*) AS children_under_18 + FROM + children_birth_dates + WHERE + AGE(make_date(year, month, day)) < interval '18 years' + GROUP BY + recruit_id +), +final_counts AS ( + SELECT + COALESCE(children_under_18, 0) AS children_count, + COUNT(*) AS num_people + FROM + public.recruits_info ri + LEFT JOIN + children_count cc ON ri.recruit_id = cc.recruit_id + GROUP BY + COALESCE(children_under_18, 0) +), +total_people AS ( + SELECT SUM(num_people) AS total_count + FROM final_counts +) +SELECT + 'M' AS gender, + '${REG_ID}' as recruitment_id, + COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) AS no_children, + COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) AS one_child, + COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) AS two_children, + COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) AS three_children, + COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) AS four_or_more_children, + ROUND(COALESCE(SUM(CASE WHEN children_count = 0 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS no_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 1 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS one_child_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 2 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS two_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count = 3 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS three_children_percent, + ROUND(COALESCE(SUM(CASE WHEN children_count >= 4 THEN num_people ELSE 0 END), 0) * 100.0 / NULLIF((SELECT total_count FROM total_people), 0), 2) AS four_or_more_children_percent +FROM + final_counts; + 0 + + N + Y + N + + + + + + + + + + 256 + 192 + Y + + + + + + + N + +
diff --git a/mappings/region/total_registered.driver_license(reg) .ktr b/mappings/region/total_registered.driver_license(reg) .ktr new file mode 100644 index 0000000..66d37da --- /dev/null +++ b/mappings/region/total_registered.driver_license(reg) .ktr @@ -0,0 +1,1542 @@ + + + + total_registered.driver_license(reg) + + + + Normal + 0 + / + + + LOAD_DATE + 20240829 + + + + + + + + + + + + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + TRANSNAME + Y + TRANSNAME + + + STATUS + Y + STATUS + + + LINES_READ + Y + LINES_READ + + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + + LINES_UPDATED + Y + LINES_UPDATED + + + + LINES_INPUT + Y + LINES_INPUT + + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + + LINES_REJECTED + Y + LINES_REJECTED + + + + ERRORS + Y + ERRORS + + + STARTDATE + Y + STARTDATE + + + ENDDATE + Y + ENDDATE + + + LOGDATE + Y + LOGDATE + + + DEPDATE + Y + DEPDATE + + + REPLAYDATE + Y + REPLAYDATE + + + LOG_FIELD + Y + LOG_FIELD + + + EXECUTING_SERVER + N + EXECUTING_SERVER + + + EXECUTING_USER + N + EXECUTING_USER + + + CLIENT + N + CLIENT + + + + + +
+ + + + ID_BATCH + Y + ID_BATCH + + + SEQ_NR + Y + SEQ_NR + + + LOGDATE + Y + LOGDATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + INPUT_BUFFER_ROWS + Y + INPUT_BUFFER_ROWS + + + OUTPUT_BUFFER_ROWS + Y + OUTPUT_BUFFER_ROWS + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + LOGGING_OBJECT_TYPE + Y + LOGGING_OBJECT_TYPE + + + OBJECT_NAME + Y + OBJECT_NAME + + + OBJECT_COPY + Y + OBJECT_COPY + + + REPOSITORY_DIRECTORY + Y + REPOSITORY_DIRECTORY + + + FILENAME + Y + FILENAME + + + OBJECT_ID + Y + OBJECT_ID + + + OBJECT_REVISION + Y + OBJECT_REVISION + + + PARENT_CHANNEL_ID + Y + PARENT_CHANNEL_ID + + + ROOT_CHANNEL_ID + Y + ROOT_CHANNEL_ID + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + TRANSNAME + Y + TRANSNAME + + + STEPNAME + Y + STEPNAME + + + STEP_COPY + Y + STEP_COPY + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + LOG_FIELD + N + LOG_FIELD + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + METRICS_DATE + Y + METRICS_DATE + + + METRICS_CODE + Y + METRICS_CODE + + + METRICS_DESCRIPTION + Y + METRICS_DESCRIPTION + + + METRICS_SUBJECT + Y + METRICS_SUBJECT + + + METRICS_TYPE + Y + METRICS_TYPE + + + METRICS_VALUE + Y + METRICS_VALUE + + + + + +
+ + 0.0 + 0.0 + + 10000 + 50 + 50 + N + Y + 50000 + Y + + N + 1000 + 100 + + + + + + + local + localhost + 8888 + + cluster + Encrypted 2be98afc86aa7f2e4cb1aa265cd86aac8 + + + + Y + N + + + + + - + 2024/08/02 11:56:22.507 + - + 2024/08/02 11:56:22.507 + H4sIAAAAAAAAAAMAAAAAAAAAAAA= + N + + + + + ervu-dashboard + dashboard-dbhost + POSTGRESQL + Native + dashboard-dbname + 1111 + dashboard-dbuser + Encrypted 2daf9dca008c89396af54aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 1111 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + ervu_person_registry + person-dbhost + POSTGRESQL + Native + person-dbname + 4444 + person-dbuser + Encrypted 2be98afb80fd5818ba554aa72ce93bcc9 + + + + + + FORCE_IDENTIFIERS_TO_LOWERCASE + N + + + FORCE_IDENTIFIERS_TO_UPPERCASE + N + + + IS_CLUSTERED + N + + + PORT_NUMBER + 4444 + + + PRESERVE_RESERVED_WORD_CASE + Y + + + QUOTE_ALL_FIELDS + N + + + SUPPORTS_BOOLEAN_DATA_TYPE + N + + + SUPPORTS_TIMESTAMP_DATA_TYPE + N + + + USE_POOLING + N + + + + + + Get variables 3 2 + Select values 3 2 + Y + + + Select values 3 2 + Insert / update (total_registered.driver_license) 2 + Y + + + Get variables 3 2 2 + Select values 3 2 2 + Y + + + Table input (driver_license) регионы/все + Get variables 3 2 + Y + + + Select values 3 2 2 + Insert / update (total_registered.driver_license) 2 2 + Y + + + Get variables 3 2 2 2 + Select values 3 2 2 2 + Y + + + Table input (person_registry) регионы/мужчины + Get variables 3 2 2 + Y + + + Select values 3 2 2 2 + Insert / update (total_registered.driver_license) 2 2 2 + Y + + + Table input (person_registry) регионы/женщины + Get variables 3 2 2 2 + Y + + + + Get variables 3 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + REG_ID + + String + + + + + -1 + -1 + none + + + VK_ARRAY + + String + + + + + -1 + -1 + none + + + + + + + + + + + + 672 + 192 + Y + + + + Get variables 3 2 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + REG_ID + + String + + + + + -1 + -1 + none + + + VK_ARRAY + + String + + + + + -1 + -1 + none + + + + + + + + + + + + 672 + 352 + Y + + + + Get variables 3 2 2 2 + GetVariable + + Y + + 1 + + none + + + + + LOAD_DATE + ${LOAD_DATE} + Date + yyyyMMdd + + + + -1 + -1 + none + + + REG_ID + + String + + + + + -1 + -1 + none + + + VK_ARRAY + + String + + + + + -1 + -1 + none + + + + + + + + + + + + 672 + 512 + Y + + + + Insert / update (total_registered.driver_license) 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered +
driver_license
+ + REG_ID + recruitment_id + = + + + + "A" + a + Y + + + "B" + b + Y + + + "C" + c + Y + + + "D" + d + Y + + + "E" + e + Y + + + nope + nope + Y + + + "A_repcent" + a_percent + Y + + + "B_repcent" + b_percent + Y + + + "C_repcent" + c_percent + Y + + + "D_repcent" + d_percent + Y + + + "E_repcent" + e_percent + Y + + + "all_M_W" + gender + N + + + recruitment_id + recruitment_id + N + + + + + + + + + + + + 1072 + 192 + Y + + + + Insert / update (total_registered.driver_license) 2 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered + driver_license
+ + REG_ID + recruitment_id + = + + + + "A" + a + Y + + + "B" + b + Y + + + "C" + c + Y + + + "D" + d + Y + + + "E" + e + Y + + + nope + nope + Y + + + "A_repcent" + a_percent + Y + + + "B_repcent" + b_percent + Y + + + "C_repcent" + c_percent + Y + + + "D_repcent" + d_percent + Y + + + "E_repcent" + e_percent + Y + + + "all_M_W" + gender + N + + + recruitment_id + recruitment_id + N + +
+ + + + + + + + + + 1072 + 352 + Y + +
+ + Insert / update (total_registered.driver_license) 2 2 2 + InsertUpdate + + Y + + 1 + + none + + + ervu-dashboard + 100 + Y + + total_registered + driver_license
+ + REG_ID + recruitment_id + = + + + + "A" + a + Y + + + "B" + b + Y + + + "C" + c + Y + + + "D" + d + Y + + + "E" + e + Y + + + nope + nope + Y + + + "A_repcent" + a_percent + Y + + + "B_repcent" + b_percent + Y + + + "C_repcent" + c_percent + Y + + + "D_repcent" + d_percent + Y + + + "E_repcent" + e_percent + Y + + + "all_M_W" + gender + N + + + recruitment_id + recruitment_id + N + +
+ + + + + + + + + + 1072 + 512 + Y + +
+ + Select values 3 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + REG_ID + REG_ID + String + -2 + -2 + + false + + + false + + + + + + + + VK_ARRAY + VK_ARRAY + String + -2 + -2 + + false + + + false + + + + + + + + + + + + + + + + + 816 + 192 + Y + + + + Select values 3 2 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + REG_ID + REG_ID + String + -2 + -2 + + false + + + false + + + + + + + + VK_ARRAY + VK_ARRAY + String + -2 + -2 + + false + + + false + + + + + + + + + + + + + + + + + 816 + 352 + Y + + + + Select values 3 2 2 2 + SelectValues + + Y + + 1 + + none + + + + N + + LOAD_DATE + LOAD_DATE + Date + -2 + -2 + yyyy-MM-dd + false + + + false + + + + + + + + REG_ID + REG_ID + String + -2 + -2 + + false + + + false + + + + + + + + VK_ARRAY + VK_ARRAY + String + -2 + -2 + + false + + + false + + + + + + + + + + + + + + + + + 816 + 512 + Y + + + + Table input (driver_license) регионы/все + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH categorized AS ( + SELECT + r.id, + r.gender, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "A")') AS has_A, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "B")') AS has_B, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "C")') AS has_C, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "D")') AS has_D, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "E")') AS has_E + FROM public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') +), +aggregated AS ( + SELECT + 'ALL' AS gender, + '${REG_ID}' as recruitment_id, + COUNT(*) FILTER (WHERE NOT has_A AND NOT has_B AND NOT has_C AND NOT has_D AND NOT has_E) AS nope, + COUNT(*) FILTER (WHERE has_A) AS a, + COUNT(*) FILTER (WHERE has_B) AS b, + COUNT(*) FILTER (WHERE has_C) AS c, + COUNT(*) FILTER (WHERE has_D) AS d, + COUNT(*) FILTER (WHERE has_E) AS e, + COUNT(*) AS total + FROM categorized +) +SELECT *, + ROUND((nope * 100.0) / NULLIF(total, 0), 2) AS nope_percent, + ROUND((a * 100.0) / NULLIF(total, 0), 2) AS a_percent, + ROUND((b * 100.0) / NULLIF(total, 0), 2) AS b_percent, + ROUND((c * 100.0) / NULLIF(total, 0), 2) AS c_percent, + ROUND((d * 100.0) / NULLIF(total, 0), 2) AS d_percent, + ROUND((e * 100.0) / NULLIF(total, 0), 2) AS e_percent +FROM aggregated; + 0 + + N + Y + N + + + + + + + + + + 448 + 192 + Y + + + + Table input (person_registry) регионы/женщины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH categorized AS ( + SELECT + r.id, + r.gender, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "A")') AS has_A, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "B")') AS has_B, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "C")') AS has_C, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "D")') AS has_D, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "E")') AS has_E + FROM public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') and r.gender = 'FEMALE' +), +aggregated AS ( + SELECT + 'W' AS gender, + '${REG_ID}' as recruitment_id, + COUNT(*) FILTER (WHERE NOT has_A AND NOT has_B AND NOT has_C AND NOT has_D AND NOT has_E) AS nope, + COUNT(*) FILTER (WHERE has_A) AS a, + COUNT(*) FILTER (WHERE has_B) AS b, + COUNT(*) FILTER (WHERE has_C) AS c, + COUNT(*) FILTER (WHERE has_D) AS d, + COUNT(*) FILTER (WHERE has_E) AS e, + COUNT(*) AS total + FROM categorized +) +SELECT *, + ROUND((nope * 100.0) / NULLIF(total, 0), 2) AS nope_percent, + ROUND((a * 100.0) / NULLIF(total, 0), 2) AS a_percent, + ROUND((b * 100.0) / NULLIF(total, 0), 2) AS b_percent, + ROUND((c * 100.0) / NULLIF(total, 0), 2) AS c_percent, + ROUND((d * 100.0) / NULLIF(total, 0), 2) AS d_percent, + ROUND((e * 100.0) / NULLIF(total, 0), 2) AS e_percent +FROM aggregated; + 0 + + N + Y + N + + + + + + + + + + 432 + 512 + Y + + + + Table input (person_registry) регионы/мужчины + TableInput + + Y + + 1 + + none + + + ervu_person_registry + WITH categorized AS ( + SELECT + r.id, + r.gender, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "A")') AS has_A, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "B")') AS has_B, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "C")') AS has_C, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "D")') AS has_D, + jsonb_path_exists(ri.info, '$.svedVoditUdost.voditUdost.svedKat[*]?(@.kategoriya like_regex "E")') AS has_E + FROM public.recruits_info ri + JOIN public.recruits r ON ri.recruit_id = r.id + where r.vu_current_info -> 'isMilitaryRegistered' = 'true' and target_recruitment_id = any('${VK_ARRAY}') and r.gender = 'MALE' +), +aggregated AS ( + SELECT + 'M' AS gender, + '${REG_ID}' as recruitment_id, + COUNT(*) FILTER (WHERE NOT has_A AND NOT has_B AND NOT has_C AND NOT has_D AND NOT has_E) AS nope, + COUNT(*) FILTER (WHERE has_A) AS a, + COUNT(*) FILTER (WHERE has_B) AS b, + COUNT(*) FILTER (WHERE has_C) AS c, + COUNT(*) FILTER (WHERE has_D) AS d, + COUNT(*) FILTER (WHERE has_E) AS e, + COUNT(*) AS total + FROM categorized +) +SELECT *, + ROUND((nope * 100.0) / NULLIF(total, 0), 2) AS nope_percent, + ROUND((a * 100.0) / NULLIF(total, 0), 2) AS a_percent, + ROUND((b * 100.0) / NULLIF(total, 0), 2) AS b_percent, + ROUND((c * 100.0) / NULLIF(total, 0), 2) AS c_percent, + ROUND((d * 100.0) / NULLIF(total, 0), 2) AS d_percent, + ROUND((e * 100.0) / NULLIF(total, 0), 2) AS e_percent +FROM aggregated; + 0 + + N + Y + N + + + + + + + + + + 432 + 352 + Y + + + + + + + N + +
diff --git a/mappings/region/total_registered.reg_mil_cat(reg).ktr b/mappings/region/total_registered.reg_mil_cat(reg).ktr index fe5ce86..2d8dc9b 100644 --- a/mappings/region/total_registered.reg_mil_cat(reg).ktr +++ b/mappings/region/total_registered.reg_mil_cat(reg).ktr @@ -653,12 +653,6 @@ total_registered reg_mil_cat
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -668,17 +662,17 @@ first_reg_17 first_reg_17 - N + Y first_reg_18 first_reg_18 - N + Y "mil_spec_W" mil_spec_w - N + Y recruitment_id @@ -688,58 +682,53 @@ returned_dep_liberty returned_dep_liberty - N + Y punished punished - N + Y received_citizenship received_citizenship - N + Y first_reg_17_percent first_reg_17_percent - N + Y first_reg_18_percent first_reg_18_percent - N + Y returned_dep_liberty_percent returned_dep_liberty_percent - N + Y "mil_spec_W_percent" mil_spec_w_percent - N + Y punished_percent punished_percent - N + Y received_citizenship_percent received_citizenship_percent - N + Y mil_reg mil_reg N - - recording_date - LOAD_DATE - N -
diff --git a/mappings/region/total_registered.removed_registry(reg).ktr b/mappings/region/total_registered.removed_registry(reg).ktr index 47cc462..734bf0a 100644 --- a/mappings/region/total_registered.removed_registry(reg).ktr +++ b/mappings/region/total_registered.removed_registry(reg).ktr @@ -739,78 +739,73 @@ age_limit age_limit - N + Y death death - N + Y removed_registry removed_registry - N + Y deprivation_citizenship deprivation_citizenship - N + Y travel_abroad travel_abroad - N + Y living_abroad travel_abroad - N + Y other other - N + Y deprivation_citizen_percents deprivation_citizen_percents - N + Y age_limit_percent age_limit_percent - N + Y death_percent death_percent - N + Y travel_abroad_percent travel_abroad_percent - N + Y living_abroad_percent living_abroad_percent - N + Y other_percent other_percent - N + Y recruitment_id recruitment_id N - - recording_date - LOAD_DATE - N - diff --git a/mappings/region/total_registered.subpoenas(reg).ktr b/mappings/region/total_registered.subpoenas(reg).ktr index dcf6d7a..e262759 100644 --- a/mappings/region/total_registered.subpoenas(reg).ktr +++ b/mappings/region/total_registered.subpoenas(reg).ktr @@ -731,12 +731,6 @@ total_registered subpoenas
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -746,52 +740,52 @@ subpoena subpoena - N + Y appeared appeared - N + Y average_appeared average_appeared - N + Y not_appeared not_appeared - N + Y not_ap_good_reason not_ap_good_reason - N + Y introduced_measures introduced_measures - N + Y ap_not_required ap_not_required - N + Y electron electron - N + Y paper paper - N + Y restrictions_applied restrictions_applied - N + Y recruitment_id @@ -806,47 +800,42 @@ appeared_percent appeared_percent - N + Y not_appeared_percent not_appeared_percent - N + Y not_ap_good_reason_percent not_ap_good_reason_percent - N + Y ap_not_required_percent ap_not_required_percent - N + Y electron_percent electron_percent - N + Y paper_percent paper_percent - N + Y restrictions_applied_percent restrictions_applied_percent - N + Y introduced_measures_percent introduced_measures_percent - N - - - recording_date - LOAD_DATE - N + Y
@@ -880,12 +869,6 @@ total_registered subpoenas
- - LOAD_DATE - recording_date - = - - REG_ID recruitment_id @@ -895,52 +878,52 @@ subpoena subpoena - N + Y appeared appeared - N + Y average_appeared average_appeared - N + Y not_appeared not_appeared - N + Y not_ap_good_reason not_ap_good_reason - N + Y introduced_measures introduced_measures - N + Y ap_not_required ap_not_required - N + Y electron electron - N + Y paper paper - N + Y restrictions_applied restrictions_applied - N + Y recruitment_id @@ -955,47 +938,42 @@ appeared_percent appeared_percent - N + Y not_appeared_percent not_appeared_percent - N + Y not_ap_good_reason_percent not_ap_good_reason_percent - N + Y ap_not_required_percent ap_not_required_percent - N + Y electron_percent electron_percent - N + Y paper_percent paper_percent - N + Y restrictions_applied_percent restrictions_applied_percent - N + Y introduced_measures_percent introduced_measures_percent - N - - - recording_date - LOAD_DATE - N + Y