优化商品库存查询的接口,解决0库存的商品不展示的问题
This commit is contained in:
@@ -610,16 +610,16 @@
|
|||||||
FROM jsh_material m
|
FROM jsh_material m
|
||||||
left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1'
|
left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1'
|
||||||
left join jsh_material_current_stock mcs on m.id = mcs.material_id and ifnull(mcs.delete_flag,'0') !='1'
|
left join jsh_material_current_stock mcs on m.id = mcs.material_id and ifnull(mcs.delete_flag,'0') !='1'
|
||||||
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
|
|
||||||
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
|
|
||||||
where 1=1
|
|
||||||
and me.default_flag=1
|
|
||||||
<if test="depotList.size()>0">
|
<if test="depotList.size()>0">
|
||||||
and mcs.depot_id in
|
and mcs.depot_id in
|
||||||
<foreach collection="depotList" item="item" index="index" separator="," open="(" close=")">
|
<foreach collection="depotList" item="item" index="index" separator="," open="(" close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||||
|
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
|
||||||
|
where 1=1
|
||||||
|
and me.default_flag=1
|
||||||
<if test="idList.size()>0">
|
<if test="idList.size()>0">
|
||||||
and m.category_id in
|
and m.category_id in
|
||||||
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
||||||
@@ -655,16 +655,16 @@
|
|||||||
(select m.id, ifnull(sum(mcs.current_number),0) currentStock from jsh_material m
|
(select m.id, ifnull(sum(mcs.current_number),0) currentStock from jsh_material m
|
||||||
left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1'
|
left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1'
|
||||||
left join jsh_material_current_stock mcs on m.id = mcs.material_id and ifnull(mcs.delete_flag,'0') !='1'
|
left join jsh_material_current_stock mcs on m.id = mcs.material_id and ifnull(mcs.delete_flag,'0') !='1'
|
||||||
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
|
|
||||||
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
|
|
||||||
where 1=1
|
|
||||||
and me.default_flag=1
|
|
||||||
<if test="depotList.size()>0">
|
<if test="depotList.size()>0">
|
||||||
and mcs.depot_id in
|
and mcs.depot_id in
|
||||||
<foreach collection="depotList" item="item" index="index" separator="," open="(" close=")">
|
<foreach collection="depotList" item="item" index="index" separator="," open="(" close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||||
|
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
|
||||||
|
where 1=1
|
||||||
|
and me.default_flag=1
|
||||||
<if test="idList.size()>0">
|
<if test="idList.size()>0">
|
||||||
and m.category_id in
|
and m.category_id in
|
||||||
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
|||||||
Reference in New Issue
Block a user