Skip to content

Commit

Permalink
fix: Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
larshelge committed Nov 24, 2024
1 parent 7db77c5 commit 4d2ad59
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ private List<AnalyticsTableColumn> getColumnFromDataElement(
}

private List<AnalyticsTableColumn> getColumnFromOrgUnitDataElement(
DataElement dataElement, String dataClause) {
DataElement dataElement, String dataFilterClause) {
List<AnalyticsTableColumn> columns = new ArrayList<>();

String columnExpression =
Expand All @@ -529,7 +529,7 @@ private List<AnalyticsTableColumn> getColumnFromOrgUnitDataElement(

if (isSpatialSupport()) {
String fromType = "ou.geometry " + fromClause;
String geoSql = getSelectForInsert(dataElement, fromType, dataClause);
String geoSql = getSelectForInsert(dataElement, fromType, dataFilterClause);

columns.add(
AnalyticsTableColumn.builder()
Expand All @@ -542,7 +542,7 @@ private List<AnalyticsTableColumn> getColumnFromOrgUnitDataElement(
}

String fromTypeSql = "ou.name " + fromClause;
String ouNameSql = getSelectForInsert(dataElement, fromTypeSql, dataClause);
String ouNameSql = getSelectForInsert(dataElement, fromTypeSql, dataFilterClause);

columns.add(
AnalyticsTableColumn.builder()
Expand Down Expand Up @@ -624,15 +624,15 @@ private List<AnalyticsTableColumn> getColumnFromTrackedEntityAttributeWithLegend
}

private List<AnalyticsTableColumn> getColumnsFromOrgUnitTrackedEntityAttribute(
TrackedEntityAttribute attribute, String dataClause) {
TrackedEntityAttribute attribute, String dataFilterClause) {
List<AnalyticsTableColumn> columns = new ArrayList<>();

String fromClause =
qualifyVariables("from ${organisationunit} ou where ou.uid = (select value");

if (isSpatialSupport()) {
String fromType = "ou.geometry " + fromClause;
String geoSql = selectForInsert(attribute, fromType, dataClause);
String geoSql = selectForInsert(attribute, fromType, dataFilterClause);
columns.add(
AnalyticsTableColumn.builder()
.name((attribute.getUid() + OU_GEOMETRY_COL_SUFFIX))
Expand All @@ -644,7 +644,7 @@ private List<AnalyticsTableColumn> getColumnsFromOrgUnitTrackedEntityAttribute(
}

String fromTypeSql = "ou.name " + fromClause;
String ouNameSql = selectForInsert(attribute, fromTypeSql, dataClause);
String ouNameSql = selectForInsert(attribute, fromTypeSql, dataFilterClause);

columns.add(
AnalyticsTableColumn.builder()
Expand Down

0 comments on commit 4d2ad59

Please sign in to comment.