<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="purchasePaymentServiceDaoImpl">
|
|
<!-- 保存采购支付信息 add by system 2026-03-25 -->
|
<insert id="savePurchasePaymentInfo" parameterType="Map">
|
insert into purchase_payment(id, apply_order_id, payable_amount, paid_amount, unpaid_amount,
|
payment_amount, payment_company, pay_type, payment_no, invoice_status, tax_rate, planned_pay_date, pay_date)
|
values (#{id}, #{applyOrderId}, #{payableAmount}, #{paidAmount}, #{unpaidAmount},
|
#{paymentAmount}, #{paymentCompany}, #{payType}, #{paymentNo}, #{invoiceStatus}, #{taxRate}, #{plannedPayDate}, #{payDate})
|
</insert>
|
|
<!-- 查询采购支付信息 add by system 2026-03-25 -->
|
<select id="getPurchasePaymentInfo" parameterType="Map" resultType="Map">
|
select t.id,
|
t.apply_order_id,
|
t.apply_order_id applyOrderId,
|
t.payable_amount,
|
t.payable_amount payableAmount,
|
t.paid_amount,
|
t.paid_amount paidAmount,
|
t.unpaid_amount,
|
t.unpaid_amount unpaidAmount,
|
t.payment_amount,
|
t.payment_amount paymentAmount,
|
t.payment_company,
|
t.payment_company paymentCompany,
|
t.pay_type,
|
t.pay_type payType,
|
t.payment_no,
|
t.payment_no paymentNo,
|
t.invoice_status,
|
t.invoice_status invoiceStatus,
|
t.tax_rate,
|
t.tax_rate taxRate,
|
t.planned_pay_date,
|
t.planned_pay_date plannedPayDate,
|
t.pay_date,
|
t.pay_date payDate
|
from purchase_payment t
|
where 1 =1
|
<if test="id !=null and id != ''">
|
and t.id= #{id}
|
</if>
|
<if test="applyOrderId !=null and applyOrderId != ''">
|
and t.apply_order_id= #{applyOrderId}
|
</if>
|
<if test="payableAmount !=null and payableAmount != ''">
|
and t.payable_amount= #{payableAmount}
|
</if>
|
<if test="paidAmount !=null and paidAmount != ''">
|
and t.paid_amount= #{paidAmount}
|
</if>
|
<if test="unpaidAmount !=null and unpaidAmount != ''">
|
and t.unpaid_amount= #{unpaidAmount}
|
</if>
|
<if test="paymentAmount !=null and paymentAmount != ''">
|
and t.payment_amount= #{paymentAmount}
|
</if>
|
<if test="paymentCompany !=null and paymentCompany != ''">
|
and t.payment_company= #{paymentCompany}
|
</if>
|
<if test="payType !=null and payType != ''">
|
and t.pay_type= #{payType}
|
</if>
|
<if test="paymentNo !=null and paymentNo != ''">
|
and t.payment_no= #{paymentNo}
|
</if>
|
<if test="invoiceStatus !=null and invoiceStatus != ''">
|
and t.invoice_status= #{invoiceStatus}
|
</if>
|
<if test="taxRate !=null and taxRate != ''">
|
and t.tax_rate= #{taxRate}
|
</if>
|
<if test="plannedPayDate !=null and plannedPayDate != ''">
|
and t.planned_pay_date= #{plannedPayDate}
|
</if>
|
<if test="payDate !=null and payDate != ''">
|
and t.pay_date= #{payDate}
|
</if>
|
order by t.id desc
|
<if test="page != -1 and page != null ">
|
limit #{page}, #{row}
|
</if>
|
</select>
|
|
<!-- 修改采购支付信息 add by system 2026-03-25 -->
|
<update id="updatePurchasePaymentInfo" parameterType="Map">
|
update purchase_payment t set
|
<if test="applyOrderId !=null and applyOrderId != ''">
|
t.apply_order_id= #{applyOrderId},
|
</if>
|
<if test="payableAmount !=null and payableAmount != ''">
|
t.payable_amount= #{payableAmount},
|
</if>
|
<if test="paidAmount !=null and paidAmount != ''">
|
t.paid_amount= #{paidAmount},
|
</if>
|
<if test="unpaidAmount !=null and unpaidAmount != ''">
|
t.unpaid_amount= #{unpaidAmount},
|
</if>
|
<if test="paymentAmount !=null and paymentAmount != ''">
|
t.payment_amount= #{paymentAmount},
|
</if>
|
<if test="paymentCompany !=null and paymentCompany != ''">
|
t.payment_company= #{paymentCompany},
|
</if>
|
<if test="payType !=null and payType != ''">
|
t.pay_type= #{payType},
|
</if>
|
<if test="paymentNo !=null and paymentNo != ''">
|
t.payment_no= #{paymentNo},
|
</if>
|
<if test="invoiceStatus !=null and invoiceStatus != ''">
|
t.invoice_status= #{invoiceStatus},
|
</if>
|
<if test="taxRate !=null and taxRate != ''">
|
t.tax_rate= #{taxRate},
|
</if>
|
<if test="plannedPayDate !=null and plannedPayDate != ''">
|
t.planned_pay_date= #{plannedPayDate},
|
</if>
|
<if test="payDate !=null and payDate != ''">
|
t.pay_date= #{payDate}
|
</if>
|
where 1=1
|
<if test="id !=null and id != ''">
|
and t.id= #{id}
|
</if>
|
<if test="applyOrderId !=null and applyOrderId != ''">
|
and t.apply_order_id= #{applyOrderId}
|
</if>
|
</update>
|
|
<!-- 查询采购支付数量 add by system 2026-03-25 -->
|
<select id="queryPurchasePaymentsCount" parameterType="Map" resultType="Map">
|
select count(1) count
|
from purchase_payment t
|
where 1 =1
|
<if test="id !=null and id != ''">
|
and t.id= #{id}
|
</if>
|
<if test="applyOrderId !=null and applyOrderId != ''">
|
and t.apply_order_id= #{applyOrderId}
|
</if>
|
<if test="payableAmount !=null and payableAmount != ''">
|
and t.payable_amount= #{payableAmount}
|
</if>
|
<if test="paidAmount !=null and paidAmount != ''">
|
and t.paid_amount= #{paidAmount}
|
</if>
|
<if test="unpaidAmount !=null and unpaidAmount != ''">
|
and t.unpaid_amount= #{unpaidAmount}
|
</if>
|
<if test="paymentAmount !=null and paymentAmount != ''">
|
and t.payment_amount= #{paymentAmount}
|
</if>
|
<if test="paymentCompany !=null and paymentCompany != ''">
|
and t.payment_company= #{paymentCompany}
|
</if>
|
<if test="payType !=null and payType != ''">
|
and t.pay_type= #{payType}
|
</if>
|
<if test="paymentNo !=null and paymentNo != ''">
|
and t.payment_no= #{paymentNo}
|
</if>
|
<if test="invoiceStatus !=null and invoiceStatus != ''">
|
and t.invoice_status= #{invoiceStatus}
|
</if>
|
<if test="taxRate !=null and taxRate != ''">
|
and t.tax_rate= #{taxRate}
|
</if>
|
<if test="plannedPayDate !=null and plannedPayDate != ''">
|
and t.planned_pay_date= #{plannedPayDate}
|
</if>
|
<if test="payDate !=null and payDate != ''">
|
and t.pay_date= #{payDate}
|
</if>
|
</select>
|
|
</mapper>
|