свежая версия со стенда
This commit is contained in:
parent
d288a7519e
commit
13aeb606dc
280 changed files with 75366 additions and 20884 deletions
200
mappings/country/appeals.main_profile.hpl
Normal file
200
mappings/country/appeals.main_profile.hpl
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>appeals.main_profile</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>2024/11/11 16:52:36.340</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2024/11/11 16:52:36.340</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input appel-doc</from>
|
||||
<to>Merge join</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input person-reg</from>
|
||||
<to>Merge join</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Merge join</from>
|
||||
<to>Memory group by</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Table input appel-doc</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.appeal-document-service</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
recruit_id
|
||||
FROM public.appeal_document</sql>
|
||||
<variables_active>N</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>480</xloc>
|
||||
<yloc>160</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table output</name>
|
||||
<type>TableOutput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>1000</commit>
|
||||
<fields>
|
||||
</fields>
|
||||
<ignore_errors>N</ignore_errors>
|
||||
<only_when_have_rows>N</only_when_have_rows>
|
||||
<partitioning_daily>N</partitioning_daily>
|
||||
<partitioning_enabled>N</partitioning_enabled>
|
||||
<partitioning_field/>
|
||||
<partitioning_monthly>Y</partitioning_monthly>
|
||||
<return_keys>N</return_keys>
|
||||
<specify_fields>N</specify_fields>
|
||||
<table/>
|
||||
<tablename_field/>
|
||||
<tablename_in_field>N</tablename_in_field>
|
||||
<tablename_in_table>Y</tablename_in_table>
|
||||
<truncate>N</truncate>
|
||||
<use_batch>Y</use_batch>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1104</xloc>
|
||||
<yloc>160</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Memory group by</name>
|
||||
<type>MemoryGroupBy</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<fields>
|
||||
</fields>
|
||||
<give_back_row>N</give_back_row>
|
||||
<group>
|
||||
</group>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>800</xloc>
|
||||
<yloc>160</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Sort rows</name>
|
||||
<type>SortRows</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<compress>N</compress>
|
||||
<directory>${java.io.tmpdir}</directory>
|
||||
<fields>
|
||||
</fields>
|
||||
<sort_prefix>out</sort_prefix>
|
||||
<sort_size>1000000</sort_size>
|
||||
<unique_rows>N</unique_rows>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>960</xloc>
|
||||
<yloc>160</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input person-reg</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu_person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
recruit_id
|
||||
FROM public.recruits r
|
||||
JOIN public.recruits_info ri
|
||||
ON ri.recruit_id = r.id
|
||||
WHERE r.current_recruitment_id IS NOT NULL
|
||||
AND r.target_recruitment_id IS NOT NULL</sql>
|
||||
<variables_active>N</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>480</xloc>
|
||||
<yloc>288</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Merge join</name>
|
||||
<type>MergeJoin</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<join_type>LEFT OUTER</join_type>
|
||||
<keys_1>
|
||||
<key>recruit_id</key>
|
||||
</keys_1>
|
||||
<keys_2>
|
||||
<key>recruit_id</key>
|
||||
</keys_2>
|
||||
<transform1>Table input appel-doc</transform1>
|
||||
<transform2>Table input person-reg</transform2>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>640</xloc>
|
||||
<yloc>160</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
</transform_error_handling>
|
||||
<attributes/>
|
||||
</pipeline>
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<pipeline>
|
||||
<info>
|
||||
<name>appeals.reasons_appeal</name>
|
||||
|
|
@ -6,31 +7,104 @@
|
|||
<extended_description/>
|
||||
<pipeline_version/>
|
||||
<pipeline_type>Normal</pipeline_type>
|
||||
<pipeline_status>0</pipeline_status>
|
||||
<directory>/</directory>
|
||||
<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>2024/08/02 11:56:22.507</created_date>
|
||||
<created_date>2025/01/28 11:14:23.116</created_date>
|
||||
<modified_user>-</modified_user>
|
||||
<modified_date>2024/08/02 11:56:22.507</modified_date>
|
||||
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
|
||||
<is_key_private>N</is_key_private>
|
||||
<modified_date>2025/01/28 11:14:23.116</modified_date>
|
||||
</info>
|
||||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (appeal_document) РФ</from>
|
||||
<to>Insert / update (main_dashboard.appeals)</to>
|
||||
<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.reasons_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>Insert / update (main_dashboard.appeals)</name>
|
||||
<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.reasons_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.reasons_appeal)</name>
|
||||
<type>InsertUpdate</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
|
|
@ -40,39 +114,140 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<commit>100</commit>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<lookup>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>appeals</table>
|
||||
<key>
|
||||
<name>recruitment_id</name>
|
||||
<field>recruitment_id</field>
|
||||
<condition>=</condition>
|
||||
<name2/>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
</key>
|
||||
<value>
|
||||
<name>total_appeals</name>
|
||||
<rename>total_appeals</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
</key>
|
||||
<schema>appeals</schema>
|
||||
<table>reasons_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>appeal</name>
|
||||
<rename>appeal</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>incorrect_inf</name>
|
||||
<rename>incorrect_inf</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>incorrect_inf_percent</name>
|
||||
<rename>incorrect_inf_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>sending_documents</name>
|
||||
<rename>sending_documents</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>sending_documents_percent</name>
|
||||
<rename>sending_documents_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>decision_disagreement</name>
|
||||
<rename>decision_disagreement</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>decision_disagreement_persent</name>
|
||||
<rename>decision_disagreement_persent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>complaint_withdrawal</name>
|
||||
<rename>complaint_withdrawal</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>complaint_withdrawal_percent</name>
|
||||
<rename>complaint_withdrawal_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<cluster_schema/>
|
||||
<GUI>
|
||||
<xloc>752</xloc>
|
||||
<yloc>176</yloc>
|
||||
<draw>Y</draw>
|
||||
<xloc>1296</xloc>
|
||||
<yloc>448</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (appeal_document) РФ</name>
|
||||
<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>
|
||||
|
|
@ -82,33 +257,58 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.appeal-document-service</connection>
|
||||
<sql>WITH
|
||||
t1 AS (
|
||||
SELECT COUNT(*) AS total_appeals
|
||||
FROM public.appeal_document
|
||||
) -- нет причин обжалований
|
||||
SELECT
|
||||
t1.total_appeals,
|
||||
'00' AS recruitment_id,
|
||||
0 AS incorrect_inf,
|
||||
0 AS no_data,
|
||||
0 AS other,
|
||||
0 AS incorrect_inf_percent,
|
||||
0 AS no_data_percent,
|
||||
0 AS other_percent
|
||||
FROM t1;</sql>
|
||||
<limit>0</limit>
|
||||
<lookup/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<variables_active>N</variables_active>
|
||||
<lazy_conversion_active>N</lazy_conversion_active>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(appeal), 0) appeal,
|
||||
COALESCE(SUM(incorrect_inf), 0) incorrect_inf,
|
||||
COALESCE(SUM(sending_documents), 0) sending_documents,
|
||||
COALESCE(SUM(decision_disagreement), 0) decision_disagreement,
|
||||
COALESCE(SUM(complaint_withdrawal), 0) complaint_withdrawal,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appeal) > 0
|
||||
THEN ROUND((SUM(incorrect_inf) / SUM(appeal) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) incorrect_inf_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appeal) > 0
|
||||
THEN ROUND((SUM(sending_documents) / SUM(appeal) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) sending_documents_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appeal) > 0
|
||||
THEN ROUND((SUM(decision_disagreement) / SUM(appeal) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) decision_disagreement_persent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(appeal) > 0
|
||||
THEN ROUND((SUM(complaint_withdrawal) / SUM(appeal) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) complaint_withdrawal_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
'Ministry' AS schema
|
||||
FROM appeals.reasons_appeal
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<cluster_schema/>
|
||||
<GUI>
|
||||
<xloc>400</xloc>
|
||||
<yloc>176</yloc>
|
||||
<draw>Y</draw>
|
||||
<xloc>576</xloc>
|
||||
<yloc>448</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
300
mappings/country/appeals.topic_appeal.hpl
Normal file
300
mappings/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>
|
||||
|
|
@ -37,8 +37,8 @@
|
|||
<schedulerType>0</schedulerType>
|
||||
<weekDay>1</weekDay>
|
||||
<parallel>N</parallel>
|
||||
<xloc>48</xloc>
|
||||
<yloc>576</yloc>
|
||||
<xloc>576</xloc>
|
||||
<yloc>1088</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -71,8 +71,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>48</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>624</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -81,8 +81,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>48</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>624</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -115,8 +115,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>128</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>704</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -125,8 +125,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>128</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>704</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -159,8 +159,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>192</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>768</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -169,8 +169,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>192</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>768</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -203,8 +203,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>272</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>848</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -213,8 +213,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>272</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>848</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -247,8 +247,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>352</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>928</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -257,8 +257,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>352</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>928</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -291,8 +291,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>432</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1008</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -301,8 +301,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>432</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1008</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -335,8 +335,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>512</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1088</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -345,8 +345,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>512</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1088</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -379,8 +379,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>576</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1152</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -389,8 +389,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>576</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1152</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -423,8 +423,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>640</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1216</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -433,8 +433,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>640</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1216</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -467,8 +467,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>704</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1280</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -477,8 +477,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>704</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1280</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -511,8 +511,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>768</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1344</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -521,128 +521,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>768</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.md.appeals</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM main_dashboard.appeals where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>48</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.md.rec_cam</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM main_dashboard.recruitment_campaign where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>128</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.md.tot_reg</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM main_dashboard.total_registered where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>192</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.md.wait_reg</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM main_dashboard.waiting_registration where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>272</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.rcam.subpoenas</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM recruitment_campaign.subpoenas where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>352</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.totreg.mrc</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM total_registered.reg_mil_cat where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>432</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.totreg.remreg</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM total_registered.removed_registry where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>512</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.totreg.sub</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM total_registered.subpoenas where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>576</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1344</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -675,8 +555,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>832</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1408</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -685,68 +565,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>832</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.totreg.marstat</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM total_registered.marital_status where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>832</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.totreg.chimin</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM total_registered.child_minor where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>704</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.totreg.age</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM total_registered.age where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>768</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.totreg.drilic</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM total_registered.driver_license where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>640</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1408</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -779,8 +599,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>912</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1488</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -789,23 +609,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>912</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.totreg.edulev</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM total_registered.education_level where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>912</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1488</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -838,8 +643,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>992</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1568</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -848,23 +653,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>992</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.totreg.busyn</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM total_registered.busyness where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>992</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1568</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -897,8 +687,8 @@
|
|||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>N</parallel>
|
||||
<xloc>960</xloc>
|
||||
<yloc>1056</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>1632</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -907,23 +697,8 @@
|
|||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>1056</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>SQL.reccam.app</name>
|
||||
<description/>
|
||||
<type>SQL</type>
|
||||
<attributes/>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<sendOneStatement>N</sendOneStatement>
|
||||
<sql>DELETE FROM recruitment_campaign.appeals where recruitment_id = '00' and recording_date = current_date</sql>
|
||||
<sqlfromfile>N</sqlfromfile>
|
||||
<useVariableSubstitution>N</useVariableSubstitution>
|
||||
<parallel>N</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>1056</yloc>
|
||||
<xloc>1536</xloc>
|
||||
<yloc>1632</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
|
|
@ -947,20 +722,101 @@
|
|||
<set_append_logfile>N</set_append_logfile>
|
||||
<set_logfile>N</set_logfile>
|
||||
<wait_until_finished>Y</wait_until_finished>
|
||||
<parallel>Y</parallel>
|
||||
<xloc>768</xloc>
|
||||
<yloc>1088</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>appeals.reasons_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.reasons_appeal.hpl</filename>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>VK_ARRAY</name>
|
||||
<stream_name>VK_ARRAY_ID</stream_name>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>REG_ID</name>
|
||||
<stream_name>RECRUITMENT_REG_ID</stream_name>
|
||||
</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>240</xloc>
|
||||
<yloc>576</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>544</yloc>
|
||||
<attributes_hac/>
|
||||
</action>
|
||||
<action>
|
||||
<name>Success 5</name>
|
||||
<description/>
|
||||
<type>SUCCESS</type>
|
||||
<attributes/>
|
||||
<parallel>N</parallel>
|
||||
<xloc>1536</xloc>
|
||||
<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>
|
||||
<loglevel>Basic</loglevel>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>VK_ARRAY</name>
|
||||
<stream_name>VK_ARRAY_ID</stream_name>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>REG_ID</name>
|
||||
<stream_name>RECRUITMENT_REG_ID</stream_name>
|
||||
</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>
|
||||
<from>main_dashboard.appeals</from>
|
||||
<to>Success</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>main_dashboard.recruitment_campaign</from>
|
||||
<to>Success 2</to>
|
||||
|
|
@ -1031,69 +887,6 @@
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.md.appeals</from>
|
||||
<to>main_dashboard.appeals</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.md.rec_cam</from>
|
||||
<to>main_dashboard.recruitment_campaign</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.md.tot_reg</from>
|
||||
<to>main_dashboard.total_registered</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.md.wait_reg</from>
|
||||
<to>main_dashboard.waiting_registration</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.rcam.subpoenas</from>
|
||||
<to>recruitment_campaign.subpoenas</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.totreg.mrc</from>
|
||||
<to>total_registered.reg_mil_cat</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.totreg.remreg</from>
|
||||
<to>total_registered.removed_registry</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.totreg.sub</from>
|
||||
<to>total_registered.subpoenas</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.totreg.marstat</from>
|
||||
<to>total_registered.marital_status</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>total_registered.marital_status</from>
|
||||
<to>Success 13</to>
|
||||
|
|
@ -1101,34 +894,6 @@
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.totreg.chimin</from>
|
||||
<to>total_registered.child_minor</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.totreg.age</from>
|
||||
<to>total_registered.age</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.totreg.drilic</from>
|
||||
<to>total_registered.driver_license</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.totreg.edulev</from>
|
||||
<to>total_registered.education_level</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>total_registered.education_level</from>
|
||||
<to>Success 14</to>
|
||||
|
|
@ -1136,13 +901,6 @@
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.totreg.busyn</from>
|
||||
<to>total_registered.busyness</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>total_registered.busyness</from>
|
||||
<to>Success 15</to>
|
||||
|
|
@ -1150,13 +908,6 @@
|
|||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>SQL.reccam.app</from>
|
||||
<to>recruitment_campaign.appeals</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>recruitment_campaign.appeals</from>
|
||||
<to>Success 16</to>
|
||||
|
|
@ -1172,109 +923,144 @@
|
|||
<unconditional>Y</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.md.appeals</to>
|
||||
<from>main_dashboard.appeals</from>
|
||||
<to>Success</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.md.tot_reg</to>
|
||||
<to>main_dashboard.appeals</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.md.wait_reg</to>
|
||||
<to>main_dashboard.recruitment_campaign</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.md.rec_cam</to>
|
||||
<to>main_dashboard.total_registered</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.rcam.subpoenas</to>
|
||||
<to>main_dashboard.waiting_registration</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.totreg.mrc</to>
|
||||
<to>recruitment_campaign.subpoenas</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.totreg.remreg</to>
|
||||
<to>total_registered.reg_mil_cat</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.totreg.sub</to>
|
||||
<to>total_registered.removed_registry</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.totreg.drilic</to>
|
||||
<to>total_registered.subpoenas</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.totreg.chimin</to>
|
||||
<to>total_registered.driver_license</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.totreg.age</to>
|
||||
<to>total_registered.child_minor</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.totreg.marstat</to>
|
||||
<to>total_registered.age</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.totreg.edulev</to>
|
||||
<to>total_registered.marital_status</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.totreg.busyn</to>
|
||||
<to>total_registered.education_level</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>SQL.reccam.app</to>
|
||||
<to>total_registered.busyness</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>N</evaluation>
|
||||
<unconditional>Y</unconditional>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>recruitment_campaign.appeals</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>appeals.reasons_appeal.hpl</from>
|
||||
<to>Success 5</to>
|
||||
<enabled>Y</enabled>
|
||||
<evaluation>Y</evaluation>
|
||||
<unconditional>N</unconditional>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>select_recruitments_country</from>
|
||||
<to>appeals.reasons_appeal.hpl</to>
|
||||
<enabled>Y</enabled>
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -21,11 +21,6 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (appeal_document) РФ</from>
|
||||
<to>Insert / update (main_dashboard.appeals)</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 3 2</from>
|
||||
<to>Select values 3 2</to>
|
||||
|
|
@ -41,7 +36,41 @@
|
|||
<to>Get variables 3 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (appeal_document) РФ</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>Y</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 main_dashboard.appeals
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>336</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 3 2</name>
|
||||
<type>GetVariable</type>
|
||||
|
|
@ -71,82 +100,8 @@
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>672</xloc>
|
||||
<yloc>176</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (main_dashboard.appeals)</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>
|
||||
</key>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>appeals</table>
|
||||
<value>
|
||||
<name>total_appeals</name>
|
||||
<rename>total_appeals</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_consideration</name>
|
||||
<rename>average_consideration</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>resolved</name>
|
||||
<rename>resolved</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_rating</name>
|
||||
<rename>average_rating</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_to_face</name>
|
||||
<rename>average_to_face</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"average_EPGU"</name>
|
||||
<rename>average_epgu</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_to_face_percent</name>
|
||||
<rename>average_to_face_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"average_EPGU_percent"</name>
|
||||
<rename>average_epgu_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>736</xloc>
|
||||
<yloc>400</yloc>
|
||||
<xloc>768</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -168,6 +123,11 @@
|
|||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
</key>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>appeals</table>
|
||||
<value>
|
||||
|
|
@ -215,12 +175,17 @@
|
|||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1024</xloc>
|
||||
<yloc>176</yloc>
|
||||
<xloc>1120</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -273,8 +238,8 @@
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>816</xloc>
|
||||
<yloc>176</yloc>
|
||||
<xloc>912</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -288,45 +253,43 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.appeal-document-service</connection>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH
|
||||
t1 AS (
|
||||
SELECT COUNT(*) AS total_appeals
|
||||
FROM public.appeal_document
|
||||
),
|
||||
t2 AS (
|
||||
SELECT
|
||||
ROUND(
|
||||
AVG(
|
||||
(TRIM(BOTH '"' FROM (ad.extra_info ->> 'resultDate')::text)::date - ad.appeal_date)
|
||||
),
|
||||
2
|
||||
) AS average_consideration
|
||||
FROM public.appeal_document ad
|
||||
),
|
||||
resolved AS (
|
||||
SELECT COUNT(*) AS resolved
|
||||
FROM public.appeal_document ad
|
||||
WHERE ad.extra_info->>'result' IN ('1', '2')
|
||||
)
|
||||
SELECT
|
||||
t1.total_appeals,
|
||||
t2.average_consideration,
|
||||
r.resolved,
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(total_appeals), 0) total_appeals,
|
||||
COALESCE(SUM(resolved), 0) resolved,
|
||||
COALESCE(SUM(average_consideration), 0) average_consideration,
|
||||
COALESCE(SUM(average_rating), 0) average_rating,
|
||||
COALESCE(SUM(average_to_face), 0) average_to_face,
|
||||
COALESCE(SUM("average_EPGU"), 0) average_epgu,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN (SUM(average_to_face) + SUM("average_EPGU")) > 0
|
||||
THEN ROUND((SUM(average_to_face) / (SUM(average_to_face) + SUM("average_EPGU")) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) average_to_face_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN (SUM(average_to_face) + SUM("average_EPGU")) > 0
|
||||
THEN ROUND((SUM("average_EPGU") / (SUM(average_to_face) + SUM("average_EPGU")) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) average_epgu_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
0 AS average_rating,
|
||||
0 AS average_to_face,
|
||||
0 AS average_epgu,
|
||||
0 AS average_to_face_percent,
|
||||
0 AS average_epgu_percent
|
||||
FROM t1, t2, resolved AS r;</sql>
|
||||
'Ministry' AS schema
|
||||
FROM main_dashboard.appeals
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>400</xloc>
|
||||
<yloc>176</yloc>
|
||||
<xloc>560</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -21,11 +21,6 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ</from>
|
||||
<to>Insert / update (main_dashboard.total_registered)</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2</from>
|
||||
<to>Select values 2 2</to>
|
||||
|
|
@ -41,7 +36,74 @@
|
|||
<to>Insert / update (main_dashboard.total_registered)</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (person_registry) РФ</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>Y</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 main_dashboard.total_registered
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>240</xloc>
|
||||
<yloc>368</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>624</xloc>
|
||||
<yloc>368</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (main_dashboard.total_registered)</name>
|
||||
<type>InsertUpdate</type>
|
||||
|
|
@ -60,7 +122,16 @@
|
|||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>convicts</field>
|
||||
<name>convicts</name>
|
||||
</key>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>total_registered</table>
|
||||
|
|
@ -114,148 +185,24 @@
|
|||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>convicts</name>
|
||||
<rename>convicts</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>992</xloc>
|
||||
<xloc>1008</xloc>
|
||||
<yloc>368</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) РФ</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu_person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH vse as (
|
||||
select *,
|
||||
r.id as r_id
|
||||
FROM public.recruits AS r
|
||||
JOIN public.recruits_info AS ri
|
||||
ON ri.recruit_id = r.id
|
||||
WHERE r.vu_current_info ->> 'isMilitaryRegistered' = 'true'
|
||||
AND r.current_recruitment_id IS NOT NULL
|
||||
AND r.target_recruitment_id IS NOT NULL
|
||||
),
|
||||
extracted_children AS (
|
||||
SELECT
|
||||
ri.recruit_id,
|
||||
jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child
|
||||
FROM
|
||||
vse ri
|
||||
WHERE
|
||||
jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array'
|
||||
),
|
||||
children_birth_dates AS (
|
||||
SELECT
|
||||
recruit_id,
|
||||
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day,
|
||||
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month,
|
||||
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year
|
||||
FROM
|
||||
extracted_children
|
||||
),
|
||||
children_count AS (
|
||||
SELECT
|
||||
recruit_id,
|
||||
COUNT(*) AS children_under_16
|
||||
FROM
|
||||
children_birth_dates
|
||||
WHERE
|
||||
AGE(make_date(year, month, day)) < interval '16 years'
|
||||
GROUP BY
|
||||
recruit_id
|
||||
),
|
||||
recruit_data AS (
|
||||
SELECT
|
||||
COUNT(*) AS total_count,
|
||||
COUNT(*) FILTER (WHERE gender = 'MALE') AS male_count,
|
||||
COUNT(*) FILTER (WHERE gender = 'FEMALE') AS female_count,
|
||||
COUNT(*) FILTER (
|
||||
WHERE (EXTRACT(YEAR FROM AGE(NOW(), birth_date)) BETWEEN 18 AND 70
|
||||
AND gender = 'MALE') -- мужчины от 18 до 70 лет
|
||||
OR
|
||||
(EXTRACT(YEAR FROM AGE(NOW(), birth_date)) BETWEEN 18 AND 45
|
||||
AND gender = 'FEMALE') -- женщины от 18 до 45 лет
|
||||
AND (conscription IS NULL OR conscription = false) -- отсутствие отсрочки
|
||||
AND COALESCE(cc.children_under_16, 0) < 5 -- исключить рекрутов с 5 и более детьми младше 16 лет
|
||||
) AS mobilization_criterion,
|
||||
COUNT(*) FILTER (
|
||||
WHERE EXTRACT(YEAR FROM AGE(NOW(), birth_date)) BETWEEN 18 AND 30
|
||||
AND gender = 'MALE' -- мужчины от 18 до 30 лет
|
||||
AND (conscription IS NULL OR conscription = false) -- отсутствие отсрочки
|
||||
) AS volunteer_criterion,
|
||||
COUNT(*) FILTER (
|
||||
WHERE EXTRACT(YEAR FROM AGE(NOW(), birth_date)) BETWEEN 18 AND 50
|
||||
AND gender = 'MALE' -- мужчины от 18 до 50 лет
|
||||
AND (conscription IS NULL OR conscription = false) -- отсутствие отсрочки
|
||||
AND ri.info->'svedSudim'->>'prOtsSvedSudim' = '1' -- признак отсутствия данных о судимости
|
||||
) AS contract_criterion
|
||||
FROM vse as ri
|
||||
LEFT JOIN children_count AS cc
|
||||
ON ri.r_id = cc.recruit_id
|
||||
)
|
||||
SELECT
|
||||
total_count,
|
||||
male_count,
|
||||
female_count,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
mobilization_criterion,
|
||||
volunteer_criterion,
|
||||
contract_criterion,
|
||||
ROUND(mobilization_criterion::NUMERIC / NULLIF(total_count, 0) * 100, 2) AS mobilization_criterion_percent,
|
||||
ROUND(volunteer_criterion::NUMERIC / NULLIF(total_count, 0) * 100, 2) AS volunteer_criterion_percent,
|
||||
ROUND(contract_criterion::NUMERIC / NULLIF(total_count, 0) * 100, 2) AS contract_criterion_percent
|
||||
FROM recruit_data;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>432</xloc>
|
||||
<yloc>368</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>592</xloc>
|
||||
<yloc>464</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 2</name>
|
||||
<type>SelectValues</type>
|
||||
|
|
@ -306,8 +253,68 @@ FROM recruit_data;</sql>
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>800</xloc>
|
||||
<yloc>464</yloc>
|
||||
<xloc>768</xloc>
|
||||
<yloc>368</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) РФ</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(total_registered), 0) total_count,
|
||||
COALESCE(SUM("total_registered_M"), 0) male_count,
|
||||
COALESCE(SUM("total_registered_W"), 0) female_count,
|
||||
COALESCE(SUM(mobilization_criterion), 0) mobilization_criterion,
|
||||
COALESCE(SUM(volunteer_criterion), 0) volunteer_criterion,
|
||||
COALESCE(SUM(contract_criterion), 0) contract_criterion,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_registered) > 0
|
||||
THEN ROUND((SUM(mobilization_criterion) / SUM(total_registered) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) mobilization_criterion_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_registered) > 0
|
||||
THEN ROUND((SUM(volunteer_criterion) / SUM(total_registered) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) volunteer_criterion_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_registered) > 0
|
||||
THEN ROUND((SUM(contract_criterion) / SUM(total_registered) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) contract_criterion_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
convicts,
|
||||
'Ministry' AS schema
|
||||
FROM main_dashboard.total_registered
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE
|
||||
GROUP BY convicts;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>432</xloc>
|
||||
<yloc>368</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
|
|
@ -21,11 +21,6 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input 2 (person_registry) РФ</from>
|
||||
<to>Insert / update (main_dashboard.waiting_registration)</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2</from>
|
||||
<to>Select values 2 2</to>
|
||||
|
|
@ -41,7 +36,41 @@
|
|||
<to>Insert / update (main_dashboard.waiting_registration)</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input 2 (person_registry) РФ</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>Y</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 main_dashboard.waiting_registration
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>416</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2</name>
|
||||
<type>GetVariable</type>
|
||||
|
|
@ -71,8 +100,8 @@
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>544</xloc>
|
||||
<yloc>400</yloc>
|
||||
<xloc>832</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -93,6 +122,13 @@
|
|||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>main_dashboard</schema>
|
||||
<table>waiting_registration</table>
|
||||
|
|
@ -141,22 +177,22 @@
|
|||
<rename>contract_criterion_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>waiting_registration_percent</name>
|
||||
<rename>waiting_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>928</xloc>
|
||||
<yloc>336</yloc>
|
||||
<xloc>1360</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -209,8 +245,8 @@
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>752</xloc>
|
||||
<yloc>400</yloc>
|
||||
<xloc>1040</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -224,95 +260,51 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.person_registry</connection>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH vse as (
|
||||
select *,
|
||||
r.id as r_id
|
||||
FROM public.recruits AS r
|
||||
JOIN public.recruits_info AS ri
|
||||
ON ri.recruit_id = r.id
|
||||
WHERE r.vu_current_info ->> 'isMilitaryRegistered' = 'false'
|
||||
AND r.current_recruitment_id IS NOT NULL
|
||||
AND r.target_recruitment_id IS NOT NULL
|
||||
),
|
||||
extracted_children AS (
|
||||
SELECT
|
||||
ri.recruit_id,
|
||||
jsonb_array_elements_text(ri.info->'svedDeti'->'rebenok') AS child
|
||||
FROM
|
||||
vse ri
|
||||
WHERE
|
||||
jsonb_typeof(ri.info->'svedDeti'->'rebenok') = 'array'
|
||||
),
|
||||
children_birth_dates AS (
|
||||
SELECT
|
||||
recruit_id,
|
||||
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'den')::int AS day,
|
||||
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'mesyacz')::int AS month,
|
||||
(child::jsonb->'svedFLBS'->'dataRozhdDok'->>'god')::int AS year
|
||||
FROM
|
||||
extracted_children
|
||||
),
|
||||
children_count AS (
|
||||
SELECT
|
||||
recruit_id,
|
||||
COUNT(*) AS children_under_16
|
||||
FROM
|
||||
children_birth_dates
|
||||
WHERE
|
||||
AGE(make_date(year, month, day)) < interval '16 years'
|
||||
GROUP BY
|
||||
recruit_id
|
||||
),
|
||||
recruit_data AS (
|
||||
SELECT
|
||||
COUNT(*) AS waiting_count,
|
||||
COUNT(*) FILTER (WHERE gender = 'MALE') AS male_count,
|
||||
COUNT(*) FILTER (WHERE gender = 'FEMALE') AS female_count,
|
||||
COUNT(*) FILTER (
|
||||
WHERE (EXTRACT(YEAR FROM AGE(NOW(), birth_date)) BETWEEN 18 AND 70
|
||||
AND gender = 'MALE') -- мужчины от 18 до 70 лет
|
||||
OR
|
||||
(EXTRACT(YEAR FROM AGE(NOW(), birth_date)) BETWEEN 18 AND 45
|
||||
AND gender = 'FEMALE') -- женщины от 18 до 45 лет
|
||||
AND (conscription IS NULL OR conscription = false) -- отсутствие отсрочки
|
||||
AND COALESCE(cc.children_under_16, 0) < 5 -- исключить рекрутов с 5 и более детьми младше 16 лет
|
||||
) AS mobilization_criterion,
|
||||
COUNT(*) FILTER (
|
||||
WHERE EXTRACT(YEAR FROM AGE(NOW(), birth_date)) BETWEEN 18 AND 30
|
||||
AND gender = 'MALE' -- мужчины от 18 до 30 лет
|
||||
AND (conscription IS NULL OR conscription = false) -- отсутствие отсрочки
|
||||
) AS volunteer_criterion,
|
||||
COUNT(*) FILTER (
|
||||
WHERE EXTRACT(YEAR FROM AGE(NOW(), birth_date)) BETWEEN 18 AND 50
|
||||
AND gender = 'MALE' -- мужчины от 18 до 50 лет
|
||||
AND (conscription IS NULL OR conscription = false) -- отсутствие отсрочки
|
||||
AND ri.info->'svedSudim'->>'prOtsSvedSudim' = '1' -- признак отсутствия данных о судимости
|
||||
) AS contract_criterion
|
||||
FROM vse as ri
|
||||
LEFT JOIN children_count AS cc
|
||||
ON ri.r_id = cc.recruit_id
|
||||
)
|
||||
SELECT
|
||||
waiting_count,
|
||||
ROUND(COALESCE((waiting_count::DECIMAL / NULLIF((SELECT COUNT(*) FROM public.recruits), 0) * 100), 0), 2) AS waiting_percent,
|
||||
male_count,
|
||||
female_count,
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(waiting_registration), 0) waiting_count,
|
||||
COALESCE(SUM("waiting_registration_M"), 0) male_count,
|
||||
COALESCE(SUM("waiting_registration_W"), 0) female_count,
|
||||
COALESCE(SUM(mobilization_criterion), 0) mobilization_criterion,
|
||||
COALESCE(SUM(volunteer_criterion), 0) volunteer_criterion,
|
||||
COALESCE(SUM(contract_criterion), 0) contract_criterion,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(waiting_registration) > 0
|
||||
THEN ROUND((SUM(mobilization_criterion) / SUM(waiting_registration) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) mobilization_criterion_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(waiting_registration) > 0
|
||||
THEN ROUND((SUM(volunteer_criterion) / SUM(waiting_registration) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) volunteer_criterion_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(waiting_registration) > 0
|
||||
THEN ROUND((SUM(contract_criterion) / SUM(waiting_registration) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) contract_criterion_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
mobilization_criterion,
|
||||
volunteer_criterion,
|
||||
contract_criterion,
|
||||
ROUND(mobilization_criterion::NUMERIC / NULLIF(waiting_count, 0) * 100, 2) AS mobilization_criterion_percent,
|
||||
ROUND(volunteer_criterion::NUMERIC / NULLIF(waiting_count, 0) * 100, 2) AS volunteer_criterion_percent,
|
||||
ROUND(contract_criterion::NUMERIC / NULLIF(waiting_count, 0) * 100, 2) AS contract_criterion_percent
|
||||
FROM recruit_data;</sql>
|
||||
'Ministry' AS schema
|
||||
FROM main_dashboard.waiting_registration
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>368</xloc>
|
||||
<yloc>336</yloc>
|
||||
<xloc>624</xloc>
|
||||
<yloc>352</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
|
|
@ -21,36 +21,11 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (appeal_document) РФ/осень</from>
|
||||
<to>Insert / update (main_dashboard.appeals)</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (appeal_document) РФ/весна</from>
|
||||
<to>Insert / update (main_dashboard.appeals) 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2</from>
|
||||
<to>Select values 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2 2</from>
|
||||
<to>Select values 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (appeal_document) РФ/весна</from>
|
||||
<to>Get variables 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 2 2 2</from>
|
||||
<to>Insert / update (main_dashboard.appeals) 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (appeal_document) РФ/осень</from>
|
||||
<to>Get variables 2 2</to>
|
||||
|
|
@ -61,249 +36,39 @@
|
|||
<to>Insert / update (main_dashboard.appeals)</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (appeal_document) РФ/осень</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Insert / update (main_dashboard.appeals)</name>
|
||||
<type>InsertUpdate</type>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>100</commit>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>recruitment_campaign</schema>
|
||||
<table>appeals</table>
|
||||
<value>
|
||||
<name>total_appeals</name>
|
||||
<rename>total_appeals</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_consideration</name>
|
||||
<rename>average_consideration</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>resolved</name>
|
||||
<rename>resolved</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_resolved</name>
|
||||
<rename>not_resolved</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_resolved_percent</name>
|
||||
<rename>not_resolved_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_rating</name>
|
||||
<rename>average_rating</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>resolved_percent</name>
|
||||
<rename>resolved_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>spring_autumn</name>
|
||||
<rename>spring_autumn</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>752</xloc>
|
||||
<yloc>176</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>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>recruitment_campaign</schema>
|
||||
<table>appeals</table>
|
||||
<value>
|
||||
<name>total_appeals</name>
|
||||
<rename>total_appeals</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_consideration</name>
|
||||
<rename>average_consideration</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>resolved</name>
|
||||
<rename>resolved</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_resolved</name>
|
||||
<rename>not_resolved</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_resolved_percent</name>
|
||||
<rename>not_resolved_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_rating</name>
|
||||
<rename>average_rating</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>resolved_percent</name>
|
||||
<rename>resolved_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>spring_autumn</name>
|
||||
<rename>spring_autumn</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>752</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (appeal_document) РФ/весна</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.appeal-document-service</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>-- ad.extra_info->>'result' = '**' 1 - удовлетворена, 2 - частично удовлетворена, 3 - отказано в удовлетворении
|
||||
WITH appeals_data AS (
|
||||
SELECT
|
||||
COUNT(*) AS total_appeals,
|
||||
ROUND(AVG((TRIM(BOTH '"' FROM (ad.extra_info ->> 'resultDate')::text)::date - ad.appeal_date)), 2) AS average_consideration,
|
||||
COUNT(CASE WHEN ad.extra_info->>'result' IN ('1', '2') THEN 1 END) AS resolved, -- 2 это частично удовлетворена
|
||||
COUNT(CASE WHEN ad.extra_info->>'result' = '3' THEN 1 END) AS not_resolved
|
||||
FROM public.appeal_document ad
|
||||
)
|
||||
SELECT
|
||||
ad.total_appeals,
|
||||
ad.average_consideration,
|
||||
ad.resolved,
|
||||
ad.not_resolved,
|
||||
ROUND(ad.resolved * 100.0 / NULLIF(ad.total_appeals, 0), 2) AS resolved_percent,
|
||||
ROUND(ad.not_resolved * 100.0 / NULLIF(ad.total_appeals, 0), 2) AS not_resolved_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
0 AS average_rating,
|
||||
'Весна' as spring_autumn
|
||||
FROM appeals_data AS ad;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<quoteString>N</quoteString>
|
||||
<replace_variables>Y</replace_variables>
|
||||
<set_params>N</set_params>
|
||||
<single_statement>N</single_statement>
|
||||
<sql>DELETE FROM recruitment_campaign.appeals
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>400</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (appeal_document) РФ/осень</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.appeal-document-service</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>-- ad.extra_info->>'result' = '**' 1 - удовлетворена, 2 - частично удовлетворена, 3 - отказано в удовлетворении
|
||||
WITH appeals_data AS (
|
||||
SELECT
|
||||
COUNT(*) AS total_appeals,
|
||||
ROUND(AVG((TRIM(BOTH '"' FROM (ad.extra_info ->> 'resultDate')::text)::date - ad.appeal_date)), 2) AS average_consideration,
|
||||
COUNT(CASE WHEN ad.extra_info->>'result' IN ('1', '2') THEN 1 END) AS resolved, -- 2 это частично удовлетворена
|
||||
COUNT(CASE WHEN ad.extra_info->>'result' = '3' THEN 1 END) AS not_resolved
|
||||
FROM public.appeal_document ad
|
||||
)
|
||||
SELECT
|
||||
ad.total_appeals,
|
||||
ad.average_consideration,
|
||||
ad.resolved,
|
||||
ad.not_resolved,
|
||||
ROUND(ad.resolved * 100.0 / NULLIF(ad.total_appeals, 0), 2) AS resolved_percent,
|
||||
ROUND(ad.not_resolved * 100.0 / NULLIF(ad.total_appeals, 0), 2) AS not_resolved_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
0 AS average_rating,
|
||||
'Осень' as spring_autumn
|
||||
FROM appeals_data AS ad;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>400</xloc>
|
||||
<yloc>176</yloc>
|
||||
<xloc>208</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -335,7 +100,96 @@ FROM appeals_data AS ad;</sql>
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>464</xloc>
|
||||
<xloc>656</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (main_dashboard.appeals)</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>REG_ID</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
</key>
|
||||
<schema>recruitment_campaign</schema>
|
||||
<table>appeals</table>
|
||||
<value>
|
||||
<name>total_appeals</name>
|
||||
<rename>total_appeals</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_consideration</name>
|
||||
<rename>average_consideration</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>resolved</name>
|
||||
<rename>resolved</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_resolved</name>
|
||||
<rename>not_resolved</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_resolved_percent</name>
|
||||
<rename>not_resolved_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>average_rating</name>
|
||||
<rename>average_rating</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>resolved_percent</name>
|
||||
<rename>resolved_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>spring_autumn</name>
|
||||
<rename>spring_autumn</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1104</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -389,13 +243,13 @@ FROM appeals_data AS ad;</sql>
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>672</xloc>
|
||||
<xloc>864</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2 2</name>
|
||||
<type>GetVariable</type>
|
||||
<name>Table input (appeal_document) РФ/осень</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
|
|
@ -404,80 +258,46 @@ FROM appeals_data AS ad;</sql>
|
|||
<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>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(total_appeals), 0) total_appeals,
|
||||
COALESCE(SUM(average_consideration), 0) average_consideration,
|
||||
COALESCE(SUM(resolved), 0) resolved,
|
||||
COALESCE(SUM(not_resolved), 0) not_resolved,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_appeals) > 0
|
||||
THEN ROUND((SUM(not_resolved) / SUM(total_appeals) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) not_resolved_percent,
|
||||
|
||||
COALESCE(SUM(average_rating), 0) average_rating,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_appeals) > 0
|
||||
THEN ROUND((SUM(resolved) / SUM(total_appeals) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) resolved_percent,
|
||||
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
spring_autumn,
|
||||
'Ministry' AS schema
|
||||
FROM recruitment_campaign.appeals
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE
|
||||
GROUP BY spring_autumn;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>464</xloc>
|
||||
<yloc>416</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 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>672</xloc>
|
||||
<yloc>416</yloc>
|
||||
<xloc>416</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
|
|
@ -21,26 +21,11 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (subpoena) осень/РФ</from>
|
||||
<to>Insert / update (recruitment_campaign.subpoenas)</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (subpoena) Весна/РФ</from>
|
||||
<to>Insert / update (recruitment_campaign.subpoenas) 3</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2</from>
|
||||
<to>Select values 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2 2</from>
|
||||
<to>Select values 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (subpoena) осень/РФ</from>
|
||||
<to>Get variables 2 2</to>
|
||||
|
|
@ -52,602 +37,38 @@
|
|||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (subpoena) Весна/РФ</from>
|
||||
<to>Get variables 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 2 2 2</from>
|
||||
<to>Insert / update (recruitment_campaign.subpoenas) 3</to>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (subpoena) осень/РФ</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Insert / update (recruitment_campaign.subpoenas)</name>
|
||||
<type>InsertUpdate</type>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>100</commit>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>recruitment_campaign</schema>
|
||||
<table>subpoenas</table>
|
||||
<value>
|
||||
<name>subpoena</name>
|
||||
<rename>count_subpoena</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared</name>
|
||||
<rename>count_appeared</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared</name>
|
||||
<rename>count_not_appeared</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_ap_good_reason</name>
|
||||
<rename>count_not_ap_good_reason</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>introduced_measures</name>
|
||||
<rename>count_introduced_measures</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>ap_not_required</name>
|
||||
<rename>count_ap_not_required</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>restrictions_applied</name>
|
||||
<rename>count_restrictions_applied</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared_percent</name>
|
||||
<rename>appeared_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared_percent</name>
|
||||
<rename>not_appeared_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_ap_good_reason_percent</name>
|
||||
<rename>not_ap_good_reason_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>ap_not_required_percent</name>
|
||||
<rename>ap_not_required_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>restrictions_applied_percent</name>
|
||||
<rename>restrictions_applied_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>introduced_measures_percent</name>
|
||||
<rename>introduced_measures_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>rest</name>
|
||||
<rename>rest</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>spring_autumn</name>
|
||||
<rename>spring_autumn</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>count_not_delivery</name>
|
||||
<rename>count_not_delivery</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appear_date_is_good</name>
|
||||
<rename>appear_date_is_good</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_delivery_percent</name>
|
||||
<rename>not_delivery_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appear_date_is_good_percent</name>
|
||||
<rename>appear_date_is_good_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1072</xloc>
|
||||
<yloc>240</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (recruitment_campaign.subpoenas) 3</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>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>recruitment_campaign</schema>
|
||||
<table>subpoenas</table>
|
||||
<value>
|
||||
<name>subpoena</name>
|
||||
<rename>count_subpoena</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared</name>
|
||||
<rename>count_appeared</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared</name>
|
||||
<rename>count_not_appeared</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_ap_good_reason</name>
|
||||
<rename>count_not_ap_good_reason</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>introduced_measures</name>
|
||||
<rename>count_introduced_measures</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>ap_not_required</name>
|
||||
<rename>count_ap_not_required</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>restrictions_applied</name>
|
||||
<rename>count_restrictions_applied</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared_percent</name>
|
||||
<rename>appeared_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared_percent</name>
|
||||
<rename>not_appeared_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_ap_good_reason_percent</name>
|
||||
<rename>not_ap_good_reason_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>ap_not_required_percent</name>
|
||||
<rename>ap_not_required_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>restrictions_applied_percent</name>
|
||||
<rename>restrictions_applied_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>introduced_measures_percent</name>
|
||||
<rename>introduced_measures_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>rest</name>
|
||||
<rename>rest</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>spring_autumn</name>
|
||||
<rename>spring_autumn</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>count_not_delivery</name>
|
||||
<rename>count_not_delivery</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appear_date_is_good</name>
|
||||
<rename>appear_date_is_good</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_delivery_percent</name>
|
||||
<rename>not_delivery_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appear_date_is_good_percent</name>
|
||||
<rename>appear_date_is_good_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1072</xloc>
|
||||
<yloc>432</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>postgres.subpoena</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH subpoena_data AS (
|
||||
SELECT
|
||||
s.id AS subpoena_id,
|
||||
s.status_id,
|
||||
sr.type,
|
||||
ssh.code AS sub_stat_hist,
|
||||
s.send_date,
|
||||
sh.date_time::timestamp AS history_date,
|
||||
rdi.restriction_document_cancel_id AS restr_dc,
|
||||
rdi.applied_date AS ap_date,
|
||||
rdi.id AS rdi_id,
|
||||
ssi.delivery_code AS d_code,
|
||||
ROW_NUMBER() OVER (PARTITION BY s.id ORDER BY sh.date_time DESC) AS rn -- добавляем строку для получения последнего статуса
|
||||
FROM subpoena s
|
||||
JOIN subpoena_history AS sh ON sh.subpoena_id = s.id
|
||||
JOIN subpoena_status AS ss ON ss.id = s.status_id
|
||||
JOIN subpoena_status AS ssh ON ssh.id = sh.status_id
|
||||
JOIN subpoena_reason AS sr ON sr.id = s.reason_id
|
||||
LEFT JOIN restriction_document AS rd ON rd.subpoena_id = s.id
|
||||
LEFT JOIN restriction_document_item AS rdi ON rdi.restriction_document_create_id = rd.id
|
||||
LEFT JOIN subpoena_send_info AS ssi ON ssi.subpoena_id = s.id
|
||||
WHERE sr.type = '3'
|
||||
and ssh.code not in ('3.14','3.7','3.72', '3.71')
|
||||
),
|
||||
-- фильтруем только последние статусы для каждой повестки
|
||||
last_status AS (
|
||||
SELECT *
|
||||
FROM subpoena_data
|
||||
WHERE rn = 1 -- выбираем только последнюю запись для каждой повестки
|
||||
),
|
||||
-- Подсчет различных метрик
|
||||
t1 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_subpoena
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IS NOT NULL
|
||||
),
|
||||
t2 AS (
|
||||
SELECT ROUND(AVG(EXTRACT(DAY FROM (history_date::timestamp - send_date::timestamp))), 1) AS average_appeared
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IN ('4.1', '4.2', '4')
|
||||
),
|
||||
t3 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_appeared
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IN ('4.1', '4.2', '4')
|
||||
),
|
||||
t4 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_not_appeared
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist = '5'
|
||||
),
|
||||
t5 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_not_ap_good_reason
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist = '5.1'
|
||||
),
|
||||
t6 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_ap_not_required
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IN ('3.8', '5.2')
|
||||
),
|
||||
t7 AS ( -- количество повесток по которым применены ограничения
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_restrictions_applied
|
||||
FROM last_status
|
||||
WHERE restr_dc IS NULL
|
||||
),
|
||||
t8 AS ( -- количество повесток по которым введены меры
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_introduced_measures
|
||||
FROM last_status
|
||||
WHERE restr_dc IS NULL AND ap_date IS NOT NULL
|
||||
),
|
||||
t9 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_paper
|
||||
FROM last_status
|
||||
WHERE d_code != '7'
|
||||
),
|
||||
t10 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_electron
|
||||
FROM last_status
|
||||
WHERE d_code = '7'
|
||||
),
|
||||
t11 AS (
|
||||
SELECT COUNT (DISTINCT rdi_id) AS count_restrictions
|
||||
FROM last_status
|
||||
),
|
||||
t12 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_not_delivery --не вручена
|
||||
FROM last_status
|
||||
WHERE d_code is null
|
||||
),
|
||||
t13 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS appear_date_is_good
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IN ('3','3.12', '3.13', '3.15', '3.1')
|
||||
)
|
||||
SELECT
|
||||
t1.count_subpoena,
|
||||
t2.average_appeared,
|
||||
t3.count_appeared,
|
||||
t4.count_not_appeared,
|
||||
t5.count_not_ap_good_reason,
|
||||
t6.count_ap_not_required,
|
||||
t7.count_restrictions_applied,
|
||||
t8.count_introduced_measures,
|
||||
t9.count_paper,
|
||||
t10.count_electron,
|
||||
t11.count_restrictions,
|
||||
t12.count_not_delivery,
|
||||
t13.appear_date_is_good,
|
||||
ROUND(count_appeared * 100.0 / NULLIF(count_subpoena, 0), 2) AS appeared_percent,
|
||||
ROUND(count_not_appeared * 100.0 / NULLIF(count_subpoena, 0), 2) AS not_appeared_percent,
|
||||
ROUND(count_not_ap_good_reason * 100.0 / NULLIF(count_subpoena, 0), 2) AS not_ap_good_reason_percent,
|
||||
ROUND(count_ap_not_required * 100.0 / NULLIF(count_subpoena, 0), 2) AS ap_not_required_percent,
|
||||
ROUND(count_electron * 100.0 / NULLIF(count_subpoena, 0), 2) AS electron_percent,
|
||||
ROUND(count_paper * 100.0 / NULLIF(count_subpoena, 0), 2) AS paper_percent,
|
||||
ROUND(count_restrictions_applied * 100.0 / NULLIF(count_subpoena, 0), 2) AS restrictions_applied_percent,
|
||||
ROUND(count_introduced_measures * 100.0 / NULLIF(count_subpoena, 0), 2) AS introduced_measures_percent,
|
||||
ROUND(count_not_delivery * 100.0 / NULLIF(count_subpoena, 0), 2) AS not_delivery_percent, --процент не врученных
|
||||
ROUND(appear_date_is_good * 100.0 / NULLIF(count_subpoena, 0), 2) AS appear_date_is_good_percent, --процент не врученных
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
0 as rest,
|
||||
'Весна' as spring_autumn,
|
||||
1 AS org
|
||||
FROM t1
|
||||
FULL OUTER JOIN t2 ON 1 = 1
|
||||
FULL OUTER JOIN t3 ON 1 = 1
|
||||
FULL OUTER JOIN t4 ON 1 = 1
|
||||
FULL OUTER JOIN t5 ON 1 = 1
|
||||
FULL OUTER JOIN t6 ON 1 = 1
|
||||
FULL OUTER JOIN t7 ON 1 = 1
|
||||
FULL OUTER JOIN t8 ON 1 = 1
|
||||
FULL OUTER JOIN t9 ON 1 = 1
|
||||
FULL OUTER JOIN t10 ON 1 = 1
|
||||
FULL OUTER JOIN t11 ON 1 = 1
|
||||
FULL OUTER JOIN t12 ON 1 = 1
|
||||
FULL OUTER JOIN t13 ON 1 = 1;
|
||||
</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<quoteString>N</quoteString>
|
||||
<replace_variables>Y</replace_variables>
|
||||
<set_params>N</set_params>
|
||||
<single_statement>N</single_statement>
|
||||
<sql>DELETE FROM recruitment_campaign.subpoenas
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>384</xloc>
|
||||
<yloc>432</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>postgres.subpoena</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH subpoena_data AS (
|
||||
SELECT
|
||||
s.id AS subpoena_id,
|
||||
s.status_id,
|
||||
sr.type,
|
||||
ssh.code AS sub_stat_hist,
|
||||
s.send_date,
|
||||
sh.date_time::timestamp AS history_date,
|
||||
rdi.restriction_document_cancel_id AS restr_dc,
|
||||
rdi.applied_date AS ap_date,
|
||||
rdi.id AS rdi_id,
|
||||
ssi.delivery_code AS d_code,
|
||||
ROW_NUMBER() OVER (PARTITION BY s.id ORDER BY sh.date_time DESC) AS rn -- добавляем строку для получения последнего статуса
|
||||
FROM subpoena s
|
||||
JOIN subpoena_history AS sh ON sh.subpoena_id = s.id
|
||||
JOIN subpoena_status AS ss ON ss.id = s.status_id
|
||||
JOIN subpoena_status AS ssh ON ssh.id = sh.status_id
|
||||
JOIN subpoena_reason AS sr ON sr.id = s.reason_id
|
||||
LEFT JOIN restriction_document AS rd ON rd.subpoena_id = s.id
|
||||
LEFT JOIN restriction_document_item AS rdi ON rdi.restriction_document_create_id = rd.id
|
||||
LEFT JOIN subpoena_send_info AS ssi ON ssi.subpoena_id = s.id
|
||||
WHERE sr.type = '3'
|
||||
and ssh.code not in ('3.14','3.7','3.72', '3.71')
|
||||
),
|
||||
-- фильтруем только последние статусы для каждой повестки
|
||||
last_status AS (
|
||||
SELECT *
|
||||
FROM subpoena_data
|
||||
WHERE rn = 1 -- выбираем только последнюю запись для каждой повестки
|
||||
),
|
||||
-- Подсчет различных метрик
|
||||
t1 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_subpoena
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IS NOT NULL
|
||||
),
|
||||
t2 AS (
|
||||
SELECT ROUND(AVG(EXTRACT(DAY FROM (history_date::timestamp - send_date::timestamp))), 1) AS average_appeared
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IN ('4.1', '4.2', '4')
|
||||
),
|
||||
t3 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_appeared
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IN ('4.1', '4.2', '4')
|
||||
),
|
||||
t4 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_not_appeared
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist = '5'
|
||||
),
|
||||
t5 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_not_ap_good_reason
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist = '5.1'
|
||||
),
|
||||
t6 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_ap_not_required
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IN ('3.8', '5.2')
|
||||
),
|
||||
t7 AS ( -- количество повесток по которым применены ограничения
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_restrictions_applied
|
||||
FROM last_status
|
||||
WHERE restr_dc IS NULL
|
||||
),
|
||||
t8 AS ( -- количество повесток по которым введены меры
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_introduced_measures
|
||||
FROM last_status
|
||||
WHERE restr_dc IS NULL AND ap_date IS NOT NULL
|
||||
),
|
||||
t9 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_paper
|
||||
FROM last_status
|
||||
WHERE d_code != '7'
|
||||
),
|
||||
t10 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_electron
|
||||
FROM last_status
|
||||
WHERE d_code = '7'
|
||||
),
|
||||
t11 AS (
|
||||
SELECT COUNT (DISTINCT rdi_id) AS count_restrictions
|
||||
FROM last_status
|
||||
),
|
||||
t12 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS count_not_delivery --не вручена
|
||||
FROM last_status
|
||||
WHERE d_code is null
|
||||
),
|
||||
t13 AS (
|
||||
SELECT COUNT(DISTINCT subpoena_id) AS appear_date_is_good
|
||||
FROM last_status
|
||||
WHERE sub_stat_hist IN ('3','3.12', '3.13', '3.15', '3.1')
|
||||
)
|
||||
SELECT
|
||||
t1.count_subpoena,
|
||||
t2.average_appeared,
|
||||
t3.count_appeared,
|
||||
t4.count_not_appeared,
|
||||
t5.count_not_ap_good_reason,
|
||||
t6.count_ap_not_required,
|
||||
t7.count_restrictions_applied,
|
||||
t8.count_introduced_measures,
|
||||
t9.count_paper,
|
||||
t10.count_electron,
|
||||
t11.count_restrictions,
|
||||
t12.count_not_delivery,
|
||||
t13.appear_date_is_good,
|
||||
ROUND(count_appeared * 100.0 / NULLIF(count_subpoena, 0), 2) AS appeared_percent,
|
||||
ROUND(count_not_appeared * 100.0 / NULLIF(count_subpoena, 0), 2) AS not_appeared_percent,
|
||||
ROUND(count_not_ap_good_reason * 100.0 / NULLIF(count_subpoena, 0), 2) AS not_ap_good_reason_percent,
|
||||
ROUND(count_ap_not_required * 100.0 / NULLIF(count_subpoena, 0), 2) AS ap_not_required_percent,
|
||||
ROUND(count_electron * 100.0 / NULLIF(count_subpoena, 0), 2) AS electron_percent,
|
||||
ROUND(count_paper * 100.0 / NULLIF(count_subpoena, 0), 2) AS paper_percent,
|
||||
ROUND(count_restrictions_applied * 100.0 / NULLIF(count_subpoena, 0), 2) AS restrictions_applied_percent,
|
||||
ROUND(count_introduced_measures * 100.0 / NULLIF(count_subpoena, 0), 2) AS introduced_measures_percent,
|
||||
ROUND(count_not_delivery * 100.0 / NULLIF(count_subpoena, 0), 2) AS not_delivery_percent, --процент не врученных
|
||||
ROUND(appear_date_is_good * 100.0 / NULLIF(count_subpoena, 0), 2) AS appear_date_is_good_percent, --процент не врученных
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
0 as rest,
|
||||
'Осень' as spring_autumn,
|
||||
1 AS org
|
||||
FROM t1
|
||||
FULL OUTER JOIN t2 ON 1 = 1
|
||||
FULL OUTER JOIN t3 ON 1 = 1
|
||||
FULL OUTER JOIN t4 ON 1 = 1
|
||||
FULL OUTER JOIN t5 ON 1 = 1
|
||||
FULL OUTER JOIN t6 ON 1 = 1
|
||||
FULL OUTER JOIN t7 ON 1 = 1
|
||||
FULL OUTER JOIN t8 ON 1 = 1
|
||||
FULL OUTER JOIN t9 ON 1 = 1
|
||||
FULL OUTER JOIN t10 ON 1 = 1
|
||||
FULL OUTER JOIN t11 ON 1 = 1
|
||||
FULL OUTER JOIN t12 ON 1 = 1
|
||||
FULL OUTER JOIN t13 ON 1 = 1;
|
||||
</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>384</xloc>
|
||||
<yloc>240</yloc>
|
||||
<xloc>192</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -680,7 +101,151 @@ FULL OUTER JOIN t13 ON 1 = 1;
|
|||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>640</xloc>
|
||||
<yloc>304</yloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (recruitment_campaign.subpoenas)</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>REG_ID</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>spring_autumn</field>
|
||||
<name>spring_autumn</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
</key>
|
||||
<schema>recruitment_campaign</schema>
|
||||
<table>subpoenas</table>
|
||||
<value>
|
||||
<name>subpoena</name>
|
||||
<rename>count_subpoena</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared</name>
|
||||
<rename>count_appeared</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared</name>
|
||||
<rename>count_not_appeared</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_ap_good_reason</name>
|
||||
<rename>count_not_ap_good_reason</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>introduced_measures</name>
|
||||
<rename>count_introduced_measures</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>ap_not_required</name>
|
||||
<rename>count_ap_not_required</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>restrictions_applied</name>
|
||||
<rename>count_restrictions_applied</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appeared_percent</name>
|
||||
<rename>appeared_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_appeared_percent</name>
|
||||
<rename>not_appeared_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_ap_good_reason_percent</name>
|
||||
<rename>not_ap_good_reason_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>ap_not_required_percent</name>
|
||||
<rename>ap_not_required_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>restrictions_applied_percent</name>
|
||||
<rename>restrictions_applied_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>introduced_measures_percent</name>
|
||||
<rename>introduced_measures_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>rest</name>
|
||||
<rename>rest</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>spring_autumn</name>
|
||||
<rename>spring_autumn</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>count_not_delivery</name>
|
||||
<rename>count_not_delivery</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appear_date_is_good</name>
|
||||
<rename>appear_date_is_good</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_delivery_percent</name>
|
||||
<rename>not_delivery_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>appear_date_is_good_percent</name>
|
||||
<rename>appear_date_is_good_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1104</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -734,12 +299,12 @@ FULL OUTER JOIN t13 ON 1 = 1;
|
|||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>848</xloc>
|
||||
<yloc>304</yloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2 2</name>
|
||||
<type>GetVariable</type>
|
||||
<name>Table input (subpoena) осень/РФ</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
|
|
@ -748,80 +313,105 @@ FULL OUTER JOIN t13 ON 1 = 1;
|
|||
<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>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(subpoena), 0) count_subpoena,
|
||||
COALESCE(SUM(appeared), 0) count_appeared,
|
||||
COALESCE(SUM(not_appeared), 0) count_not_appeared,
|
||||
COALESCE(SUM(not_ap_good_reason), 0) count_not_ap_good_reason,
|
||||
COALESCE(SUM(introduced_measures), 0) count_introduced_measures,
|
||||
COALESCE(SUM(ap_not_required), 0) count_ap_not_required,
|
||||
COALESCE(SUM(restrictions_applied), 0) count_restrictions_applied,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(subpoena) > 0
|
||||
THEN ROUND((SUM(appeared) / SUM(subpoena) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) appeared_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(subpoena) > 0
|
||||
THEN ROUND((SUM(not_appeared) / SUM(subpoena) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) not_appeared_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(subpoena) > 0
|
||||
THEN ROUND((SUM(not_ap_good_reason) / SUM(subpoena) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) not_ap_good_reason_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(subpoena) > 0
|
||||
THEN ROUND((SUM(ap_not_required) / SUM(subpoena) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) ap_not_required_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(subpoena) > 0
|
||||
THEN ROUND((SUM(restrictions_applied) / SUM(subpoena) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) restrictions_applied_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(subpoena) > 0
|
||||
THEN ROUND((SUM(introduced_measures) / SUM(subpoena) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) introduced_measures_percent,
|
||||
COALESCE(SUM(rest), 0) rest,
|
||||
COALESCE(SUM(count_not_delivery), 0) count_not_delivery,
|
||||
COALESCE(SUM(appear_date_is_good), 0) appear_date_is_good,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(subpoena) > 0
|
||||
THEN ROUND((SUM(count_not_delivery) / SUM(subpoena) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) not_delivery_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(subpoena) > 0
|
||||
THEN ROUND((SUM(count_not_delivery) / SUM(subpoena) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) not_delivery_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(subpoena) > 0
|
||||
THEN ROUND((SUM(appear_date_is_good) / SUM(subpoena) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) appear_date_is_good_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
spring_autumn,
|
||||
'Ministry' AS schema
|
||||
FROM recruitment_campaign.subpoenas
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE
|
||||
GROUP BY spring_autumn;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>640</xloc>
|
||||
<yloc>496</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 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>848</xloc>
|
||||
<yloc>496</yloc>
|
||||
<xloc>416</xloc>
|
||||
<yloc>336</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
|
|
@ -57,13 +57,10 @@
|
|||
</partitioning>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>10</limit>
|
||||
<sql>WITH
|
||||
t1 AS (SELECT ARRAY_AGG(t.idm_id) AS RECRUITMENT00_ID FROM ervu_dashboard.recruitment AS t WHERE t.code = '0000000')
|
||||
SELECT
|
||||
t1.RECRUITMENT00_ID AS VK_ARRAY_ID,
|
||||
'00' AS RECRUITMENT_REG_ID
|
||||
FROM t1
|
||||
<limit/>
|
||||
<sql>SELECT 'f03fc8c0-2ce7-4121-a306-f82d65ea029d' AS RECRUITMENT_REG_ID,
|
||||
array_agg(recruitment_dstr_id) AS VK_ARRAY_ID
|
||||
FROM ervu_dashboard.array_mildis
|
||||
</sql>
|
||||
<variables_active>N</variables_active>
|
||||
<attributes/>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -21,36 +21,11 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/женщины</from>
|
||||
<to>Insert / update (total_registered.driver_license) 2 2 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/мужчины</from>
|
||||
<to>Insert / update (total_registered.driver_license) 2 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/все</from>
|
||||
<to>Insert / update (total_registered.driver_license) 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2</from>
|
||||
<to>Select values 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2 2</from>
|
||||
<to>Select values 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2 3</from>
|
||||
<to>Select values 2 2 3</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/все</from>
|
||||
<to>Get variables 2 2</to>
|
||||
|
|
@ -62,529 +37,40 @@
|
|||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/мужчины</from>
|
||||
<to>Get variables 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 2 2 2</from>
|
||||
<to>Insert / update (total_registered.driver_license) 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/женщины</from>
|
||||
<to>Get variables 2 2 3</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 2 2 3</from>
|
||||
<to>Insert / update (total_registered.driver_license) 2 2 2</to>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (person_registry) РФ/все</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.driver_license) 2</name>
|
||||
<type>InsertUpdate</type>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>100</commit>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>"all_M_W"</field>
|
||||
<name>gender</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>driver_license</table>
|
||||
<value>
|
||||
<name>"A"</name>
|
||||
<rename>a</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"B"</name>
|
||||
<rename>b</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"C"</name>
|
||||
<rename>c</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"D"</name>
|
||||
<rename>d</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"E"</name>
|
||||
<rename>e</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>nope</name>
|
||||
<rename>nope</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"A_repcent"</name>
|
||||
<rename>a_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"B_repcent"</name>
|
||||
<rename>b_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"C_repcent"</name>
|
||||
<rename>c_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"D_repcent"</name>
|
||||
<rename>d_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"E_repcent"</name>
|
||||
<rename>e_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"all_M_W"</name>
|
||||
<rename>gender</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>nope_repcent</name>
|
||||
<rename>nope_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<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 total_registered.driver_license
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1104</xloc>
|
||||
<yloc>128</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.driver_license) 2 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>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>"all_M_W"</field>
|
||||
<name>gender</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>driver_license</table>
|
||||
<value>
|
||||
<name>"A"</name>
|
||||
<rename>a</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"B"</name>
|
||||
<rename>b</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"C"</name>
|
||||
<rename>c</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"D"</name>
|
||||
<rename>d</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"E"</name>
|
||||
<rename>e</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>nope</name>
|
||||
<rename>nope</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"A_repcent"</name>
|
||||
<rename>a_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"B_repcent"</name>
|
||||
<rename>b_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"C_repcent"</name>
|
||||
<rename>c_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"D_repcent"</name>
|
||||
<rename>d_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"E_repcent"</name>
|
||||
<rename>e_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>nope_repcent</name>
|
||||
<rename>nope_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"all_M_W"</name>
|
||||
<rename>gender</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1104</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.driver_license) 2 2 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>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>"all_M_W"</field>
|
||||
<name>gender</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>driver_license</table>
|
||||
<value>
|
||||
<name>"A"</name>
|
||||
<rename>a</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"B"</name>
|
||||
<rename>b</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"C"</name>
|
||||
<rename>c</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"D"</name>
|
||||
<rename>d</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"E"</name>
|
||||
<rename>e</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>nope</name>
|
||||
<rename>nope</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"A_repcent"</name>
|
||||
<rename>a_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"B_repcent"</name>
|
||||
<rename>b_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"C_repcent"</name>
|
||||
<rename>c_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"D_repcent"</name>
|
||||
<rename>d_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"E_repcent"</name>
|
||||
<rename>e_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>nope_repcent</name>
|
||||
<rename>nope_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"all_M_W"</name>
|
||||
<rename>gender</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1104</xloc>
|
||||
<xloc>608</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) РФ/все</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH categorized AS (
|
||||
SELECT
|
||||
r.id,
|
||||
r.gender,
|
||||
-- Проверяем наличие хотя бы одной категории, используем DISTINCT для уникальных рекрутов
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%A%' THEN 1 ELSE 0 END) AS has_A,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%B%' THEN 1 ELSE 0 END) AS has_B,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%C%' THEN 1 ELSE 0 END) AS has_C,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%D%' THEN 1 ELSE 0 END) AS has_D,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%E%' THEN 1 ELSE 0 END) AS has_E
|
||||
FROM public.recruits_info ri
|
||||
JOIN public.recruits r ON ri.recruit_id = r.id
|
||||
LEFT JOIN jsonb_array_elements(ri.info->'svedVoditUdost'->'voditUdost'->'svedKat') AS cat ON true
|
||||
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true'
|
||||
AND r.current_recruitment_id IS NOT NULL
|
||||
AND r.target_recruitment_id IS NOT NULL
|
||||
GROUP BY r.id, r.gender
|
||||
),
|
||||
aggregated AS (
|
||||
SELECT
|
||||
'ALL' AS gender,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
-- Считаем количество уникальных рекрутов с каждой категорией
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_A > 0) AS a,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_B > 0) AS b,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_C > 0) AS c,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_D > 0) AS d,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_E > 0) AS e,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_A = 0 AND has_B = 0 AND has_C = 0 AND has_D = 0 AND has_E = 0) AS nope,
|
||||
COUNT(DISTINCT r.id) AS total
|
||||
FROM categorized r
|
||||
)
|
||||
SELECT *,
|
||||
ROUND((a * 100.0) / NULLIF(total, 0), 2) AS a_percent,
|
||||
ROUND((b * 100.0) / NULLIF(total, 0), 2) AS b_percent,
|
||||
ROUND((c * 100.0) / NULLIF(total, 0), 2) AS c_percent,
|
||||
ROUND((d * 100.0) / NULLIF(total, 0), 2) AS d_percent,
|
||||
ROUND((e * 100.0) / NULLIF(total, 0), 2) AS e_percent,
|
||||
ROUND((nope * 100.0) / NULLIF(total, 0), 2) AS nope_percent
|
||||
FROM aggregated;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>480</xloc>
|
||||
<yloc>128</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) РФ/женщины</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH categorized AS (
|
||||
SELECT
|
||||
r.id,
|
||||
r.gender,
|
||||
-- Проверяем наличие хотя бы одной категории, используем DISTINCT для уникальных рекрутов
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%A%' THEN 1 ELSE 0 END) AS has_A,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%B%' THEN 1 ELSE 0 END) AS has_B,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%C%' THEN 1 ELSE 0 END) AS has_C,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%D%' THEN 1 ELSE 0 END) AS has_D,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%E%' THEN 1 ELSE 0 END) AS has_E
|
||||
FROM public.recruits_info ri
|
||||
JOIN public.recruits r ON ri.recruit_id = r.id
|
||||
LEFT JOIN jsonb_array_elements(ri.info->'svedVoditUdost'->'voditUdost'->'svedKat') AS cat ON true
|
||||
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true'
|
||||
AND r.current_recruitment_id IS NOT NULL
|
||||
AND r.target_recruitment_id IS NOT NULL
|
||||
AND r.gender = 'FEMALE'
|
||||
GROUP BY r.id, r.gender
|
||||
),
|
||||
aggregated AS (
|
||||
SELECT
|
||||
'W' AS gender,
|
||||
'${REG_ID}' as recruitment_id,
|
||||
-- Считаем количество уникальных рекрутов с каждой категорией
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_A > 0) AS a,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_B > 0) AS b,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_C > 0) AS c,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_D > 0) AS d,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_E > 0) AS e,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_A = 0 AND has_B = 0 AND has_C = 0 AND has_D = 0 AND has_E = 0) AS nope,
|
||||
COUNT(DISTINCT r.id) AS total
|
||||
FROM categorized r
|
||||
)
|
||||
SELECT *,
|
||||
ROUND((a * 100.0) / NULLIF(total, 0), 2) AS a_percent,
|
||||
ROUND((b * 100.0) / NULLIF(total, 0), 2) AS b_percent,
|
||||
ROUND((c * 100.0) / NULLIF(total, 0), 2) AS c_percent,
|
||||
ROUND((d * 100.0) / NULLIF(total, 0), 2) AS d_percent,
|
||||
ROUND((e * 100.0) / NULLIF(total, 0), 2) AS e_percent,
|
||||
ROUND((nope * 100.0) / NULLIF(total, 0), 2) AS nope_percent
|
||||
FROM aggregated;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>480</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) РФ/мужчины</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH categorized AS (
|
||||
SELECT
|
||||
r.id,
|
||||
r.gender,
|
||||
-- Проверяем наличие хотя бы одной категории, используем DISTINCT для уникальных рекрутов
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%A%' THEN 1 ELSE 0 END) AS has_A,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%B%' THEN 1 ELSE 0 END) AS has_B,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%C%' THEN 1 ELSE 0 END) AS has_C,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%D%' THEN 1 ELSE 0 END) AS has_D,
|
||||
MAX(CASE WHEN cat->>'kategoriya' like '%E%' THEN 1 ELSE 0 END) AS has_E
|
||||
FROM public.recruits_info ri
|
||||
JOIN public.recruits r ON ri.recruit_id = r.id
|
||||
LEFT JOIN jsonb_array_elements(ri.info->'svedVoditUdost'->'voditUdost'->'svedKat') AS cat ON true
|
||||
WHERE r.vu_current_info->>'isMilitaryRegistered' = 'true'
|
||||
AND r.current_recruitment_id IS NOT NULL
|
||||
AND r.target_recruitment_id IS NOT NULL
|
||||
AND r.gender = 'MALE'
|
||||
GROUP BY r.id, r.gender
|
||||
),
|
||||
aggregated AS (
|
||||
SELECT
|
||||
'M' AS gender,
|
||||
'${REG_ID}' as recruitment_id,
|
||||
-- Считаем количество уникальных рекрутов с каждой категорией
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_A > 0) AS a,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_B > 0) AS b,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_C > 0) AS c,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_D > 0) AS d,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_E > 0) AS e,
|
||||
COUNT(DISTINCT r.id) FILTER (WHERE has_A = 0 AND has_B = 0 AND has_C = 0 AND has_D = 0 AND has_E = 0) AS nope,
|
||||
COUNT(DISTINCT r.id) AS total
|
||||
FROM categorized r
|
||||
)
|
||||
SELECT *,
|
||||
ROUND((a * 100.0) / NULLIF(total, 0), 2) AS a_percent,
|
||||
ROUND((b * 100.0) / NULLIF(total, 0), 2) AS b_percent,
|
||||
ROUND((c * 100.0) / NULLIF(total, 0), 2) AS c_percent,
|
||||
ROUND((d * 100.0) / NULLIF(total, 0), 2) AS d_percent,
|
||||
ROUND((e * 100.0) / NULLIF(total, 0), 2) AS e_percent,
|
||||
ROUND((nope * 100.0) / NULLIF(total, 0), 2) AS nope_percent
|
||||
FROM aggregated;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>480</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2</name>
|
||||
<type>GetVariable</type>
|
||||
|
|
@ -614,8 +100,137 @@ FROM aggregated;</sql>
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>688</xloc>
|
||||
<yloc>192</yloc>
|
||||
<xloc>1104</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.driver_license) 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>REG_ID</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>"all_M_W"</field>
|
||||
<name>gender</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>convicts</field>
|
||||
<name>convicts</name>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>driver_license</table>
|
||||
<value>
|
||||
<name>"A"</name>
|
||||
<rename>a</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"B"</name>
|
||||
<rename>b</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"C"</name>
|
||||
<rename>c</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"D"</name>
|
||||
<rename>d</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"E"</name>
|
||||
<rename>e</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>nope</name>
|
||||
<rename>nope</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"A_repcent"</name>
|
||||
<rename>a_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"B_repcent"</name>
|
||||
<rename>b_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"C_repcent"</name>
|
||||
<rename>c_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"D_repcent"</name>
|
||||
<rename>d_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"E_repcent"</name>
|
||||
<rename>e_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"all_M_W"</name>
|
||||
<rename>gender</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>nope_repcent</name>
|
||||
<rename>nope_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<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>convicts</name>
|
||||
<rename>convicts</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>total_count</name>
|
||||
<rename>total</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1584</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -668,13 +283,13 @@ FROM aggregated;</sql>
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>896</xloc>
|
||||
<yloc>192</yloc>
|
||||
<xloc>1312</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2 2</name>
|
||||
<type>GetVariable</type>
|
||||
<name>Table input (person_registry) РФ/все</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
|
|
@ -683,167 +298,79 @@ FROM aggregated;</sql>
|
|||
<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>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(total_count), 0) total,
|
||||
COALESCE(SUM("A"), 0) a,
|
||||
COALESCE(SUM("B"), 0) b,
|
||||
COALESCE(SUM("C"), 0) c,
|
||||
COALESCE(SUM("D"), 0) d,
|
||||
COALESCE(SUM("E"), 0) e,
|
||||
COALESCE(SUM(nope), 0) nope,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_count) > 0
|
||||
THEN ROUND((SUM("A") / SUM(total_count) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) a_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_count) > 0
|
||||
THEN ROUND((SUM("B") / SUM(total_count) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) b_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_count) > 0
|
||||
THEN ROUND((SUM("C") / SUM(total_count) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) c_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_count) > 0
|
||||
THEN ROUND((SUM("D") / SUM(total_count) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) d_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_count) > 0
|
||||
THEN ROUND((SUM("E") / SUM(total_count) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) e_percent, -- нет такой категории
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(total_count) > 0
|
||||
THEN ROUND((SUM(nope) / SUM(total_count) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) nope_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
"all_M_W" AS gender,
|
||||
convicts,
|
||||
'Ministry' AS schema
|
||||
FROM total_registered.driver_license
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE
|
||||
GROUP BY "all_M_W", convicts;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>688</xloc>
|
||||
<yloc>304</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 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>896</xloc>
|
||||
<yloc>304</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2 3</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>688</xloc>
|
||||
<yloc>464</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 2 3</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>896</xloc>
|
||||
<yloc>464</yloc>
|
||||
<xloc>864</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -21,36 +21,11 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/все</from>
|
||||
<to>Insert / update (total_registered.marital_status) </to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/мужчины</from>
|
||||
<to>Insert / update (total_registered.marital_status) 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/женщины</from>
|
||||
<to>Insert / update (total_registered.marital_status) 3</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2</from>
|
||||
<to>Select values 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2 2</from>
|
||||
<to>Select values 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2 3</from>
|
||||
<to>Select values 2 2 3</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/все</from>
|
||||
<to>Get variables 2 2</to>
|
||||
|
|
@ -62,429 +37,37 @@
|
|||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/мужчины</from>
|
||||
<to>Get variables 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 2 2 2</from>
|
||||
<to>Insert / update (total_registered.marital_status) 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/женщины</from>
|
||||
<to>Get variables 2 2 3</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 2 2 3</from>
|
||||
<to>Insert / update (total_registered.marital_status) 3</to>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (person_registry) РФ/все</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.marital_status) </name>
|
||||
<type>InsertUpdate</type>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<distribute>N</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<commit>100</commit>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<lookup>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>"all_M_W"</field>
|
||||
<name>gender</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>marital_status</table>
|
||||
<value>
|
||||
<name>married</name>
|
||||
<rename>married</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_married</name>
|
||||
<rename>not_married</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>married_percent</name>
|
||||
<rename>married_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_married_percent</name>
|
||||
<rename>not_married_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"all_M_W"</name>
|
||||
<rename>gender</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>total</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1216</xloc>
|
||||
<yloc>176</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.marital_status) 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>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>"all_M_W"</field>
|
||||
<name>gender</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>marital_status</table>
|
||||
<value>
|
||||
<name>married</name>
|
||||
<rename>married</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_married</name>
|
||||
<rename>not_married</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>married_percent</name>
|
||||
<rename>married_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_married_percent</name>
|
||||
<rename>not_married_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"all_M_W"</name>
|
||||
<rename>gender</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>total</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1216</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.marital_status) 3</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>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>"all_M_W"</field>
|
||||
<name>gender</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>marital_status</table>
|
||||
<value>
|
||||
<name>married</name>
|
||||
<rename>married</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_married</name>
|
||||
<rename>not_married</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>married_percent</name>
|
||||
<rename>married_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_married_percent</name>
|
||||
<rename>not_married_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"all_M_W"</name>
|
||||
<rename>gender</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>total</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1216</xloc>
|
||||
<yloc>368</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) РФ/все</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu_person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
|
||||
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
|
||||
) AS not_married,
|
||||
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
|
||||
) AS married,
|
||||
|
||||
COUNT(*) AS total,
|
||||
|
||||
CASE
|
||||
WHEN COUNT(*) = 0 THEN 0
|
||||
ELSE ROUND(
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
|
||||
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
|
||||
) * 100.0 / COUNT(*), 2
|
||||
) END AS not_married_percent,
|
||||
|
||||
CASE
|
||||
WHEN COUNT(*) = 0 THEN 0
|
||||
ELSE ROUND(
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
|
||||
) * 100.0 / COUNT(*), 2
|
||||
) END AS married_percent,
|
||||
'ALL' as gender,
|
||||
'${REG_ID}' as recruitment_id
|
||||
|
||||
FROM
|
||||
public.recruits r
|
||||
JOIN
|
||||
public.recruits_info ri ON ri.recruit_id = r.id
|
||||
WHERE
|
||||
r.current_recruitment_id IS NOT NULL
|
||||
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null and r.target_recruitment_id is not null</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<quoteString>N</quoteString>
|
||||
<replace_variables>Y</replace_variables>
|
||||
<set_params>N</set_params>
|
||||
<single_statement>N</single_statement>
|
||||
<sql>DELETE FROM total_registered.marital_status
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>592</xloc>
|
||||
<yloc>176</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) РФ/женщины</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu_person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql> SELECT
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
|
||||
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
|
||||
) AS not_married,
|
||||
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
|
||||
) AS married,
|
||||
|
||||
COUNT(*) AS total,
|
||||
|
||||
CASE
|
||||
WHEN COUNT(*) = 0 THEN 0
|
||||
ELSE ROUND(
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
|
||||
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
|
||||
) * 100.0 / COUNT(*), 2
|
||||
) END AS not_married_percent,
|
||||
|
||||
CASE
|
||||
WHEN COUNT(*) = 0 THEN 0
|
||||
ELSE ROUND(
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
|
||||
) * 100.0 / COUNT(*), 2
|
||||
) END AS married_percent,
|
||||
'W' as gender,
|
||||
'${REG_ID}' as recruitment_id
|
||||
|
||||
FROM
|
||||
public.recruits r
|
||||
JOIN
|
||||
public.recruits_info ri ON ri.recruit_id = r.id
|
||||
WHERE
|
||||
r.current_recruitment_id IS NOT NULL
|
||||
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null and r.target_recruitment_id is not null
|
||||
AND r.gender = 'FEMALE';
|
||||
</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>592</xloc>
|
||||
<yloc>368</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) РФ/мужчины</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu_person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
|
||||
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
|
||||
) AS not_married,
|
||||
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
|
||||
) AS married,
|
||||
|
||||
COUNT(*) AS total,
|
||||
|
||||
CASE
|
||||
WHEN COUNT(*) = 0 THEN 0
|
||||
ELSE ROUND(
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('Вдова/Вдовец', 'В разводе')
|
||||
OR ri.info->'svedSemPolozh'->'semPolozhNaim' IS NULL
|
||||
) * 100.0 / COUNT(*), 2
|
||||
) END AS not_married_percent,
|
||||
|
||||
CASE
|
||||
WHEN COUNT(*) = 0 THEN 0
|
||||
ELSE ROUND(
|
||||
COUNT(*) FILTER (
|
||||
WHERE
|
||||
ri.info->'svedSemPolozh'->>'semPolozhNaim' IN ('В браке')
|
||||
) * 100.0 / COUNT(*), 2
|
||||
) END AS married_percent,
|
||||
'M' as gender,
|
||||
'${REG_ID}' as recruitment_id
|
||||
|
||||
FROM
|
||||
public.recruits r
|
||||
JOIN
|
||||
public.recruits_info ri ON ri.recruit_id = r.id
|
||||
WHERE
|
||||
r.current_recruitment_id IS NOT NULL
|
||||
AND r.vu_current_info->>'isMilitaryRegistered' = 'true' and r.current_recruitment_id is not null and r.target_recruitment_id is not null
|
||||
AND r.gender = 'MALE';
|
||||
</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>592</xloc>
|
||||
<xloc>352</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
|
|
@ -517,8 +100,107 @@ WHERE
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>800</xloc>
|
||||
<yloc>208</yloc>
|
||||
<xloc>880</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.marital_status) </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>REG_ID</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>"all_M_W"</field>
|
||||
<name>gender</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>convicts</field>
|
||||
<name>convicts</name>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>marital_status</table>
|
||||
<value>
|
||||
<name>married</name>
|
||||
<rename>married</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_married</name>
|
||||
<rename>not_married</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>married_percent</name>
|
||||
<rename>married_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>not_married_percent</name>
|
||||
<rename>not_married_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"all_M_W"</name>
|
||||
<rename>gender</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>marital_status</name>
|
||||
<rename>total</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>convicts</name>
|
||||
<rename>convicts</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>other</name>
|
||||
<rename>other</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>other_percent</name>
|
||||
<rename>other_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>Y</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1392</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -571,13 +253,13 @@ WHERE
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1008</xloc>
|
||||
<yloc>208</yloc>
|
||||
<xloc>1088</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2 2</name>
|
||||
<type>GetVariable</type>
|
||||
<name>Table input (person_registry) РФ/все</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
|
|
@ -586,167 +268,52 @@ WHERE
|
|||
<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>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(married), 0) married,
|
||||
COALESCE(SUM(not_married), 0) not_married,
|
||||
COALESCE(SUM(other), 0) other,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(marital_status) > 0
|
||||
THEN ROUND((SUM(married) / SUM(marital_status) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) married_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(marital_status) > 0
|
||||
THEN ROUND((SUM(not_married) / SUM(marital_status) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) not_married_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(marital_status) > 0
|
||||
THEN ROUND((SUM(other) / SUM(marital_status) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) other_percent,
|
||||
COALESCE(SUM(marital_status), 0) total,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
"all_M_W" AS gender,
|
||||
convicts,
|
||||
'Ministry' AS schema
|
||||
FROM total_registered.marital_status
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE
|
||||
GROUP BY "all_M_W", convicts;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>800</xloc>
|
||||
<yloc>304</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 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>304</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2 3</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>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 2 3</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>400</yloc>
|
||||
<xloc>608</xloc>
|
||||
<yloc>272</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
|
|
@ -21,36 +21,11 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/на учете</from>
|
||||
<to>Insert / update (total_registered.reg_mil_cat)</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/не на учете</from>
|
||||
<to>Insert / update (total_registered.reg_mil_cat) 2</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2</from>
|
||||
<to>Select values 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2 2</from>
|
||||
<to>Select values 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/не на учете</from>
|
||||
<to>Get variables 2 2 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Select values 2 2 2</from>
|
||||
<to>Insert / update (total_registered.reg_mil_cat) 2</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Table input (person_registry) РФ/на учете</from>
|
||||
<to>Get variables 2 2</to>
|
||||
|
|
@ -61,7 +36,41 @@
|
|||
<to>Insert / update (total_registered.reg_mil_cat)</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (person_registry) РФ/на учете</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 total_registered.reg_mil_cat
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>672</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 2</name>
|
||||
<type>GetVariable</type>
|
||||
|
|
@ -91,41 +100,8 @@
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>624</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Get variables 2 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>624</xloc>
|
||||
<yloc>480</yloc>
|
||||
<xloc>1184</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -152,109 +128,10 @@
|
|||
<field>mil_reg</field>
|
||||
<name>mil_reg</name>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>reg_mil_cat</table>
|
||||
<value>
|
||||
<name>first_reg_17</name>
|
||||
<rename>first_reg_17</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>first_reg_18</name>
|
||||
<rename>first_reg_18</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"mil_spec_W"</name>
|
||||
<rename>mil_spec_w</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>recruitment_id</name>
|
||||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>returned_dep_liberty</name>
|
||||
<rename>returned_dep_liberty</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>punished</name>
|
||||
<rename>punished</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>received_citizenship</name>
|
||||
<rename>received_citizenship</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>first_reg_17_percent</name>
|
||||
<rename>first_reg_17_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>first_reg_18_percent</name>
|
||||
<rename>first_reg_18_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>returned_dep_liberty_percent</name>
|
||||
<rename>returned_dep_liberty_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>"mil_spec_W_percent"</name>
|
||||
<rename>mil_spec_w_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>punished_percent</name>
|
||||
<rename>punished_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>received_citizenship_percent</name>
|
||||
<rename>received_citizenship_percent</rename>
|
||||
<update>Y</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>mil_reg</name>
|
||||
<rename>mil_reg</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>944</xloc>
|
||||
<yloc>176</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.reg_mil_cat) 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>REG_ID</name>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>mil_reg</field>
|
||||
<name>mil_reg</name>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>reg_mil_cat</table>
|
||||
|
|
@ -328,12 +205,17 @@
|
|||
<rename>mil_reg</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>944</xloc>
|
||||
<yloc>384</yloc>
|
||||
<xloc>1648</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -386,62 +268,8 @@
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>832</xloc>
|
||||
<yloc>256</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 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>832</xloc>
|
||||
<yloc>480</yloc>
|
||||
<xloc>1392</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
|
|
@ -455,223 +283,83 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu_person_registry</connection>
|
||||
<connection>ervu-dashboard</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH base_data AS (
|
||||
-- Основной набор данных
|
||||
SELECT
|
||||
r.registration_reasons,
|
||||
r.gender,
|
||||
r.vu_current_info ->> 'isMilitaryRegistered' AS is_military_registered
|
||||
FROM public.recruits r
|
||||
WHERE r.vu_current_info ->> 'isMilitaryRegistered' = 'true'
|
||||
AND r.current_recruitment_id IS NOT NULL
|
||||
AND r.target_recruitment_id IS NOT NULL
|
||||
),
|
||||
total AS (
|
||||
-- Общее количество записей
|
||||
SELECT COUNT(*) AS total_count
|
||||
FROM base_data
|
||||
),
|
||||
t1 AS (
|
||||
-- Первоначальная постановка 17 лет
|
||||
SELECT COUNT(*) AS first_reg_17
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"5"'
|
||||
),
|
||||
t2 AS (
|
||||
-- Первоначальная постановка 18 лет
|
||||
SELECT COUNT(*) AS first_reg_18
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"6"'
|
||||
OR registration_reasons @> '"3"'
|
||||
OR registration_reasons @> '"1"'
|
||||
OR registration_reasons @> '"4"'
|
||||
OR registration_reasons @> '"2"'
|
||||
),
|
||||
t3 AS (
|
||||
-- Женщины, получившие ВУС
|
||||
SELECT COUNT(*) AS mil_spec_w
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"3"' AND gender = 'FEMALE'
|
||||
),
|
||||
t4 AS (
|
||||
-- Возвратившиеся из мест лишения свободы
|
||||
SELECT COUNT(*) AS returned_dep_liberty
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"1"'
|
||||
),
|
||||
t5 AS (
|
||||
-- Отбывающие наказание в местах лишения свободы
|
||||
SELECT COUNT(*) AS punished
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"4"'
|
||||
),
|
||||
t6 AS (
|
||||
-- Получившие гражданство
|
||||
SELECT COUNT(*) AS received_citizenship
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"2"'
|
||||
),
|
||||
t7 AS (
|
||||
-- Получившие гражданство
|
||||
SELECT COUNT(*) AS other
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"6"'
|
||||
AND NOT registration_reasons @> '"3"'
|
||||
AND NOT registration_reasons @> '"1"'
|
||||
AND NOT registration_reasons @> '"4"'
|
||||
AND NOT registration_reasons @> '"2"'
|
||||
)
|
||||
SELECT
|
||||
total.total_count,
|
||||
t1.first_reg_17,
|
||||
t2.first_reg_18,
|
||||
t3.mil_spec_w,
|
||||
t4.returned_dep_liberty,
|
||||
t5.punished,
|
||||
t6.received_citizenship,
|
||||
t7.other,
|
||||
-- Вычисление процентов
|
||||
ROUND(t1.first_reg_17 * 100.0 / NULLIF(total.total_count, 0), 2) AS first_reg_17_percent,
|
||||
ROUND(t2.first_reg_18 * 100.0 / NULLIF(total.total_count, 0), 2) AS first_reg_18_percent,
|
||||
ROUND(t4.returned_dep_liberty * 100.0 / NULLIF(total.total_count, 0), 2) AS returned_dep_liberty_percent,
|
||||
ROUND(t3.mil_spec_w * 100.0 / NULLIF(total.total_count, 0), 2) AS mil_spec_w_percent,
|
||||
ROUND(t5.punished * 100.0 / NULLIF(total.total_count, 0), 2) AS punished_percent,
|
||||
ROUND(t6.received_citizenship * 100.0 / NULLIF(total.total_count, 0), 2) AS received_citizenship_percent,
|
||||
ROUND(t7.other * 100.0 / NULLIF(total.total_count, 0), 2) AS other_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
1 AS mil_reg,
|
||||
1 AS org
|
||||
FROM total
|
||||
FULL OUTER JOIN t1 ON 1 = 1
|
||||
FULL OUTER JOIN t2 ON 1 = 1
|
||||
FULL OUTER JOIN t3 ON 1 = 1
|
||||
FULL OUTER JOIN t4 ON 1 = 1
|
||||
FULL OUTER JOIN t5 ON 1 = 1
|
||||
FULL OUTER JOIN t6 ON 1 = 1
|
||||
FULL OUTER JOIN t7 ON 1 = 1;</sql>
|
||||
<sql>SELECT
|
||||
COALESCE(SUM(first_reg_17), 0) first_reg_17,
|
||||
COALESCE(SUM(first_reg_18), 0) first_reg_18,
|
||||
COALESCE(SUM("mil_spec_W"), 0) mil_spec_w,
|
||||
COALESCE(SUM(returned_dep_liberty), 0) returned_dep_liberty,
|
||||
COALESCE(SUM(punished), 0) punished,
|
||||
COALESCE(SUM(received_citizenship), 0) received_citizenship,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN (SUM(first_reg_17) + SUM(first_reg_18)) > 0
|
||||
THEN ROUND((SUM(first_reg_17) / (SUM(first_reg_17) + SUM(first_reg_18)) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
)
|
||||
first_reg_17_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN (SUM(first_reg_17) + SUM(first_reg_18)) > 0
|
||||
THEN ROUND((SUM(first_reg_18) / (SUM(first_reg_17) + SUM(first_reg_18)) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
)
|
||||
first_reg_18_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN (SUM(first_reg_17) + SUM(first_reg_18)) > 0
|
||||
THEN ROUND((SUM(returned_dep_liberty) / (SUM(first_reg_17) + SUM(first_reg_18)) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
)
|
||||
returned_dep_liberty_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN (SUM(first_reg_17) + SUM(first_reg_18)) > 0
|
||||
THEN ROUND((SUM("mil_spec_W") / (SUM(first_reg_17) + SUM(first_reg_18)) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
)
|
||||
mil_spec_w_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN (SUM(first_reg_17) + SUM(first_reg_18)) > 0
|
||||
THEN ROUND((SUM(punished) / (SUM(first_reg_17) + SUM(first_reg_18)) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
)
|
||||
punished_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN (SUM(first_reg_17) + SUM(first_reg_18)) > 0
|
||||
THEN ROUND((SUM(received_citizenship) / (SUM(first_reg_17) + SUM(first_reg_18)) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
)
|
||||
received_citizenship_percent,
|
||||
'${REG_ID}'::uuid AS recruitment_id,
|
||||
mil_reg,
|
||||
'Ministry' AS schema
|
||||
FROM total_registered.reg_mil_cat
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE
|
||||
GROUP BY mil_reg;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>512</xloc>
|
||||
<yloc>176</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (person_registry) РФ/не на учете</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>ervu_person_registry</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>WITH base_data AS (
|
||||
-- Основной набор данных
|
||||
SELECT
|
||||
r.registration_reasons,
|
||||
r.gender,
|
||||
r.vu_current_info ->> 'isMilitaryRegistered' AS is_military_registered
|
||||
FROM public.recruits r
|
||||
WHERE r.vu_current_info ->> 'isMilitaryRegistered' = 'false'
|
||||
AND r.current_recruitment_id IS NOT NULL
|
||||
AND r.target_recruitment_id IS NOT NULL
|
||||
),
|
||||
total AS (
|
||||
-- Общее количество записей
|
||||
SELECT COUNT(*) AS total_count
|
||||
FROM base_data
|
||||
),
|
||||
t1 AS (
|
||||
-- Первоначальная постановка 17 лет
|
||||
SELECT COUNT(*) AS first_reg_17
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"5"'
|
||||
),
|
||||
t2 AS (
|
||||
-- Первоначальная постановка 18 лет
|
||||
SELECT COUNT(*) AS first_reg_18
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"6"'
|
||||
OR registration_reasons @> '"3"'
|
||||
OR registration_reasons @> '"1"'
|
||||
OR registration_reasons @> '"4"'
|
||||
OR registration_reasons @> '"2"'
|
||||
),
|
||||
t3 AS (
|
||||
-- Женщины, получившие ВУС
|
||||
SELECT COUNT(*) AS mil_spec_w
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"3"' AND gender = 'FEMALE'
|
||||
),
|
||||
t4 AS (
|
||||
-- Возвратившиеся из мест лишения свободы
|
||||
SELECT COUNT(*) AS returned_dep_liberty
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"1"'
|
||||
),
|
||||
t5 AS (
|
||||
-- Отбывающие наказание в местах лишения свободы
|
||||
SELECT COUNT(*) AS punished
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"4"'
|
||||
),
|
||||
t6 AS (
|
||||
-- Получившие гражданство
|
||||
SELECT COUNT(*) AS received_citizenship
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"2"'
|
||||
),
|
||||
t7 AS (
|
||||
-- Получившие гражданство
|
||||
SELECT COUNT(*) AS other
|
||||
FROM base_data
|
||||
WHERE registration_reasons @> '"6"'
|
||||
AND NOT registration_reasons @> '"3"'
|
||||
AND NOT registration_reasons @> '"1"'
|
||||
AND NOT registration_reasons @> '"4"'
|
||||
AND NOT registration_reasons @> '"2"'
|
||||
)
|
||||
SELECT
|
||||
total.total_count,
|
||||
t1.first_reg_17,
|
||||
t2.first_reg_18,
|
||||
t3.mil_spec_w,
|
||||
t4.returned_dep_liberty,
|
||||
t5.punished,
|
||||
t6.received_citizenship,
|
||||
t7.other,
|
||||
-- Вычисление процентов
|
||||
ROUND(t1.first_reg_17 * 100.0 / NULLIF(total.total_count, 0), 2) AS first_reg_17_percent,
|
||||
ROUND(t2.first_reg_18 * 100.0 / NULLIF(total.total_count, 0), 2) AS first_reg_18_percent,
|
||||
ROUND(t4.returned_dep_liberty * 100.0 / NULLIF(total.total_count, 0), 2) AS returned_dep_liberty_percent,
|
||||
ROUND(t3.mil_spec_w * 100.0 / NULLIF(total.total_count, 0), 2) AS mil_spec_w_percent,
|
||||
ROUND(t5.punished * 100.0 / NULLIF(total.total_count, 0), 2) AS punished_percent,
|
||||
ROUND(t6.received_citizenship * 100.0 / NULLIF(total.total_count, 0), 2) AS received_citizenship_percent,
|
||||
ROUND(t7.other * 100.0 / NULLIF(total.total_count, 0), 2) AS other_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
0 AS mil_reg,
|
||||
1 AS org
|
||||
FROM total
|
||||
FULL OUTER JOIN t1 ON 1 = 1
|
||||
FULL OUTER JOIN t2 ON 1 = 1
|
||||
FULL OUTER JOIN t3 ON 1 = 1
|
||||
FULL OUTER JOIN t4 ON 1 = 1
|
||||
FULL OUTER JOIN t5 ON 1 = 1
|
||||
FULL OUTER JOIN t6 ON 1 = 1
|
||||
FULL OUTER JOIN t7 ON 1 = 1;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>512</xloc>
|
||||
<yloc>384</yloc>
|
||||
<xloc>944</xloc>
|
||||
<yloc>400</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
|
|
@ -21,11 +21,6 @@
|
|||
<notepads>
|
||||
</notepads>
|
||||
<order>
|
||||
<hop>
|
||||
<from>Table input (decision-document-service) РФ</from>
|
||||
<to>Insert / update (total_registered.removed_registry)</to>
|
||||
<enabled>N</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Get variables 2 2</from>
|
||||
<to>Select values 2 2</to>
|
||||
|
|
@ -41,7 +36,74 @@
|
|||
<to>Insert / update (total_registered.removed_registry)</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
<hop>
|
||||
<from>Execute SQL script</from>
|
||||
<to>Table input (decision-document-service) РФ</to>
|
||||
<enabled>Y</enabled>
|
||||
</hop>
|
||||
</order>
|
||||
<transform>
|
||||
<name>Execute SQL script</name>
|
||||
<type>ExecSql</type>
|
||||
<description/>
|
||||
<distribute>Y</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 total_registered.removed_registry
|
||||
WHERE recording_date = current_date
|
||||
AND schema = 'Ministry'
|
||||
AND recruitment_id = '${REG_ID}'</sql>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>224</xloc>
|
||||
<yloc>224</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>672</xloc>
|
||||
<yloc>224</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Insert / update (total_registered.removed_registry)</name>
|
||||
<type>InsertUpdate</type>
|
||||
|
|
@ -60,7 +122,11 @@
|
|||
<condition>=</condition>
|
||||
<field>recruitment_id</field>
|
||||
<name>REG_ID</name>
|
||||
<name2/>
|
||||
</key>
|
||||
<key>
|
||||
<condition>=</condition>
|
||||
<field>schema</field>
|
||||
<name>schema</name>
|
||||
</key>
|
||||
<schema>total_registered</schema>
|
||||
<table>removed_registry</table>
|
||||
|
|
@ -134,92 +200,19 @@
|
|||
<rename>recruitment_id</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
<value>
|
||||
<name>schema</name>
|
||||
<rename>schema</rename>
|
||||
<update>N</update>
|
||||
</value>
|
||||
</lookup>
|
||||
<update_bypassed>N</update_bypassed>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>1072</xloc>
|
||||
<xloc>1136</xloc>
|
||||
<yloc>224</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (decision-document-service) РФ</name>
|
||||
<type>TableInput</type>
|
||||
<description/>
|
||||
<distribute>Y</distribute>
|
||||
<custom_distribution/>
|
||||
<copies>1</copies>
|
||||
<partitioning>
|
||||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<connection>postgres.decision-document-service</connection>
|
||||
<execute_each_row>N</execute_each_row>
|
||||
<limit>0</limit>
|
||||
<sql>SELECT
|
||||
COUNT(*) AS removed_registry,
|
||||
COUNT(CASE WHEN d.extra_info ->> 'cause' = 'ageLimit' THEN 1 END) AS age_limit, -- Количество по причине предельный возраст
|
||||
COUNT(CASE WHEN d.extra_info ->> 'cause' = 'notAlive' THEN 1 END) AS death, -- Количество по причине смерть
|
||||
'0' AS deprivation_citizenship,
|
||||
'0' AS travel_abroad,
|
||||
'0' AS living_abroad,
|
||||
COUNT(CASE WHEN (d.extra_info ->> 'cause' IS NULL OR d.extra_info ->> 'cause' NOT IN ('ageLimit', 'notAlive')) THEN 1 END) AS other, -- Количество по другим причинам
|
||||
'0' AS deprivation_citizen_percents,
|
||||
ROUND(COUNT(CASE WHEN d.extra_info ->> 'cause' = 'ageLimit' THEN 1 END) * 100.0 / NULLIF(COUNT(*), 0), 2) AS age_limit_percent, -- Процент по причине предельный возраст
|
||||
ROUND(COUNT(CASE WHEN d.extra_info ->> 'cause' = 'notAlive' THEN 1 END) * 100.0 / NULLIF(COUNT(*), 0), 2) AS death_percent, -- Процент по причине смерть
|
||||
'0' AS travel_abroad_percent,
|
||||
'0' AS living_abroad_percent,
|
||||
ROUND(COUNT(CASE WHEN (d.extra_info ->> 'cause' IS NULL OR d.extra_info ->> 'cause' NOT IN ('ageLimit', 'notAlive')) THEN 1 END) * 100.0 / NULLIF(COUNT(*), 0), 2) AS other_percent, -- Процент по другим причинам
|
||||
'${REG_ID}' AS recruitment_id
|
||||
FROM public.recruit AS r
|
||||
JOIN public.decision AS d
|
||||
ON d.recruit_id = r.id
|
||||
JOIN public.decision_type AS dt
|
||||
ON dt.id = d.type_id
|
||||
WHERE r.system_pgs_status = '1.3'
|
||||
AND r.current_recruitment IS NOT NULL
|
||||
AND r.target_recruitment IS NOT NULL
|
||||
AND dt.code IN ('9', '10');</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>464</xloc>
|
||||
<yloc>224</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>656</xloc>
|
||||
<yloc>304</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Select values 2 2</name>
|
||||
<type>SelectValues</type>
|
||||
|
|
@ -270,8 +263,91 @@ WHERE r.system_pgs_status = '1.3'
|
|||
</fields>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>864</xloc>
|
||||
<yloc>304</yloc>
|
||||
<xloc>880</xloc>
|
||||
<yloc>224</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform>
|
||||
<name>Table input (decision-document-service) РФ</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(age_limit), 0) age_limit,
|
||||
COALESCE(SUM(death), 0) death,
|
||||
COALESCE(SUM(removed_registry), 0) removed_registry,
|
||||
COALESCE(SUM(deprivation_citizenship), 0) deprivation_citizenship,
|
||||
COALESCE(SUM(travel_abroad), 0) travel_abroad,
|
||||
COALESCE(SUM(living_abroad), 0) living_abroad,
|
||||
COALESCE(SUM(other), 0) other,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(removed_registry) > 0
|
||||
THEN ROUND((SUM(deprivation_citizenship) / SUM(removed_registry) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) deprivation_citizen_percents,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(removed_registry) > 0
|
||||
THEN ROUND((SUM(age_limit) / SUM(removed_registry) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) age_limit_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(removed_registry) > 0
|
||||
THEN ROUND((SUM(death) / SUM(removed_registry) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) death_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(removed_registry) > 0
|
||||
THEN ROUND((SUM(travel_abroad) / SUM(removed_registry) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) travel_abroad_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(removed_registry) > 0
|
||||
THEN ROUND((SUM(living_abroad) / SUM(removed_registry) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) living_abroad_percent,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN SUM(removed_registry) > 0
|
||||
THEN ROUND((SUM(other) / SUM(removed_registry) * 100), 2)
|
||||
ELSE 0
|
||||
END,
|
||||
0
|
||||
) other_percent,
|
||||
'${REG_ID}' AS recruitment_id,
|
||||
'Ministry' AS schema
|
||||
FROM total_registered.removed_registry
|
||||
WHERE recruitment_id = ANY ('${VK_ARRAY}')
|
||||
AND schema = 'Region'
|
||||
AND recording_date = CURRENT_DATE;</sql>
|
||||
<variables_active>Y</variables_active>
|
||||
<attributes/>
|
||||
<GUI>
|
||||
<xloc>464</xloc>
|
||||
<yloc>224</yloc>
|
||||
</GUI>
|
||||
</transform>
|
||||
<transform_error_handling>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue