164 instance.resource_realm_cnt

This commit is contained in:
2025-11-13 15:43:31 +03:00
parent 1a268626c4
commit 869c2c0b81
2 changed files with 15 additions and 2 deletions
+14 -1
View File
@@ -57,7 +57,20 @@
when coalesce(st.is_deleted,'false') = 'false' AND coalesce(st.is_suspended, 'false') = 'false' then 'running'
when io.instance_uid IS NULL then 'not configured'
else null end
) as explained_status</m:field>
) as explained_status
</m:field>
<m:field>(select count(distinct r.resource_realm)
from resource_realm r
join resource_realm_access a on (
r.resource_realm_id=a.resource_realm_id
AND (a.contract_id IN (
select contract_id
from contract d
where d.contragent_id=k.contragent_id AND NOT d.is_closed
) OR a.contract_id=0) /*0 means access to any contract*/
AND a.is_enabled)
where r.resource_realm_type_id=v.resource_realm_type_id) as resource_realm_cnt
</m:field>
<!--- <m:field>st.version</m:field> --->
</m:field_set>
from instance e