|
@@ -64,10 +64,10 @@
|
|
|
order by rand()
|
|
|
</if>
|
|
|
<if test="sortType == 2">
|
|
|
- order by chp.price
|
|
|
+ order by price
|
|
|
</if>
|
|
|
<if test="sortType == 3">
|
|
|
- order by chp.price desc
|
|
|
+ order by price desc
|
|
|
</if>
|
|
|
<if test="sortType == 4">
|
|
|
order by chp.id desc
|
|
@@ -77,19 +77,33 @@
|
|
|
<select id="getProduct" resultType="com.caimei365.commodity.model.vo.HeheProductVo">
|
|
|
SELECT chp.productId,
|
|
|
(select price from cm_hehe_sku where productId = chp.productId order by price asc limit 1) as price,
|
|
|
- (select price from cm_hehe_sku where productId = chp.productId order by price asc limit 1) as normalPrice,
|
|
|
- (select unit from cm_sku cs left join cm_hehe_sku chs on cs.skuId=chs.skuId where cs.productId = chp.productId order by chs.price asc limit 1) as unit,
|
|
|
- (select stock from cm_sku cs left join cm_hehe_sku chs on cs.skuId=chs.skuId where cs.productId = chp.productId order by chs.price asc limit 1) as stock,
|
|
|
+ (select price
|
|
|
+ from cm_hehe_sku
|
|
|
+ where productId = chp.productId
|
|
|
+ order by price asc
|
|
|
+ limit 1) as normalPrice,
|
|
|
+ (select unit
|
|
|
+ from cm_sku cs
|
|
|
+ left join cm_hehe_sku chs on cs.skuId = chs.skuId
|
|
|
+ where cs.productId = chp.productId
|
|
|
+ order by chs.price asc
|
|
|
+ limit 1) as unit,
|
|
|
+ (select stock
|
|
|
+ from cm_sku cs
|
|
|
+ left join cm_hehe_sku chs on cs.skuId = chs.skuId
|
|
|
+ where cs.productId = chp.productId
|
|
|
+ order by chs.price asc
|
|
|
+ limit 1) as stock,
|
|
|
chp.includedTax,
|
|
|
chp.invoiceType,
|
|
|
chp.clubTaxPoint,
|
|
|
p.name,
|
|
|
p.mainImage,
|
|
|
- cb.name as "brandName",
|
|
|
+ cb.name as "brandName",
|
|
|
p.tags
|
|
|
FROM cm_hehe_product chp
|
|
|
- LEFT JOIN product p ON chp.productId = p.productID
|
|
|
- LEFT JOIN cm_brand cb on p.brandID = cb.id
|
|
|
+ LEFT JOIN product p ON chp.productId = p.productID
|
|
|
+ LEFT JOIN cm_brand cb on p.brandID = cb.id
|
|
|
WHERE chp.validFlag = 1
|
|
|
and chp.productId = #{productId}
|
|
|
</select>
|
|
@@ -103,9 +117,14 @@
|
|
|
AND a.productId = #{productId}
|
|
|
</select>
|
|
|
<select id="getCollageProduct" resultType="com.caimei365.commodity.model.po.HeheCollageProductPo">
|
|
|
- select chcs.skuId,chcp.productId, chcs.collagePrice as price, chcp.limitedNum, chcp.unlimitedFlag, chcp.memberNum
|
|
|
+ select chcs.skuId,
|
|
|
+ chcp.productId,
|
|
|
+ chcs.collagePrice as price,
|
|
|
+ chcp.limitedNum,
|
|
|
+ chcp.unlimitedFlag,
|
|
|
+ chcp.memberNum
|
|
|
from cm_hehe_collage_product chcp
|
|
|
- left join cm_hehe_collage_sku chcs on chcp.productId=chcs.productId
|
|
|
+ left join cm_hehe_collage_sku chcs on chcp.productId = chcs.productId
|
|
|
where chcs.skuId = #{skuId}
|
|
|
and chcp.status = 1
|
|
|
ORDER BY price ASC
|
|
@@ -152,8 +171,8 @@
|
|
|
<select id="getDiscountPrice" resultType="com.caimei365.commodity.model.po.HeheDiscountPricePo">
|
|
|
select chds.discountPrice, a.productId, chda.offlineTime
|
|
|
from hehe_discount_activity_product a
|
|
|
- left join cm_hehe_discount_activity_sku chds on a.productId=chds.productId
|
|
|
- left join cm_hehe_discount_activity chda on a.activityId = chda.id
|
|
|
+ left join cm_hehe_discount_activity_sku chds on a.productId = chds.productId
|
|
|
+ left join cm_hehe_discount_activity chda on a.activityId = chda.id
|
|
|
where chds.skuId = #{skuId}
|
|
|
and a.status = 1
|
|
|
and NOW() between chda.onlineTime and chda.offlineTime
|
|
@@ -332,9 +351,9 @@
|
|
|
cs.stock,
|
|
|
chs.price,
|
|
|
chs.price as normalPrice
|
|
|
- from cm_sku cs
|
|
|
- left join cm_hehe_sku chs on cs.skuId = chs.skuId
|
|
|
- where cs.productId=#{productId}
|
|
|
+ from cm_hehe_sku chs
|
|
|
+ left join cm_sku cs on cs.skuId = chs.skuId
|
|
|
+ where chs.productId = #{productId}
|
|
|
order by chs.price asc
|
|
|
</select>
|
|
|
<select id="getActivityLadderListBySkuId" resultType="com.caimei365.commodity.model.vo.LadderPriceVo">
|