Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
a7c56d6b
Commit
a7c56d6b
authored
May 24, 2019
by
qiankunpingtai
Browse files
修改库存统计问题
parent
326ff097
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
a7c56d6b
...
...
@@ -611,24 +611,24 @@
AND intype.BasicInNumber > 0
</select>
<select
id=
"getCurrentRepByMaterialIdAndDepotId"
resultType=
"java.math.BigDecimal"
>
select ((curep.inTotal+curep.transfInTotal+curep.assemInTotal+curep.disAssemInTotal)
-(curep.transfOutTotal+curep.outTotal+curep.assemOutTotal+curep.disAssemOutTotal)) as currentRepo
from
(select sum(dh.type='入库' and di.DepotId=#{depotId}) as inTotal,
sum(dh.SubType='调拨' and di.AnotherDepotId=#{depotId}) as transfInTotal,
sum(dh.SubType='调拨' and di.DepotId=#{depotId}) as transfOutTotal,
sum(dh.type='出库' and dh.SubType!='调拨' and di.DepotId=#{depotId}) as outTotal,
sum(dh.SubType='组装单' and di.MType='组合件' and di.DepotId=#{depotId}) as assemInTotal,
sum(dh.SubType='组装单' and di.MType='普通子件' and di.DepotId=#{depotId}) as assemOutTotal,
sum(dh.SubType='拆卸单' and di.MType='普通子件' and di.DepotId=#{depotId}) as disAssemInTotal,
sum(dh.SubType='拆卸单' and di.MType='组合件' and di.DepotId=#{depotId}) as disAssemOutTotal
from
jsh_depothead dh,jsh_depotitem di
where 1=1
and dh.id=di.HeaderId
and di.MaterialId=#{materialId}
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1') curep
select ((curep.inTotal+curep.transfInTotal+curep.assemInTotal+curep.disAssemInTotal)
-(curep.transfOutTotal+curep.outTotal+curep.assemOutTotal+curep.disAssemOutTotal)) as currentRepo
from
(select sum(
if(
dh.type='入库' and di.DepotId=#{depotId}
,di.BasicNumber,0)
) as inTotal,
sum(
if(
dh.SubType='调拨' and di.AnotherDepotId=#{depotId}
,di.BasicNumber,0)
) as transfInTotal,
sum(
if(
dh.SubType='调拨' and di.DepotId=#{depotId}
,di.BasicNumber,0)
) as transfOutTotal,
sum(
if(
dh.type='出库' and dh.SubType!='调拨' and di.DepotId=#{depotId}
,di.BasicNumber,0)
) as outTotal,
sum(
if(
dh.SubType='组装单' and di.MType='组合件' and di.DepotId=#{depotId}
,di.BasicNumber,0)
) as assemInTotal,
sum(
if(
dh.SubType='组装单' and di.MType='普通子件' and di.DepotId=#{depotId}
,di.BasicNumber,0)
) as assemOutTotal,
sum(
if(
dh.SubType='拆卸单' and di.MType='普通子件' and di.DepotId=#{depotId}
,di.BasicNumber,0)
) as disAssemInTotal,
sum(
if(
dh.SubType='拆卸单' and di.MType='组合件' and di.DepotId=#{depotId}
,di.BasicNumber,0)
) as disAssemOutTotal
from
jsh_depothead dh,jsh_depotitem di
where 1=1
and dh.id=di.HeaderId
and di.MaterialId=#{materialId}
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1') curep
</select>
</mapper>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment