diff --git a/src/main/java/com/corewing/app/entity/BizProduct.java b/src/main/java/com/corewing/app/entity/BizProduct.java index ec732cc..2218bb2 100644 --- a/src/main/java/com/corewing/app/entity/BizProduct.java +++ b/src/main/java/com/corewing/app/entity/BizProduct.java @@ -25,8 +25,12 @@ public class BizProduct extends CommonEntity { private String hotStatus; + private String showType; + private String content; + private String tag; + private String detailUrl; private BigDecimal amount; @@ -42,6 +46,4 @@ public class BizProduct extends CommonEntity { @TableField(exist = false) private String categoryId; - - } diff --git a/src/main/java/com/corewing/app/entity/BizProductCategory.java b/src/main/java/com/corewing/app/entity/BizProductCategory.java index 6b441c4..424ab78 100644 --- a/src/main/java/com/corewing/app/entity/BizProductCategory.java +++ b/src/main/java/com/corewing/app/entity/BizProductCategory.java @@ -8,6 +8,8 @@ import com.corewing.app.common.base.CommonEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.List; + @EqualsAndHashCode(callSuper = true) @Data @TableName("biz_product_category") @@ -34,5 +36,4 @@ public class BizProductCategory extends CommonEntity { @TableField(exist = false) Page productPage; - } diff --git a/src/main/java/com/corewing/app/mapper/BizProductCategoryMapper.java b/src/main/java/com/corewing/app/mapper/BizProductCategoryMapper.java index ecd3c0c..99de56f 100644 --- a/src/main/java/com/corewing/app/mapper/BizProductCategoryMapper.java +++ b/src/main/java/com/corewing/app/mapper/BizProductCategoryMapper.java @@ -11,5 +11,5 @@ import java.util.List; @Mapper public interface BizProductCategoryMapper extends BaseMapper { - List list(@Param("productCategoryRequest") ProductCategoryRequest productCategoryRequest); + } diff --git a/src/main/java/com/corewing/app/service/impl/BizProductCategroyServiceImpl.java b/src/main/java/com/corewing/app/service/impl/BizProductCategroyServiceImpl.java index c05c70a..07a2f20 100644 --- a/src/main/java/com/corewing/app/service/impl/BizProductCategroyServiceImpl.java +++ b/src/main/java/com/corewing/app/service/impl/BizProductCategroyServiceImpl.java @@ -1,5 +1,7 @@ package com.corewing.app.service.impl; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.corewing.app.dto.website.ProductCategoryRequest; @@ -25,13 +27,17 @@ public class BizProductCategroyServiceImpl extends ServiceImpl list(ProductCategoryRequest productCategoryRequest) { - List bizProductCategory = bizProductCategoryMapper.list(productCategoryRequest); - bizProductCategory.forEach(item -> { - ProductPageRequest query = new ProductPageRequest(); - query.setCategoryId(item.getId()); - Page page = bizProductService.page(query); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StrUtil.isNotBlank(productCategoryRequest.getSearchKey()), BizProductCategory::getCategoryTitle, productCategoryRequest.getSearchKey()); + List bizProductCategories = bizProductCategoryMapper.selectList(queryWrapper); + + bizProductCategories.forEach(item -> { + ProductPageRequest productPageRequest = new ProductPageRequest(); + productPageRequest.setCategoryId(item.getId()); + Page page = bizProductService.page(productPageRequest); item.setProductPage(page); }); - return bizProductCategory; + + return bizProductCategories; } } diff --git a/src/main/java/com/corewing/app/service/impl/BizProductServiceImpl.java b/src/main/java/com/corewing/app/service/impl/BizProductServiceImpl.java index 1087128..ad12af8 100644 --- a/src/main/java/com/corewing/app/service/impl/BizProductServiceImpl.java +++ b/src/main/java/com/corewing/app/service/impl/BizProductServiceImpl.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.corewing.app.common.page.PageContext; import com.corewing.app.dto.website.ProductPageRequest; -import com.corewing.app.entity.AppModel; import com.corewing.app.entity.BizProduct; import com.corewing.app.mapper.BizProductMapper; import com.corewing.app.service.BizProductService; diff --git a/src/main/resources/mapper/BizProductCategoryMapper.xml b/src/main/resources/mapper/BizProductCategoryMapper.xml index 931f5fc..07f02ae 100644 --- a/src/main/resources/mapper/BizProductCategoryMapper.xml +++ b/src/main/resources/mapper/BizProductCategoryMapper.xml @@ -9,15 +9,6 @@ FROM biz_product_category pc - - diff --git a/src/main/resources/mapper/BizProductMapper.xml b/src/main/resources/mapper/BizProductMapper.xml index 310286c..7c4bea7 100644 --- a/src/main/resources/mapper/BizProductMapper.xml +++ b/src/main/resources/mapper/BizProductMapper.xml @@ -21,6 +21,7 @@ and p.title like CONCAT('%', #{productPageRequest.searchKey}, '%') + and delete_flag = 'NOT_DELETE'