Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
doc
/
backend-knowledge-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8f89c892
authored
Mar 19, 2026
by
林冲
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加商品的售卖数量、售价处理
1 parent
e893ac8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
operations/导出附件里的商品ID在25年的售卖数量和售价.md
operations/导出附件里的商品ID在25年的售卖数量和售价.md
0 → 100644
View file @
8f89c89
## 邮件需求描述
导出附件里的商品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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment