Commit a978a902 authored by 季圣华's avatar 季圣华
Browse files

解决库存报表的bug

parent 2099f5a9
...@@ -154,14 +154,12 @@ ...@@ -154,14 +154,12 @@
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial"> <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, select m.id MId, m.name MName, m.mfrs MMfrs, m.model MModel, m.unit MaterialUnit, m.color MColor,
me.purchase_decimal, u.name unit_name 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
from jsh_material m from jsh_material m
left join jsh_depot_item di on di.material_id=m.id and ifnull(m.delete_Flag,'0') !='1' 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' left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.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_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
where 1=1 where 1=1
and me.default_flag=1
<if test="name != null"> <if test="name != null">
and m.name like '%${name}%' and m.name like '%${name}%'
</if> </if>
...@@ -171,8 +169,8 @@ ...@@ -171,8 +169,8 @@
<if test="endTime != null"> <if test="endTime != null">
and dh.oper_time &lt;= '${endTime}' and dh.oper_time &lt;= '${endTime}'
</if> </if>
and ifnull(di.delete_flag,'0') !='1' and ifnull(m.delete_flag,'0') !='1'
group by m.id,m.name, m.model, m.unit, m.color, me.purchase_decimal, u.name group by m.id,m.name, m.model, m.unit, m.color, u.name
order by m.name, m.model asc order by m.name, m.model asc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment