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.
408 lines
14 KiB
408 lines
14 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" useGeneratedKeys="true"
|
|
keyProperty="id"
|
|
keyColumn="id">
|
|
INSERT INTO cash_record_refund (
|
|
jwcode,
|
|
name,
|
|
market,
|
|
order_code,
|
|
bank_code,
|
|
permanent_gold,
|
|
free_gold,
|
|
submitter_id,
|
|
submitter_market,
|
|
voucher,
|
|
remark,
|
|
reject_reason,
|
|
refund_reason,
|
|
refund_model,
|
|
executor,
|
|
refund_channels,
|
|
refund_time,
|
|
refund_remark,
|
|
refund_voucher,
|
|
refund_currency,
|
|
refund_amount,
|
|
related_id,
|
|
audit_id,
|
|
status
|
|
) VALUES (
|
|
#{jwcode},
|
|
#{name},
|
|
#{market},
|
|
#{orderCode},
|
|
#{bankCode},
|
|
#{partRefundGold},
|
|
#{partRefundFree},
|
|
#{submitterId},
|
|
#{submitterMarket},
|
|
#{voucher},
|
|
#{remark},
|
|
#{rejectReason},
|
|
#{refundReason},
|
|
#{refundModel},
|
|
#{executor},
|
|
#{refundChannels},
|
|
#{refundTime},
|
|
#{refundRemark},
|
|
#{refundVoucher},
|
|
#{refundCurrency},
|
|
#{refundAmount},
|
|
#{originalOrderId},
|
|
#{auditId},
|
|
#{status}
|
|
);
|
|
</insert>
|
|
<insert id="addAudit" parameterType="com.example.demo.domain.vo.cash.CashRecordDone" useGeneratedKeys="true" keyProperty="id">
|
|
insert into lhl_audit
|
|
(
|
|
|
|
area_servise,
|
|
area_finance,
|
|
area_charge,
|
|
head_finance
|
|
)
|
|
values(
|
|
|
|
#{areaServise},
|
|
#{areaFinance},
|
|
#{areaCharge},
|
|
#{headFinance}
|
|
)
|
|
|
|
</insert>
|
|
<update id="update">
|
|
update cash_record_refund
|
|
set
|
|
status = 10,
|
|
refund_model = #{refundModel},
|
|
refund_reason = #{refundReason}
|
|
where id = #{id}
|
|
</update>
|
|
<update id="withdraw">
|
|
update cash_record_refund set status = 11
|
|
where id = #{id}
|
|
</update>
|
|
<update id="review">
|
|
update cash_record_refund set status = #{status},executor = #{executor},reject_reason = #{rejectReason}
|
|
where id = #{id}
|
|
</update>
|
|
<update id="executor">
|
|
update cash_record_refund set refund_currency = #{refundCurrency},
|
|
refund_amount = #{refundAmount},
|
|
refund_channels = #{refundChannels},
|
|
refund_time = #{refundTime},
|
|
refund_remark = #{refundRemark},
|
|
refund_voucher = #{refundVoucher},
|
|
status = #{status},
|
|
executor = #{executor}
|
|
where id = #{id}
|
|
</update>
|
|
<update id="updateStatus">
|
|
update cash_record_collection
|
|
set status = #{status}
|
|
<where>
|
|
<if test="id != null">
|
|
and id = #{id}
|
|
</if>
|
|
<if test="orderCode != null">
|
|
and order_code = #{orderCode}
|
|
</if>
|
|
</where>
|
|
</update>
|
|
<update id="updateAudit">
|
|
update lhl_audit
|
|
<set>
|
|
<if test="areaServise != null">
|
|
area_servise = #{areaServise},
|
|
</if>
|
|
<if test="areaFinance != null">
|
|
area_finance = #{areaFinance},
|
|
</if>
|
|
<if test="areaCharge != null">
|
|
area_charge = #{areaCharge},
|
|
</if>
|
|
<if test="headFinance != null">
|
|
head_finance = #{headFinance},
|
|
</if>
|
|
</set>
|
|
where id = #{auditId}
|
|
</update>
|
|
|
|
|
|
<select id="select" resultType="com.example.demo.domain.vo.cash.CashRecordDTO">
|
|
select
|
|
crr.id,
|
|
crr.jwcode,
|
|
crr.name,
|
|
crr.market,
|
|
crr.permanent_gold,
|
|
crr.free_gold,
|
|
crr.audit_id,
|
|
crr.status,
|
|
crr.submitter_id,
|
|
crr.submitter_market,
|
|
crr.executor,
|
|
crr.order_code,
|
|
crr.refund_channels,
|
|
crr.refund_time,
|
|
crr.create_time,
|
|
crr.update_time,
|
|
crr.audit_time,
|
|
crr.related_id,
|
|
la.area_servise,
|
|
la.area_finance,
|
|
la.area_charge,
|
|
la.head_finance,
|
|
crc.activity,
|
|
crc.goods_name,
|
|
crc.good_num as goodsNum,
|
|
crc.num_unit,
|
|
crc.pay_type,
|
|
crc.pay_time,
|
|
crc.voucher,
|
|
crc.remark,
|
|
crc.payment_currency,
|
|
crc.payment_amount
|
|
from cash_record_refund crr
|
|
left join lhl_audit la on la.id = crr.audit_id
|
|
left join cash_record_collection crc on crc.id = crr.related_id
|
|
<where>
|
|
<if test="status != null">
|
|
and crr.status = #{status}
|
|
</if>
|
|
<if test="name != null and name.length() > 0">
|
|
and crr.name = #{name}
|
|
</if>
|
|
<if test="jwcode != null">
|
|
and crr.jwcode = #{jwcode}
|
|
</if>
|
|
<if test="markets!= null and markets.size > 0">
|
|
AND crr.market IN
|
|
<foreach collection="markets" item="markets" open="(" separator="," close=")">
|
|
#{markets}
|
|
</foreach>
|
|
</if>
|
|
<if test="statuses!= null and statuses.size > 0">
|
|
AND crr.status IN
|
|
<foreach collection="statuses" item="statuses" open="(" separator="," close=")">
|
|
#{statuses}
|
|
</foreach>
|
|
</if>
|
|
<if test="paymentCurrency!= null and paymentCurrency.length() > 0">
|
|
AND crc.payment_currency LIKE CONCAT('%', #{paymentCurrency}, '%')
|
|
</if>
|
|
|
|
<if test="goodsNames!= null and goodsNames.size > 0">
|
|
AND crc.goods_name IN
|
|
<foreach collection="goodsNames" item="goodsNames" open="(" separator="," close=")">
|
|
#{goodsNames}
|
|
</foreach>
|
|
</if>
|
|
<if test="payType != null and payType.length()>0">
|
|
and crc.pay_type = #{payType}
|
|
</if>
|
|
<if test="startTime != null and endTime != null">
|
|
and crc.`pay_time` BETWEEN #{startTime} AND #{endTime}
|
|
</if>
|
|
<if test=" submitterId!= null">
|
|
and crr.submitter_id = #{submitterId}
|
|
</if>
|
|
</where>
|
|
<choose>
|
|
<when test="sortField != null and sortField.length > 0 or sortOrder != null and sortOrder.length > 0">
|
|
ORDER BY ${sortField} ${sortOrder}
|
|
</when>
|
|
<otherwise>
|
|
ORDER BY crr.create_time DESC
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
<select id="financeSelect" resultType="com.example.demo.domain.vo.cash.CashRecordDTO">
|
|
select crr.id,
|
|
crr.jwcode,
|
|
crr.name,
|
|
crr.market,
|
|
crc.goods_name,
|
|
crr.order_code,
|
|
crc.good_num as goodsNum,
|
|
crc.num_unit,
|
|
crr.refund_model,
|
|
crr.submitter_id,
|
|
crr.refund_reason,
|
|
crr.remark,
|
|
crr.status,
|
|
crr.permanent_gold,
|
|
crr.free_gold,
|
|
crr.audit_id,
|
|
crr.related_id,
|
|
la.area_servise,
|
|
la.area_finance,
|
|
la.area_charge,
|
|
la.head_finance
|
|
from cash_record_refund crr
|
|
left join cash_record_collection crc on crc.id = crr.related_id
|
|
left join lhl_audit la on la.id = crr.audit_id
|
|
<where>
|
|
<if test="status != null">
|
|
and crr.status = #{status}
|
|
</if>
|
|
<if test="name != null and name.length() > 0">
|
|
and crr.name = #{name}
|
|
</if>
|
|
<if test="jwcode != null">
|
|
and crr.jwcode = #{jwcode}
|
|
</if>
|
|
<if test="markets!= null and markets.size > 0">
|
|
AND crr.market IN
|
|
<foreach collection="markets" item="markets" open="(" separator="," close=")">
|
|
#{markets}
|
|
</foreach>
|
|
</if>
|
|
<if test="statuses!= null and statuses.size > 0">
|
|
AND crr.status IN
|
|
<foreach collection="statuses" item="statuses" open="(" separator="," close=")">
|
|
#{statuses}
|
|
</foreach>
|
|
</if>
|
|
<if test="paymentCurrency!= null and paymentCurrency.length() > 0">
|
|
AND crc.payment_currency LIKE CONCAT('%', #{paymentCurrency}, '%')
|
|
</if>
|
|
|
|
<if test="goodsNames!= null and goodsNames.size > 0">
|
|
AND crc.goods_name IN
|
|
<foreach collection="goodsNames" item="goodsNames" open="(" separator="," close=")">
|
|
#{goodsNames}
|
|
</foreach>
|
|
</if>
|
|
<if test="payType != null and payType.length()>0">
|
|
and crc.pay_type = #{payType}
|
|
</if>
|
|
<if test="startTime != null and endTime != null">
|
|
and crc.`pay_time` BETWEEN #{startTime} AND #{endTime}
|
|
</if>
|
|
<if test=" submitterId!= null">
|
|
and crr.submitter_id = #{submitterId}
|
|
</if>
|
|
</where>
|
|
<choose>
|
|
<when test="sortField != null and sortField.length > 0 or sortOrder != null and sortOrder.length > 0">
|
|
ORDER BY ${sortField} ${sortOrder}
|
|
</when>
|
|
<otherwise>
|
|
ORDER BY crr.create_time DESC
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
<select id="getAudit" resultType="com.example.demo.domain.vo.cash.LhlAudit">
|
|
select la.id,
|
|
la.area_servise,
|
|
la.area_finance,
|
|
la.area_charge,
|
|
la.head_finance
|
|
from lhl_audit la
|
|
where la.id = #{id}
|
|
</select>
|
|
<select id="exSelect" resultType="com.example.demo.domain.vo.cash.CashRecordDTO">
|
|
select crr.id,
|
|
crr.jwcode,
|
|
crr.name,
|
|
crr.market,
|
|
crc.goods_name,
|
|
crc.order_code,
|
|
crc.good_num as goodsNum,
|
|
crc.num_unit,
|
|
crr.refund_model,
|
|
crr.refund_currency,
|
|
crr.refund_amount,
|
|
crr.refund_channels,
|
|
crr.voucher,
|
|
crr.refund_time,
|
|
crr.status,
|
|
crr.audit_id,
|
|
crr.submitter_id,
|
|
crr.related_id,
|
|
la.area_servise,
|
|
la.area_finance,
|
|
la.area_charge,
|
|
la.head_finance
|
|
from cash_record_refund crr
|
|
left join cash_record_collection crc on crc.id = crr.related_id
|
|
left join lhl_audit la on la.id = crr.audit_id
|
|
<where>
|
|
<if test="status != null">
|
|
and crr.status = #{status}
|
|
</if>
|
|
<if test="name != null and name.length() > 0">
|
|
and crr.name = #{name}
|
|
</if>
|
|
<if test="jwcode != null">
|
|
and crr.jwcode = #{jwcode}
|
|
</if>
|
|
<if test="markets!= null and markets.size > 0">
|
|
AND crr.market IN
|
|
<foreach collection="markets" item="markets" open="(" separator="," close=")">
|
|
#{markets}
|
|
</foreach>
|
|
</if>
|
|
<if test="statuses!= null and statuses.size > 0">
|
|
AND crr.status IN
|
|
<foreach collection="statuses" item="statuses" open="(" separator="," close=")">
|
|
#{statuses}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="goodsNames!= null and goodsNames.size > 0">
|
|
AND crc.goods_name IN
|
|
<foreach collection="goodsNames" item="goodsNames" open="(" separator="," close=")">
|
|
#{goodsNames}
|
|
</foreach>
|
|
</if>
|
|
<if test="refundCurrency != null and refundCurrency.size > 0">
|
|
AND crr.refund_currency = #{refundCurrency}
|
|
</if>
|
|
<if test="refundChannels != null and refundChannels.length()>0">
|
|
and crc.refund_channels = #{refundChannels}
|
|
</if>
|
|
<if test="startTime != null and endTime != null">
|
|
and crc.`refund_time` BETWEEN #{startTime} AND #{endTime}
|
|
</if>
|
|
<if test=" submitterId!= null">
|
|
and crr.submitter_id = #{submitterId}
|
|
</if>
|
|
</where>
|
|
<choose>
|
|
<when test="sortField != null and sortField.length > 0 or sortOrder != null and sortOrder.length > 0">
|
|
ORDER BY ${sortField} ${sortOrder}
|
|
</when>
|
|
<otherwise>
|
|
ORDER BY crr.create_time DESC
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
|
|
<select id="getAuditBatch" resultType="com.example.demo.domain.vo.cash.LhlAudit">
|
|
SELECT *
|
|
FROM lhl_audit
|
|
WHERE 1 = 0
|
|
<if test="auditIds != null and auditIds.size() > 0">
|
|
OR id IN
|
|
<foreach collection="auditIds" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
</select>
|
|
<select id="selectById" resultType="com.example.demo.domain.vo.cash.CashRecordDTO">
|
|
select crr.id,
|
|
crr.jwcode,
|
|
crr.name,
|
|
crr.status
|
|
from cash_record_refund crr
|
|
where crr.id = #{id}
|
|
</select>
|
|
|
|
|
|
</mapper>
|