解决库存报表的bug

This commit is contained in:
季圣华 2020-12-13 01:31:48 +08:00
parent a978a902b1
commit 3b2b20bfb2

View File

@ -153,8 +153,11 @@
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, m.name MName, m.mfrs MMfrs, m.model MModel, m.unit MaterialUnit, m.color MColor,
u.name unit_name, (select purchase_decimal from jsh_material_extend me where me.material_id=m.id and me.default_flag=1) purchase_decimal
select m.id MId, m.name MName, m.mfrs MMfrs, m.model MModel,
m.unit MaterialUnit, m.color MColor, u.name unit_name,
(select purchase_decimal from jsh_material_extend me
where me.material_id=m.id and me.default_flag=1 and ifnull(me.delete_Flag,'0') !='1' limit 0,1)
purchase_decimal
from jsh_material m
left join jsh_depot_item di on di.material_id=m.id and ifnull(di.delete_Flag,'0') !='1'
left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1'