026 ceiling

This commit is contained in:
2026-07-28 12:38:02 +03:00
parent 849a4c2796
commit e8df23c2e2
5 changed files with 31 additions and 70 deletions
+13 -6
View File
@@ -186,13 +186,20 @@ from a
join ngcloud_ru.vdc on capacity_storage.vdc_id=vdc.id
join ngcloud_ru.tenant on tenant.id=vdc.tenant_id
join ngcloud_ru.storage_profile_types on capacity_storage.storage_profile_types_id=storage_profile_types.id
where tenant.wzcode = <cfqueryparam cfsqltype="cf_sql_integer" value=#ATTRIBUTES.tenant_wz_index#/>
where tenant.wzcode = <cfqueryparam cfsqltype="cf_sql_integer" value=#ATTRIBUTES.tenant_wz_index#/> --AND 1=0
AND capacity_storage.timestamp::date >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#attributes.dt_start#/>
AND capacity_storage.timestamp::date <= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#attributes.dt_finish#/>
group by tenant.wzcode, vdc.name, storage_profile_types.name, capacity_storage.timestamp::date
order by tenant.wzcode, vdc.name, storage_profile_types.name, capacity_storage.timestamp::date;
order by tenant.wzcode, vdc.name, storage_profile_types.name, capacity_storage.timestamp::date
;
</cfquery>
<!--- create index IX_capacity_storage_sort on ngcloud_ru.capacity_storage(vdc_id,storage_profile_types_id,timestamp); --->
<cfif (ATTRIBUTES.debug)>
qStorage
<cfoutput>#getTickCount() - request.startTickCount#</cfoutput>
<cfdump var=#qStorage#/>
<cfflush/>
</cfif>
<!---
"placement" "size_gb" "get_10k" "put_10k" "bytes_sent_gb"
@@ -466,7 +473,7 @@ from a
<!--- Здесь агрегировано за месяц, но детализировано по измерениям --->
<cfquery name="qChargeMonthly" dbType="query">
SELECT
<d:field_set titleMapOut="titleMap" lengthOut="fieldCount">
<d:field_set titleMapOut="chargeTitleMap" lengthOut="chargeFieldCount">
<d:field title="Артикул по договору">s_code</d:field>
<d:field title="Артикул по системам">m_code</d:field>
<d:field title="Артикул">s_code as code</d:field>
@@ -538,8 +545,8 @@ from a
<cfset report.qSpecification = qSpecification/>
<cfset report.qCharge = qChargeMonthly/>
<cfset report.qFreeTier = qFreeTier/><!--- мы не применяем скидку на уровне детализации, а только после агрегации. На самом деле правильно было бы агрегировать натуральные метрики, а умножать на цену уже агрегаты --->
<!--- <cfset report.chargeTitleMap = titleMap/>
<cfset report.chargeFieldCount = fieldCount/> --->
<cfset report.chargeTitleMap = chargeTitleMap/><!--- нужен для экспорта в XL --->
<!--- <cfset report.chargeFieldCount = chargeFieldCount/> --->
<cfset "CALLER.#ATTRIBUTES.output#" = report/>