提交 97194407 作者: xiaowang

新增:商品订单需要用到的接口

上级 92587869
......@@ -2,6 +2,7 @@ package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.*;
import com.mmc.pms.model.qo.MallOrderGoodsInfoQO;
import com.mmc.pms.model.qo.ProductSpecPriceQO;
import com.mmc.pms.model.vo.Create;
import com.mmc.pms.model.vo.GoodsAddVO;
......@@ -79,4 +80,22 @@ public class BackstageGoodsManageController {
@RequestParam(value = "tagId") Integer tagId) {
return goodsInfoService.feignGetUnitPriceByTag(specId, tagId);
}
@ApiOperation(value = "根据商品的产品规格id查询商品信息")
@ApiIgnore
@PostMapping("feignListProdGoodsSkuInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)})
public List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(@RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
return goodsInfoService.feignListProdGoodsSkuInfo(mallOrderGoodsInfoQO);
}
@ApiOperation(value = "根据商品的行业规格id查询商品清单信息")
@ApiIgnore
@PostMapping("feignListIndstGoodsSkuInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)})
public List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(@RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
return goodsInfoService.feignListIndstGoodsSkuInfo(mallOrderGoodsInfoQO);
}
}
......@@ -77,6 +77,17 @@ public interface GoodsInfoDao {
void batchUpdateMallProdSpec(List<Integer> delSpecId);
List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds);
List<MallGoodsSpecInfoDO> listIndstSpecInfo(@Param("indstIds") Set<Integer> indstIds);
List<GoodsServiceDO> listGoodsService(List<Integer> goodsIds);
List<MallGoodsInfoSimpleDO> listMallGoodsIndstSimpleInfo(@Param("indstSkuSpecIds") Set<Integer> indstSkuSpecIds);
List<Integer> listIndustrySpecIds(Set<Integer> mallIndstSkuSpecIds);
List<MallGoodsProductDO> listIndustryProductList(List<Integer> industrySpecIds);
}
......
......@@ -96,4 +96,5 @@ public interface IndustrySpecDao {
List<MallIndustrySkuInfoSpecDO> getIndustrySkuInfoSpec(Integer goodsInfoId);
List<IndustrySpecPriceDO> listIndustrySpecPrice(Integer channelClass, List<Integer> industrySpecIds);
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.dto.OrderGoodsProdDTO;
import com.mmc.pms.model.dto.ProductSkuVO;
import com.mmc.pms.model.dto.ProductSpecPriceDTO;
import com.mmc.pms.model.dto.ProductSpecVO;
import com.mmc.pms.model.qo.MallOrderGoodsInfoQO;
import com.mmc.pms.model.qo.ProductSkuQO;
import com.mmc.pms.model.vo.PriceAcquisition;
import com.mmc.pms.model.vo.ProductSpecCPQVO;
......@@ -104,6 +106,10 @@ public interface ProductDao {
List<ProductSpecDO> getProductSpecList(List<Integer> productSkuIds);
List<MallProdSkuInfoSpecDO> getProductSpecByIds(List<Integer> delProductSpecId);
Set<Integer> listProductSpecIds(@Param("mallProdSkuSpecIds") Set<Integer> mallProdSkuSpecIds);
List<OrderGoodsProdDTO> listProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
}
......
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.OrderGoodsIndstDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
/**
* author:zhenjie
* Date:2022/10/20
* time:16:50
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MallGoodsInfoSimpleDO implements Serializable {
private static final long serialVersionUID = -9183566814152128414L;
@ApiModelProperty(value = "商品id")
private Integer id;
@ApiModelProperty(value = "商品所属类型")
private Integer sortTypeId;
@ApiModelProperty(value = "商品编号")
private String goodsNo;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "商品主图")
private String mainImg;
@ApiModelProperty(value = "状态 0:下架 1:上架")
private Integer shelfStatus;
@ApiModelProperty(value = "是否删除")
private Integer deleted;
@ApiModelProperty(value = "商品规格信息")
private List<MallGoodsSpecSimpleDO> mallGoodsSpecSimpleDOS;
public OrderGoodsIndstDTO buildOrderGoodsIndstDTO() {
return OrderGoodsIndstDTO.builder().goodsInfoId(this.id).goodsName(this.goodsName).sortTypeId(this.sortTypeId).goodsNo(this.goodsNo).mainImg(this.mainImg).valid(this.deleted.equals(0) && this.shelfStatus.equals(1) ? true : false)
.orderGoodsIndstDetailDTOS(mallGoodsSpecSimpleDOS == null ? null : this.mallGoodsSpecSimpleDOS.stream().map(d -> d.buildOrderGoodsIndstDetailDTO()).collect(Collectors.toList())).build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.OrderGoodsIndstProdListDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* author:zhenjie
* Date:2022/10/20
* time:16:57
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MallGoodsProductDO implements Serializable {
private static final long serialVersionUID = -8801235084545192790L;
@ApiModelProperty(value = "行业规格id")
private Integer industrySpecId;
@ApiModelProperty(value = "产品规格id")
private Integer productSpecId;
@ApiModelProperty(value = "产品规格名称")
private String specName;
@ApiModelProperty(value = "产品规格图片")
private String prodSkuSpecImage;
@ApiModelProperty(value = "料号")
private String partNo;
@ApiModelProperty(value = "版本描述")
private String versionDesc;
@ApiModelProperty(value = "商品产品类型名称")
private String goodsTypeName;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "品牌")
private String productBrand;
public OrderGoodsIndstProdListDTO buildOrderGoodsIndstProdListDTO() {
return OrderGoodsIndstProdListDTO.builder().productSpecId(this.productSpecId).prodSkuSpecName(this.specName).prodSkuSpecImage(this.prodSkuSpecImage)
.partNo(this.partNo).versionDesc(this.versionDesc).goodsTypeName(this.goodsTypeName).productName(this.productName).model(this.model).productBrand(this.productBrand).build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.OrderGoodsIndstDetailDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
/**
* author:zhenjie
* Date:2022/10/20
* time:16:47
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MallGoodsSpecSimpleDO implements Serializable {
private static final long serialVersionUID = 1452073707519053399L;
private Integer mallIndustrySkuInfoSpecId;
private Integer industrySpecId;
private String specName;
private String specImage;
private BigDecimal unitPrice;
private Integer skuInfoDeleted;
private Integer skuSpecDeleted;
private Integer specDeleted;
private String unitName;
private List<MallGoodsProductDO> mallGoodsProductDOS;
public OrderGoodsIndstDetailDTO buildOrderGoodsIndstDetailDTO() {
return OrderGoodsIndstDetailDTO.builder().mallIndstSkuInfoSpecId(this.mallIndustrySkuInfoSpecId).industrySpecId(this.industrySpecId).industrySkuSpecName(this.specName)
.industrySkuSpecImage(this.specImage).unitPrice(this.unitPrice).valid(this.skuInfoDeleted.equals(0) && this.skuSpecDeleted.equals(0) && this.specDeleted.equals(0) ? true : false)
.orderGoodsIndstProdListDTOS(mallGoodsProductDOS == null ? null : mallGoodsProductDOS.stream().map(d -> d.buildOrderGoodsIndstProdListDTO()).collect(Collectors.toList()))
.unitName(this.unitName).build();
}
}
......@@ -51,9 +51,9 @@ public class OrderGoodsIndstDTO implements Serializable {
@ApiModelProperty(value = "是否有效")
private Boolean valid;
//
// @ApiModelProperty(value = "行业订单规格")
// private List<OrderGoodsIndstDetailDTO> orderGoodsIndstDetailDTOS;
@ApiModelProperty(value = "行业订单规格")
private List<OrderGoodsIndstDetailDTO> orderGoodsIndstDetailDTOS;
@ApiModelProperty("商品服务列表")
private List<GoodsServiceDTO> services;
......
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* author:zhenjie
* Date:2022/10/21
* time:17:44
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.mall.dto.OrderGoodsIndstDetailDTO", description = "行业订单规格DTO")
public class OrderGoodsIndstDetailDTO implements Serializable {
private static final long serialVersionUID = 3716298704318911013L;
@ApiModelProperty(value = "行业订单规格id")
private Integer id;
@ApiModelProperty(value = "行业订单id")
private Integer orderGoodsIndstId;
@ApiModelProperty(value = "购物车详情id")
private Integer mallIndstShopCarDetailId;
@ApiModelProperty(value = "商品行业规格id")
private Integer mallIndstSkuInfoSpecId;
@ApiModelProperty(value = "行业规格id")
private Integer industrySpecId;
@ApiModelProperty(value = "行业规格名称")
private String industrySkuSpecName;
@ApiModelProperty(value = "行业规格图片")
private String industrySkuSpecImage;
@ApiModelProperty(value = "购买数量")
private Integer buyNum;
@ApiModelProperty(value = "行业规格单价")
private BigDecimal unitPrice;
@ApiModelProperty(value = "行业所有规格总额")
private BigDecimal skuSpecAmount;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "是否有效")
private Boolean valid;
@ApiModelProperty(value = "产品单位名称")
private String unitName;
private List<OrderGoodsIndstProdListDTO> orderGoodsIndstProdListDTOS;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* author:zhenjie
* Date:2022/10/21
* time:17:54
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.mall.dto.OrderGoodsIndstProdListDTO", description = "行业规格对应产品清单DTO")
public class OrderGoodsIndstProdListDTO implements Serializable {
private static final long serialVersionUID = -1838976151472371521L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "行业订单规格id")
private Integer orderGoodsIndstDetailId;
@ApiModelProperty(value = "产品类型名称")
private String goodsTypeName;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "品牌")
private String productBrand;
@ApiModelProperty(value = "产品规格id")
private Integer productSpecId;
@ApiModelProperty(value = "产品规格名称")
private String prodSkuSpecName;
@ApiModelProperty(value = "产品规格图片")
private String prodSkuSpecImage;
@ApiModelProperty(value = "料号")
private String partNo;
@ApiModelProperty(value = "版本描述")
private String versionDesc;
@ApiModelProperty(value = "购买数量")
private Integer buyNum;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "单位名称-产品规格")
private String unitName;
}
......@@ -59,6 +59,6 @@ public class OrderGoodsProdDTO implements Serializable {
@ApiModelProperty("商品服务列表")
private List<GoodsServiceDTO> services;
// @ApiModelProperty(value = "订单详情")
// private List<OrderGoodsProdDetailDTO> orderGoodsProdDetailDTOS;
@ApiModelProperty(value = "订单详情")
private List<OrderGoodsProdDetailDTO> orderGoodsProdDetailDTOS;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* author:zhenjie
* Date:2022/10/19
* time:15:27
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.mall.dto.OrderGoodsProdDetailDTO", description = "订单最小sku信息")
public class OrderGoodsProdDetailDTO implements Serializable {
private static final long serialVersionUID = 2079521148328016486L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "二级订单的id")
private Integer orderGoodsProdId;
@ApiModelProperty(value = "购物车详情id")
private Integer mallProdShopCarDetailId;
@ApiModelProperty(value = "商品skuId")
private Integer mallProdSkuInfoId;
@ApiModelProperty(value = "商品sku详情id")
private Integer mallProdSkuInfoSpecId;
@ApiModelProperty(value = "产品规格id")
private Integer productSpecId;
@ApiModelProperty(value = "产品规格名称")
private String specName;
@ApiModelProperty(value = "产品规格图片")
private String prodSkuSpecImage;
@ApiModelProperty(value = "料号")
private String partNo;
@ApiModelProperty(value = "版本描述")
private String versionDesc;
@ApiModelProperty(value = "购买数量")
private Integer buyNum;
@ApiModelProperty(value = "单价")
private BigDecimal unitPrice;
@ApiModelProperty(value = "总价格")
private BigDecimal skuSpecAmount;
@ApiModelProperty(value = "商品产品类型名称")
private String goodsTypeName;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "品牌")
private String productBrand;
@ApiModelProperty(value = "品牌Id")
private Integer brandInfoId;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "是否有效")
private Boolean valid;
@ApiModelProperty(value = "是否删除")
private Integer skuInfoDeleted;
@ApiModelProperty(value = "是否删除")
private Integer skuSpecDeleted;
@ApiModelProperty(value = "是否删除")
private Integer specDeleted;
@ApiModelProperty(value = "单位名称")
private String unitName;
}
......@@ -5,6 +5,8 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
......@@ -18,6 +20,7 @@ import java.io.Serializable;
public class ClassifyInfoVO implements Serializable {
@ApiModelProperty(value = "id")
@NotNull(message = "id不能为空", groups = {Update.class})
@Min(value = 1, groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "所属目录id")
......@@ -26,7 +29,7 @@ public class ClassifyInfoVO implements Serializable {
@ApiModelProperty(value = "分类名称", required = true)
@Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
@NotNull(message = "分类名称不能为空", groups = {Update.class, Create.class})
@NotBlank(message = "分类名称不能为空或空字符", groups = {Update.class, Create.class})
private String classifyName;
@ApiModelProperty(value = "pid:一级分类的pid是0 二级分类pid是一级分类id", required = true)
......
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.MallGoodsShopCarDTO;
import com.mmc.pms.model.dto.MallProductSpecPriceDTO;
import com.mmc.pms.model.dto.ProductSpecPriceDTO;
import com.mmc.pms.model.dto.*;
import com.mmc.pms.model.qo.MallOrderGoodsInfoQO;
import com.mmc.pms.model.qo.ProductSpecPriceQO;
import com.mmc.pms.model.vo.GoodsAddVO;
......@@ -29,4 +28,8 @@ public interface GoodsInfoService {
List<MallProductSpecPriceDTO> feignListProductSpecPrice(ProductSpecPriceQO productSpecPriceQO);
ProductSpecPriceDTO feignGetUnitPriceByTag(Integer specId, Integer tagId);
List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
}
......@@ -54,9 +54,7 @@
<update id="updateClassification">
update categories
<set>
<if test="name != null and name != ''">
`name` = #{classifyName},
</if>
`name` = #{classifyName},
<if test="description != null">
description = #{description},
</if>
......@@ -107,7 +105,7 @@
FROM categories
WHERE `name` = #{classifyName} and `type` = #{type}
and is_deleted = 0
<if test="id!=null and id!=''">
<if test="id !=null">
and id <![CDATA[<>]]> #{id}
</if>
</select>
......
......@@ -283,4 +283,118 @@
</foreach>
and is_deleted = 0
</select>
<select id="listProdSpecInfo" resultType="com.mmc.pms.entity.MallGoodsSpecInfoDO">
SELECT
gi.id, gi.directory_id, mpsip.id as mallSkuInfoSpecId, mpsip.is_deleted as sku_spec_deleted, ps.spec_name,
ps.is_deleted as spec_deleted
FROM
goods_info gi
INNER JOIN mall_prod_info mpsi ON gi.id = mpsi.goods_info_id
INNER JOIN mall_prod_info_spec mpsip ON mpsi.id = mpsip.mall_prod_info_id
INNER JOIN product_spec ps ON ps.id = mpsip.product_spec_id
<where>
mpsip.id in (
<if test="prodIds != null">
<foreach collection="prodIds" item="id" index="index" separator=",">
#{id}
</foreach>
</if>
)
</where>
</select>
<select id="listIndstSpecInfo" resultType="com.mmc.pms.entity.MallGoodsSpecInfoDO">
SELECT
gi.id, gi.directory_id, misis.id as mallSkuInfoSpecId, misis.is_deleted as sku_spec_deleted, ins.spec_name,
ins.is_deleted as spec_deleted
FROM
goods_info gi
INNER JOIN mall_industry_sku_info misi ON gi.id = misi.goods_info_id
INNER JOIN mall_industry_sku_info_spec misis ON misi.id = misis.mall_industry_sku_info_id
INNER JOIN industry_spec ins ON ins.id = misis.industry_spec_id
<where>
misis.id in (
<if test="indstIds != null">
<foreach collection="indstIds" item="id" index="index" separator=",">
#{id}
</foreach>
</if>
)
</where>
</select>
<select id="listGoodsService" resultType="com.mmc.pms.entity.GoodsServiceDO">
select g.id,g.goods_info_id,g.sale_service_id,s.service_name,s.remark
from goods_service g
inner join sale_service s on s.id=g.sale_service_id
<where>
1=1
<foreach collection="list" item="id" index="index"
open="and g.goods_info_id in (" close=")" separator=",">
#{id}
</foreach>
</where>
</select>
<select id="listMallGoodsIndstSimpleInfo" resultType="com.mmc.pms.entity.MallGoodsInfoSimpleDO">
SELECT
gi.id,
gi.goods_name,
gi.goods_no,
gi.directory_id,
gimg.img_url,
gi.shelf_status,
gi.is_deleted,
misi.is_deleted as sku_info_deleted,
su.unit_name,
misis.id as mall_industry_sku_info_spec_id,
misis.industry_spec_id,
misis.is_deleted as sku_spec_deleted,
isp.spec_name,
isp.spec_image,
isp.is_deleted as spec_deleted
FROM
goods_info gi
INNER JOIN goods_img gimg ON gi.id = gimg.goods_info_id
AND gimg.img_type = 0
INNER JOIN mall_industry_sku_info misi ON gi.id = misi.goods_info_id
INNER JOIN mall_industry_sku_info_spec misis ON misi.id = misis.mall_industry_sku_info_id
INNER JOIN industry_spec isp ON isp.id = misis.industry_spec_id
left join sku_unit su on su.id = misi.sku_unit_id
where gimg.is_deleted = 0 and
misis.id in (
<foreach collection="indstSkuSpecIds" item="id" index="index" separator=",">
#{id}
</foreach>
)
</select>
<select id="listIndustrySpecIds" resultType="java.lang.Integer">
select DISTINCT misis.industry_spec_id FROM mall_industry_sku_info_spec misis
where misis.id in (
<foreach collection="list" item="id" index="index" separator=",">
#{id}
</foreach>
)
</select>
<select id="listIndustryProductList" resultType="com.mmc.pms.entity.MallGoodsProductDO">
SELECT
ipi.industry_spec_id as industrySpecId,
gt.name AS goodsTypeName,
psk.product_name as productName,
psk.model,
bi.brand_name as productBrand,
psc.id AS productSpecId,
psc.spec_name as specName,
psc.spec_image AS prodSkuSpecImage,
psc.part_no as partNo,
psc.version_desc as versionDesc
FROM
industry_product_inventory ipi
INNER JOIN inventory_spec isp ON ipi.id = isp.industry_product_inventory_id
INNER JOIN product_spec psc ON isp.product_spec_id = psc.id
INNER JOIN product psk ON psk.id = psc.product_id
INNER JOIN categories gt ON psk.categories_id = gt.id
where isp.is_deleted = 0 and ipi.industry_spec_id in (
<foreach collection="list" item="id" index="index" separator=",">
#{id}
</foreach>
)
</select>
</mapper>
......@@ -343,4 +343,17 @@
INNER JOIN industry_spec ins ON ins.id = mi.industry_spec_id and mi.is_deleted = 0
WHERE goods_info_id = #{id}
</select>
<select id="listIndustrySpecPrice" resultType="com.mmc.pms.entity.IndustrySpecPriceDO">
select id,
industry_spec_id industrySpecId,
tag_info_id tagInfoId,
price,
create_time createTime
from industry_spec_price
where is_deleted = 0 and `type` = 0 and tag_info_id = #{tagInfoId} and industry_spec_id in (
<foreach collection="industrySpecIds" item="id" index="index" separator=",">
#{id}
</foreach>
)
</select>
</mapper>
\ No newline at end of file
......@@ -353,7 +353,7 @@
psp.price
FROM
product_spec_price psp
where psp.cooperation_tag = #{tagInfoId} and psp.product_spec_id in (
where psp.cooperation_tag = #{tagInfoId} and `type` = 0 and psp.product_spec_id in (
<foreach collection="prodSkuSpecIds" item="id" index="index" separator=",">
#{id}
</foreach>
......@@ -364,6 +364,7 @@
from product_spec_price
where product_spec_id = #{id}
and tag_info_id = #{tagId}
and `type` = 0
</select>
<select id="getProductSpecList" resultType="com.mmc.pms.entity.ProductSpecDO">
SELECT
......@@ -390,4 +391,46 @@
</foreach>
and is_deleted = 0
</select>
<select id="listProductSpecIds" resultType="java.lang.Integer">
select DISTINCT mpsis.product_spec_id FROM mall_prod_info_spec mpsis
where mpsis.id in (
<foreach collection="mallProdSkuSpecIds" item="id" index="index" separator=",">
#{id}
</foreach>
)
</select>
<select id="listProdGoodsSkuInfo" resultType="com.mmc.pms.model.dto.OrderGoodsProdDTO">
SELECT
gi.id as goods_info_id,gi.goods_name,gi.goods_no,gi.directory_id,
gimg.img_url as mainImg,
gi.shelf_status,
gi.is_deleted,
mpsi.id as mall_prod_info_id,
mpsi.is_deleted as sku_info_deleted,
gt.name as goods_type_name,psk.id, psk.product_name,psk.model,psk.brand_info_id,
mpsis.id as mall_prod_info_spec_id,
mpsis.is_deleted as sku_spec_deleted,
psc.id as product_spec_id,psc.spec_name,psc.spec_image as prod_sku_spec_image,psc.part_no,psc.version_desc,
psc.is_deleted as spec_deleted,
su.unit_name,
bi.brand_name
FROM
goods_info gi
INNER JOIN mall_prod_info mpsi ON gi.id = mpsi.goods_info_id
INNER JOIN mall_prod_info_spec mpsis ON mpsi.id = mpsis.mall_prod_info_id
INNER JOIN product_spec psc ON mpsis.product_spec_id = psc.id
INNER JOIN product psk ON psk.id = psc.product_id
INNER JOIN goods_img gimg ON gi.id = gimg.goods_info_id and gimg.img_type = 0
INNER JOIN categories gt ON psk.categories_id = gt.id
LEFT JOIN sku_unit su ON su.id = mpsi.sku_unit_id
left join brand_info bi on bi.id = psk.brand_info_id
<where>
gi.is_deleted = 0 and
mpsis.id in (
<foreach collection="mallProdSkuSpecIds" item="id" index="index" separator=",">
#{id}
</foreach>
)
</where>
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论