правки

This commit is contained in:
Фоат Саляхов 2024-12-03 11:18:01 +03:00
parent 1236b8eb44
commit 60338cae76
2 changed files with 48 additions and 1 deletions

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<changeSet id="0001" author="saliakhov">
<comment>Добавление колонки в таблицу и представление</comment>
<sql>
ALTER TABLE actualization.applications_received_from_epgu ADD COLUMN IF NOT EXISTS count_received_department BIGINT NOT NULL DEFAULT 0;
COMMENT ON COLUMN actualization.applications_received_from_epgu.count_received_department IS 'получено Ведомством';
DROP VIEW IF EXISTS actualization.view_applications_received_from_epgu;
CREATE OR REPLACE VIEW actualization.view_applications_received_from_epgu
AS SELECT applications_received_from_epgu.applications_received_from_epgu_id,
round(applications_received_from_epgu.count_executor_appointed::numeric * 100::numeric / applications_received_from_epgu.count_all::numeric) AS percent_executor_appointed,
round(applications_received_from_epgu.count_executor_not_appointed_expired::numeric * 100::numeric / applications_received_from_epgu.count_all::numeric) AS percent_executor_not_appointed_expired,
round(applications_received_from_epgu.count_executor_not_appointed_on_time::numeric * 100::numeric / applications_received_from_epgu.count_all::numeric) AS percent_executor_not_appointed_on_time,
round(applications_received_from_epgu.count_registered::numeric * 100::numeric / applications_received_from_epgu.count_all::numeric) AS percent_registered,
round(applications_received_from_epgu.count_registration_refusal::numeric * 100::numeric / applications_received_from_epgu.count_all::numeric) AS percent_registration_refusal,
round(applications_received_from_epgu.count_refusal_provide_service::numeric * 100::numeric / applications_received_from_epgu.count_all::numeric) AS percent_refusal_provide_service,
round(applications_received_from_epgu.count_provided::numeric * 100::numeric / applications_received_from_epgu.count_all::numeric) AS percent_provided,
round(applications_received_from_epgu.count_received_department::numeric * 100::numeric / applications_received_from_epgu.count_all::numeric) AS percent_received_department
FROM actualization.applications_received_from_epgu;
</sql>
</changeSet>
</databaseChangeLog>

View file

@ -1488,6 +1488,19 @@
</item>
</value>
</entry>
<entry>
<key>style</key>
<value>
<complex>
<entry>
<key>width</key>
<value>
<simple>"100%"</simple>
</value>
</entry>
</complex>
</value>
</entry>
</properties>
</scripts>
<scripts id="b6068710-0f31-48ec-8e03-c0c1480a40c0"/>
@ -1520,7 +1533,7 @@
<entry>
<key>width</key>
<value>
<simple>null</simple>
<simple>"100%"</simple>
</value>
</entry>
</complex>