修复一下bug
This commit is contained in:
@@ -5,7 +5,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.ShopProduct;
|
||||
import com.peanut.modules.common.to.ParamTo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopProductService extends IService<ShopProduct> {
|
||||
|
||||
Page getMarketProductList(ParamTo param);
|
||||
|
||||
List<ShopProduct> getProductListForCourse(Integer CatalogueId);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CourseCatalogueChapterServiceImpl extends ServiceImpl<CourseCatalog
|
||||
@Override
|
||||
public List<CourseCatalogueChapterEntity> getCourseCatalogueChapterList(int id) {
|
||||
LambdaQueryWrapper<CourseCatalogueChapterEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CourseCatalogueChapterEntity::getCourseId,id);
|
||||
wrapper.eq(CourseCatalogueChapterEntity::getCatalogueId,id);
|
||||
wrapper.orderByAsc(CourseCatalogueChapterEntity::getSort);
|
||||
List<CourseCatalogueChapterEntity> list = this.list(wrapper);
|
||||
return list;
|
||||
|
||||
@@ -3,17 +3,24 @@ package com.peanut.modules.sociology.service.impl;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.modules.common.dao.ShopProductCourseDao;
|
||||
import com.peanut.modules.common.dao.ShopProductDao;
|
||||
import com.peanut.modules.common.entity.ShopProduct;
|
||||
import com.peanut.modules.common.entity.ShopProductCourseEntity;
|
||||
import com.peanut.modules.common.entity.ShopProductToSociologyMarket;
|
||||
import com.peanut.modules.common.to.ParamTo;
|
||||
import com.peanut.modules.sociology.service.ShopProductService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service("sociologyShopProduct")
|
||||
public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProduct> implements ShopProductService {
|
||||
@Autowired
|
||||
private ShopProductCourseDao shopProductCourseDao;
|
||||
|
||||
@Override
|
||||
public Page getMarketProductList(ParamTo param) {
|
||||
@@ -24,4 +31,16 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
||||
Page<ShopProduct> shopProductPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), ShopProduct.class, wrapper);
|
||||
return shopProductPage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ShopProduct> getProductListForCourse(Integer catalogueId) {
|
||||
MPJLambdaWrapper<ShopProductCourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(ShopProduct.class);
|
||||
wrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,ShopProductCourseEntity::getProductId);
|
||||
wrapper.eq(ShopProductCourseEntity::getCatalogueId,catalogueId);
|
||||
wrapper.orderByAsc(ShopProduct::getPrice);
|
||||
List<ShopProduct> shopProducts = shopProductCourseDao.selectJoinList(ShopProduct.class, wrapper);
|
||||
return shopProducts;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user