Commit 8f89c892 by 林冲

增加商品的售卖数量、售价处理

1 parent e893ac8b
## 邮件需求描述
导出附件里的商品ID在25年的售卖数量和售价
导出结果字段:商品ID 产值 数量 平均售价 最高售价 最低售价
给出UID例如:
商品ID
U2106301731037590011
U2203211302374790022
U2203211302374790029
U2203211302374790043
U2208161642312280001
U2208161642312280004
U2209232349288350001
U2209232349523670001
U2210101610257330001
## 处理sql
```sql
select gso.upgrade_goods_commodity_code,
sum(gso.total_price),
sum(number),
ROUND(sum(gso.total_price) / sum(number), 2),
ROUND(avg(gso.total_price / number), 2),
ROUND(max(gso.total_price / number), 2),
ROUND(min(gso.total_price / number), 2)
from dj_car_life_goods_sub_order gso
left join dj_car_life_goods_order go
on go.order_code=gso.order_code
left join dj_car_life_pay_order po on po.order_code= go.order_code
where gso.deleted_flag='N'
and po.success_date>='2025-01-01'
and po.success_date
<'2026-01-01'
and go.status in (4
, 6)
and go.deleted_flag='N'
and po.deleted_flag='N'
and gso.upgrade_goods_commodity_code in (
'U2106301731037590011'
)
GROUP BY gso.upgrade_goods_commodity_code;
```
## 脚本提供人
立明
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!