diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/CategoryController.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/CategoryController.java index 58a4b0aef..6322d3e76 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/CategoryController.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/CategoryController.java @@ -3,8 +3,12 @@ package com.youlai.mall.product.controller.admin; import com.youlai.common.result.Result; import com.youlai.common.web.model.Option; import com.youlai.mall.product.model.form.CategoryForm; +import com.youlai.mall.product.model.vo.AttributeGroupVO; import com.youlai.mall.product.model.vo.CategoryVO; +import com.youlai.mall.product.model.vo.SpecVO; +import com.youlai.mall.product.service.AttrService; import com.youlai.mall.product.service.CategoryService; +import com.youlai.mall.product.service.SpecService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -27,6 +31,8 @@ import java.util.List; public class CategoryController { private final CategoryService categoryService; + private final AttrService attrService; + private final SpecService specService; @Operation(summary = "获取商品分类列表") @GetMapping @@ -69,4 +75,22 @@ public class CategoryController { return Result.success(); } + @Operation(summary = "获取属性列表") + @GetMapping("/{categoryId}/attributes") + public Result> listAttributesByCategoryId( + @Parameter(description = "分类ID", example = "3") @PathVariable Long categoryId + ) { + List list = attrService.listAttributesByCategoryId(categoryId); + return Result.success(list); + } + + @Operation(summary = "获取规格列表") + @GetMapping("/{categoryId}/specs") + public Result> listSpecsByCategoryId( + @Parameter(description = "分类ID", example = "3") @PathVariable Long categoryId + ) { + List list = specService.listSpecsByCategoryId(categoryId); + return Result.success(list); + } + } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/AttrConverter.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/AttrConverter.java index 77c9a5c7a..45e0ecbcb 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/AttrConverter.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/AttrConverter.java @@ -5,7 +5,7 @@ import com.youlai.mall.product.model.form.AttrForm; import org.mapstruct.*; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.product.model.vo.AttributePageVO; +import com.youlai.mall.product.model.vo.AttrPageVO; import com.youlai.mall.product.model.bo.AttrBO; @Mapper(componentModel = "spring") @@ -14,9 +14,9 @@ public interface AttrConverter { @Mappings({ @Mapping(target = "inputTypeLabel", expression = "java(bo.getInputType()!=null? bo.getInputType().getLabel():\"\")") }) - AttributePageVO convertToPageVo(AttrBO bo); + AttrPageVO toPageVo(AttrBO bo); - Page convertToPageVo(Page bo); + Page toPageVo(Page bo); AttrForm convertToForm(Attr entity); diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/BrandConverter.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/BrandConverter.java index 581783116..341ccafc9 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/BrandConverter.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/BrandConverter.java @@ -27,5 +27,5 @@ public interface BrandConverter { BrandPageVO convertToVo(Brand entity); - Page convertToPageVo(Page page); + Page toPageVo(Page page); } \ No newline at end of file diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrMapper.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrMapper.java index 3cb08eca3..a30e688ed 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrMapper.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrMapper.java @@ -35,7 +35,7 @@ public interface AttrMapper extends BaseMapper { * * @param categoryId 分类ID */ - List listBaseAttributes(Long categoryId); + List listAttributesByCategoryId(Long categoryId); /** * 根据分类ID获取销售属性列表 diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpecMapper.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpecMapper.java index f6dea18ad..dcc379b81 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpecMapper.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpecMapper.java @@ -5,8 +5,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.youlai.mall.product.model.bo.SpecBO; import com.youlai.mall.product.model.query.SpecPageQuery; +import com.youlai.mall.product.model.vo.SpecPageVO; +import com.youlai.mall.product.model.vo.SpecVO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * Mapper 接口 * @@ -24,6 +28,13 @@ public interface SpecMapper extends BaseMapper { * @param queryParams 查询参数 * @return */ - Page listPagedSpecs(Page page, SpecPageQuery queryParams); + Page listPagedSpecs(Page page, SpecPageQuery queryParams); + /** + * 根据分类ID查询规格列表 + * + * @param categoryId + * @return + */ + List listSpecsByCategoryId(Long categoryId); } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpuImageMapper.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpuImageMapper.java index ec8095d60..55efd2cc4 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpuImageMapper.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpuImageMapper.java @@ -1,9 +1,7 @@ package com.youlai.mall.product.mapper; -import com.youlai.mall.product.model.entity.SpuImage; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.product.model.bo.SpuImageBO; +import com.youlai.mall.product.model.entity.SpuImage; import org.apache.ibatis.annotations.Mapper; /** diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/SpuImageBO.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/SpuImageBO.java deleted file mode 100644 index b427670e2..000000000 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/SpuImageBO.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.youlai.mall.product.model.bo; - -import java.io.Serializable; -import lombok.Getter; -import lombok.Setter; - -/** - * 商品图片 - * - * @author Ray Hao - * @since 2024-04-14 - */ -@Getter -@Setter -public class SpuImageBO implements Serializable { - - private static final long serialVersionUID = 1L; - - private Long spuId; - - private String imgUrl; -} diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Attr.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Attr.java index e56f11ed1..75c560319 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Attr.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Attr.java @@ -29,25 +29,14 @@ public class Attr extends BaseEntity { private String name; /** - * 属性类型(1:基础属性,2:销售属性) - * @see com.youlai.mall.product.enums.AttributeTypeEnum - */ - private AttributeTypeEnum type; - - /** - * 输入方式(1:手动输入,2:从列表选择) + * 输入方式:1->手动输入;2->列表选择 */ private AttributeInputTypeEnum inputType; /** * 可选值列表(以逗号分隔,仅当输入方式为2时使用) */ - private String selectableValues; - - /** - * 分类ID - */ - private Long categoryId; + private String options; /** * 排序 diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/SpecPageQuery.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/SpecPageQuery.java index 95a5c6f90..45dbf871f 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/SpecPageQuery.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/SpecPageQuery.java @@ -6,7 +6,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; /** - * 分页查询对象 + * 规格分页查询对象 * * @author Ray Hao * @since 2024-06-13 @@ -19,4 +19,7 @@ public class SpecPageQuery extends BasePageQuery { @Schema(description="关键字") private String keywords; + @Schema(description="分类ID",example = "3") + private Long categoryId; + } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttributePageVO.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrPageVO.java similarity index 80% rename from mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttributePageVO.java rename to mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrPageVO.java index 5eccee757..22ca0bb97 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttributePageVO.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrPageVO.java @@ -1,8 +1,6 @@ package com.youlai.mall.product.model.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import com.youlai.mall.product.enums.AttributeInputTypeEnum; -import com.youlai.mall.product.enums.AttributeTypeEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; @@ -18,10 +16,9 @@ import java.time.LocalDateTime; */ @Getter @Setter -@Schema(description = "属性") -public class AttributePageVO implements Serializable { +@Schema(description = "属性分页对象") +public class AttrPageVO implements Serializable { - private static final long serialVersionUID = 1L; @Schema(description = "属性主键") private Long id; diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/SpecVO.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/SpecVO.java index 4541fdbbe..eafc3197a 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/SpecVO.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/SpecVO.java @@ -1,56 +1,37 @@ package com.youlai.mall.product.model.vo; +import java.io.Serial; import java.io.Serializable; import java.time.LocalDateTime; + import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; /** - * VO + * 规格 VO * * @author Ray Hao * @since 2024-06-13 */ @Getter @Setter -@Schema( description = "视图对象") +@Schema(description = "规格视图对象") public class SpecVO implements Serializable { + @Serial private static final long serialVersionUID = 1L; - + @Schema(description = "规格ID") private Long id; - @Schema(description = "属性名称") - + @Schema(description = "规格名称") private String name; - @Schema(description = "输入方式(1:手动输入,2:列表选择)") - + @Schema(description = "输入方式(1:手动输入,2:列表选择)") private Byte inputType; - @Schema(description = "可选值列表(以逗号分隔,仅当输入方式为2时使用)") - + @Schema(description = "可选值列表(以逗号分隔,仅当输入方式为2时使用)") private String options; - @Schema(description = "分类ID") - - private Long categoryId; - - @Schema(description = "排序") - - private Short sort; - - @Schema(description = "创建时间") - - private LocalDateTime createTime; - - @Schema(description = "更新时间") - - private LocalDateTime updateTime; - - @Schema(description = "逻辑删除标识(0:未删除,1:已删除)") - - private Byte isDeleted; } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/AttrService.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/AttrService.java index 738a2bdde..40fbd7b47 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/AttrService.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/AttrService.java @@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.youlai.mall.product.model.form.AttrForm; import com.youlai.mall.product.model.query.AttributePageQuery; import com.youlai.mall.product.model.vo.AttributeGroupVO; -import com.youlai.mall.product.model.vo.AttributePageVO; +import com.youlai.mall.product.model.vo.AttrPageVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.youlai.mall.product.model.vo.AttributeVO; @@ -23,7 +23,7 @@ public interface AttrService extends IService { /** * 属性分页列表 */ - IPage listPagedAttributes(AttributePageQuery queryParams); + IPage listPagedAttributes(AttributePageQuery queryParams); /** @@ -61,7 +61,7 @@ public interface AttrService extends IService { * * @param categoryId 商品分类ID */ - List listBaseAttributes(Long categoryId); + List listAttributesByCategoryId(Long categoryId); /** * 获取销售属性列表 diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/SpecService.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/SpecService.java index f616ce580..d0a8e7e48 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/SpecService.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/SpecService.java @@ -6,8 +6,12 @@ import com.youlai.mall.product.model.form.SpecForm; import com.youlai.mall.product.model.query.SpecPageQuery; import com.youlai.mall.product.model.vo.SpecPageVO; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.youlai.mall.product.model.vo.SpecVO; + +import java.util.List; + /** - * 服务类 + * 规格接口层 * * @author Ray Hao * @since 2024-06-13 @@ -16,7 +20,7 @@ public interface SpecService extends IService { /** - *分页列表 + * 分页列表 * * @return */ @@ -29,7 +33,7 @@ public interface SpecService extends IService { * @param id ID * @return */ - SpecForm getSpecFormData(Long id); + SpecForm getSpecFormData(Long id); /** @@ -43,7 +47,7 @@ public interface SpecService extends IService { /** * 修改 * - * @param id ID + * @param id ID * @param formData 表单对象 * @return */ @@ -58,4 +62,11 @@ public interface SpecService extends IService { */ boolean deleteSpecs(String ids); + /** + * 根据分类ID获取规格列表 + * + * @param categoryId 分类ID + * @return + */ + List listSpecsByCategoryId(Long categoryId); } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/AttrServiceImpl.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/AttrServiceImpl.java index 4a9fcc80e..97cb8552c 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/AttrServiceImpl.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/AttrServiceImpl.java @@ -5,6 +5,7 @@ import com.youlai.mall.product.model.bo.AttrBO; import com.youlai.mall.product.model.entity.Attr; import com.youlai.mall.product.mapper.AttrMapper; import com.youlai.mall.product.model.form.AttrForm; +import com.youlai.mall.product.model.vo.AttrPageVO; import com.youlai.mall.product.model.vo.AttributeGroupVO; import com.youlai.mall.product.model.vo.AttributeVO; import com.youlai.mall.product.service.AttrService; @@ -12,7 +13,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import com.youlai.mall.product.model.query.AttributePageQuery; -import com.youlai.mall.product.model.vo.AttributePageVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -39,15 +39,15 @@ public class AttrServiceImpl extends ServiceImpl implements At * 获取属性分页列表 * * @param queryParams 查询参数 - * @return {@link IPage} 属性分页列表 + * @return {@link IPage< AttrPageVO >} 属性分页列表 */ @Override - public IPage listPagedAttributes(AttributePageQuery queryParams) { + public IPage listPagedAttributes(AttributePageQuery queryParams) { Page page = this.baseMapper.listPagedAttributes( new Page<>(queryParams.getPageNum(), queryParams.getPageSize()), queryParams ); - return attributeConverter.convertToPageVo(page); + return attributeConverter.toPageVo(page); } /** @@ -106,8 +106,8 @@ public class AttrServiceImpl extends ServiceImpl implements At * @param categoryId 商品分类ID */ @Override - public List listBaseAttributes(Long categoryId) { - return this.baseMapper.listBaseAttributes(categoryId); + public List listAttributesByCategoryId(Long categoryId) { + return this.baseMapper.listAttributesByCategoryId(categoryId); } /** diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/BrandServiceImpl.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/BrandServiceImpl.java index 174ab7884..4b70b41d5 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/BrandServiceImpl.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/BrandServiceImpl.java @@ -44,7 +44,7 @@ public class BrandServiceImpl extends ServiceImpl implements new LambdaQueryWrapper().like(StrUtil.isNotBlank(keywords), Brand::getName, keywords) .orderByAsc(Brand::getSort) ); - return brandConverter.convertToPageVo(page); + return brandConverter.toPageVo(page); } /** diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/SpecServiceImpl.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/SpecServiceImpl.java index 8f19c85a0..fb82a59b6 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/SpecServiceImpl.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/impl/SpecServiceImpl.java @@ -2,6 +2,7 @@ package com.youlai.mall.product.service.impl; import com.youlai.mall.product.model.entity.Spec; import com.youlai.mall.product.mapper.SpecMapper; +import com.youlai.mall.product.model.vo.SpecVO; import com.youlai.mall.product.service.SpecService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.RequiredArgsConstructor; @@ -24,7 +25,7 @@ import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; /** - * 服务实现类 + * 规格服务实现类 * * @author Ray Hao * @since 2024-06-13 @@ -36,29 +37,25 @@ public class SpecServiceImpl extends ServiceImpl implements Sp private final SpecConverter specConverter; /** - * 获取分页列表 - * - * @param queryParams 查询参数 - * @return {@link IPage} 分页列表 - */ + * 获取分页列表 + * + * @param queryParams 查询参数 + * @return {@link IPage} 分页列表 + */ @Override public IPage listPagedSpecs(SpecPageQuery queryParams) { - + // 参数构建 int pageNum = queryParams.getPageNum(); int pageSize = queryParams.getPageSize(); - Page page = new Page<>(pageNum, pageSize); + Page page = new Page<>(pageNum, pageSize); // 格式化为数据库日期格式,避免日期比较使用格式化函数导致索引失效 DateUtils.toDatabaseFormat(queryParams, "startTime", "endTime"); - - // 查询数据 - Page boPage = this.baseMapper.listPagedSpecs(page, queryParams); - - // 实体转换 - return specConverter.toPageVo(boPage); + + return this.baseMapper.listPagedSpecs(page, queryParams); } - + /** * 获取表单数据 * @@ -70,7 +67,7 @@ public class SpecServiceImpl extends ServiceImpl implements Sp Spec entity = this.getById(id); return specConverter.toForm(entity); } - + /** * 新增 * @@ -83,20 +80,20 @@ public class SpecServiceImpl extends ServiceImpl implements Sp Spec entity = specConverter.toEntity(formData); return this.save(entity); } - + /** * 更新 * - * @param id ID + * @param id ID * @param formData 表单对象 * @return */ @Override - public boolean updateSpec(Long id,SpecForm formData) { + public boolean updateSpec(Long id, SpecForm formData) { Spec entity = specConverter.toEntity(formData); return this.updateById(entity); } - + /** * 删除 * @@ -112,6 +109,17 @@ public class SpecServiceImpl extends ServiceImpl implements Sp .toList(); return this.removeByIds(idList); } - + + /** + * 根据分类ID获取规格列表 + * + * @param categoryId 分类ID + * @return + */ + @Override + public List listSpecsByCategoryId(Long categoryId) { + return this.baseMapper.listSpecsByCategoryId(categoryId); + } + } diff --git a/mall-product/product-boot/src/main/resources/mapper/AttrGroupMapper.xml b/mall-product/product-boot/src/main/resources/mapper/AttrGroupMapper.xml index 23f63b005..18d903307 100644 --- a/mall-product/product-boot/src/main/resources/mapper/AttrGroupMapper.xml +++ b/mall-product/product-boot/src/main/resources/mapper/AttrGroupMapper.xml @@ -11,7 +11,7 @@ ag.create_time, c.name AS category_name FROM - pms_attribute_group ag + pms_attr_group ag LEFT JOIN pms_category c on ag.category_id = c.id AND c.is_deleted = 0 ag.is_deleted = 0 diff --git a/mall-product/product-boot/src/main/resources/mapper/AttrMapper.xml b/mall-product/product-boot/src/main/resources/mapper/AttrMapper.xml index 95f79bd9d..4560158a2 100644 --- a/mall-product/product-boot/src/main/resources/mapper/AttrMapper.xml +++ b/mall-product/product-boot/src/main/resources/mapper/AttrMapper.xml @@ -15,8 +15,8 @@ t3.NAME categoryName, t1.create_time FROM - `pms_attribute` t1 - LEFT JOIN pms_attribute_group t2 ON t1.attribute_group_id = t2.id + `pms_attr` t1 + LEFT JOIN pms_attr_group t2 ON t1.attribute_group_id = t2.id LEFT JOIN pms_category t3 ON t1.category_id = t3.id t1.is_deleted = 0 @@ -62,19 +62,18 @@ - SELECT t1.id, t1.`name`, t2.id AS attribute_group_id, t2.`name` AS attribute_group_name FROM - pms_attribute t1 - INNER JOIN pms_attribute_group t2 ON t1.attribute_group_id = t2.id AND t2.is_deleted = 0 + pms_attr t1 + INNER JOIN pms_attr_group t2 ON t1.attribute_group_id = t2.id AND t2.is_deleted = 0 WHERE t1.category_id = #{categoryId} AND t1.is_deleted = 0 - AND t1.type = 1 ORDER BY t2.sort, t1.sort @@ -99,7 +98,7 @@ t1.input_type, t1.options FROM - pms_attribute t1 + pms_attr t1 WHERE t1.category_id = #{categoryId} AND t1.is_deleted = 0 diff --git a/mall-product/product-boot/src/main/resources/mapper/SpecMapper.xml b/mall-product/product-boot/src/main/resources/mapper/SpecMapper.xml index 4d53bda3e..d6a9a8869 100644 --- a/mall-product/product-boot/src/main/resources/mapper/SpecMapper.xml +++ b/mall-product/product-boot/src/main/resources/mapper/SpecMapper.xml @@ -2,29 +2,24 @@ - - - - - - - - - - - + + + + + - - - id, name, input_type, options, category_id, sort, create_time, update_time, is_deleted - - - - SELECT - + id, + `name`, + input_type, + options, + create_time FROM pms_spec @@ -41,7 +36,36 @@ AND create_time <= #{queryParams.endTime} - ORDER BY create_time DESC + ORDER BY + create_time DESC + + + + + + + + + + + +