模板修改

This commit is contained in:
guo 2023-10-19 17:44:46 +08:00
parent 5b4ede3e06
commit 51b0b6f003
2 changed files with 3 additions and 0 deletions

View File

@ -53,6 +53,7 @@ public class GtMaterialArticleController {
HttpServletRequest req) { HttpServletRequest req) {
Result<IPage<GtMaterialArticle>> result = new Result<IPage<GtMaterialArticle>>(); Result<IPage<GtMaterialArticle>> result = new Result<IPage<GtMaterialArticle>>();
QueryWrapper<GtMaterialArticle> queryWrapper = QueryGenerator.initQueryWrapper(gtMaterialArticle, req.getParameterMap()); QueryWrapper<GtMaterialArticle> queryWrapper = QueryGenerator.initQueryWrapper(gtMaterialArticle, req.getParameterMap());
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(GtMaterialArticle::getId));
Page<GtMaterialArticle> page = new Page<GtMaterialArticle>(pageNo, pageSize); Page<GtMaterialArticle> page = new Page<GtMaterialArticle>(pageNo, pageSize);
IPage<GtMaterialArticle> pageList = gtMaterialArticleService.page(page, queryWrapper); IPage<GtMaterialArticle> pageList = gtMaterialArticleService.page(page, queryWrapper);
result.setSuccess(true); result.setSuccess(true);
@ -74,6 +75,7 @@ public class GtMaterialArticleController {
QueryWrapper<GtMaterialArticle> queryWrapper = QueryGenerator.initQueryWrapper(gtMaterialArticle, req.getParameterMap(), null, QueryWrapper<GtMaterialArticle> queryWrapper = QueryGenerator.initQueryWrapper(gtMaterialArticle, req.getParameterMap(), null,
RefUtil.fieldNames(GtMaterialArticle::getArticleTitle)); RefUtil.fieldNames(GtMaterialArticle::getArticleTitle));
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(GtMaterialArticle::getId));
return Result.success(gtMaterialArticleService.list(queryWrapper)); return Result.success(gtMaterialArticleService.list(queryWrapper));
} }

View File

@ -38,6 +38,7 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
private QueryWrapper<${entityName}> getQueryWrapper(HashMap<String, Object> paramMap) { private QueryWrapper<${entityName}> getQueryWrapper(HashMap<String, Object> paramMap) {
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initPageQueryWrapper(${entityName}.class, paramMap); QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initPageQueryWrapper(${entityName}.class, paramMap);
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(${entityName}::getId));
return queryWrapper; return queryWrapper;
} }