2026-06-05 d1fac30e634e33edd29e3440de1f91da84c150c1
src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml
@@ -18,6 +18,7 @@
        <result column="apply_date" property="applyDate" />
        <result column="remark" property="remark" />
        <result column="status" property="status" />
        <result column="payment_status" property="paymentStatus" />
        <result column="payment_amount" property="paymentAmount" />
    </resultMap>
     <select
@@ -25,7 +26,8 @@
         resultType="com.ruoyi.account.bean.vo.purchase.AccountPaymentApplicationVo">
        select * from (select apa.*,
               sm.supplier_name,
               GROUP_CONCAT(sir.inbound_batches SEPARATOR ',') AS inboundBatches
               GROUP_CONCAT(sir.inbound_batches SEPARATOR ',') AS inboundBatches,
               IFNULL((SELECT SUM(app.payment_amount) FROM account_purchase_payment app WHERE app.account_payment_application_id = apa.id), 0) AS paidAmount
        from account_payment_application apa
        left join supplier_manage sm on apa.supplier_id = sm.id
        left join stock_in_record sir on FIND_IN_SET(sir.id, apa.stock_in_record_ids) > 0
@@ -40,6 +42,9 @@
             <if test="req.status != null">
                 AND A.status = #{req.status}
            </if>
            <if test="req.paymentStatus != null">
                 AND A.payment_status = #{req.paymentStatus}
            </if>
            <if test="req.startDate != null and req.endDate != null">
                AND A.apply_date BETWEEN #{req.startDate} AND #{req.endDate}
            </if>