Интеграция с СОРМ 3 Яхонт компании НОРСИ-ТРАНС

Ключ
Эта строка удалена.
Это слово было удалено. Это слово было добавлено.
Эта строка добавлена.

Изменения (9)

просмотр истории страницы
{code}set heading off;
select
'"' ||
abs(usl.id) || '";"' ||
usl.NAME || '";"' ||
(select first 1
cast(lpad(extract(day from time_changed),2,'0') as varchar(2)) || '.' ||
cast(lpad(extract(month from time_changed),2,'0') as varchar(2)) || '.' ||
extract(year from time_changed) from usluga_history where usluga_id = usl.id) ||
' 00:00:00";"' ||
iif(usl.deleted > 0,
(select first 1
cast(lpad(extract(day from time_changed),2,'0') as varchar(2)) || '.' ||
cast(lpad(extract(month from time_changed),2,'0') as varchar(2)) || '.' ||
extract(year from time_changed) from usluga_history where usluga_id = usl.id order by time_changed desc) ||
' 00:00:00";"',
'";"') ||
coalesce(usl.comments,'') || '"'
'"1";"' ||
abs(usl.id) || '";"' ||
usl.NAME || '";"' ||
coalesce((select first 1
cast(lpad(extract(day from time_changed),2,'0') as varchar(2)) || '.' ||
cast(lpad(extract(month from time_changed),2,'0') as varchar(2)) || '.' ||
extract(year from time_changed) from usluga_history where usluga_id = usl.id),'') ||
' 00:00:00";"' ||
iif(usl.deleted > 0,
(select first 1
cast(lpad(extract(day from time_changed),2,'0') as varchar(2)) || '.' ||
cast(lpad(extract(month from time_changed),2,'0') as varchar(2)) || '.' ||
extract(year from time_changed) from usluga_history where usluga_id = usl.id order by time_changed desc) ||
' 00:00:00";"',
'";"') ||
coalesce(usl.comments,'') || '"'
from
usluga usl
usluga usl
where
usl.system_type != 13 and
usl.system_type != 13 and
usl.id!=170000 and
usl.id usl.id in (select usluga_id from usluga_history union distinct select usluga_id from users_usluga where deleted = 0 and abonent_id is not null) and
(usl.name is not null and usl.name <> '')
(usl.name is not null and usl.name <> '')
and usl.id>0
order by id;
{code}