瀏覽代碼

问题处理

yzc 1 年之前
父節點
當前提交
b168ec94a0
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      hx-item/src/main/resources/mapper/product/ProductInfoMapper.xml

+ 5 - 5
hx-item/src/main/resources/mapper/product/ProductInfoMapper.xml

@@ -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