历史流程实例对应的表:ACT_HI_PROCINST
@Resource
HistoryService historyService;
// 查询历史流程实例列表----不分页
List<HistoricProcessInstance> processInstancesList = historyService.createNativeHistoricProcessInstanceQuery()
.sql(customSql(" SELECT HPI.* ,DEF.NAME_, DEF.VERSION_, DEF.DEPLOYMENT_ID_ FROM ", queryDto, "HPI.START_TIME_ DESC")).list();
// 查询历史流程实例列表----分页
List<HistoricProcessInstance> processInstanceList = historyService.createNativeHistoricProcessInstanceQuery()
.sql(customSql("SELECT HPI.* ,DEF.NAME_, DEF.VERSION_, DEF.DEPLOYMENT_ID_ FROM ", queryDto, "HPI.START_TIME_ DESC"))
.listPage(page.getStartRow(), page.getPageSize());
// 查询历史流程实例数量
long count = historyService.createNativeHistoricProcessInstanceQuery()
.sql(customSql("select count(*) from ", queryDto