Skip to content

Commit

Permalink
Notice Intent Reports: Update Queries (#434)
Browse files Browse the repository at this point in the history
* Use parens in query for involved parties 
* Use regex to match word boundary for object count type associated
  • Loading branch information
mikejritter authored Dec 3, 2024
1 parent fa9f29b commit 5efa415
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ FROM hierarchy summary_hierarchy
email.email
FROM hierarchy
INNER JOIN partiesinvolvedgroup party ON party.id = hierarchy.id AND
party.involvedrole LIKE '%lineal_descendant%' OR party.involvedrole LIKE '%tribal_rep%'
(party.involvedrole LIKE '%lineal_descendant%' OR party.involvedrole LIKE '%tribal_rep%')
INNER JOIN persons_common person ON person.shortidentifier = substring(party.involvedparty FROM '^urn:.*item:name\(([^)]+)\)')
INNER JOIN hierarchy person_hierarchy ON person_hierarchy.id = person.id
INNER JOIN hierarchy ptg_hierarchy ON ptg_hierarchy.parentid = person.id AND ptg_hierarchy.pos = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ FROM hierarchy
SELECT ocg_hierarchy.parentid,
sum(ocg.objectcount) AS object_count_afo
FROM hierarchy ocg_hierarchy
INNER JOIN objectcountgroup ocg ON ocg.id = ocg_hierarchy.id AND ocg.objectcounttype LIKE '%associated%'
INNER JOIN objectcountgroup ocg ON ocg.id = ocg_hierarchy.id AND ocg.objectcounttype ~ '\yassociated'
WHERE ocg_hierarchy.name = 'collectionobjects_common:objectCountGroupList'
GROUP BY ocg_hierarchy.parentid
) object_count_afo ON object_count_afo.parentid = relation.objectcsid
Expand Down

0 comments on commit 5efa415

Please sign in to comment.