修改库存统计问题
This commit is contained in:
@@ -614,14 +614,14 @@
|
|||||||
select ((curep.inTotal+curep.transfInTotal+curep.assemInTotal+curep.disAssemInTotal)
|
select ((curep.inTotal+curep.transfInTotal+curep.assemInTotal+curep.disAssemInTotal)
|
||||||
-(curep.transfOutTotal+curep.outTotal+curep.assemOutTotal+curep.disAssemOutTotal)) as currentRepo
|
-(curep.transfOutTotal+curep.outTotal+curep.assemOutTotal+curep.disAssemOutTotal)) as currentRepo
|
||||||
from
|
from
|
||||||
(select sum(dh.type='入库' and di.DepotId=#{depotId}) as inTotal,
|
(select sum(if(dh.type='入库' and di.DepotId=#{depotId},di.BasicNumber,0)) as inTotal,
|
||||||
sum(dh.SubType='调拨' and di.AnotherDepotId=#{depotId}) as transfInTotal,
|
sum(if(dh.SubType='调拨' and di.AnotherDepotId=#{depotId},di.BasicNumber,0)) as transfInTotal,
|
||||||
sum(dh.SubType='调拨' and di.DepotId=#{depotId}) as transfOutTotal,
|
sum(if(dh.SubType='调拨' and di.DepotId=#{depotId},di.BasicNumber,0)) as transfOutTotal,
|
||||||
sum(dh.type='出库' and dh.SubType!='调拨' and di.DepotId=#{depotId}) as outTotal,
|
sum(if(dh.type='出库' and dh.SubType!='调拨' and di.DepotId=#{depotId},di.BasicNumber,0)) as outTotal,
|
||||||
sum(dh.SubType='组装单' and di.MType='组合件' and di.DepotId=#{depotId}) as assemInTotal,
|
sum(if(dh.SubType='组装单' and di.MType='组合件' and di.DepotId=#{depotId},di.BasicNumber,0)) as assemInTotal,
|
||||||
sum(dh.SubType='组装单' and di.MType='普通子件' and di.DepotId=#{depotId}) as assemOutTotal,
|
sum(if(dh.SubType='组装单' and di.MType='普通子件' and di.DepotId=#{depotId},di.BasicNumber,0)) as assemOutTotal,
|
||||||
sum(dh.SubType='拆卸单' and di.MType='普通子件' and di.DepotId=#{depotId}) as disAssemInTotal,
|
sum(if(dh.SubType='拆卸单' and di.MType='普通子件' and di.DepotId=#{depotId},di.BasicNumber,0)) as disAssemInTotal,
|
||||||
sum(dh.SubType='拆卸单' and di.MType='组合件' and di.DepotId=#{depotId}) as disAssemOutTotal
|
sum(if(dh.SubType='拆卸单' and di.MType='组合件' and di.DepotId=#{depotId},di.BasicNumber,0)) as disAssemOutTotal
|
||||||
from
|
from
|
||||||
jsh_depothead dh,jsh_depotitem di
|
jsh_depothead dh,jsh_depotitem di
|
||||||
where 1=1
|
where 1=1
|
||||||
|
|||||||
Reference in New Issue
Block a user