|
|
@ -446,6 +446,7 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectfunds" resultType="com.example.demo.domain.vo.cash.FundsDTO"> |
|
|
<select id="selectfunds" resultType="com.example.demo.domain.vo.cash.FundsDTO"> |
|
|
|
|
|
SELECT * FROM ( |
|
|
SELECT |
|
|
SELECT |
|
|
crc.id, |
|
|
crc.id, |
|
|
crc.jwcode, |
|
|
crc.jwcode, |
|
|
@ -459,19 +460,20 @@ |
|
|
crc.order_code, |
|
|
crc.order_code, |
|
|
crc.payment_currency, |
|
|
crc.payment_currency, |
|
|
ROUND(crc.payment_amount / 100.0, 2) as paymentAmount, |
|
|
ROUND(crc.payment_amount / 100.0, 2) as paymentAmount, |
|
|
|
|
|
|
|
|
crc.received_currency, |
|
|
crc.received_currency, |
|
|
ROUND(crc.received_amount / 100.0, 2) as receivedAmount, |
|
|
ROUND(crc.received_amount / 100.0, 2) as receivedAmount, |
|
|
|
|
|
|
|
|
ROUND(crc.handling_charge / 100.0, 2) as handlingCharge, |
|
|
ROUND(crc.handling_charge / 100.0, 2) as handlingCharge, |
|
|
ROUND(crc.permanent_gold / 100.0, 2) as permanentGold, |
|
|
ROUND(crc.permanent_gold / 100.0, 2) as permanentGold, |
|
|
ROUND(crc.free_gold / 100.0, 2) as freeGold, |
|
|
ROUND(crc.free_gold / 100.0, 2) as freeGold, |
|
|
|
|
|
|
|
|
crc.pay_type, |
|
|
crc.pay_type, |
|
|
crc.pay_time, |
|
|
crc.pay_time, |
|
|
crc.status |
|
|
|
|
|
|
|
|
crc.status, |
|
|
|
|
|
NULL as refundCurrency, |
|
|
|
|
|
NULL as refundAmount, |
|
|
|
|
|
NULL as relatedId, |
|
|
|
|
|
0 as isRefundRow |
|
|
FROM cash_record_collection crc |
|
|
FROM cash_record_collection crc |
|
|
<where> |
|
|
|
|
|
|
|
|
WHERE 1=1 |
|
|
<if test="jwcode != null"> |
|
|
<if test="jwcode != null"> |
|
|
and crc.jwcode = #{jwcode} |
|
|
and crc.jwcode = #{jwcode} |
|
|
</if> |
|
|
</if> |
|
|
@ -508,16 +510,74 @@ |
|
|
#{statuses} |
|
|
#{statuses} |
|
|
</foreach> |
|
|
</foreach> |
|
|
</if> |
|
|
</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 crc.create_time DESC |
|
|
|
|
|
</otherwise> |
|
|
|
|
|
</choose> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UNION ALL |
|
|
|
|
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
crc.id, |
|
|
|
|
|
crc.jwcode, |
|
|
|
|
|
crc.income_type, |
|
|
|
|
|
crc.remark, |
|
|
|
|
|
crc.good_num, |
|
|
|
|
|
crc.performance_market, |
|
|
|
|
|
crc.received_market, |
|
|
|
|
|
crc.name, |
|
|
|
|
|
crc.market, |
|
|
|
|
|
CONCAT('TK', crc.order_code) as order_code, |
|
|
|
|
|
NULL as payment_currency, |
|
|
|
|
|
NULL as paymentAmount, |
|
|
|
|
|
crc.received_currency as received_currency, |
|
|
|
|
|
ROUND(-crr.refund_amount / 100.0, 2) as receivedAmount, |
|
|
|
|
|
NULL as handlingCharge, |
|
|
|
|
|
NULL as permanentGold, |
|
|
|
|
|
NULL as freeGold, |
|
|
|
|
|
NULL as pay_type, |
|
|
|
|
|
crr.refund_time as pay_time, |
|
|
|
|
|
crc.status, |
|
|
|
|
|
crr.refund_currency as refundCurrency, |
|
|
|
|
|
ROUND(crr.refund_amount / 100.0, 2) as refundAmount, |
|
|
|
|
|
crr.related_id as relatedId, |
|
|
|
|
|
1 as isRefundRow |
|
|
|
|
|
FROM cash_record_refund crr |
|
|
|
|
|
INNER JOIN cash_record_collection crc ON crr.related_id = crc.id |
|
|
|
|
|
WHERE crc.status =6 and crr.status =41 |
|
|
|
|
|
<if test="jwcode != null"> |
|
|
|
|
|
and crc.jwcode = #{jwcode} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="markets!= null and markets.size > 0"> |
|
|
|
|
|
AND crc.received_market IN |
|
|
|
|
|
<foreach collection="markets" item="markets" open="(" separator="," close=")"> |
|
|
|
|
|
#{markets} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="performanceMarkets!= null and performanceMarkets.size > 0"> |
|
|
|
|
|
AND crc.performance_market IN |
|
|
|
|
|
<foreach collection="performanceMarkets" item="performanceMarkets" open="(" separator="," close=")"> |
|
|
|
|
|
#{performanceMarkets} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="localMarket != null and localMarket.size > 0"> |
|
|
|
|
|
AND crc.market IN |
|
|
|
|
|
<foreach collection="localMarket" item="localMarket" open="(" separator="," close=")"> |
|
|
|
|
|
#{localMarket} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="startTime != null and endTime != null"> |
|
|
|
|
|
and crc.`pay_time` BETWEEN #{startTime} AND #{endTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="payType!= null and payType.length > 0"> |
|
|
|
|
|
AND crc.pay_type like CONCAT('%', #{payType}, '%') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="orderCode!= null and orderCode.length > 0"> |
|
|
|
|
|
AND crc.order_code like CONCAT('%', #{orderCode}, '%') |
|
|
|
|
|
</if> |
|
|
|
|
|
) AS combined_result |
|
|
|
|
|
ORDER BY |
|
|
|
|
|
id, |
|
|
|
|
|
isRefundRow DESC, |
|
|
|
|
|
pay_time DESC |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectRefundCount" resultType="com.example.demo.domain.vo.cash.FundsDTO"> |
|
|
<select id="selectRefundCount" resultType="com.example.demo.domain.vo.cash.FundsDTO"> |
|
|
select crr.refund_currency, |
|
|
select crr.refund_currency, |
|
|
crr.refund_amount, |
|
|
crr.refund_amount, |
|
|
|