appeals.reasons_appeal(reg)
Y
Normal
N
1000
100
-
2025/01/27 11:51:55.468
-
2025/01/27 11:51:55.468
Execute SQL script
Table input (appeal_document) регионы
Y
Insert / update (main_dashboard.appeals) 2
Execute SQL script 2
Y
Table input (appeal_document) регионы
Insert / update (main_dashboard.appeals) 2
Y
Execute SQL script
ExecSql
N
1
none
ervu-dashboard
N
N
N
N
N
DELETE FROM appeals.reasons_appeal
WHERE recording_date = current_date
AND schema = 'Organization'
512
336
Execute SQL script 2
ExecSql
N
1
none
ervu-dashboard
N
N
Y
N
N
DELETE FROM appeals.reasons_appeal
WHERE recording_date = current_date
AND schema = 'REG_LVL'
1296
336
Insert / update (main_dashboard.appeals) 2
InsertUpdate
Y
1
none
100
ervu-dashboard
=
recruitment_id
recruitment_id
=
schema
schema
=
recording_date
recording_date
appeals
recruitment_id
recruitment_id
N
schema
schema
N
appeal
appeal
Y
incorrect_inf
incorrect_inf
Y
incorrect_inf_percent
incorrect_inf_percent
Y
sending_documents
sending_documents
Y
sending_documents_percent
sending_documents_percent
Y
decision_disagreement
decision_disagreement
Y
decision_disagreement_persent
decision_disagreement_percent
Y
complaint_withdrawal
complaint_withdrawal
Y
complaint_withdrawal_percent
complaint_withdrawal_percent
Y
Y
1056
336
Table input (appeal_document) регионы
TableInput
N
1
none
ervu-dashboard
N
0
WITH
ids AS (
SELECT unnest(string_to_array(trim(both '{}' from '${ARR_REG}'), ','))::uuid AS recruitment_id
),
summary_counts AS (
SELECT
region_id AS recruitment_id,
COUNT(*) AS total_appeals,
COUNT(*) FILTER (WHERE fact ILIKE 'Внесли изменения%') AS incorrect_inf, -- Некорректные данные
COUNT(*) FILTER (WHERE fact ILIKE 'Досыл%') AS sending_documents, -- Досыл документов
COUNT(*) FILTER (WHERE fact ILIKE 'Не согласен%') AS decision_disagreement, -- Несогласие с решением
COUNT(*) FILTER (WHERE fact ILIKE 'Прошу%') AS complaint_withdrawal -- Отзыв жалобы
FROM appeals.appeals_list
WHERE region_id::uuid IN (SELECT recruitment_id FROM ids)
GROUP BY region_id
)
SELECT
'Organization' AS schema,
i.recruitment_id,
current_date AS recording_date,
COALESCE(sc.total_appeals, 0) AS appeal,
COALESCE(sc.incorrect_inf, 0) AS incorrect_inf,
COALESCE(sc.sending_documents, 0) AS sending_documents,
COALESCE(sc.decision_disagreement, 0) AS decision_disagreement,
COALESCE(sc.complaint_withdrawal, 0) AS complaint_withdrawal,
COALESCE(ROUND(sc.incorrect_inf * 100.0 / NULLIF(sc.total_appeals, 0), 2), 0) AS incorrect_inf_percent,
COALESCE(ROUND(sc.sending_documents * 100.0 / NULLIF(sc.total_appeals, 0), 2), 0) AS sending_documents_percent,
COALESCE(ROUND(sc.decision_disagreement * 100.0 / NULLIF(sc.total_appeals, 0), 2), 0) AS decision_disagreement_percent,
COALESCE(ROUND(sc.complaint_withdrawal * 100.0 / NULLIF(sc.total_appeals, 0), 2), 0) AS complaint_withdrawal_percent
FROM ids i
LEFT JOIN summary_counts sc ON sc.recruitment_id = i.recruitment_id;
Y
720
336