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')||
|
|
|
|
|
|
',"trg":'|| coalesce('"'||target_recruitment_id::text||'"','null')||
|
|
|
|
|
|
',"dio":'|| coalesce('"'||department_id_old::text||'"','null')||
|
|
|
|
|
|
',"st":'|| coalesce('"'||system_pgs_status::text||'"','null')||'}')::jsonb
|
|
|
|
|
|
)
|
2024-09-21 17:07:14 +03:00
|
|
|
|
where id in ${endpointArguments} ${extraConditions};
|
2024-09-19 12:57:06 +03:00
|
|
|
|
end
|
|
|
|
|
|
$$;
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</RequestURL>
|
|
|
|
|
|
<SqlConnectionParams>
|
|
|
|
|
|
<JdbcHost>localhost</JdbcHost>
|
|
|
|
|
|
<JdbcPort>5432</JdbcPort>
|
|
|
|
|
|
<JdbcUsername>sqlUser</JdbcUsername>
|
|
|
|
|
|
<JdbcPassword>sqlPassword</JdbcPassword>
|
|
|
|
|
|
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
|
|
|
|
|
|
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
|
|
|
|
|
|
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
|
|
|
|
|
|
<JdbcDatabase>mainDatabase</JdbcDatabase>
|
|
|
|
|
|
</SqlConnectionParams>
|
|
|
|
|
|
</SqlRequest>
|
|
|
|
|
|
|
|
|
|
|
|
<SqlRequest>
|
|
|
|
|
|
<RequestURL>
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
DO
|
|
|
|
|
|
$$
|
|
|
|
|
|
BEGIN
|
2024-09-21 17:07:14 +03:00
|
|
|
|
DELETE FROM subpoena_history where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments} ${extraConditions};
|
|
|
|
|
|
DELETE FROM subpoena_appearance where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments} ${extraConditions}));
|
|
|
|
|
|
DELETE FROM subpoena_send_info where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments} ${extraConditions}));
|
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-21 17:07:14 +03:00
|
|
|
|
select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments} ${extraConditions}))));
|
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-21 17:07:14 +03:00
|
|
|
|
select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments} ${extraConditions}))));
|
2024-09-19 12:57:06 +03:00
|
|
|
|
|
|
|
|
|
|
DELETE FROM restriction_document_item where restriction_document_create_id in (
|
2024-09-21 17:07:14 +03:00
|
|
|
|
select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments} ${extraConditions})));
|
2024-09-19 12:57:06 +03:00
|
|
|
|
DELETE FROM restriction_document_item where restriction_document_cancel_id in (
|
2024-09-21 17:07:14 +03:00
|
|
|
|
select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments} ${extraConditions})));
|
|
|
|
|
|
DELETE FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments} ${extraConditions}));
|
|
|
|
|
|
DELETE FROM subpoena where recruit_id in ${endpointArguments} ${extraConditions};
|
2024-09-19 12:57:06 +03:00
|
|
|
|
END
|
|
|
|
|
|
$$;
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</RequestURL>
|
|
|
|
|
|
<SqlConnectionParams>
|
|
|
|
|
|
<JdbcHost>localhost</JdbcHost>
|
|
|
|
|
|
<JdbcPort>5432</JdbcPort>
|
|
|
|
|
|
<JdbcUsername>sqlUser</JdbcUsername>
|
|
|
|
|
|
<JdbcPassword>sqlPassword</JdbcPassword>
|
|
|
|
|
|
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
|
|
|
|
|
|
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
|
|
|
|
|
|
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
|
|
|
|
|
|
<JdbcDatabase>mainDatabase</JdbcDatabase>
|
|
|
|
|
|
</SqlConnectionParams>
|
|
|
|
|
|
</SqlRequest>
|
|
|
|
|
|
|
|
|
|
|
|
<SqlRequest>
|
|
|
|
|
|
<RequestURL>
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
DO
|
|
|
|
|
|
$$
|
|
|
|
|
|
BEGIN
|
|
|
|
|
|
DELETE
|
|
|
|
|
|
FROM incident_history
|
2024-09-21 17:07:14 +03:00
|
|
|
|
where incident_id in (select id from incident where recruit_id in ${endpointArguments} ${extraConditions}));
|
|
|
|
|
|
DELETE FROM incident where recruit_id in ${endpointArguments} ${extraConditions};
|
2024-09-19 12:57:06 +03:00
|
|
|
|
END
|
|
|
|
|
|
$$;
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</RequestURL>
|
|
|
|
|
|
<SqlConnectionParams>
|
|
|
|
|
|
<JdbcHost>localhost</JdbcHost>
|
|
|
|
|
|
<JdbcPort>5432</JdbcPort>
|
|
|
|
|
|
<JdbcUsername>sqlUser</JdbcUsername>
|
|
|
|
|
|
<JdbcPassword>sqlPassword</JdbcPassword>
|
|
|
|
|
|
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
|
|
|
|
|
|
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
|
|
|
|
|
|
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
|
|
|
|
|
|
<JdbcDatabase>mainDatabase</JdbcDatabase>
|
|
|
|
|
|
</SqlConnectionParams>
|
|
|
|
|
|
</SqlRequest>
|
|
|
|
|
|
|
|
|
|
|
|
<SqlRequest>
|
|
|
|
|
|
<RequestURL>
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
DO
|
|
|
|
|
|
$$
|
|
|
|
|
|
BEGIN
|
2024-09-21 17:07:14 +03:00
|
|
|
|
DELETE FROM notifications where recruit_id in ${endpointArguments} ${extraConditions};
|
2024-09-19 12:57:06 +03:00
|
|
|
|
END
|
|
|
|
|
|
$$;
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</RequestURL>
|
|
|
|
|
|
<SqlConnectionParams>
|
|
|
|
|
|
<JdbcHost>localhost</JdbcHost>
|
|
|
|
|
|
<JdbcPort>5432</JdbcPort>
|
|
|
|
|
|
<JdbcUsername>sqlUser</JdbcUsername>
|
|
|
|
|
|
<JdbcPassword>sqlPassword</JdbcPassword>
|
|
|
|
|
|
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
|
|
|
|
|
|
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
|
|
|
|
|
|
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
|
|
|
|
|
|
<JdbcDatabase>mainDatabase</JdbcDatabase>
|
|
|
|
|
|
</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>
|
|
|
|
|
|
<JdbcHost>localhost</JdbcHost>
|
|
|
|
|
|
<JdbcPort>5432</JdbcPort>
|
|
|
|
|
|
<JdbcUsername>sqlUser</JdbcUsername>
|
|
|
|
|
|
<JdbcPassword>sqlPassword</JdbcPassword>
|
|
|
|
|
|
<JdbcDriverClassName>org.postgresql.Driver</JdbcDriverClassName>
|
|
|
|
|
|
<JdbcXaDataSourceClassName>org.postgresql.xa.PGXADataSource</JdbcXaDataSourceClassName>
|
|
|
|
|
|
<JdbcXaDataSourcePoolSize>15</JdbcXaDataSourcePoolSize>
|
|
|
|
|
|
<JdbcDatabase>mainDatabase</JdbcDatabase>
|
|
|
|
|
|
</SqlConnectionParams>
|
|
|
|
|
|
</SqlRequest>
|
|
|
|
|
|
|
|
|
|
|
|
</Requests>
|