ERVU-168
This commit is contained in:
parent
9257318f3b
commit
aecae4c015
1 changed files with 36 additions and 1 deletions
|
|
@ -420,6 +420,13 @@
|
|||
CREATE INDEX IF NOT EXISTS idx_records_info_id_uk_id_ern_date ON init_registration_info.records_info_id_uk_id_ern (info_date);
|
||||
CREATE INDEX IF NOT EXISTS idx_records_info_id_uk_id_ern_recr ON init_registration_info.records_info_id_uk_id_ern (recruitment_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_records_info_id_uk_id_ern_recr_date ON init_registration_info.records_info_id_uk_id_ern (recruitment_id, info_date);
|
||||
|
||||
CREATE OR REPLACE VIEW init_registration_info.view_records_info_id_uk_id_ern AS
|
||||
SELECT
|
||||
round(records_with_id_uk::numeric * 100 / count_all) AS percent_with_id_uk,
|
||||
round(records_without_id_uk::numeric * 100 / count_all) AS percent_without_id_uk,
|
||||
round(records_with_id_ern::numeric * 100 / count_all) AS percent_with_id_ern
|
||||
FROM init_registration_info.records_info_id_uk_id_ern;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS init_registration_info.info_sent_to_lk_epgu
|
||||
|
|
@ -475,6 +482,15 @@
|
|||
CREATE INDEX IF NOT EXISTS idx_decision_formation_status_date ON init_registration_info.decision_formation_status (info_date);
|
||||
CREATE INDEX IF NOT EXISTS idx_decision_formation_status_recr ON init_registration_info.decision_formation_status (recruitment_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_decision_formation_status_recr_date ON init_registration_info.decision_formation_status (recruitment_id, info_date);
|
||||
|
||||
CREATE OR REPLACE VIEW init_registration_info.view_decision_formation_status AS
|
||||
SELECT
|
||||
count_signed + count_suggested + count_waiting_sign + count_refused AS count_all,
|
||||
round(count_signed::numeric * 100 / (count_signed + count_suggested + count_waiting_sign + count_refused)) AS percent_signed,
|
||||
round(count_suggested::numeric * 100 / (count_signed + count_suggested + count_waiting_sign + count_refused)) AS percent_suggested,
|
||||
round(count_waiting_sign::numeric * 100 / (count_signed + count_suggested + count_waiting_sign + count_refused)) AS percent_waiting_sign,
|
||||
round(count_refused::numeric * 100 / (count_signed + count_suggested + count_waiting_sign + count_refused)) AS percent_refused
|
||||
FROM init_registration_info.decision_formation_status;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS init_registration_info.incidents_info
|
||||
|
|
@ -540,7 +556,7 @@
|
|||
WITH (OIDS = FALSE);
|
||||
ALTER TABLE IF EXISTS init_registration_info.applications_received_from_epgu OWNER to ervu_business_metrics;
|
||||
|
||||
COMMENT ON TABLE init_registration_info.applications_received_from_epgu IS 'Первоначальная постановка на учет. Первоначальная постановка на учет по данным из ГИР ВУ';
|
||||
COMMENT ON TABLE init_registration_info.applications_received_from_epgu IS 'Первоначальная постановка на учет. Заявления, поступившие через ЕПГУ';
|
||||
|
||||
COMMENT ON COLUMN init_registration_info.applications_received_from_epgu.count_executor_not_appointed_expired IS 'Не назначен исполнитель свыше допустимых сроков (просрочено)';
|
||||
COMMENT ON COLUMN init_registration_info.applications_received_from_epgu.count_executor_not_appointed_on_time IS 'Не назначен исполнитель в пределах допустимых сроков';
|
||||
|
|
@ -552,6 +568,18 @@
|
|||
CREATE INDEX IF NOT EXISTS idx_applications_received_from_epgu_date ON init_registration_info.applications_received_from_epgu (info_date);
|
||||
CREATE INDEX IF NOT EXISTS idx_applications_received_from_epgu_recr ON init_registration_info.applications_received_from_epgu (recruitment_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_applications_received_from_epgu_recr_date ON init_registration_info.applications_received_from_epgu (recruitment_id, info_date);
|
||||
|
||||
CREATE OR REPLACE VIEW init_registration_info.view_applications_received_from_epgu AS
|
||||
SELECT
|
||||
round(count_executor_appointed::numeric * 100 / count_all) AS percent_executor_appointed,
|
||||
round(count_registered::numeric * 100 / count_all) AS percent_registered,
|
||||
round(count_registration_refusal::numeric * 100 / count_all) AS percent_registration_refusal,
|
||||
round(count_refusal_provide_service::numeric * 100 / count_all) AS percent_refusal_provide_service,
|
||||
round(count_executor_not_appointed_expired::numeric * 100 / count_all) AS percent_executor_not_appointed_expired,
|
||||
round(count_executor_not_appointed_on_time::numeric * 100 / count_all) AS percent_executor_not_appointed_on_time,
|
||||
round(count_received::numeric * 100 / count_all) AS percent_received,
|
||||
round(count_provided::numeric * 100 / count_all) AS percent_provided
|
||||
FROM init_registration_info.applications_received_from_epgu;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS init_registration_info.statuses_decisions_on_epgu
|
||||
|
|
@ -573,6 +601,13 @@
|
|||
CREATE INDEX IF NOT EXISTS idx_statuses_decisions_on_epgu_recr ON init_registration_info.statuses_decisions_on_epgu (recruitment_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_statuses_decisions_on_epgu_recr_date ON init_registration_info.statuses_decisions_on_epgu (recruitment_id, info_date);
|
||||
|
||||
CREATE OR REPLACE VIEW init_registration_info.view_statuses_decisions_on_epgu AS
|
||||
SELECT
|
||||
round(count_signed::numeric * 100 / count_loaded) AS percent_signed,
|
||||
round(count_formed_for_signing::numeric * 100 / count_loaded) AS percent_formed_for_signing
|
||||
FROM init_registration_info.statuses_decisions_on_epgu;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS metrics.criminal_administrative_liability
|
||||
(
|
||||
criminal_administrative_liability_id bigserial NOT NULL PRIMARY KEY,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue