Skip to content

Commit 7ced140

Browse files
committed
add FlowDirection
1 parent 2c6623e commit 7ced140

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

example/example-application/src/main/java/com/codingapi/example/query/FlowRecordQueryController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class FlowRecordQueryController {
2828

2929
@GetMapping("/list")
3030
public MultiResponse<FlowRecordEntity> list(SearchRequest searchRequest) {
31-
PageRequest pageRequest = PageRequest.of(searchRequest.getCurrent(), searchRequest.getPageSize(), Sort.by("createTime").descending());
31+
PageRequest pageRequest = PageRequest.of(searchRequest.getCurrent(), searchRequest.getPageSize(), Sort.by("id").descending());
3232
return MultiResponse.of(flowRecordQuery.findAll(pageRequest));
3333
}
3434

example/example-infra-flow/src/main/java/com/codingapi/example/jpa/FlowRecordEntityRepository.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ public interface FlowRecordEntityRepository extends FastRepository<FlowRecordEnt
1919
List<FlowRecordEntity> findFlowRecordEntityByProcessId(String processId);
2020

2121

22-
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'TODO' and r.flowStatus = 'RUNNING' order by r.createTime desc")
22+
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'TODO' and r.flowStatus = 'RUNNING' order by r.id desc")
2323
Page<FlowRecordEntity> findTodoByOperatorId(long operatorId,PageRequest pageRequest);
2424

25-
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'DONE' order by r.createTime desc")
25+
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'DONE' order by r.id desc")
2626
Page<FlowRecordEntity> findDoneByOperatorId(long operatorId, PageRequest pageRequest);
2727

28-
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.preId = 0 and r.nodeCode = 'start' order by r.createTime desc")
28+
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.preId = 0 and r.nodeCode = 'start' order by r.id desc")
2929
Page<FlowRecordEntity> findInitiatedByOperatorId(long operatorId, PageRequest pageRequest);
3030

31-
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'TODO' and r.flowStatus = 'RUNNING' and r.timeoutTime >0 and r.timeoutTime < ?2 order by r.createTime desc")
31+
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'TODO' and r.flowStatus = 'RUNNING' and r.timeoutTime >0 and r.timeoutTime < ?2 order by r.id desc")
3232
Page<FlowRecordEntity> findTimeoutTodoByOperatorId(long operatorId,long currentTime, PageRequest pageRequest);
3333

34-
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'TODO' and r.flowStatus = 'RUNNING' and r.postponedCount > 0 order by r.createTime desc")
34+
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'TODO' and r.flowStatus = 'RUNNING' and r.postponedCount > 0 order by r.id desc")
3535
Page<FlowRecordEntity> findPostponedTodoByOperatorId(long operatorId, PageRequest pageRequest);
3636

37-
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'TODO' and r.flowStatus = 'RUNNING' order by r.createTime desc")
37+
@Query(value = "select r from FlowRecordEntity r where r.currentOperatorId = ?1 and r.flowType = 'TODO' and r.flowStatus = 'RUNNING' order by r.id desc")
3838
List<FlowRecordEntity> findTodoFlowRecordByProcessId(String processId);
3939
}

0 commit comments

Comments
 (0)