use of eu.europa.ec.fisheries.uvms.activity.model.schemas.GroupCriteria in project UVMS-ActivityModule-APP by UnionVMS.
the class FaCatchDaoTest method testGetFACatchSummaryReportString.
@Test
public void testGetFACatchSummaryReportString() throws Exception {
dbSetupTracker.skipNextLaunch();
FishingActivityQuery query = new FishingActivityQuery();
Map<SearchFilter, String> searchCriteriaMap = new HashMap<>();
List<GroupCriteria> groupByFields = new ArrayList<>();
groupByFields.add(GroupCriteria.DATE_MONTH);
groupByFields.add(GroupCriteria.SPECIES);
query.setGroupByFields(groupByFields);
searchCriteriaMap.put(SearchFilter.SOURCE, "FLUX");
query.setSearchCriteriaMap(searchCriteriaMap);
// FACatchSummaryHelper faCatchSummaryHelper = FACatchSummaryHelper.createFACatchSummaryHelper();
// System.out.println( faCatchSummaryHelper.printJsonstructure(query));
Map<FaCatchSummaryCustomProxy, List<FaCatchSummaryCustomProxy>> faCatchSummaryCustomEntityListMap = dao.getGroupedFaCatchData(query, false);
assertNotNull(faCatchSummaryCustomEntityListMap);
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.GroupCriteria 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