mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
feat: 库存查询接口
This commit is contained in:
@@ -51,14 +51,14 @@ select
|
||||
d.warehouse_id as warehouse_id,
|
||||
count(d.id) over (partition by g.id) as detail_count,
|
||||
round((sum(d.number) filter ( where d.receipt_type = '0' ) over (partition by g.id, d.warehouse_id))::numeric,
|
||||
2) as type0_number,
|
||||
2) as type0number,
|
||||
round((sum(d.number) filter ( where d.receipt_type = '1' ) over (partition by g.id, d.warehouse_id))::numeric,
|
||||
2) as type1_number,
|
||||
2) as type1number,
|
||||
|
||||
round((sum(d.amount) filter ( where d.receipt_type = '0' ) over (partition by g.id, d.warehouse_id))::numeric,
|
||||
2) as type0_amount,
|
||||
2) as type0amount,
|
||||
round((sum(d.amount) filter ( where d.receipt_type = '1' ) over (partition by g.id, d.warehouse_id))::numeric,
|
||||
2) as type1_amount
|
||||
2) as type1amount
|
||||
|
||||
from t_warehouse_goods g
|
||||
inner join t_warehouse_receipt_detail d on d.goods_id = g.id and d.organization_id = g.organization_id
|
||||
|
||||
Reference in New Issue
Block a user