解决同一单据产生多行的bug

This commit is contained in:
季圣华
2019-06-12 23:02:32 +08:00
parent fa1c15e8b1
commit 27c58a8d3c

View File

@@ -42,7 +42,7 @@
</resultMap> </resultMap>
<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 dh.*, d.name ProjectName, s.supplier OrganName, p.name HandsPersonName, a.name AccountName, dd.name AllocationProjectName select distinct dh.*, d.name ProjectName, s.supplier OrganName, p.name HandsPersonName, a.name AccountName, dd.name AllocationProjectName
from jsh_depothead dh from jsh_depothead dh
left join jsh_depot d on dh.ProjectId=d.id and ifnull(d.delete_Flag,'0') !='1' left join jsh_depot d on dh.ProjectId=d.id and ifnull(d.delete_Flag,'0') !='1'
left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1' left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
@@ -81,8 +81,8 @@
</select> </select>
<select id="countsByDepotHead" resultType="java.lang.Long"> <select id="countsByDepotHead" resultType="java.lang.Long">
SELECT SELECT
COUNT(jsh_depothead.id) COUNT(1) from
FROM jsh_depothead (select distinct jsh_depothead.* FROM jsh_depothead
inner join jsh_depotitem di on jsh_depothead.Id = di.HeaderId and ifnull(di.delete_Flag,'0') !='1' inner join jsh_depotitem di on jsh_depothead.Id = di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
inner join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1' inner join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1'
WHERE 1=1 WHERE 1=1
@@ -107,7 +107,7 @@
<if test="depotIds != null"> <if test="depotIds != null">
and di.DepotId in (${depotIds}) and di.DepotId in (${depotIds})
</if> </if>
and ifnull(jsh_depothead.delete_Flag,'0') !='1' and ifnull(jsh_depothead.delete_Flag,'0') !='1') tb
</select> </select>
<select id="getMaxId" resultType="java.lang.Long"> <select id="getMaxId" resultType="java.lang.Long">