优化单据的查询sql
This commit is contained in:
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
<select id="selectByConditionDepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
|
<select id="selectByConditionDepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
|
||||||
select jdh.*, s.supplier OrganName, u.username userName, a.name AccountName
|
select jdh.*, s.supplier OrganName, u.username userName, a.name AccountName
|
||||||
from (select distinct dh.id
|
from (select dh.id
|
||||||
from jsh_depot_head dh
|
from jsh_depot_head dh
|
||||||
left join jsh_depot_item di on dh.id = di.header_id and ifnull(di.delete_flag,'0') !='1'
|
left join jsh_depot_item di on dh.id = di.header_id and ifnull(di.delete_flag,'0') !='1'
|
||||||
left join jsh_material m on di.material_id = m.id and ifnull(m.delete_flag,'0') !='1'
|
left join jsh_material m on di.material_id = m.id and ifnull(m.delete_flag,'0') !='1'
|
||||||
@@ -148,6 +148,7 @@
|
|||||||
and (dh.remark like #{bindRemark} or di.remark like #{bindRemark})
|
and (dh.remark like #{bindRemark} or di.remark like #{bindRemark})
|
||||||
</if>
|
</if>
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
|
group by dh.id
|
||||||
order by dh.id desc
|
order by dh.id desc
|
||||||
<if test="offset != null and rows != null">
|
<if test="offset != null and rows != null">
|
||||||
limit #{offset},#{rows}
|
limit #{offset},#{rows}
|
||||||
|
|||||||
Reference in New Issue
Block a user