|
|
|
@ -13,21 +13,21 @@
|
|
|
|
|
l.clearing_amount,
|
|
|
|
|
l.refund_id,
|
|
|
|
|
l.transaction_type,
|
|
|
|
|
o.create_time
|
|
|
|
|
l.create_time
|
|
|
|
|
FROM pmt_transactions l
|
|
|
|
|
INNER JOIN pmt_orders o
|
|
|
|
|
ON o.order_id = l.order_id
|
|
|
|
|
<if test="begin != null">
|
|
|
|
|
AND o.create_time >= #{begin}
|
|
|
|
|
AND l.create_time >= #{begin}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="end != null">
|
|
|
|
|
AND o.create_time < #{end}
|
|
|
|
|
AND l.create_time < #{end}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="begin_month">
|
|
|
|
|
AND DATE_FORMAT(o.create_time, '%Y-%m') >= #{begin_month}
|
|
|
|
|
AND DATE_FORMAT(l.create_time, '%Y-%m') >= #{begin_month}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="end_month">
|
|
|
|
|
AND DATE_FORMAT(o.create_time, '%Y-%m') <= #{end_month}
|
|
|
|
|
AND DATE_FORMAT(l.create_time, '%Y-%m') <= #{end_month}
|
|
|
|
|
</if>
|
|
|
|
|
WHERE (l.transaction_type = 'Credit' OR l.refund_id IS NOT NULL)
|
|
|
|
|
) temp
|
|
|
|
|