use of org.pmiops.workbench.model.ParticipantConditionsColumns in project workbench by all-of-us.
the class ReviewTabQueryBuilder method buildQuery.
public QueryJobConfiguration buildQuery(ReviewTabQueries queries, Long participantId, PageRequest pageRequest) {
ParticipantConditionsColumns sortColumn = ParticipantConditionsColumns.fromValue(pageRequest.getSortColumn());
String finalSql = String.format(queries.getQuery(), ParticipantConditionDbInfo.fromName(sortColumn).getDbName(), pageRequest.getSortOrder().toString(), pageRequest.getPageSize(), pageRequest.getPageNumber() * pageRequest.getPageSize());
Map<String, QueryParameterValue> params = new HashMap<>();
params.put(queries.NAMED_PARTICIPANTID_PARAM, QueryParameterValue.int64(participantId));
return QueryJobConfiguration.newBuilder(finalSql).setNamedParameters(params).setUseLegacySql(false).build();
}
Aggregations