SUPPORT-8925 fix errors

This commit is contained in:
y.kuznetsova 2025-03-04 13:16:31 +03:00
parent 36d8cf1943
commit 567a5f4a7c
12 changed files with 46 additions and 133 deletions

View file

@ -262,10 +262,10 @@ WHERE recording_date = current_date
<execute_each_row>N</execute_each_row> <execute_each_row>N</execute_each_row>
<limit>0</limit> <limit>0</limit>
<sql>SELECT <sql>SELECT
SUM(total_appeals), 0) total_appeals, COALESCE(SUM(total_appeals), 0) total_appeals,
SUM(average_consideration), 0) average_consideration, COALESCE(SUM(average_consideration), 0) average_consideration,
SUM(resolved), 0) resolved, COALESCE(SUM(resolved), 0) resolved,
SUM(not_resolved), 0) not_resolved, COALESCE(SUM(not_resolved), 0) not_resolved,
COALESCE( COALESCE(
CASE CASE
WHEN SUM(total_appeals) > 0 WHEN SUM(total_appeals) > 0
@ -275,7 +275,7 @@ WHERE recording_date = current_date
0 0
) not_resolved_percent, ) not_resolved_percent,
SUM(average_rating) END AS average_rating, COALESCE(SUM(average_rating), 0) average_rating,
COALESCE( COALESCE(
CASE CASE
WHEN SUM(total_appeals) > 0 WHEN SUM(total_appeals) > 0

View file

@ -309,10 +309,7 @@ WHERE recording_date = current_date
COALESCE(SUM("D"), 0) d, COALESCE(SUM("D"), 0) d,
COALESCE(SUM("E"), 0) e, COALESCE(SUM("E"), 0) e,
COALESCE(SUM(nope), 0) nope, COALESCE(SUM(nope), 0) nope,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("A") / SUM(total_count) * 100), 2) THEN ROUND((SUM("A") / SUM(total_count) * 100), 2)
@ -320,10 +317,7 @@ WHERE recording_date = current_date
END, END,
0 0
) a_percent, ) a_percent,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("B") / SUM(total_count) * 100), 2) THEN ROUND((SUM("B") / SUM(total_count) * 100), 2)
@ -331,10 +325,7 @@ WHERE recording_date = current_date
END, END,
0 0
) b_percent, ) b_percent,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("C") / SUM(total_count) * 100), 2) THEN ROUND((SUM("C") / SUM(total_count) * 100), 2)
@ -342,10 +333,7 @@ WHERE recording_date = current_date
END, END,
0 0
) c_percent, ) c_percent,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("D") / SUM(total_count) * 100), 2) THEN ROUND((SUM("D") / SUM(total_count) * 100), 2)
@ -353,10 +341,7 @@ WHERE recording_date = current_date
END, END,
0 0
) d_percent, ) d_percent,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("E") / SUM(total_count) * 100), 2) THEN ROUND((SUM("E") / SUM(total_count) * 100), 2)
@ -364,10 +349,7 @@ WHERE recording_date = current_date
END, END,
0 0
) e_percent, -- нет такой категории ) e_percent, -- нет такой категории
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM(nope) / SUM(total_count) * 100), 2) THEN ROUND((SUM(nope) / SUM(total_count) * 100), 2)

View file

@ -286,10 +286,7 @@ WHERE recording_date = current_date
COALESCE(SUM(average), 0) average_prof, COALESCE(SUM(average), 0) average_prof,
COALESCE(SUM(only_general), 0) only_general, COALESCE(SUM(only_general), 0) only_general,
COALESCE(SUM(no_data), 0) count_nodata, COALESCE(SUM(no_data), 0) count_nodata,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(education_level) > 0 WHEN SUM(education_level) > 0
THEN ROUND((SUM(higher) / SUM(education_level) * 100), 2) THEN ROUND((SUM(higher) / SUM(education_level) * 100), 2)
@ -297,10 +294,7 @@ WHERE recording_date = current_date
END, END,
0 0
) higher_percentage, ) higher_percentage,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(education_level) > 0 WHEN SUM(education_level) > 0
THEN ROUND((SUM(average) / SUM(education_level) * 100), 2) THEN ROUND((SUM(average) / SUM(education_level) * 100), 2)
@ -308,10 +302,7 @@ WHERE recording_date = current_date
END, END,
0 0
) average_prof_percentage, ) average_prof_percentage,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(education_level) > 0 WHEN SUM(education_level) > 0
THEN ROUND((SUM(only_general) / SUM(education_level) * 100), 2) THEN ROUND((SUM(only_general) / SUM(education_level) * 100), 2)
@ -319,10 +310,7 @@ WHERE recording_date = current_date
END, END,
0 0
) only_general_percentage, ) only_general_percentage,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(education_level) > 0 WHEN SUM(education_level) > 0
THEN ROUND((SUM(no_data) / SUM(education_level) * 100), 2) THEN ROUND((SUM(no_data) / SUM(education_level) * 100), 2)
@ -331,7 +319,7 @@ WHERE recording_date = current_date
0 0
) count_nodata_percentage, ) count_nodata_percentage,
COALESCE(SUM(education_level)) total, COALESCE(SUM(education_level), 0) total,
'${REG_ID}' AS recruitment_id, '${REG_ID}' AS recruitment_id,
"all_M_W" AS gender, "all_M_W" AS gender,
convicts, convicts,

View file

@ -275,10 +275,7 @@ WHERE recording_date = current_date
COALESCE(SUM(married), 0) married, COALESCE(SUM(married), 0) married,
COALESCE(SUM(not_married), 0) not_married, COALESCE(SUM(not_married), 0) not_married,
COALESCE(SUM(other), 0) other, COALESCE(SUM(other), 0) other,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(marital_status) > 0 WHEN SUM(marital_status) > 0
THEN ROUND((SUM(married) / SUM(marital_status) * 100), 2) THEN ROUND((SUM(married) / SUM(marital_status) * 100), 2)
@ -286,10 +283,7 @@ WHERE recording_date = current_date
END, END,
0 0
) married_percent, ) married_percent,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(marital_status) > 0 WHEN SUM(marital_status) > 0
THEN ROUND((SUM(not_married) / SUM(marital_status) * 100), 2) THEN ROUND((SUM(not_married) / SUM(marital_status) * 100), 2)
@ -297,10 +291,7 @@ WHERE recording_date = current_date
END, END,
0 0
) not_married_percent, ) not_married_percent,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(marital_status) > 0 WHEN SUM(marital_status) > 0
THEN ROUND((SUM(other) / SUM(marital_status) * 100), 2) THEN ROUND((SUM(other) / SUM(marital_status) * 100), 2)
@ -308,7 +299,7 @@ WHERE recording_date = current_date
END, END,
0 0
) other_percent, ) other_percent,
COALESCE(SUM(marital_status) END AS total, COALESCE(SUM(marital_status), 0) total,
'${REG_ID}' AS recruitment_id, '${REG_ID}' AS recruitment_id,
"all_M_W" AS gender, "all_M_W" AS gender,
convicts, convicts,

View file

@ -282,13 +282,13 @@ WHERE recording_date = current_date
<execute_each_row>N</execute_each_row> <execute_each_row>N</execute_each_row>
<limit>0</limit> <limit>0</limit>
<sql>SELECT <sql>SELECT
SUM(age_limit), 0) age_limit, COALESCE(SUM(age_limit), 0) age_limit,
SUM(death), 0) death, COALESCE(SUM(death), 0) death,
SUM(removed_registry), 0) removed_registry, COALESCE(SUM(removed_registry), 0) removed_registry,
SUM(deprivation_citizenship), 0) deprivation_citizenship, COALESCE(SUM(deprivation_citizenship), 0) deprivation_citizenship,
SUM(travel_abroad), 0) travel_abroad, COALESCE(SUM(travel_abroad), 0) travel_abroad,
SUM(living_abroad), 0) living_abroad, COALESCE(SUM(living_abroad), 0) living_abroad,
SUM(other), 0) other, COALESCE(SUM(other), 0) other,
COALESCE( COALESCE(
CASE CASE
WHEN SUM(removed_registry) > 0 WHEN SUM(removed_registry) > 0

View file

@ -412,8 +412,8 @@ WHERE recording_date = current_date
0 0
) introduced_measures_percent, ) introduced_measures_percent,
COALESCE(SUM(count_not_delivery) END AS count_not_delivery, COALESCE(SUM(count_not_delivery), 0) count_not_delivery,
COALESCE(SUM(appear_date_is_good) END AS appear_date_is_good, COALESCE(SUM(appear_date_is_good), 0) appear_date_is_good,
COALESCE( COALESCE(
CASE CASE

View file

@ -317,10 +317,7 @@ WHERE recording_date = current_date
COALESCE(SUM(new_recruits), 0) new_recruits, COALESCE(SUM(new_recruits), 0) new_recruits,
COALESCE(SUM(postponement_have_right), 0) postponement_have_right, COALESCE(SUM(postponement_have_right), 0) postponement_have_right,
COALESCE(SUM(postponement_granted), 0) postponement_granted, COALESCE(SUM(postponement_granted), 0) postponement_granted,
CASE COALESCE(
WHEN '${MD_ARRAY}' IS NULL OR '${MD_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(subpoenas_sent) > 0 WHEN SUM(subpoenas_sent) > 0
THEN ROUND((SUM(appeared_on_subpoenas) / SUM(subpoenas_sent) * 100), 2) THEN ROUND((SUM(appeared_on_subpoenas) / SUM(subpoenas_sent) * 100), 2)

View file

@ -295,10 +295,7 @@ WHERE recording_date = current_date
COALESCE(SUM(average_consideration), 0) average_consideration, COALESCE(SUM(average_consideration), 0) average_consideration,
COALESCE(SUM(resolved), 0) resolved, COALESCE(SUM(resolved), 0) resolved,
COALESCE(SUM(not_resolved), 0) not_resolved, COALESCE(SUM(not_resolved), 0) not_resolved,
CASE COALESCE(
WHEN '${MD_ARRAY}' IS NULL OR '${MD_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_appeals) > 0 WHEN SUM(total_appeals) > 0
THEN ROUND((SUM(not_resolved) / SUM(total_appeals) * 100), 2) THEN ROUND((SUM(not_resolved) / SUM(total_appeals) * 100), 2)

View file

@ -307,10 +307,7 @@
COALESCE(SUM("41-45_years"), 0) "41-45_year_count", COALESCE(SUM("41-45_years"), 0) "41-45_year_count",
COALESCE(SUM("51+_years"), 0) "51+_year_count", COALESCE(SUM("51+_years"), 0) "51+_year_count",
COALESCE(SUM("46-50_years"), 0) "46-50_year_count", COALESCE(SUM("46-50_years"), 0) "46-50_year_count",
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("17_years") / SUM(total_count) * 100), 2) THEN ROUND((SUM("17_years") / SUM(total_count) * 100), 2)
@ -318,10 +315,7 @@
END, END,
0 0
) "17_year_percent", ) "17_year_percent",
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("18-26_years") / SUM(total_count) * 100), 2) THEN ROUND((SUM("18-26_years") / SUM(total_count) * 100), 2)
@ -329,10 +323,7 @@
END, END,
0 0
) "18-26_year_percent", ) "18-26_year_percent",
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("27-30_years") / SUM(total_count) * 100), 2) THEN ROUND((SUM("27-30_years") / SUM(total_count) * 100), 2)
@ -340,10 +331,7 @@
END, END,
0 0
) "27-30_year_percent", ) "27-30_year_percent",
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("31-35_years") / SUM(total_count) * 100), 2) THEN ROUND((SUM("31-35_years") / SUM(total_count) * 100), 2)
@ -351,10 +339,7 @@
END, END,
0 0
) "31-35_year_percent", ) "31-35_year_percent",
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("36-40_years") / SUM(total_count) * 100), 2) THEN ROUND((SUM("36-40_years") / SUM(total_count) * 100), 2)
@ -362,10 +347,7 @@
END, END,
0 0
) "36-40_year_percent", ) "36-40_year_percent",
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("41-45_years") / SUM(total_count) * 100), 2) THEN ROUND((SUM("41-45_years") / SUM(total_count) * 100), 2)
@ -373,10 +355,7 @@
END, END,
0 0
) "41-45_year_percent", ) "41-45_year_percent",
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("46-50_years") / SUM(total_count) * 100), 2) THEN ROUND((SUM("46-50_years") / SUM(total_count) * 100), 2)
@ -384,10 +363,7 @@
END, END,
0 0
) "46-50_year_percent", ) "46-50_year_percent",
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(total_count) > 0 WHEN SUM(total_count) > 0
THEN ROUND((SUM("51+_years") / SUM(total_count) * 100), 2) THEN ROUND((SUM("51+_years") / SUM(total_count) * 100), 2)

View file

@ -270,8 +270,7 @@
ELSE 0 ELSE 0
END, END,
0 0
) ) no_info_percent,
END AS no_info_percent,
COALESCE(SUM(busyness), 0) total_people, COALESCE(SUM(busyness), 0) total_people,
'${REG_ID}' AS recruitment_id, '${REG_ID}' AS recruitment_id,

View file

@ -88,25 +88,21 @@
<condition>=</condition> <condition>=</condition>
<field>recruitment_id</field> <field>recruitment_id</field>
<name>REG_ID</name> <name>REG_ID</name>
<name2/>
</key> </key>
<key> <key>
<condition>=</condition> <condition>=</condition>
<field>schema</field> <field>schema</field>
<name>schema</name> <name>schema</name>
<name2/>
</key> </key>
<key> <key>
<condition>=</condition> <condition>=</condition>
<field>"all_M_W"</field> <field>"all_M_W"</field>
<name>gender</name> <name>gender</name>
<name2/>
</key> </key>
<key> <key>
<condition>=</condition> <condition>=</condition>
<field>convicts</field> <field>convicts</field>
<name>convicts</name> <name>convicts</name>
<name2/>
</key> </key>
<schema>total_registered</schema> <schema>total_registered</schema>
<table>education_level</table> <table>education_level</table>
@ -256,10 +252,7 @@
COALESCE(SUM(average), 0) average_prof, COALESCE(SUM(average), 0) average_prof,
COALESCE(SUM(only_general), 0) only_general, COALESCE(SUM(only_general), 0) only_general,
COALESCE(SUM(no_data), 0) count_nodata, COALESCE(SUM(no_data), 0) count_nodata,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(education_level) > 0 WHEN SUM(education_level) > 0
THEN ROUND((SUM(higher) / SUM(education_level) * 100), 2) THEN ROUND((SUM(higher) / SUM(education_level) * 100), 2)
@ -267,10 +260,7 @@
END, END,
0 0
) higher_percentage, ) higher_percentage,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(education_level) > 0 WHEN SUM(education_level) > 0
THEN ROUND((SUM(average) / SUM(education_level) * 100), 2) THEN ROUND((SUM(average) / SUM(education_level) * 100), 2)
@ -278,10 +268,7 @@
END, END,
0 0
) average_prof_percentage, ) average_prof_percentage,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(education_level) > 0 WHEN SUM(education_level) > 0
THEN ROUND((SUM(only_general) / SUM(education_level) * 100), 2) THEN ROUND((SUM(only_general) / SUM(education_level) * 100), 2)
@ -289,10 +276,7 @@
END, END,
0 0
) only_general_percentage, ) only_general_percentage,
CASE COALESCE(
WHEN '${VK_ARRAY}' IS NULL OR '${VK_ARRAY}' = ''
THEN 0
ELSE COALESCE(
CASE CASE
WHEN SUM(education_level) > 0 WHEN SUM(education_level) > 0
THEN ROUND((SUM(no_data) / SUM(education_level) * 100), 2) THEN ROUND((SUM(no_data) / SUM(education_level) * 100), 2)
@ -301,7 +285,7 @@
0 0
) count_nodata_percentage, ) count_nodata_percentage,
COALESCE(SUM(education_level) END AS total, COALESCE(SUM(education_level), 0) total,
'${REG_ID}' AS recruitment_id, '${REG_ID}' AS recruitment_id,
"all_M_W" AS gender, "all_M_W" AS gender,
convicts, convicts,

View file

@ -256,8 +256,7 @@
ELSE 0 ELSE 0
END, END,
0 0
) ) not_married_percent,
END AS not_married_percent,
COALESCE( COALESCE(
CASE CASE
WHEN SUM(marital_status) > 0 WHEN SUM(marital_status) > 0