This commit is contained in:
2025-11-25 14:36:05 +08:00
parent 043d09bee8
commit 1453b1be12

View File

@@ -272,12 +272,13 @@ public interface ShopOrderStatisticMapper extends BaseMapper<ShopOrderStatistic>
@Select("SELECT" +
" relation.product_id as productId," +
" ROUND(relation.surplus_stock * cons.price, 2) AS costAmount" +
" sum(ROUND(relation.surplus_stock * cons.price, 2)) AS costAmount" +
" FROM" +
" tb_prod_cons_relation relation " +
" INNER JOIN tb_cons_info cons on relation.cons_info_id = cons.id and relation.shop_id = cons.shop_id and price > 0" +
" WHERE" +
" relation.shop_id = #{shopId} " +
" group by relation.product_id" +
" order by relation.product_id")
List<ProductCostAmountVO> getConsCostAmount(Long shopId);