diff --git a/src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java b/src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java index d90c0b0..c926b1c 100644 --- a/src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java +++ b/src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java @@ -78,5 +78,5 @@ public interface PortfolioMapper extends Mapper { * 获取作品集列表数据 * @return */ - List selectPortfolios(); + List selectPortfolios(); } diff --git a/src/main/java/com/rymcu/forest/service/PortfolioService.java b/src/main/java/com/rymcu/forest/service/PortfolioService.java index db6d67c..bae6059 100644 --- a/src/main/java/com/rymcu/forest/service/PortfolioService.java +++ b/src/main/java/com/rymcu/forest/service/PortfolioService.java @@ -82,5 +82,5 @@ public interface PortfolioService extends Service { * 获取作品集列表数据 * @return */ - List findPortfolios(); + List findPortfolios(); } diff --git a/src/main/java/com/rymcu/forest/service/impl/PortfolioServiceImpl.java b/src/main/java/com/rymcu/forest/service/impl/PortfolioServiceImpl.java index c7a9c1d..e82539e 100644 --- a/src/main/java/com/rymcu/forest/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/rymcu/forest/service/impl/PortfolioServiceImpl.java @@ -199,7 +199,7 @@ public class PortfolioServiceImpl extends AbstractService implements } @Override - public List findPortfolios() { + public List findPortfolios() { return portfolioMapper.selectPortfolios(); } diff --git a/src/main/java/com/rymcu/forest/web/api/common/CommonApiController.java b/src/main/java/com/rymcu/forest/web/api/common/CommonApiController.java index 27980fa..7bd8e3b 100644 --- a/src/main/java/com/rymcu/forest/web/api/common/CommonApiController.java +++ b/src/main/java/com/rymcu/forest/web/api/common/CommonApiController.java @@ -147,8 +147,8 @@ public class CommonApiController { @GetMapping("/portfolios") public GlobalResult portfolios(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "12") Integer rows) { PageHelper.startPage(page, rows); - List list = portfolioService.findPortfolios(); - PageInfo pageInfo = new PageInfo(list); + List list = portfolioService.findPortfolios(); + PageInfo pageInfo = new PageInfo(list); Map map = new HashMap(2); map.put("portfolios", pageInfo.getList()); Map pagination = Utils.getPagination(pageInfo); diff --git a/src/main/java/mapper/PortfolioMapper.xml b/src/main/java/mapper/PortfolioMapper.xml index ad1ebbc..815be1c 100644 --- a/src/main/java/mapper/PortfolioMapper.xml +++ b/src/main/java/mapper/PortfolioMapper.xml @@ -17,6 +17,7 @@ + insert into forest_portfolio_article (id_portfolio, id_article, sort_no) values (#{idPortfolio}, #{idArticle}, #{maxSortNo}) @@ -51,8 +52,8 @@ - + select fp.*,fpa.numbers from forest_portfolio fp left join (select id_portfolio, count(id_portfolio) numbers from forest_portfolio_article group by id_portfolio) fpa on fp.id = fpa.id_portfolio order by fpa.numbers desc, updated_time desc \ No newline at end of file