mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-08-06 01:36:46 +08:00
order by saved queries
This commit is contained in:
@ -36,4 +36,9 @@ public class OperationPageQueryParam extends PageQueryParam {
|
||||
* 是否在tab中被打开,y表示打开,n表示未打开
|
||||
*/
|
||||
private String tabOpened;
|
||||
|
||||
/**
|
||||
* orderBy modify time desc
|
||||
*/
|
||||
private Boolean orderByDesc;
|
||||
}
|
||||
|
@ -105,6 +105,11 @@ public class OperationServiceImpl implements OperationService {
|
||||
Integer offset = param.getPageSize();
|
||||
Page<OperationSavedDO> page = new Page<>(start, offset);
|
||||
page.setOptimizeCountSql(false);
|
||||
if (param.getOrderByDesc()) {
|
||||
queryWrapper.orderByDesc("gmt_modified");
|
||||
} else {
|
||||
queryWrapper.orderByAsc("gmt_modified");
|
||||
}
|
||||
IPage<OperationSavedDO> iPage = operationSavedMapper.selectPage(page, queryWrapper);
|
||||
List<Operation> userSavedDdlDOS = operationConverter.do2dto(iPage.getRecords());
|
||||
if (CollectionUtils.isEmpty(userSavedDdlDOS)) {
|
||||
|
@ -36,4 +36,9 @@ public class OperationQueryRequest extends PageQueryRequest {
|
||||
* ddl语句状态:DRAFT/RELEASE
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* orderBy modify time desc
|
||||
*/
|
||||
private Boolean orderByDesc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user