You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataExportStore.java
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -174,10 +174,9 @@ ou_ids AS (
174
174
),
175
175
ou_with_descendants_ids AS (
176
176
SELECT DISTINCT ou.organisationunitid
177
-
FROM organisationunit ou
178
-
LEFT JOIN organisationunit parent_ou ON (ou.path LIKE parent_ou.path || '%')
179
-
WHERE ou.organisationunitid IN (SELECT organisationunitid FROM ou_ids)
180
-
OR parent_ou.organisationunitid IN (SELECT organisationunitid FROM ou_ids)
177
+
FROM ou_ids
178
+
JOIN organisationunit root USING (organisationunitid)
179
+
JOIN organisationunit ou ON ou.path LIKE root.path || '%'
Copy file name to clipboardExpand all lines: dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/hibernate/DataExportQueryBuilderTest.java
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -298,10 +298,9 @@ ou_ids AS (
298
298
),
299
299
ou_with_descendants_ids AS (
300
300
SELECT DISTINCT ou.organisationunitid
301
-
FROM organisationunit ou
302
-
LEFT JOIN organisationunit parent_ou ON (ou.path LIKE parent_ou.path || '%')
303
-
WHERE ou.organisationunitid IN (SELECT organisationunitid FROM ou_ids)
304
-
OR parent_ou.organisationunitid IN (SELECT organisationunitid FROM ou_ids)
301
+
FROM ou_ids
302
+
JOIN organisationunit root USING (organisationunitid)
303
+
JOIN organisationunit ou ON ou.path LIKE root.path || '%'
305
304
)
306
305
SELECT
307
306
de.uid AS deid,
@@ -391,10 +390,9 @@ ou_ids AS (
391
390
),
392
391
ou_with_descendants_ids AS (
393
392
SELECT DISTINCT ou.organisationunitid
394
-
FROM organisationunit ou
395
-
LEFT JOIN organisationunit parent_ou ON (ou.path LIKE parent_ou.path || '%')
396
-
WHERE ou.organisationunitid IN (SELECT organisationunitid FROM ou_ids)
397
-
OR parent_ou.organisationunitid IN (SELECT organisationunitid FROM ou_ids)
393
+
FROM ou_ids
394
+
JOIN organisationunit root USING (organisationunitid)
395
+
JOIN organisationunit ou ON ou.path LIKE root.path || '%'
0 commit comments