You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
5.8 KiB

<?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.example.demo.mapper.cash.CashRefundMapper">
<insert id="insert">
INSERT INTO cash_record (
order_type,
jwcode,
name,
market,
activity,
order_code,
bank_code,
goods_name,
good_num,
payment_currency,
payment_amount,
received_currency,
received_amount,
handling_charge,
received_market,
pay_type,
pay_time,
received_time,
status,
submitter_id,
voucher,
remark,
refund_reason,
refund_model,
executor,
refund_channels,
refund_time,
refund_remark,
refund_voucher,
create_time,
update_time
) VALUES (
#{orderType},
#{jwcode},
#{name},
#{market},
#{activity},
#{orderCode},
#{bankCode},
#{goodsName},
#{goodsNum},
#{paymentCurrency},
#{paymentAmount},
#{receivedCurrency},
#{receivedAmount},
#{handlingCharge},
#{receivedMarket},
#{payType},
#{payTime},
#{receivedTime},
#{submitterId},
#{voucher},
#{remark},
#{status},
#{refundReason},
#{refundModel},
#{executor},
#{refundChannels},
#{refundCurrency},
#{refundAmount},
#{refundTime},
#{refundRemark},
#{refundVoucher},
#{createTime},
#{updateTime},
);
</insert>
<update id="update">
update cash_record
set
status = 10,
refund_model = #{refundModel},
refund_reason = #{refundReason}
where id = #{id}
</update>
<update id="withdraw">
update cash_record set status = 11
where order_type =2 and id = #{id}
</update>
<update id="review">
update cash_record set status = #{status},executor = #{executor},reject_reason = #{rejectReason}
where order_type =2 and id = #{id}
</update>
<update id="executor">
update cash_record set refund_currency = #{refundCurrency},
refund_amount = #{refundAmount},
refund_channels = #{refundChannels},
refund_time = #{refundTime},
refund_remark = #{refundRemark},
refund_voucher = #{refundVoucher},
status = #{status}
where order_type =2 and id = #{id}
</update>
<select id="select" resultType="com.example.demo.domain.vo.cash.CashRecordDone">
select
cr.id,
cr.order_type,
cr.jwcode,
cr.name,
cr.market,
cr.activity,
cr.order_code,
cr.bank_code,
cr.goods_name,
cr.good_num,
cr.payment_currency,
cr.payment_amount,
cr.received_currency,
cr.received_amount,
cr.handling_charge,
cr.pay_type,
cr.received_market,
cr.pay_time,
cr.received_time,
cr.audit_id,
cr.status,
cr.submitter_id,
cr.voucher,
cr.refund_reason,
cr.refund_model,
cr.executor,
cr.refund_channels,
cr.refund_time,
cr.refund_remark,
cr.refund_voucher,
cr.remark,
cr.reject_reason,
cr.create_time,
cr.update_time,
cr.audit_time,
a1.admin_name as submitterName,
a2.admin_name as auditName,
a3.admin_name as executorName
from cash_record cr
left join admin a1 on submitter_id = a1.id
left join admin a2 on audit_id = a2.id
left join admin a3 on executor = a3.account
<where>
cr.order_type = 2
<if test="status != null">
and cr.status = #{status}
</if>
<if test="orderCode != null">
and cr.order_code = #{orderCode}
</if>
<if test="name != null and name.length() > 0">
and cr.name = #{name}
</if>
<if test="jwcode != null">
and cr.jwcode = #{jwcode}
</if>
<if test="markets!= null and markets.size > 0">
AND cr.market IN
<foreach collection="markets" item="markets" open="(" separator="," close=")">
#{markets}
</foreach>
</if>
<if test="paymentCurrency!= null and paymentCurrency.length() > 0">
AND cr.payment_currency = #{paymentCurrency}
</if>
<if test="goodsName != null and goodsName.length()>0">
and cr.goods_name = #{goodsName}
</if>
<if test="payType != null and payType.length()>0">
and cr.pay_type = #{payTyoe}
</if>
<if test="refundModel != null and refundModel.length()>0">
and cr.refundModel = #{refundModel}
</if>
<if test="startTime != null and endTime != null">
and cr.`pay_time` BETWEEN #{startTime} AND #{endTime}
</if>
</where>
</select>
</mapper>