修改商品列表
This commit is contained in:
parent
e0f6ccace8
commit
ccadf33e19
@ -23,11 +23,11 @@ public class AppProductController {
|
||||
private final ProductConvert convert;
|
||||
private final ProductService productService;
|
||||
|
||||
@Tag(name ="查询商品信息列表")
|
||||
@Tag(name = "查询商品信息列表")
|
||||
@PostMapping("page")
|
||||
public R<IPage<ProductVO>> page(@RequestBody ProductBo query, Page<Product> page) {
|
||||
Page<Product> productCategoryPage = service.page(page,query.toWrapper());
|
||||
return R.ok(convert.toVO(productCategoryPage));
|
||||
IPage<ProductVO> resultPage = service.getProduct(page, query);
|
||||
return R.ok(resultPage);
|
||||
}
|
||||
|
||||
@Tag(name ="获取商品信息详细信息")
|
||||
|
@ -106,7 +106,7 @@ public class ProductVO extends BaseAudit {
|
||||
@Schema(description = "SKU列表")
|
||||
private List<Sku> skuList;
|
||||
|
||||
@Schema(description = "店铺名称")
|
||||
@Schema(description = "联系人")
|
||||
private String contactUserName;
|
||||
|
||||
@Schema(description = "店铺手机号")
|
||||
@ -133,4 +133,8 @@ public class ProductVO extends BaseAudit {
|
||||
@Schema(description = "优惠金额")
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
@Schema(description = "店铺名称")
|
||||
private String storeName;
|
||||
|
||||
|
||||
}
|
||||
|
@ -50,4 +50,7 @@ public interface ProductMapper extends BaseMapper<Product> {
|
||||
"SUM(CASE WHEN auth_flag = 2 THEN 1 ELSE 0 END) AS count2 " +
|
||||
"FROM pms_product")
|
||||
Map<String, Object> countProduct();
|
||||
|
||||
|
||||
IPage<ProductVO> getProduct(@Param("page") Page<Product> page, @Param("query") ProductBo query);
|
||||
}
|
||||
|
@ -161,4 +161,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
//删除商品主表数据
|
||||
return productMapper.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
public IPage<ProductVO> getProduct(Page<Product> page, ProductBo query) {
|
||||
return productMapper.getProduct(page, query);
|
||||
}
|
||||
}
|
||||
|
@ -130,6 +130,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
p.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getProduct" resultType="com.wzj.soopin.goods.domain.vo.ProductVO">
|
||||
SELECT
|
||||
p.*,
|
||||
t.store_name AS storeName
|
||||
FROM
|
||||
pms_product p
|
||||
LEFT JOIN
|
||||
sys_tenant t ON p.tenant_id = t.tenant_id
|
||||
<where>
|
||||
<if test="query.nameLike != null and query.nameLike != ''">
|
||||
AND p.name LIKE CONCAT('%', #{query.nameLike}, '%')
|
||||
</if>
|
||||
<if test="query.categoryId != null">
|
||||
AND p.category_id = #{query.categoryId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<resultMap id="ProductWithSkusResultMap" type="ProductVO">
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user