<Requests>
    <SqlRequest>
        <RequestURL>
            <![CDATA[
            DO
            $$
                BEGIN
                    DELETE FROM summoned_list where ${clause};
                    DELETE FROM recruit_active_list where ${clause};
                    DELETE FROM documents where ${clause};
                    DELETE FROM subpoena where ${clause};
                END
            $$;
            ]]>
        </RequestURL>
        <RequestArguments>
            <RequestArgument>
                <Id>recruit_id</Id>
            </RequestArgument>
        </RequestArguments>
        <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
            update recruits
            set current_recruitment_id  = jsonb_extract_path_text(extra_info,'blocked','cur')::uuid
                ,target_recruitment_id = jsonb_extract_path_text(extra_info,'blocked','trg')::uuid
                ,department_id_old = jsonb_extract_path_text(extra_info,'blocked','dio')::uuid
                ,system_pgs_status = '1.2'
                ,conscription = null
                ,extra_info = extra_info - ('blocked')
            where ${clause};
            end
            $$;
            ]]>
        </RequestURL>
        <RequestArguments>
            <RequestArgument>
                <Id>id</Id>
            </RequestArgument>
        </RequestArguments>
        <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>