demand: TMS系统 - 客户账单管理 - 月结账单核销 - 运单收款明细查询重复数据问题修复

committer: heyu
This commit is contained in:
aike 2025-10-10 15:49:42 +08:00
parent 8e9b75a875
commit fae230d502

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xdadan.erp.emis.mapper.EmisSettlePayRelMapper">
<resultMap type="EmisSettlePayRel" id="EmisSettlePayRelResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="payId" column="pay_id" />
@ -32,16 +32,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.update_time,
a.create_site,
a.update_site,
(select r.apply_seq_no
from emis_settle_pay_invoice_rel r
where r.pay_id = a.pay_id and r.del_flag = '0'
limit 1) as apply_seq_no
(
select r.apply_seq_no
from emis_settle_invoice_rel r
where r.bill_no = a.bill_no
and r.del_flag = '0'
and exists (
select 1 from emis_settle_pay_invoice_rel p
where p.apply_seq_no = r.apply_seq_no
and p.pay_id = a.pay_id
and p.del_flag = '0'
)
limit 1
) as apply_seq_no
from emis_settle_pay_rel a
</sql>
<select id="selectEmisSettlePayRelList" parameterType="EmisSettlePayRel" resultMap="EmisSettlePayRelWithSubBillResult">
<include refid="selectEmisSettlePayRelVo"/>
<where>
<where>
a.del_flag='0'
<if test="id != null "> and a.id = #{id}</if>
<if test="payId != null and payId != ''"> and a.pay_id = #{payId}</if>
@ -100,13 +109,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and update_site = #{updateSite}
limit 1
</select>
<select id="selectEmisSettlePayRelById" parameterType="Long" resultMap="EmisSettlePayRelResult">
select id, pay_id, bill_no, pay_money, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, pay_id, bill_no, pay_money, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_settle_pay_rel a
where a.id = #{id}
</select>
<insert id="insertEmisSettlePayRel" parameterType="EmisSettlePayRel" useGeneratedKeys="true" keyProperty="id">
insert into emis_settle_pay_rel
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -164,4 +173,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>