This commit is contained in:
wangjinlei
2023-09-21 14:04:39 +08:00
parent 35ebeb5740
commit 1810d6efd7

View File

@@ -1,9 +1,14 @@
package com.peanut.modules.book.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.R;
import com.peanut.modules.book.dao.ShopProductLabelDao;
import com.peanut.modules.book.dao.ShopProductToLabelDao;
import com.peanut.modules.book.entity.ShopProductEntity;
import com.peanut.modules.book.entity.ShopProductLabelEntity;
import com.peanut.modules.book.entity.ShopProductToLabelEntity;
import com.peanut.modules.book.service.ShopProductLabelService;
@@ -29,6 +34,8 @@ public class ShopProductLabelController {
private ShopProductToLabelService shopProductToLabelService;
@Autowired
private ShopProductLabelDao shopProductLabelDao;
@Autowired
private ShopProductToLabelDao shopProductToLabelDao;
@RequestMapping("/addLabel")
@@ -97,21 +104,27 @@ public class ShopProductLabelController {
}
/**
* 获取商品列表通过标签
* @return
*/
@RequestMapping("/getProductsByLabel")
public R getProductsByLabel(@RequestParam Integer splId,@RequestParam Integer limit,@RequestParam Integer page){
MPJLambdaWrapper<ShopProductToLabelEntity> shopProductEntityMPJLambdaWrapper = new MPJLambdaWrapper<ShopProductToLabelEntity>();
shopProductEntityMPJLambdaWrapper.selectAll(ShopProductEntity.class);
shopProductEntityMPJLambdaWrapper.leftJoin(ShopProductEntity.class,ShopProductEntity::getProductId,ShopProductToLabelEntity::getProductId);
shopProductEntityMPJLambdaWrapper.eq(ShopProductToLabelEntity::getDelFlag,0);
shopProductEntityMPJLambdaWrapper.eq(ShopProductEntity::getDelFlag,0);
Page<ShopProductEntity> shopProductEntityPage = shopProductToLabelDao.selectJoinPage(new Page<ShopProductEntity>(page, limit), ShopProductEntity.class, shopProductEntityMPJLambdaWrapper);
@RequestMapping("/mytest")
public R mytest(){
shopProductLabelService.getBaseMapper();
// shopProductLabelDao.selectJoinList()
return R.ok();
return R.ok().put("page",shopProductEntityPage);
}
}