use of eu.europa.ec.fisheries.ers.service.search.GroupCriteriaMapper in project UVMS-ActivityModule-APP by UnionVMS.
the class FACatchSearchBuilder method createJoinPartOfTheQuery.
protected void createJoinPartOfTheQuery(FishingActivityQuery query, StringBuilder sql, Map<GroupCriteria, GroupCriteriaMapper> groupMAppings, List<GroupCriteria> groupByFieldList) {
// Below is default JOIN for the query
sql.append(FA_CATCH_JOIN);
// Create join part of SQL query
// Join only required tables based on filter criteria
createJoinTablesPartForQuery(sql, query);
// Add joins if not added by activity filtering . Below code will add joins required by FA Catch report joins
for (GroupCriteria criteria : groupByFieldList) {
GroupCriteriaMapper mapper = groupMAppings.get(criteria);
if (sql.indexOf(mapper.getTableJoin()) == -1) {
appendJoinString(sql, mapper.getTableJoin());
}
}
}
Aggregations