From f34453a6e807103e36e412ecef66b39e9ef1f233 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期四, 19 九月 2024 17:57:39 +0800 Subject: [PATCH] 修改接口 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TShopServiceImpl.java | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TShopServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TShopServiceImpl.java index ff9c8dc..31c8edd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TShopServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TShopServiceImpl.java @@ -1,10 +1,20 @@ package com.ruoyi.system.service.impl; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.basic.PageInfo; +import com.ruoyi.system.domain.TBoard; import com.ruoyi.system.domain.TShop; +import com.ruoyi.system.mapper.TBoardMapper; import com.ruoyi.system.mapper.TShopMapper; +import com.ruoyi.system.query.TShopQuery; import com.ruoyi.system.service.TShopService; +import com.ruoyi.system.vo.TGoodsVO; +import com.ruoyi.system.vo.TShopVO; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + +import java.util.List; /** * <p> @@ -17,4 +27,18 @@ @Service public class TShopServiceImpl extends ServiceImpl<TShopMapper, TShop> implements TShopService { + @Autowired + private TBoardMapper boardMapper; + + @Override + public PageInfo<TShopVO> pageList(TShopQuery query) { + PageInfo<TShopVO> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize()); + List<TShopVO> list = this.baseMapper.pageList(query,pageInfo); + for (TShopVO tShopVO : list) { + tShopVO.setBoards(boardMapper.selectList(Wrappers.lambdaQuery(TBoard.class) + .eq(TBoard::getShopId,tShopVO.getId()))); + } + pageInfo.setRecords(list); + return pageInfo; + } } -- Gitblit v1.7.1