1
This commit is contained in:
@@ -17,4 +17,6 @@ public interface CourseService extends IService<CourseEntity> {
|
||||
|
||||
Page<CourseEntity> getUserLateCourseList(ParamTo param);
|
||||
|
||||
Page<CourseEntity> getMarketCourseList(ParamTo param);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.peanut.modules.sociology.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.ShopProduct;
|
||||
import com.peanut.modules.common.to.ParamTo;
|
||||
|
||||
public interface ShopProductService extends IService<ShopProduct> {
|
||||
|
||||
Page getMarketProductList(ParamTo param);
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.peanut.modules.common.dao.CourseDao;
|
||||
import com.peanut.modules.common.dao.CourseToSociologyDao;
|
||||
import com.peanut.modules.common.dao.UserToCourseDao;
|
||||
import com.peanut.modules.common.entity.CourseEntity;
|
||||
import com.peanut.modules.common.entity.CourseToMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseToSociologyEntity;
|
||||
import com.peanut.modules.common.entity.UserToCourseEntity;
|
||||
import com.peanut.modules.common.to.ParamTo;
|
||||
@@ -65,6 +66,17 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
wrapper.selectAll(CourseEntity.class);
|
||||
wrapper.leftJoin(UserToCourseEntity.class,UserToCourseEntity::getCourseId,CourseEntity::getId);
|
||||
wrapper.eq(UserToCourseEntity::getUserId,param.getId());
|
||||
wrapper.orderByDesc(UserToCourseEntity::getUpdateTime);
|
||||
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), CourseEntity.class, wrapper);
|
||||
return courseEntityPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<CourseEntity> getMarketCourseList(ParamTo param) {
|
||||
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(CourseEntity.class);
|
||||
wrapper.leftJoin(CourseToMarketEntity.class,CourseToMarketEntity::getCourseId,CourseEntity::getId);
|
||||
wrapper.eq(CourseToMarketEntity::getId,param.getId());
|
||||
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), CourseEntity.class, wrapper);
|
||||
return courseEntityPage;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
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.ShopProductDao;
|
||||
import com.peanut.modules.common.entity.ShopProduct;
|
||||
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.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service("sociologyShopProduct")
|
||||
public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProduct> implements ShopProductService {
|
||||
|
||||
@Override
|
||||
public Page getMarketProductList(ParamTo param) {
|
||||
MPJLambdaWrapper<ShopProduct> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(ShopProduct.class);
|
||||
wrapper.leftJoin(ShopProductToSociologyMarket.class,ShopProductToSociologyMarket::getProductId,ShopProduct::getProductId);
|
||||
wrapper.eq(ShopProductToSociologyMarket::getSociologyMarketId,param.getId());
|
||||
Page<ShopProduct> shopProductPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), ShopProduct.class, wrapper);
|
||||
return shopProductPage;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user