提交 f8e5e55f 编写于 作者: 查尔斯-BUG万象集's avatar 查尔斯-BUG万象集

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

上级 86ee1f6c
......@@ -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()) {
......
......@@ -317,7 +317,6 @@
tableName: undefined,
page: 1,
size: 10,
sort: ['createTime,desc', 'updateTime,desc'],
},
// 表单数据
form: {} as GenConfigRecord,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册