008 notifications fix
This commit is contained in:
@@ -50,20 +50,23 @@
|
||||
<cfquery name="local.qRead" result="local.result">
|
||||
select
|
||||
<m:field_set titleMapOut="local.titleMap" lengthOut="local.fieldCount">
|
||||
<m:field>n.notification_uid</m:field>
|
||||
<m:field>n.notification_uid::text as notification_uid</m:field>
|
||||
<m:field>n.notification</m:field>
|
||||
<m:field>n.descr</m:field>
|
||||
<m:field>n.descr</m:field>
|
||||
<m:field>to_char(s.dt_show_from, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_show_from</m:field>
|
||||
<m:field>to_char(s.dt_show_to, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_show_to</m:field>
|
||||
<m:field>to_char(s.dt_created, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_created</m:field>
|
||||
<m:field>to_char(s.dt_updated, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_updated</m:field>
|
||||
<m:field>n.contragent_id</m:field>
|
||||
<m:field>k.external_uid</m:field>
|
||||
<m:field><cfqueryparam cfsqltype="cf_sql_other" value=#arguments.companyUid#/> as arguments_company_uid</m:field>
|
||||
<m:field>to_char(n.dt_show_from, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_show_from</m:field>
|
||||
<m:field>to_char(n.dt_show_to, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_show_to</m:field>
|
||||
<!--- <m:field>to_char(n.dt_created, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_created</m:field>
|
||||
<m:field>to_char(n.dt_updated, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_updated</m:field> --->
|
||||
</m:field_set>
|
||||
from notification n
|
||||
left outer join contragent k on (n.contragent_id=k.contragent_id)
|
||||
where 1=1 <m:filter_build filter=#filter#/>
|
||||
AND (n.dt_show_from <= CURRENT_TIMESTAMP OR n.dt_show_from IS NULL)
|
||||
AND (n.dt_show_to >= CURRENT_TIMESTAMP OR n.dt_show_to IS NULL)
|
||||
AND (n.companyId = <cfqueryparam cfsqltype="cf_sql_other" value=#arguments.companyId#/> OR n.companyId IS NULL)
|
||||
AND (k.external_uid = <cfqueryparam cfsqltype="cf_sql_other" value=#arguments.companyUid#/> OR n.contragent_id IS NULL)
|
||||
order by dt_show_from desc
|
||||
<!--- <m:order_build sortCollection=#this.helper.parseNumericOrder(local.titleMap, arguments.orderBy)# fieldCount=0/>--->
|
||||
limit #maxrows#
|
||||
@@ -73,11 +76,11 @@
|
||||
<cfquery name="local.qTotal">
|
||||
select count(*) as cnt
|
||||
from notification n
|
||||
where 1=1 <m:filter_build filter=#filter#/>
|
||||
left outer join contragent k on (n.contragent_id=k.contragent_id)
|
||||
where 1=1
|
||||
AND (n.dt_show_from <= CURRENT_TIMESTAMP OR n.dt_show_from IS NULL)
|
||||
AND (n.dt_show_to >= CURRENT_TIMESTAMP OR n.dt_show_to IS NULL)
|
||||
AND (n.companyId = <cfqueryparam cfsqltype="cf_sql_other" value=#arguments.companyId#/> OR n.companyId IS NULL)
|
||||
order by dt_show_from desc
|
||||
AND (k.external_uid = <cfqueryparam cfsqltype="cf_sql_other" value=#arguments.companyUid#/> OR n.contragent_id IS NULL)
|
||||
</cfquery>
|
||||
|
||||
<cfset "out.queryDurationMs"=getTickCount() - request.startTickCount/>
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
<m:field cfSqlType="CF_SQL_INTEGER">u.usr_id</m:field>
|
||||
<m:field>u.login</m:field>
|
||||
<m:field>k.contragent_id</m:field>
|
||||
<m:field>k.external_uid::text as external_uid</m:field>
|
||||
<m:field>k.contragent</m:field>
|
||||
</m:field_set>
|
||||
from usr u
|
||||
|
||||
Reference in New Issue
Block a user