|
|
@@ -66,12 +66,12 @@
|
|
|
fpd.inventory AS inventoryLocal,
|
|
|
fpd.suggestedRetailPrice,
|
|
|
(SELECT IFNULL(SUM(smd.inventory), 0.00) allInventory
|
|
|
- FROM pjpf_shopping_mall_detail smd
|
|
|
+ FROM pjpf_shopping_mall_detail_${tenantId} smd
|
|
|
WHERE smd.goods_code = fpd.goods_code
|
|
|
AND smd.id != fpd.id AND smd.tenant_id = #{tenantId} AND smd.is_deleted = 0) AS inventoryShare,
|
|
|
COUNT(goods_code) AS gc FROM
|
|
|
- pjpf_shopping_mall_detail fpd JOIN (
|
|
|
- SELECT id, min(bill_type) as bill_type from pjpf_shopping_mall_detail WHERE tenant_id = #{tenantId} and is_deleted = 0 AND sales_company_id = #{salesCompanyId} GROUP BY id
|
|
|
+ pjpf_shopping_mall_detail_${tenantId} fpd JOIN (
|
|
|
+ SELECT id, min(bill_type) as bill_type from pjpf_shopping_mall_detail_${tenantId} WHERE tenant_id = #{tenantId} and is_deleted = 0 AND sales_company_id = #{salesCompanyId} GROUP BY id
|
|
|
) spd on fpd.id = spd.id and fpd.bill_type = spd.bill_type
|
|
|
WHERE
|
|
|
fpd.tenant_id = #{tenantId}
|