|
@@ -68,13 +68,13 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="productTypeRanking" resultType="com.fjhx.item.entity.product.vo.ProductInfoVo">
|
|
|
- SELECT pi.type type,
|
|
|
+ SELECT pi.type type,
|
|
|
pi.product_classify_id,
|
|
|
pic.parent_id_set,
|
|
|
- ifnull(SUM(pc.amount), 0) contractAmount,
|
|
|
- ifnull(SUM(pc.quantity), 0) contractQuantity,
|
|
|
- ifnull(sum(pd.amount), 0) purchaseAmount,
|
|
|
- IFNULL(SUM(pd.count), 0) purchaseQuantity
|
|
|
+ ifnull(SUM(pc.amount * bc.rate), 0) contractAmount,
|
|
|
+ ifnull(SUM(pc.quantity), 0) contractQuantity,
|
|
|
+ ifnull(sum(pd.amount), 0) purchaseAmount,
|
|
|
+ IFNULL(SUM(pd.count), 0) purchaseQuantity
|
|
|
FROM product_info pi
|
|
|
LEFT JOIN bytesailing_sale.contract_product pc ON pi.id = pc.product_id
|
|
|
LEFT JOIN bytesailing_sale.contract bc ON pc.contract_id = bc.id
|