应付配置增加附加费配置,应付账单新增核销、对账、凭证、审核功能
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
<?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="com.bms.price.mapper.PayPaymentMapper">
|
||||
|
||||
<select id="selectPayPaymentList" resultType="com.bms.price.domain.PayPayment">
|
||||
select payment_id as paymentId, payment_no as paymentNo, supplier_id as supplierId, supplier_name as supplierName,
|
||||
currency, pay_date as payDate, pay_method as payMethod, bank_account as bankAccount, amount, bank_fee as bankFee,
|
||||
exchange_rate as exchangeRate, base_amount as baseAmount, alloc_amount as allocAmount,
|
||||
status, remark, create_by as createBy, create_time as createTime, confirm_by as confirmBy, confirm_time as confirmTime
|
||||
from pay_payment
|
||||
<where>
|
||||
<if test="paymentNo != null and paymentNo != ''">and payment_no like concat('%', #{paymentNo}, '%')</if>
|
||||
<if test="supplierName != null and supplierName != ''">and supplier_name like concat('%', #{supplierName}, '%')</if>
|
||||
<if test="status != null and status != ''">and status = #{status}</if>
|
||||
<if test="currency != null and currency != ''">and currency = #{currency}</if>
|
||||
</where>
|
||||
order by payment_id desc
|
||||
</select>
|
||||
|
||||
<select id="selectPayPaymentById" resultType="com.bms.price.domain.PayPayment">
|
||||
select payment_id as paymentId, payment_no as paymentNo, supplier_id as supplierId, supplier_name as supplierName,
|
||||
currency, pay_date as payDate, pay_method as payMethod, bank_account as bankAccount, amount, bank_fee as bankFee,
|
||||
exchange_rate as exchangeRate, base_amount as baseAmount, alloc_amount as allocAmount,
|
||||
status, remark, create_by as createBy, create_time as createTime, confirm_by as confirmBy, confirm_time as confirmTime
|
||||
from pay_payment where payment_id = #{paymentId}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocs" resultType="com.bms.price.domain.PayPaymentAlloc">
|
||||
select a.alloc_id as allocId, a.payment_id as paymentId, a.bill_id as billId, b.bill_no as billNo,
|
||||
a.alloc_amount as allocAmount, a.alloc_status as allocStatus, b.currency
|
||||
from pay_payment_alloc a
|
||||
left join pay_bill b on b.bill_id = a.bill_id
|
||||
where a.payment_id = #{paymentId}
|
||||
order by a.alloc_id
|
||||
</select>
|
||||
|
||||
<insert id="insertPayPayment" useGeneratedKeys="true" keyProperty="paymentId">
|
||||
insert into pay_payment (
|
||||
payment_no, supplier_id, supplier_name, currency, pay_date, pay_method, bank_account, amount, bank_fee,
|
||||
exchange_rate, status, remark, create_by, create_time
|
||||
) values (
|
||||
#{paymentNo}, #{supplierId}, #{supplierName}, #{currency}, #{payDate}, #{payMethod}, #{bankAccount},
|
||||
#{amount}, #{bankFee}, ifnull(#{exchangeRate}, 1), 'DRAFT', #{remark}, #{createBy}, sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertAlloc">
|
||||
insert into pay_payment_alloc (payment_id, bill_id, alloc_amount, alloc_status)
|
||||
values (#{paymentId}, #{billId}, #{allocAmount}, 'ACTIVE')
|
||||
</insert>
|
||||
|
||||
<update id="updatePayPaymentStatus">
|
||||
update pay_payment
|
||||
set status = #{status},
|
||||
confirm_by = #{confirmBy},
|
||||
confirm_time = #{confirmTime},
|
||||
exchange_rate = ifnull(#{exchangeRate}, exchange_rate),
|
||||
base_amount = ifnull(#{baseAmount}, base_amount),
|
||||
alloc_amount = ifnull(#{allocAmount}, alloc_amount)
|
||||
where payment_id = #{paymentId}
|
||||
</update>
|
||||
|
||||
<update id="reverseAlloc">
|
||||
update pay_payment_alloc
|
||||
set alloc_status = 'REVERSED',
|
||||
reverse_by = #{reverseBy},
|
||||
reverse_time = sysdate()
|
||||
where alloc_id = #{allocId}
|
||||
and alloc_status = 'ACTIVE'
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user