c.stock_number,a.shelve_state,concat('¥',c.price,'~¥',g.price) section,a.create_time from cere_shop_product a
LEFT JOIN (SELECT a.product_id,a.product_image from cere_product_image a,
cere_shop_product b where a.product_id=b.product_id GROUP BY a.product_id) b ON a.product_id=b.product_id
LEFT JOIN (SELECT a.product_id,a.sku_id,MIN(a.price) price,MIN(a.original_price) original_price,
SUM(a.stock_number) stock_number,c.image
from cere_product_sku a,cere_shop_product b,cere_sku_name c where
a.product_id=b.product_id and a.sku_id=c.sku_id and b.shop_id=#{shopId} GROUP BY a.product_id) c ON a.product_id=c.product_id
a.product_id=b.product_id and a.sku_id=c.sku_id and b.shop_id in (select shop_id from cere_platform_shop where business_id =#{shopId}) GROUP BY a.product_id) c ON a.product_id=c.product_id
LEFT JOIN cere_shop_group d ON a.shop_id=d.shop_id
LEFT JOIN cere_product_classify e ON a.classify_id=e.classify_id
LEFT JOIN (SELECT a.product_id,a.sku_id,MAX(a.price) price
from cere_product_sku a,cere_shop_product b where
a.product_id=b.product_id GROUP BY a.product_id) g ON a.product_id=g.product_id
where a.shop_id=#{shopId} and a.shelve_state=1
where a.shop_id in (select shop_id from cere_platform_shop where business_id =#{shopId}) and a.shelve_state=1