MyTetra Share
Делитесь знаниями!
AllContragentCreateContract_15-10-20
Время создания: 15.10.2020 13:18
Раздел: INFO - JOB - rtneo - Работа над задачами - Создание договоров
Запись: wwwlir/Tetra/master/base/1602739130h2yt7tezdx/text.html на raw.githubusercontent.com

insert

into

rtneo_entityes_temporary_set (entity_id, id, entity_name, set_name, set_comment, version, create_ts) (

select

distinct contragent.id1, newid(), 'Contragent', 'AllContragentCreateContract_15-10-20', 'Все контрагенты с объектами без договоров(без жилых и з.у.)', 1, now()

from

(

select

distinct cts.id as id1

from

(

select

cre.contragent_id as id

from

(rtneo_contragent_real_estate cre

join rtneo_real_estate re on

cre.real_estate_id = re.id

join rtneo_real_estate_category rec on

rec.id = cre.category_id)

left join rtneo_contract_position cp on

cre.id = cp.contragent_real_estate_id

where

cre.delete_ts is null

and cp.delete_ts is null

and cp is null

and not re."name" = 'Земельный участок'

and (rec.is_living is null

or rec.is_living = false) ) as cts ) as contragent)

Так же в этом разделе:
 
MyTetra Share v.0.59
Яндекс индекс цитирования