use of com.infiniteautomation.mango.db.query.PVTQueryCallback in project ma-core-public by infiniteautomation.
the class PointValueDaoSQL method getPointValuesBetween.
@Override
public void getPointValuesBetween(List<Integer> ids, long from, long to, boolean orderById, Integer limit, PVTQueryCallback<IdPointValueTime> callback) {
if (ids.size() == 0)
return;
if (orderById) {
// Limit results of each data point to size limit, i.e. loop over all points and query with limit
MutableInt counter = new MutableInt(0);
for (Integer id : ids) {
TimeRangeSinglePointValuesPreparedStatementCreator<PVTQueryCallback<IdPointValueTime>> c = new TimeRangeSinglePointValuesPreparedStatementCreator<PVTQueryCallback<IdPointValueTime>>(id, from, to, limit, callback, counter);
ejt.execute(c, c);
}
} else {
// Limit total results to limit
TimeRangeMultiplePointsValuesPreparedStatementCreator<PVTQueryCallback<IdPointValueTime>> c = new TimeRangeMultiplePointsValuesPreparedStatementCreator<PVTQueryCallback<IdPointValueTime>>(ids, from, to, limit, callback);
ejt.execute(c, c);
}
}
Aggregations