mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-11-04 10:57:10 +08:00 
			
		
		
		
	fix: 修复查询代码生成数据库表未按时间排序的问题
This commit is contained in:
		@@ -20,6 +20,7 @@ import java.io.File;
 | 
				
			|||||||
import java.nio.charset.StandardCharsets;
 | 
					import java.nio.charset.StandardCharsets;
 | 
				
			||||||
import java.sql.SQLException;
 | 
					import java.sql.SQLException;
 | 
				
			||||||
import java.util.Collection;
 | 
					import java.util.Collection;
 | 
				
			||||||
 | 
					import java.util.Comparator;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
import java.util.Map;
 | 
					import java.util.Map;
 | 
				
			||||||
import java.util.function.Function;
 | 
					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.containsAny(table.getTableName(), tableName));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        tableList.removeIf(table -> StrUtil.equalsAny(table.getTableName(), generatorProperties.getExcludeTables()));
 | 
					        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);
 | 
					        List<TableVO> tableVOList = BeanUtil.copyToList(tableList, TableVO.class);
 | 
				
			||||||
        PageDataVO<TableVO> pageDataVO = PageDataVO.build(pageQuery.getPage(), pageQuery.getSize(), tableVOList);
 | 
					        PageDataVO<TableVO> pageDataVO = PageDataVO.build(pageQuery.getPage(), pageQuery.getSize(), tableVOList);
 | 
				
			||||||
        for (TableVO tableVO : pageDataVO.getList()) {
 | 
					        for (TableVO tableVO : pageDataVO.getList()) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -317,7 +317,6 @@
 | 
				
			|||||||
      tableName: undefined,
 | 
					      tableName: undefined,
 | 
				
			||||||
      page: 1,
 | 
					      page: 1,
 | 
				
			||||||
      size: 10,
 | 
					      size: 10,
 | 
				
			||||||
      sort: ['createTime,desc', 'updateTime,desc'],
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    // 表单数据
 | 
					    // 表单数据
 | 
				
			||||||
    form: {} as GenConfigRecord,
 | 
					    form: {} as GenConfigRecord,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user