163 instance_operation_ls
This commit is contained in:
+26
-45
@@ -8,26 +8,27 @@
|
||||
<!---спецификация полей, пригодных для фильтрации (?и сортировки)--->
|
||||
<!---здесь для простоты без префикса, потому что мы используем вложенный селект, чтобы сделать композитное поле--->
|
||||
<cfset this.fieldsSpec={
|
||||
"dt_created"={type="date"},
|
||||
"dt_updated"={type="date"},
|
||||
"svc_id"={type="integer"},
|
||||
"dt_created"={prefix="sv", type="date"},
|
||||
"dt_updated"={prefix="sv", type="date"},
|
||||
"svc_id"={prefix="sv", type="integer"},
|
||||
<!--- svc_group_id={type="integer"}, --->
|
||||
"resource_realm_type_id"={type="integer"},
|
||||
"sort"={type="integer"},
|
||||
"is_production_ready"={type="boolean"},
|
||||
"svc"={type="string"},
|
||||
"svc_short"={type="string"},
|
||||
"svc_extended_name"={type="string"},
|
||||
"orchestrator_name"={type="string"},
|
||||
"synonyms"={type="string"},
|
||||
"code"={type="string"},
|
||||
"version"={type="string"},
|
||||
"descr"={type="string"},
|
||||
"man"={type="string"},
|
||||
"resource_realm_cnt"={type="integer"}
|
||||
"resource_realm_type_id"={prefix="sv", type="integer"},
|
||||
"sort"={prefix="sv", type="integer"},
|
||||
"is_production_ready"={prefix="sv", type="boolean"},
|
||||
"svc"={prefix="sv", type="string"},
|
||||
"svc_short"={prefix="sv", type="string"},
|
||||
"svc_extended_name"={prefix="sv", type="string"},
|
||||
"orchestrator_name"={prefix="sv", type="string"},
|
||||
"synonyms"={prefix="sv", type="string"},
|
||||
"code"={prefix="sv", type="string"},
|
||||
"version"={prefix="sv", type="string"},
|
||||
"descr"={prefix="sv", type="string"},
|
||||
"man"={prefix="sv", type="string"},
|
||||
"resource_realm_cnt"={prefix="sv", type="integer"}
|
||||
}
|
||||
/>
|
||||
|
||||
<!--- *** пока сортировка, пагинация и состав полей компонуются так, что приходится добавлять поле сортировки в резалтсет --->
|
||||
<cffunction name="get" hint="Список сервисов">
|
||||
<cfargument name="pageSize" type="string" hint="type:integer" default=100/>
|
||||
<cfargument name="page" type="string" hint="type:integer" default="1"/>
|
||||
@@ -152,36 +153,16 @@
|
||||
<m:field>(coalesce(s.svc,'') ||' '|| coalesce(s.svc_short,'') ||' '|| coalesce(s.synonyms,'')) as svc_extended_name</m:field>
|
||||
</m:field_set>
|
||||
|
||||
|
||||
|
||||
<!--- --->
|
||||
<!--- <cfdump var=#local.titleMap#/>
|
||||
<cfdump var=#local.fieldCount#/> --->
|
||||
<!--- fieldsToOutput:<cfdump var=#local.fieldsToOutput#/>
|
||||
fieldsToQueryFor:<cfdump var=#local.fieldsToQueryFor#/>
|
||||
definedRecordFields:<cfdump var=#local.definedRecordFields#/>
|
||||
<cfoutput>
|
||||
select <cfif listLen(local.fieldsToOutput)>#local.fieldsToOutput#<cfelse>*</cfif> from
|
||||
(
|
||||
select
|
||||
<cfif listLen(local.definedQueryFields)>
|
||||
#preserveSingleQuotes(local.definedQueryFields)#
|
||||
<cfelse>
|
||||
'' as placeholder
|
||||
</cfif>
|
||||
from svc s
|
||||
left outer join contragent k on (
|
||||
k.external_uid=<
|
||||
)
|
||||
) sv
|
||||
where 1=1
|
||||
order by <m:order_build sortCollection=#this.helper.parseNumericOrder(local.titleMap, arguments.orderBy)# fieldCount=0/>
|
||||
</cfoutput>
|
||||
<cfabort/> --->
|
||||
|
||||
<!--- <cfdump var=#local.titleMap#/>
|
||||
<cfdump var=#arguments.orderBy#/>
|
||||
<cfdump var=#this.helper.parseNumericOrder(local.titleMap, arguments.orderBy)#/>
|
||||
<cfdump var=#local.fieldsToOutput#/>
|
||||
<m:order_build sortCollection=#this.helper.parseNumericOrder(local.titleMap, arguments.orderBy)# fieldCount=1/>
|
||||
<cfabort/> --->
|
||||
|
||||
<!--- *** проблема: сортировка строится некорректно. пока добавим поля сортировки в резалтсет --->
|
||||
<cfquery name="local.qRead" result="local.result">
|
||||
select <cfif listLen(local.fieldsToOutput)>#local.fieldsToOutput#<cfelse>*</cfif> from
|
||||
select <cfif listLen(local.definedRecordFields)>#local.definedRecordFields#<cfelse>*</cfif> from
|
||||
(
|
||||
select
|
||||
<cfif listLen(local.definedQueryFields)>
|
||||
@@ -201,7 +182,7 @@
|
||||
</cfif>
|
||||
) sv
|
||||
where 1=1 <m:filter_build filter=#filter#/>
|
||||
order by <m:order_build sortCollection=#this.helper.parseNumericOrder(local.titleMap, arguments.orderBy)# fieldCount=0/><!---no sort length limit--->
|
||||
order by <m:order_build sortCollection=#this.helper.parseNumericOrder(local.titleMap, arguments.orderBy)# fieldCount=1/>
|
||||
</cfquery>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user