统一修改ruoyi->bms
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
<?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.ar.mapper.ArBalanceWriteoffMapper">
|
||||
|
||||
<resultMap id="ArBalanceWriteoffResult" type="ArBalanceWriteoff">
|
||||
<id property="writeoffId" column="writeoff_id"/>
|
||||
<result property="writeoffNo" column="writeoff_no"/>
|
||||
<result property="arBillId" column="ar_bill_id"/>
|
||||
<result property="billNo" column="bill_no"/>
|
||||
<result property="customerId" column="customer_id"/>
|
||||
<result property="accountId" column="account_id"/>
|
||||
<result property="currency" column="currency"/>
|
||||
<result property="writeoffAmount" column="writeoff_amount"/>
|
||||
<result property="balanceFlowId" column="balance_flow_id"/>
|
||||
<result property="reverseFlowId" column="reverse_flow_id"/>
|
||||
<result property="writeoffDate" column="writeoff_date"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="cancelBy" column="cancel_by"/>
|
||||
<result property="cancelTime" column="cancel_time"/>
|
||||
<result property="cancelRemark" column="cancel_remark"/>
|
||||
<result property="billName" column="bill_name"/>
|
||||
<result property="customerName" column="customer_name"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectColumns">
|
||||
select w.writeoff_id, w.writeoff_no, w.ar_bill_id, w.bill_no, w.customer_id, w.account_id,
|
||||
w.currency, w.writeoff_amount, w.balance_flow_id, w.reverse_flow_id,
|
||||
w.writeoff_date, w.status, w.remark, w.create_by, w.create_time,
|
||||
w.cancel_by, w.cancel_time, w.cancel_remark,
|
||||
b.bill_name, b.customer_name
|
||||
from ar_balance_writeoff w
|
||||
left join ar_bill b on b.ar_bill_id = w.ar_bill_id
|
||||
</sql>
|
||||
|
||||
<insert id="insertArBalanceWriteoff" parameterType="ArBalanceWriteoff"
|
||||
useGeneratedKeys="true" keyProperty="writeoffId">
|
||||
insert into ar_balance_writeoff (
|
||||
writeoff_no, ar_bill_id, bill_no, customer_id, account_id, currency,
|
||||
writeoff_amount, balance_flow_id, reverse_flow_id, writeoff_date,
|
||||
status, remark, create_by, create_time
|
||||
) values (
|
||||
#{writeoffNo}, #{arBillId}, #{billNo}, #{customerId}, #{accountId}, #{currency},
|
||||
#{writeoffAmount}, #{balanceFlowId}, #{reverseFlowId}, #{writeoffDate},
|
||||
#{status}, #{remark}, #{createBy}, sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateFlowRefs">
|
||||
update ar_balance_writeoff
|
||||
set account_id = #{accountId},
|
||||
balance_flow_id = #{balanceFlowId}
|
||||
where writeoff_id = #{writeoffId}
|
||||
</update>
|
||||
|
||||
<select id="selectByIdForUpdate" resultMap="ArBalanceWriteoffResult">
|
||||
<include refid="selectColumns"/>
|
||||
where w.writeoff_id = #{writeoffId}
|
||||
for update
|
||||
</select>
|
||||
|
||||
<update id="updateCancelled">
|
||||
update ar_balance_writeoff
|
||||
set status = #{status},
|
||||
reverse_flow_id = #{reverseFlowId},
|
||||
cancel_by = #{cancelBy},
|
||||
cancel_time = sysdate(),
|
||||
cancel_remark = #{cancelRemark}
|
||||
where writeoff_id = #{writeoffId} and status = #{effectiveStatus}
|
||||
</update>
|
||||
|
||||
<select id="selectWriteoffList" parameterType="ArBalanceWriteoff" resultMap="ArBalanceWriteoffResult">
|
||||
<include refid="selectColumns"/>
|
||||
<where>
|
||||
<if test="customerId != null">and w.customer_id = #{customerId}</if>
|
||||
<if test="arBillId != null">and w.ar_bill_id = #{arBillId}</if>
|
||||
<if test="status != null and status != ''">and w.status = #{status}</if>
|
||||
<if test="currency != null and currency != ''">and w.currency = #{currency}</if>
|
||||
<if test="writeoffNo != null and writeoffNo != ''">and w.writeoff_no like concat('%', #{writeoffNo}, '%')</if>
|
||||
<if test="billNo != null and billNo != ''">and w.bill_no like concat('%', #{billNo}, '%')</if>
|
||||
</where>
|
||||
order by w.create_time desc, w.writeoff_id desc
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user