Skip to content

Commit

Permalink
TL :: Employee Inbox :: Applications are not displayed according to a…
Browse files Browse the repository at this point in the history
…pplication date when tried to sort by application date (#1073)

* RAIN-3327 updated searcher query

* RAIN-3327 Updates tl inbox searcher query for count and sorting
  • Loading branch information
rohit-eGov committed Jul 31, 2021
1 parent 1899b59 commit 834f142
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions egov-searcher/inboxTLSearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ SearchDefinitions:
query:
baseQuery: Select row_to_json(result) from
(
select DISTINCT(tl.applicationNumber),pi.createdtime from eg_tl_tradelicense as tl
select DISTINCT(tl.applicationNumber) as applicationnumber,tl.applicationdate as createdtime from eg_tl_tradelicense as tl
INNER JOIN eg_tl_tradelicensedetail tld ON tl.id = tld.tradelicenseid
INNER JOIN eg_tl_owner owner ON tld.id = owner.tradelicensedetailid
INNER JOIN eg_tl_address tladd ON tladd.tradelicensedetailid = tld.id
INNER JOIN eg_wf_processinstance_v2 pi ON pi.businessid = tl.applicationNumber
LEFT JOIN eg_wf_assignee_v2 assg ON pi.id = assg.processinstanceid
$where
AND pi.createdtime IN (select max(createdtime) from eg_wf_processinstance_v2 wf where wf.businessid = tl.applicationNumber GROUP BY wf.businessid)
order by pi.createdtime asc $pagination
order by tl.applicationdate asc $pagination
) result
groupBy:
orderBy:
Expand Down Expand Up @@ -62,15 +61,14 @@ SearchDefinitions:
query:
baseQuery: SELECT row_to_json(TotalCount) from (SELECT COUNT(result) from
(
select DISTINCT(tl.applicationNumber),pi.createdtime from eg_tl_tradelicense as tl
select DISTINCT(tl.applicationNumber) as applicationnumber,tl.applicationdate as createdtime from eg_tl_tradelicense as tl
INNER JOIN eg_tl_tradelicensedetail tld ON tl.id = tld.tradelicenseid
INNER JOIN eg_tl_owner owner ON tld.id = owner.tradelicensedetailid
INNER JOIN eg_tl_address tladd ON tladd.tradelicensedetailid = tld.id
INNER JOIN eg_wf_processinstance_v2 pi ON pi.businessid = tl.applicationNumber
LEFT JOIN eg_wf_assignee_v2 assg ON pi.id = assg.processinstanceid
$where
AND pi.createdtime IN (select max(createdtime) from eg_wf_processinstance_v2 wf where wf.businessid = tl.applicationNumber GROUP BY wf.businessid)
order by pi.createdtime asc
order by tl.applicationdate asc
) result) TotalCount
groupBy:
orderBy:
Expand Down Expand Up @@ -114,15 +112,14 @@ SearchDefinitions:
query:
baseQuery: Select row_to_json(result) from
(
select DISTINCT(tl.applicationNumber),pi.createdtime from eg_tl_tradelicense as tl
select DISTINCT(tl.applicationNumber) as applicationnumber,tl.applicationdate as createdtime from eg_tl_tradelicense as tl
INNER JOIN eg_tl_tradelicensedetail tld ON tl.id = tld.tradelicenseid
INNER JOIN eg_tl_owner owner ON tld.id = owner.tradelicensedetailid
INNER JOIN eg_tl_address tladd ON tladd.tradelicensedetailid = tld.id
INNER JOIN eg_wf_processinstance_v2 pi ON pi.businessid = tl.applicationNumber
LEFT JOIN eg_wf_assignee_v2 assg ON pi.id = assg.processinstanceid
$where
AND pi.createdtime IN (select max(createdtime) from eg_wf_processinstance_v2 wf where wf.businessid = tl.applicationNumber GROUP BY wf.businessid)
order by pi.createdtime desc $pagination
order by tl.applicationdate desc $pagination
) result
groupBy:
orderBy:
Expand Down

0 comments on commit 834f142

Please sign in to comment.