fix
This commit is contained in:
parent
a113e854b4
commit
c0a571ffd8
10 changed files with 1084 additions and 155 deletions
300
v1_apache-hop dash mapping/country/appeals.topic_appeal.hpl
Normal file
300
v1_apache-hop dash mapping/country/appeals.topic_appeal.hpl
Normal file
|
|
@ -0,0 +1,300 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>appeals.topic_appeal</name>
|
||||
<name_sync_with_filename>Y</name_sync_with_filename>
|
||||
<description/>
|
||||
<extended_description/>
|
||||
<pipeline_version/>
|
||||
<pipeline_type>Normal</pipeline_type>
|
||||
<parameters>
|
||||
</parameters>
|
||||
<capture_transform_performance>N</capture_transform_performance>
|
||||
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
|
||||
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
|
||||
<created_user>-</created_user>
|
||||
<created_date>2025/01/28 11:14:23.116</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2025/01/28 11:14:23.116</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (subpoena) РФ/осень</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2</from>
|
||||
<to>Select values 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 2 2</from>
|
||||
<to>Insert / update (appeals.topic_appeal)</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (subpoena) РФ/осень</from>
|
||||
<to>Get variables 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<quoteString>N</quoteString>
|
||||
<replace_variables>Y</replace_variables>
|
||||
<set_params>N</set_params>
|
||||
<single_statement>N</single_statement>
|
||||
<sql>DELETE FROM appeals.topic_appeal
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>336</xloc>
|
||||
<yloc>448</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2</name>
|
||||
<type>GetVariable</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<fields>
|
||||
<field>
|
||||
<length>-1</length>
|
||||
<name>REG_ID</name>
|
||||
<precision>-1</precision>
|
||||
<trim_type>none</trim_type>
|
||||
<type>String</type>
|
||||
</field>
|
||||
<field>
|
||||
<length>-1</length>
|
||||
<name>VK_ARRAY</name>
|
||||
<precision>-1</precision>
|
||||
<trim_type>none</trim_type>
|
||||
<type>String</type>
|
||||
</field>
|
||||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>800</xloc>
|
||||
<yloc>448</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (appeals.topic_appeal)</name>
|
||||
<type>InsertUpdate</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>100</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>appeals</schema>
|
||||
<table>topic_appeal</table>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>registration</name>
|
||||
<rename>registration</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>registration_percent</name>
|
||||
<rename>registration_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>sabpoena</name>
|
||||
<rename>sabpoena</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>sabpoena_percent</name>
|
||||
<rename>sabpoena_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>temporary_measures</name>
|
||||
<rename>temporary_measures</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>temporary_measures_percent</name>
|
||||
<rename>temporary_measures_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appear</name>
|
||||
<rename>appear</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1296</xloc>
|
||||
<yloc>448</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 2</name>
|
||||
<type>SelectValues</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<fields>
|
||||
<select_unspecified>N</select_unspecified>
|
||||
<meta>
|
||||
<name>REG_ID</name>
|
||||
<rename>REG_ID</rename>
|
||||
<type>String</type>
|
||||
<length>-2</length>
|
||||
<precision>-2</precision>
|
||||
<conversion_mask/>
|
||||
<date_format_lenient>false</date_format_lenient>
|
||||
<date_format_locale/>
|
||||
<date_format_timezone/>
|
||||
<lenient_string_to_number>false</lenient_string_to_number>
|
||||
<encoding/>
|
||||
<decimal_symbol/>
|
||||
<grouping_symbol/>
|
||||
<currency_symbol/>
|
||||
<storage_type/>
|
||||
</meta>
|
||||
<meta>
|
||||
<name>VK_ARRAY</name>
|
||||
<rename>VK_ARRAY</rename>
|
||||
<type>String</type>
|
||||
<length>-2</length>
|
||||
<precision>-2</precision>
|
||||
<conversion_mask/>
|
||||
<date_format_lenient>false</date_format_lenient>
|
||||
<date_format_locale/>
|
||||
<date_format_timezone/>
|
||||
<lenient_string_to_number>false</lenient_string_to_number>
|
||||
<encoding/>
|
||||
<decimal_symbol/>
|
||||
<grouping_symbol/>
|
||||
<currency_symbol/>
|
||||
<storage_type/>
|
||||
</meta>
|
||||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1008</xloc>
|
||||
<yloc>448</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (subpoena) РФ/осень</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(appear), 0) appear,
|
||||
COALESCE(SUM(registration), 0) registration,
|
||||
COALESCE(SUM(sabpoena), 0) sabpoena,
|
||||
COALESCE(SUM(temporary_measures), 0) temporary_measures,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appear) > 0
|
||||
THEN ROUND((SUM(registration) / SUM(appear) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) registration_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appear) > 0
|
||||
THEN ROUND((SUM(sabpoena) / SUM(appear) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) sabpoena_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appear) > 0
|
||||
THEN ROUND((SUM(temporary_measures) / SUM(appear) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) temporary_measures_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
'Ministry' AS schema
|
||||
FROM appeals.topic_appeal
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>576</xloc>
|
||||
<yloc>448</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
|
|
@ -771,6 +771,54 @@
|
|||
<yloc>544</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>appeals.topic_appeal.hpl</name>
|
||||
<description/>
|
||||
<type>PIPELINE</type>
|
||||
<attributes/>
|
||||
<add_date>N</add_date>
|
||||
<add_time>N</add_time>
|
||||
<clear_files>N</clear_files>
|
||||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/country/appeals.topic_appeal.hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>VK_ARRAY</name>
|
||||
<stream_name>VK_ARRAY_ID</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>REG_ID</name>
|
||||
<stream_name>RECRUITMENT_REG_ID</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
<params_from_previous>Y</params_from_previous>
|
||||
<run_configuration>local</run_configuration>
|
||||
<set_append_logfile>N</set_append_logfile>
|
||||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>464</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>Success 17</name>
|
||||
<description/>
|
||||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>464</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
</actions>
|
||||
<hops>
|
||||
<hop>
|
||||
|
|
@ -1004,6 +1052,20 @@
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>appeals.topic_appeal.hpl</from>
|
||||
<to>Success 17</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>appeals.topic_appeal.hpl</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
</hops>
|
||||
<notepads>
|
||||
</notepads>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<schedulerType>0</schedulerType>
|
||||
<weekDay>1</weekDay>
|
||||
<parallel>N</parallel>
|
||||
<xloc>320</xloc>
|
||||
<xloc>288</xloc>
|
||||
<yloc>240</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
|
|
|
|||
|
|
@ -93,13 +93,11 @@
|
|||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>recruitment_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recording_date</field>
|
||||
<name>recording_date</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>waiting_registration</table>
|
||||
|
|
@ -234,10 +232,12 @@ ids AS (
|
|||
SELECT unnest(string_to_array(trim(both '{}' from '${ARR_MC}'), ','))::uuid AS recruitment_id
|
||||
),
|
||||
last_status as (select recruit_id,
|
||||
max(date_time) filter (where status in ('1', '12.7', '8.2', '8.3')) max_date_time
|
||||
from recruits_history
|
||||
where status in ('1', '12.7', '8.2', '8.3')
|
||||
group by recruit_id),
|
||||
max(rh.date_time) filter (where rh.status in ('1', '12.7', '8.2', '8.3')) max_date_time
|
||||
from recruits_history rh
|
||||
join recruits r on r.id = rh.recruit_id
|
||||
where rh.status in ('1', '12.7', '8.2', '8.3')
|
||||
and r.current_recruitment_id is null
|
||||
group by rh.recruit_id),
|
||||
notregistered as (
|
||||
select
|
||||
distinct rh.recruit_id,
|
||||
|
|
@ -279,7 +279,7 @@ vse AS (
|
|||
r.id in (SELECT recruit_id FROM notregistered) and
|
||||
rh.id in (SELECT recruit_history_id FROM notregistered) and
|
||||
coalesce(r.target_recruitment_id,rh.target_recruitment_id) ::uuid IN (SELECT recruitment_id FROM ids)
|
||||
AND r.current_recruitment_id is null
|
||||
--AND r.current_recruitment_id is null
|
||||
),
|
||||
extracted_children AS (
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -0,0 +1,334 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>appeals.topic_appeal(m_d)</name>
|
||||
<name_sync_with_filename>Y</name_sync_with_filename>
|
||||
<description/>
|
||||
<extended_description/>
|
||||
<pipeline_version/>
|
||||
<pipeline_type>Normal</pipeline_type>
|
||||
<parameters>
|
||||
</parameters>
|
||||
<capture_transform_performance>N</capture_transform_performance>
|
||||
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
|
||||
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
|
||||
<created_user>-</created_user>
|
||||
<created_date>2025/01/28 10:29:54.859</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2025/01/28 10:29:54.859</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (appeals.topic_appeal(m_d))</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 3 2</from>
|
||||
<to>Select values 3 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Insert / update (appeals.topic_appeal)</from>
|
||||
<to>Execute SQL script 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 3 2</from>
|
||||
<to>Insert / update (appeals.topic_appeal)</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (appeals.topic_appeal(m_d))</from>
|
||||
<to>Get variables 3 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<quoteString>N</quoteString>
|
||||
<replace_variables>Y</replace_variables>
|
||||
<set_params>N</set_params>
|
||||
<single_statement>N</single_statement>
|
||||
<sql>DELETE FROM appeals.topic_appeal
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Region'
|
||||
AND recruitment_id = '${MD_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>320</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Execute SQL script 2</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<quoteString>N</quoteString>
|
||||
<replace_variables>Y</replace_variables>
|
||||
<set_params>N</set_params>
|
||||
<single_statement>N</single_statement>
|
||||
<sql>DELETE FROM appeals.topic_appeal
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'MD_LVL'
|
||||
AND recruitment_id = '${MD_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1344</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 3 2</name>
|
||||
<type>GetVariable</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<fields>
|
||||
<field>
|
||||
<length>-1</length>
|
||||
<name>MD_ID</name>
|
||||
<precision>-1</precision>
|
||||
<trim_type>none</trim_type>
|
||||
<type>String</type>
|
||||
</field>
|
||||
<field>
|
||||
<length>-1</length>
|
||||
<name>MD_ARRAY</name>
|
||||
<precision>-1</precision>
|
||||
<trim_type>none</trim_type>
|
||||
<type>String</type>
|
||||
</field>
|
||||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>752</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (appeals.topic_appeal)</name>
|
||||
<type>InsertUpdate</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>100</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>MD_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>appeals</schema>
|
||||
<table>topic_appeal</table>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>registration</name>
|
||||
<rename>registration</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>registration_percent</name>
|
||||
<rename>registration_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>sabpoena</name>
|
||||
<rename>sabpoena</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>sabpoena_percent</name>
|
||||
<rename>sabpoena_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>temporary_measures</name>
|
||||
<rename>temporary_measures</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>temporary_measures_percent</name>
|
||||
<rename>temporary_measures_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appear</name>
|
||||
<rename>appear</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1104</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 3 2</name>
|
||||
<type>SelectValues</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<fields>
|
||||
<select_unspecified>N</select_unspecified>
|
||||
<meta>
|
||||
<name>MD_ID</name>
|
||||
<rename>MD_ID</rename>
|
||||
<type>String</type>
|
||||
<length>-2</length>
|
||||
<precision>-2</precision>
|
||||
<conversion_mask/>
|
||||
<date_format_lenient>false</date_format_lenient>
|
||||
<date_format_locale/>
|
||||
<date_format_timezone/>
|
||||
<lenient_string_to_number>false</lenient_string_to_number>
|
||||
<encoding/>
|
||||
<decimal_symbol/>
|
||||
<grouping_symbol/>
|
||||
<currency_symbol/>
|
||||
<storage_type/>
|
||||
</meta>
|
||||
<meta>
|
||||
<name>MD_ARRAY</name>
|
||||
<rename>MD_ARRAY</rename>
|
||||
<type>String</type>
|
||||
<length>-2</length>
|
||||
<precision>-2</precision>
|
||||
<conversion_mask/>
|
||||
<date_format_lenient>false</date_format_lenient>
|
||||
<date_format_locale/>
|
||||
<date_format_timezone/>
|
||||
<lenient_string_to_number>false</lenient_string_to_number>
|
||||
<encoding/>
|
||||
<decimal_symbol/>
|
||||
<grouping_symbol/>
|
||||
<currency_symbol/>
|
||||
<storage_type/>
|
||||
</meta>
|
||||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>896</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (appeals.topic_appeal(m_d))</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(appear), 0) appear,
|
||||
COALESCE(SUM(registration), 0) registration,
|
||||
COALESCE(SUM(sabpoena), 0) sabpoena,
|
||||
COALESCE(SUM(temporary_measures), 0) temporary_measures,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appear) > 0
|
||||
THEN ROUND((SUM(registration) / SUM(appear) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) registration_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appear) > 0
|
||||
THEN ROUND((SUM(sabpoena) / SUM(appear) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) sabpoena_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appear) > 0
|
||||
THEN ROUND((SUM(temporary_measures) / SUM(appear) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) temporary_measures_percent,
|
||||
'${MD_ID}' AS recruitment_id,
|
||||
'Region' AS schema
|
||||
FROM appeals.topic_appeal
|
||||
WHERE recruitment_id = ANY ('${MD_ARRAY}')
|
||||
AND schema = 'Organization'
|
||||
AND recording_date = CURRENT_DATE;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>528</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
|
|
@ -746,15 +746,19 @@
|
|||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/mil_district/appeals.reasons_appeal(m_d).hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>MD_ARRAY</name>
|
||||
<stream_name>MD_ARRAY_ID</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>MD_ID</name>
|
||||
<stream_name>RECRUITMENT_MD_ID</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
|
|
@ -778,6 +782,54 @@
|
|||
<yloc>624</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>appeals.topic_appeal(m_d).hpl</name>
|
||||
<description/>
|
||||
<type>PIPELINE</type>
|
||||
<attributes/>
|
||||
<add_date>N</add_date>
|
||||
<add_time>N</add_time>
|
||||
<clear_files>N</clear_files>
|
||||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/mil_district/appeals.topic_appeal(m_d).hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>MD_ARRAY</name>
|
||||
<stream_name>MD_ARRAY_ID</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>MD_ID</name>
|
||||
<stream_name>RECRUITMENT_MD_ID</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
<params_from_previous>Y</params_from_previous>
|
||||
<run_configuration>local</run_configuration>
|
||||
<set_append_logfile>N</set_append_logfile>
|
||||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1296</xloc>
|
||||
<yloc>544</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>Success 17</name>
|
||||
<description/>
|
||||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1552</xloc>
|
||||
<yloc>544</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
</actions>
|
||||
<hops>
|
||||
<hop>
|
||||
|
|
@ -1011,6 +1063,20 @@
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>appeals.topic_appeal(m_d).hpl</from>
|
||||
<to>Success 17</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>job_get_rows_mildis.hwf</from>
|
||||
<to>appeals.topic_appeal(m_d).hpl</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
</hops>
|
||||
<notepads>
|
||||
</notepads>
|
||||
|
|
|
|||
|
|
@ -25,26 +25,11 @@
|
|||
<to>Table input (appeal_document) регионы</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 3 2</from>
|
||||
<to>Select values 3 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Insert / update (main_dashboard.appeals) 2</from>
|
||||
<to>Execute SQL script 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 3 2</from>
|
||||
<to>Insert / update (main_dashboard.appeals) 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (appeal_document) регионы</from>
|
||||
<to>Get variables 3 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (appeal_document) регионы</from>
|
||||
<to>Insert / update (main_dashboard.appeals) 2</to>
|
||||
|
|
@ -108,46 +93,6 @@ WHERE recording_date = current_date
|
|||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 3 2</name>
|
||||
<type>GetVariable</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<fields>
|
||||
<field>
|
||||
<length>-1</length>
|
||||
<name>REG_ID</name>
|
||||
<precision>-1</precision>
|
||||
<trim_type>none</trim_type>
|
||||
<type>String</type>
|
||||
</field>
|
||||
<field>
|
||||
<length>-1</length>
|
||||
<name>VK_ARRAY</name>
|
||||
<precision>-1</precision>
|
||||
<trim_type>none</trim_type>
|
||||
<type>String</type>
|
||||
</field>
|
||||
<field>
|
||||
<length>-1</length>
|
||||
<name>SCM</name>
|
||||
<precision>-1</precision>
|
||||
<trim_type>none</trim_type>
|
||||
<type>String</type>
|
||||
</field>
|
||||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>816</xloc>
|
||||
<yloc>432</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (main_dashboard.appeals) 2</name>
|
||||
<type>InsertUpdate</type>
|
||||
|
|
@ -166,19 +111,16 @@ WHERE recording_date = current_date
|
|||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>recruitment_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recording_date</field>
|
||||
<name>recording_date</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>appeals</schema>
|
||||
<table>reasons_appeal</table>
|
||||
|
|
@ -245,77 +187,6 @@ WHERE recording_date = current_date
|
|||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 3 2</name>
|
||||
<type>SelectValues</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<fields>
|
||||
<select_unspecified>N</select_unspecified>
|
||||
<meta>
|
||||
<name>REG_ID</name>
|
||||
<rename>REG_ID</rename>
|
||||
<type>String</type>
|
||||
<length>-2</length>
|
||||
<precision>-2</precision>
|
||||
<conversion_mask/>
|
||||
<date_format_lenient>false</date_format_lenient>
|
||||
<date_format_locale/>
|
||||
<date_format_timezone/>
|
||||
<lenient_string_to_number>false</lenient_string_to_number>
|
||||
<encoding/>
|
||||
<decimal_symbol/>
|
||||
<grouping_symbol/>
|
||||
<currency_symbol/>
|
||||
<storage_type/>
|
||||
</meta>
|
||||
<meta>
|
||||
<name>VK_ARRAY</name>
|
||||
<rename>VK_ARRAY</rename>
|
||||
<type>String</type>
|
||||
<length>-2</length>
|
||||
<precision>-2</precision>
|
||||
<conversion_mask/>
|
||||
<date_format_lenient>false</date_format_lenient>
|
||||
<date_format_locale/>
|
||||
<date_format_timezone/>
|
||||
<lenient_string_to_number>false</lenient_string_to_number>
|
||||
<encoding/>
|
||||
<decimal_symbol/>
|
||||
<grouping_symbol/>
|
||||
<currency_symbol/>
|
||||
<storage_type/>
|
||||
</meta>
|
||||
<meta>
|
||||
<name>SCM</name>
|
||||
<rename>SCM</rename>
|
||||
<type>String</type>
|
||||
<length>-2</length>
|
||||
<precision>-2</precision>
|
||||
<conversion_mask/>
|
||||
<date_format_lenient>false</date_format_lenient>
|
||||
<date_format_locale/>
|
||||
<date_format_timezone/>
|
||||
<lenient_string_to_number>false</lenient_string_to_number>
|
||||
<encoding/>
|
||||
<decimal_symbol/>
|
||||
<grouping_symbol/>
|
||||
<currency_symbol/>
|
||||
<storage_type/>
|
||||
</meta>
|
||||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>960</xloc>
|
||||
<yloc>432</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (appeal_document) регионы</name>
|
||||
<type>TableInput</type>
|
||||
|
|
@ -334,27 +205,17 @@ WHERE recording_date = current_date
|
|||
ids AS (
|
||||
SELECT unnest(string_to_array(trim(both '{}' from '${ARR_REG}'), ','))::uuid AS recruitment_id
|
||||
),
|
||||
total_appeals AS (
|
||||
SELECT *
|
||||
FROM appeals.appeals_list
|
||||
WHERE
|
||||
region_id::uuid IN (SELECT recruitment_id FROM ids)
|
||||
AND reasons_appeal IN ('Отзыв жалобы', 'Некорректные данные', 'Досыл документов', 'Несогласие с решением')
|
||||
),
|
||||
summary_counts AS (
|
||||
SELECT
|
||||
region_id AS recruitment_id,
|
||||
COUNT(*) AS total_appeals,
|
||||
SUM(CASE WHEN reasons_appeal = 'Некорректные данные' THEN 1 ELSE 0 END) AS incorrect_inf, --некорректные данные
|
||||
SUM(CASE WHEN reasons_appeal = 'Досыл документов' THEN 1 ELSE 0 END) AS sending_documents,
|
||||
SUM(CASE WHEN reasons_appeal = 'Несогласие с решением' THEN 1 ELSE 0 END) AS decision_disagreement,
|
||||
SUM(CASE WHEN reasons_appeal = 'Отзыв жалобы' THEN 1 ELSE 0 END) AS complaint_withdrawal
|
||||
/*
|
||||
sending_documents -- Досыл документов
|
||||
complaint_withdrawal -- Отзыв жалобы
|
||||
decision_disagreement --Несогласие с решением*/
|
||||
FROM total_appeals
|
||||
GROUP BY recruitment_id
|
||||
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,
|
||||
|
|
|
|||
248
v1_apache-hop dash mapping/region/appeals.topic_appeal(reg).hpl
Normal file
248
v1_apache-hop dash mapping/region/appeals.topic_appeal(reg).hpl
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>appeals.topic_appeal(reg)</name>
|
||||
<name_sync_with_filename>Y</name_sync_with_filename>
|
||||
<description/>
|
||||
<extended_description/>
|
||||
<pipeline_version/>
|
||||
<pipeline_type>Normal</pipeline_type>
|
||||
<parameters>
|
||||
</parameters>
|
||||
<capture_transform_performance>N</capture_transform_performance>
|
||||
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
|
||||
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
|
||||
<created_user>-</created_user>
|
||||
<created_date>2025/03/25 13:26:59.797</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2025/03/25 13:26:59.797</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (appeal_document) регионы</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Insert / update (main_dashboard.appeals) 2</from>
|
||||
<to>Execute SQL script 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (appeal_document) регионы</from>
|
||||
<to>Insert / update (main_dashboard.appeals) 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<quoteString>N</quoteString>
|
||||
<replace_variables>N</replace_variables>
|
||||
<set_params>N</set_params>
|
||||
<single_statement>N</single_statement>
|
||||
<sql>DELETE FROM appeals.topic_appeal
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Organization'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>528</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Execute SQL script 2</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<quoteString>N</quoteString>
|
||||
<replace_variables>Y</replace_variables>
|
||||
<set_params>N</set_params>
|
||||
<single_statement>N</single_statement>
|
||||
<sql>DELETE FROM appeals.topic_appeal
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'REG_LVL'
|
||||
</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1312</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (main_dashboard.appeals) 2</name>
|
||||
<type>InsertUpdate</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>100</commit>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>recruitment_id</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recording_date</field>
|
||||
<name>recording_date</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>appeals</schema>
|
||||
<table>topic_appeal</table>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>registration</name>
|
||||
<rename>registration</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>registration_percent</name>
|
||||
<rename>registration_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>sabpoena</name>
|
||||
<rename>sabpoena</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>sabpoena_percent</name>
|
||||
<rename>sabpoena_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>temporary_measures</name>
|
||||
<rename>temporary_measures</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>temporary_measures_percent</name>
|
||||
<rename>temporary_measures_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recording_date</name>
|
||||
<rename>recording_date</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appear</name>
|
||||
<rename>appeal</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1072</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (appeal_document) регионы</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>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,
|
||||
SUM(
|
||||
CASE
|
||||
WHEN subcategory LIKE 'Решение о постановке на воинский учёт%'
|
||||
OR subcategory LIKE 'Отзыв ранее направленной жалобы по воинскому учету%'
|
||||
OR subcategory LIKE 'Досыл документов к ранее направленной жалобе по воинскому учету%'
|
||||
OR subcategory LIKE 'Решение об отказе во внесении изменений в Реестр воинского учёта%'
|
||||
THEN 1 ELSE 0
|
||||
END
|
||||
) AS registration, -- постановка на учет
|
||||
SUM(CASE WHEN subcategory LIKE 'Решение (заключение) призывной комиссии по призыву граждан на военную службу%' THEN 1 ELSE 0 END) AS sabpoena, -- повестки (призыв на службу)
|
||||
SUM(CASE WHEN subcategory LIKE 'Решение об установлении ограничительных мер%' THEN 1 ELSE 0 END) AS temporary_measures -- временные меры
|
||||
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.registration, 0) AS registration,
|
||||
COALESCE(sc.sabpoena, 0) AS sabpoena,
|
||||
COALESCE(sc.temporary_measures, 0) AS temporary_measures,
|
||||
COALESCE(ROUND(sc.registration * 100.0 / NULLIF(sc.total_appeals, 0), 2), 0) AS registration_percent,
|
||||
COALESCE(ROUND(sc.sabpoena * 100.0 / NULLIF(sc.total_appeals, 0), 2), 0) AS sabpoena_percent,
|
||||
COALESCE(ROUND(sc.temporary_measures * 100.0 / NULLIF(sc.total_appeals, 0), 2), 0) AS temporary_measures_percent
|
||||
FROM ids i
|
||||
LEFT JOIN summary_counts sc ON sc.recruitment_id = i.recruitment_id</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>736</xloc>
|
||||
<yloc>320</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
|
|
@ -1365,6 +1365,49 @@ WHERE recording_date = current_date
|
|||
<yloc>1344</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>appeals.topic_appeal(reg).hpl</name>
|
||||
<description/>
|
||||
<type>PIPELINE</type>
|
||||
<attributes/>
|
||||
<add_date>N</add_date>
|
||||
<add_time>N</add_time>
|
||||
<clear_files>N</clear_files>
|
||||
<clear_rows>N</clear_rows>
|
||||
<create_parent_folder>N</create_parent_folder>
|
||||
<exec_per_row>Y</exec_per_row>
|
||||
<filename>${PROJECT_HOME}/region/appeals.topic_appeal(reg).hpl</filename>
|
||||
<logext/>
|
||||
<logfile/>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>ARR_REG</name>
|
||||
<stream_name>ARRAY_REGION</stream_name>
|
||||
<value/>
|
||||
</parameter>
|
||||
<pass_all_parameters>Y</pass_all_parameters>
|
||||
</parameters>
|
||||
<params_from_previous>Y</params_from_previous>
|
||||
<run_configuration>local</run_configuration>
|
||||
<set_append_logfile>N</set_append_logfile>
|
||||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1696</xloc>
|
||||
<yloc>96</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>Success 18</name>
|
||||
<description/>
|
||||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1936</xloc>
|
||||
<yloc>96</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
</actions>
|
||||
<hops>
|
||||
<hop>
|
||||
|
|
@ -1724,6 +1767,20 @@ WHERE recording_date = current_date
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>array_region.hpl</from>
|
||||
<to>appeals.topic_appeal(reg).hpl</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>appeals.topic_appeal(reg).hpl</from>
|
||||
<to>Success 18</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
</hops>
|
||||
<notepads>
|
||||
</notepads>
|
||||
|
|
|
|||
|
|
@ -330,6 +330,7 @@ ids AS (
|
|||
base_data AS (
|
||||
SELECT
|
||||
region_id,
|
||||
solution_type,
|
||||
CASE
|
||||
WHEN incoming_date <> '-' THEN incoming_date::date
|
||||
ELSE NULL
|
||||
|
|
@ -352,7 +353,7 @@ aggregated_data AS (
|
|||
SELECT
|
||||
region_id AS recruitment_id,
|
||||
COUNT(*) AS total_appeals,
|
||||
COUNT(*) FILTER (WHERE fact_end_date IS NOT NULL) AS resolved,
|
||||
COUNT(*) FILTER (WHERE solution_type = 'Решено') AS resolved,
|
||||
-- Среднее время рассмотрения, учитывая возможные NULL для дат
|
||||
ROUND(AVG(CASE
|
||||
WHEN fact_end_date IS NOT NULL AND incoming_date IS NOT NULL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue