@Override @Transactional(readOnly = true) public <T> PagerResult<T> selectTaskForm(String processDefineId, String activityId, QueryParamEntity queryParam) { Objects.requireNonNull(processDefineId, "processDefineId can not be null"); Objects.requireNonNull(activityId, "activityId can not be null"); ActivityConfigEntity entity = activityConfigService.selectByProcessDefineIdAndActivityId(processDefineId, activityId); if (entity == null || StringUtils.isEmpty(entity.getFormId())) { return PagerResult.empty(); } return dynamicFormOperationService.selectPager(entity.getFormId(), queryParam); }
@Override @Transactional(readOnly = true) public <T> PagerResult<T> selectProcessForm(String processDefineId, QueryParamEntity queryParam) { ProcessDefineConfigEntity entity = processDefineConfigService.selectByProcessDefineId(processDefineId); if (entity == null || StringUtils.isEmpty(entity.getFormId())) { return PagerResult.empty(); } return dynamicFormOperationService.selectPager(entity.getFormId(), queryParam); }
public static <U, R, T extends Query<?, U>> PagerResult<R> doQuery(T query, QueryParamEntity entity, Function<U, R> mapping, BiConsumer<Term, T> notFound) { applyQueryParam(query, entity, notFound); int total = (int) query.count(); if (total == 0) { return PagerResult.empty(); } entity.rePaging(total); List<R> list = query.listPage(entity.getPageIndex(), entity.getPageSize() * (entity.getPageIndex() + 1)) .stream() .map(mapping) .filter(Objects::nonNull) .collect(Collectors.toList()); return PagerResult.of(total, list, entity); }
@Override @Transactional(readOnly = true) @SneakyThrows public <T> PagerResult<T> selectPager(String formId, QueryParamEntity paramEntity) { RDBTable<T> table = getTable(formId); RDBQuery<T> query = table.createQuery(); int total = query.setParam(paramEntity).total(); if (total == 0) { return PagerResult.empty(); } paramEntity.rePaging(total); List<T> list = query.setParam(paramEntity).list(paramEntity.getPageIndex(), paramEntity.getPageSize()); return PagerResult.of(total, list, paramEntity); }
@Override @Transactional(readOnly = true) public <T> PagerResult<T> selectTaskForm(String processDefineId, String activityId, QueryParamEntity queryParam) { Objects.requireNonNull(processDefineId, "processDefineId can not be null"); Objects.requireNonNull(activityId, "activityId can not be null"); ActivityConfigEntity entity = activityConfigService.selectByProcessDefineIdAndActivityId(processDefineId, activityId); if (entity == null || StringUtils.isEmpty(entity.getFormId())) { return PagerResult.empty(); } return dynamicFormOperationService.selectPager(entity.getFormId(), queryParam); }
@Override @Transactional(readOnly = true) public <T> PagerResult<T> selectProcessForm(String processDefineId, QueryParamEntity queryParam) { ProcessDefineConfigEntity entity = processDefineConfigService.selectByProcessDefineId(processDefineId); if (entity == null || StringUtils.isEmpty(entity.getFormId())) { return PagerResult.empty(); } return dynamicFormOperationService.selectPager(entity.getFormId(), queryParam); }
public static <U, R, T extends Query<?, U>> PagerResult<R> doQuery(T query, QueryParamEntity entity, Function<U, R> mapping, BiConsumer<Term, T> notFound) { applyQueryParam(query, entity, notFound); int total = (int) query.count(); if (total == 0) { return PagerResult.empty(); } entity.rePaging(total); List<R> list = query.listPage(entity.getPageIndex(), entity.getPageSize() * (entity.getPageIndex() + 1)) .stream() .map(mapping) .filter(Objects::nonNull) .collect(Collectors.toList()); return PagerResult.of(total, list, entity); }
@Override @Transactional(readOnly = true) @SneakyThrows public <T> PagerResult<T> selectPager(String formId, QueryParamEntity paramEntity) { RDBTable<T> table = getTable(formId); RDBQuery<T> query = table.createQuery(); int total = query.setParam(paramEntity).total(); if (total == 0) { return PagerResult.empty(); } paramEntity.rePaging(total); List<T> list = query.setParam(paramEntity).list(paramEntity.getPageIndex(), paramEntity.getPageSize()); return PagerResult.of(total, list, paramEntity); }