From 745389caaee5149c57b1c35145688e4392414961 Mon Sep 17 00:00:00 2001 From: ronger Date: Thu, 5 Aug 2021 10:51:16 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=B8=93=E9=A2=98=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java | 2 +- src/main/java/com/rymcu/forest/service/PortfolioService.java | 2 +- .../com/rymcu/forest/service/impl/PortfolioServiceImpl.java | 2 +- .../com/rymcu/forest/web/api/common/CommonApiController.java | 4 ++-- src/main/java/mapper/PortfolioMapper.xml | 5 +++-- 5 files changed, 8 insertions(+), 7 deletions(-) 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