|
@@ -299,6 +299,76 @@
|
|
|
left join shop s on s.shopId = p.shopId
|
|
|
where p.productID = #{productId}
|
|
|
</select>
|
|
|
+ <select id="getProductOrganizeDetails" resultType="com.caimei365.commodity.model.vo.ProductDetailVo">
|
|
|
+ select p.productID as productId,
|
|
|
+ p.shopID as shopId,
|
|
|
+ (select normalPrice
|
|
|
+ from cm_sku
|
|
|
+ where productId = #{productId}
|
|
|
+ order by price asc
|
|
|
+ limit 1) as normalPrice,
|
|
|
+ ifnull((select stock from cm_sku where productId = #{productId} order by price asc limit 1), 0) as stock,
|
|
|
+ (select minBuyNumber
|
|
|
+ from cm_mall_product_sku
|
|
|
+ where productId = #{productId} or mallProductId = #{productId}
|
|
|
+ order by price asc
|
|
|
+ limit 1) as minBuyNumber,
|
|
|
+ (select cs.unit from cm_sku cs
|
|
|
+ left join cm_mall_product_sku cmps on cs.skuId = cmps.skuId
|
|
|
+ where cmps.productId = #{productId} or cmps.mallProductId = #{productId} order by cs.price asc limit 1) as unit,
|
|
|
+ p.name,
|
|
|
+ p.aliasName,
|
|
|
+ p.commodityType,
|
|
|
+ p.mainImage,
|
|
|
+ p.invoiceType,
|
|
|
+ p.bigTypeID as bigTypeId,
|
|
|
+ p.smallTypeID as smallTypeId,
|
|
|
+ p.tinyTypeID as tinyTypeId,
|
|
|
+ p.searchKey,
|
|
|
+ p.visibility,
|
|
|
+ p.commodityDetailsFlag,
|
|
|
+ p.brandID as brandId,
|
|
|
+ p.productType,
|
|
|
+ p.tags,
|
|
|
+ p.includedTax,
|
|
|
+ p.productCategory,
|
|
|
+ p.serviceNumber,
|
|
|
+ p.taxPoint,
|
|
|
+ p.supplierTaxPoint,
|
|
|
+ p.priceFlag,
|
|
|
+ p.actFlag,
|
|
|
+ p.addTime,
|
|
|
+ p.hasSkuFlag,
|
|
|
+ p.sellNumber,
|
|
|
+ p.sortIndex,
|
|
|
+ p.featuredFlag,
|
|
|
+ p.recommendType,
|
|
|
+ p.machineType,
|
|
|
+ p.productCode,
|
|
|
+ p.updateTime,
|
|
|
+ p.validFlag,
|
|
|
+ p.searchKey,
|
|
|
+ p.allAreaFlag,
|
|
|
+ p.step,
|
|
|
+ p.provinceIds,
|
|
|
+ p.qualificationImg,
|
|
|
+ p.trainingMethod,
|
|
|
+ p.trainingType,
|
|
|
+ p.trainingFee,
|
|
|
+ p.productRemarks,
|
|
|
+ p.productDetail as productDetailChose,
|
|
|
+ s.shopType as shopType,
|
|
|
+ p.qualificationNo as qualificationNo,
|
|
|
+ p.productName as productName,
|
|
|
+ p.qualificationTime as qualificationTime,
|
|
|
+ p.qualificationLink as qualificationLink,
|
|
|
+ p.returnGoodsStutas,
|
|
|
+ P.relatedLabels
|
|
|
+ from product p
|
|
|
+ left join cm_mall_organize_products cmop on p.productId = cmop.productId
|
|
|
+ left join shop s on s.shopId = p.shopId
|
|
|
+ where p.productID = #{productId} or cmop.id = #{productId}
|
|
|
+ </select>
|
|
|
<select id="getBuyAgainProducts" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
|
|
|
select p.productID as productId,
|
|
|
p.actStatus,
|