ervu-secret/config-data-executor/config-examples/block.xml

167 lines
7.9 KiB
XML
Raw Normal View History

2024-09-19 12:57:06 +03:00
<Requests>
<SqlRequest>
<RequestURL>
<![CDATA[
DO
$$
begin
update recruits
set current_recruitment_id = 'ИДЕНТИФИКАТОР ТЕСТОВОГО ВК'
,target_recruitment_id = 'ИДЕНТИФИКАТОР ТЕСТОВОГО ВК'
,department_id_old = 'ИДЕНТИФИКАТОР ТЕСТОВОГО ВК'
,system_pgs_status = '13'
,extra_info = jsonb_set(coalesce(extra_info,'{}'::jsonb), '{blocked}',
('{"cur":'|| coalesce('"'||current_recruitment_id::text||'"','null')||
2024-09-27 15:47:00 +03:00
',"trg":'|| coalesce('"'||target_recruitment_id::text||'"','null')||
',"dio":'|| coalesce('"'||department_id_old::text||'"','null')||
',"st":'|| coalesce('"'||system_pgs_status::text||'"','null')||'}')::jsonb
2024-09-19 12:57:06 +03:00
)
2024-09-27 15:47:00 +03:00
where id in ${endpointArguments};
2024-09-19 12:57:06 +03:00
end
$$;
]]>
</RequestURL>
<SqlConnectionParams>
2024-09-27 15:06:05 +03:00
<JdbcHost>10.10.31.118</JdbcHost>
2024-09-19 12:57:06 +03:00
<JdbcPort>5432</JdbcPort>
2024-09-27 15:06:05 +03:00
<JdbcUsername>ervu</JdbcUsername>
<JdbcPassword>ervu</JdbcPassword>
2024-09-19 12:57:06 +03:00
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
2024-09-27 15:06:05 +03:00
<JdbcDatabase>summon-list-registry</JdbcDatabase>
2024-09-19 12:57:06 +03:00
</SqlConnectionParams>
</SqlRequest>
<SqlRequest>
<RequestURL>
<![CDATA[
DO
$$
BEGIN
2024-09-27 15:47:00 +03:00
DELETE FROM subpoena_history where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments};
DELETE FROM subpoena_appearance where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}));
DELETE FROM subpoena_send_info where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}));
2024-09-19 12:57:06 +03:00
DELETE FROM notification_item where restriction_document_item_id in (
select id from restriction_document_item where restriction_document_create_id in (
2024-09-27 15:47:00 +03:00
select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}))));
2024-09-19 12:57:06 +03:00
DELETE FROM notification_item where restriction_document_item_id in (
select id from restriction_document_item where restriction_document_cancel_id in (
2024-09-27 15:47:00 +03:00
select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}))));
2024-09-19 12:57:06 +03:00
DELETE FROM restriction_document_item where restriction_document_create_id in (
2024-09-27 15:47:00 +03:00
select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments})));
2024-09-19 12:57:06 +03:00
DELETE FROM restriction_document_item where restriction_document_cancel_id in (
2024-09-27 15:47:00 +03:00
select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments})));
DELETE FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}));
DELETE FROM subpoena where recruit_id in ${endpointArguments};
2024-09-19 12:57:06 +03:00
END
$$;
]]>
</RequestURL>
<SqlConnectionParams>
2024-09-27 15:06:05 +03:00
<JdbcHost>10.10.31.118</JdbcHost>
2024-09-19 12:57:06 +03:00
<JdbcPort>5432</JdbcPort>
2024-09-27 15:06:05 +03:00
<JdbcUsername>ervu</JdbcUsername>
<JdbcPassword>ervu</JdbcPassword>
2024-09-19 12:57:06 +03:00
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
2024-09-27 15:06:05 +03:00
<JdbcDatabase>subpoena</JdbcDatabase>
2024-09-19 12:57:06 +03:00
</SqlConnectionParams>
</SqlRequest>
<SqlRequest>
<RequestURL>
<![CDATA[
DO
$$
BEGIN
DELETE
FROM incident_history
2024-09-27 15:47:00 +03:00
where incident_id in (select id from incident where recruit_id in ${endpointArguments}));
DELETE FROM incident where recruit_id in ${endpointArguments};
2024-09-19 12:57:06 +03:00
END
$$;
]]>
</RequestURL>
<SqlConnectionParams>
2024-09-27 15:06:05 +03:00
<JdbcHost>10.10.31.118</JdbcHost>
2024-09-19 12:57:06 +03:00
<JdbcPort>5432</JdbcPort>
2024-09-27 15:06:05 +03:00
<JdbcUsername>ervu</JdbcUsername>
<JdbcPassword>ervu</JdbcPassword>
2024-09-19 12:57:06 +03:00
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
2024-09-27 15:06:05 +03:00
<JdbcDatabase>incidents</JdbcDatabase>
2024-09-19 12:57:06 +03:00
</SqlConnectionParams>
</SqlRequest>
<SqlRequest>
<RequestURL>
<![CDATA[
DO
$$
2024-09-27 15:47:00 +03:00
DECLARE
var1 uuid[] := '{
${endpointArguments}
}';
2024-09-19 12:57:06 +03:00
BEGIN
2024-09-27 15:47:00 +03:00
DELETE FROM notifications where recruit_id = any (var1);
2024-09-19 12:57:06 +03:00
END
$$;
]]>
</RequestURL>
<SqlConnectionParams>
2024-09-27 15:06:05 +03:00
<JdbcHost>10.10.31.118</JdbcHost>
2024-09-19 12:57:06 +03:00
<JdbcPort>5432</JdbcPort>
2024-09-27 15:06:05 +03:00
<JdbcUsername>ervu</JdbcUsername>
<JdbcPassword>ervu</JdbcPassword>
2024-09-19 12:57:06 +03:00
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
2024-09-27 15:06:05 +03:00
<JdbcDatabase>geps_notifications</JdbcDatabase>
2024-09-19 12:57:06 +03:00
</SqlConnectionParams>
</SqlRequest>
<SqlRequest>
<RequestURL>
<![CDATA[
DO
$$
DECLARE
2024-09-21 17:07:14 +03:00
recruitIds uuid[] := '{${endpointArguments}}';
2024-09-19 12:57:06 +03:00
importIds uuid[] := ARRAY(SELECT import_id
FROM import_results
WHERE recruit_id = ANY (recruitIds));
BEGIN
WITH ImportDeletes AS (DELETE FROM import_journal_start WHERE import_id = ANY (importIds) RETURNING journal_id)
DELETE
FROM journal
WHERE id IN (SELECT journal_id FROM ImportDeletes);
DELETE FROM import_journal_finish WHERE import_id = ANY (importIds);
DELETE FROM import_events_journal WHERE import_id = ANY (importIds);
DELETE FROM import_validation_errors WHERE import_id = ANY (importIds);
DELETE FROM import_results WHERE import_id = ANY (importIds);
DELETE FROM uploaded_files WHERE extra_info ->> 'importId' = ANY (importIds::text[]);
DELETE FROM object_history WHERE object_id = ANY (recruitIds);
DELETE FROM object_versions WHERE object_id = ANY (recruitIds);
END
$$;
]]>
</RequestURL>
<SqlConnectionParams>
2024-09-27 15:06:05 +03:00
<JdbcHost>10.10.31.118</JdbcHost>
2024-09-19 12:57:06 +03:00
<JdbcPort>5432</JdbcPort>
2024-09-27 15:06:05 +03:00
<JdbcUsername>ervu</JdbcUsername>
<JdbcPassword>ervu</JdbcPassword>
2024-09-19 12:57:06 +03:00
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
2024-09-27 15:06:05 +03:00
<JdbcDatabase>journal_dev</JdbcDatabase>
2024-09-19 12:57:06 +03:00
</SqlConnectionParams>
</SqlRequest>
</Requests>