Skip to content

Commit

Permalink
added sorting for tagged cases and documents. close #2663
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Nov 28, 2024
1 parent f7f147a commit 86822eb
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3901,13 +3901,12 @@ public List<ArchiveFileDocumentsBean> getTaggedDocuments(java.lang.String[] docT
}
inClause = inClause.replaceFirst(",", "");

st = con.prepareStatement("select distinct(docid) from (select a5.id as docid from "
st = con.prepareStatement("select docid, date_set from (select a5.id as docid, a4.date_set from "
+ " (SELECT id, date_changed, archived from cases) a1, "
+ " document_tags a4, case_documents a5 "
+ " where a1.archived=0 and a5.deleted=0 and (((a4.tagName in (" + inClause + ") and a4.documentKey=a5.id and a5.archiveFileKey=a1.id))) order by a1.date_changed DESC) allkeys limit 0,?");
+ " where a1.archived=0 and a5.deleted=0 and (((a4.tagName in (" + inClause + ") and a4.documentKey=a5.id and a5.archiveFileKey=a1.id))) order by a4.date_set DESC) allkeys order by date_set desc limit 0,?");

int index = 1;

for (String t : docTagName) {
st.setString(index, t);
index = index + 1;
Expand Down

0 comments on commit 86822eb

Please sign in to comment.