fix: 修复查询代码生成数据库表未按时间排序的问题

This commit is contained in:
Charles7c 2023-08-24 21:59:45 +08:00
parent 86ee1f6c47
commit f8e5e55fbf
2 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import java.io.File;
import java.nio.charset.StandardCharsets;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
@ -89,6 +90,8 @@ public class GeneratorServiceImpl implements GeneratorService {
tableList.removeIf(table -> !StrUtil.containsAny(table.getTableName(), tableName));
}
tableList.removeIf(table -> StrUtil.equalsAny(table.getTableName(), generatorProperties.getExcludeTables()));
CollUtil.sort(tableList,
Comparator.comparing(Table::getCreateTime).thenComparing(Table::getUpdateTime).reversed());
List<TableVO> tableVOList = BeanUtil.copyToList(tableList, TableVO.class);
PageDataVO<TableVO> pageDataVO = PageDataVO.build(pageQuery.getPage(), pageQuery.getSize(), tableVOList);
for (TableVO tableVO : pageDataVO.getList()) {

View File

@ -317,7 +317,6 @@
tableName: undefined,
page: 1,
size: 10,
sort: ['createTime,desc', 'updateTime,desc'],
},
//
form: {} as GenConfigRecord,