分组
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user