use of org.hisp.dhis.dxf2.events.trackedentity.store.mapper.TrackedEntityInstanceRowCallbackHandler in project dhis2-core by dhis2.
the class DefaultTrackedEntityInstanceStore method getTrackedEntityInstancesPartitioned.
private Map<String, TrackedEntityInstance> getTrackedEntityInstancesPartitioned(List<Long> ids, AggregateContext ctx) {
TrackedEntityInstanceRowCallbackHandler handler = new TrackedEntityInstanceRowCallbackHandler();
if (!ctx.isSuperUser() && ctx.getTrackedEntityTypes().isEmpty()) {
// empty list.
return new HashMap<>();
}
String sql = getQuery(GET_TEIS_SQL, ctx, "tei.trackedentitytypeid in (:teiTypeIds)", FILTER_OUT_DELETED_TEIS);
jdbcTemplate.query(applySortOrder(sql, StringUtils.join(ids, ","), "trackedentityinstanceid"), createIdsParam(ids).addValue("teiTypeIds", ctx.getTrackedEntityTypes()), handler);
return handler.getItems();
}
Aggregations