|
|
|
@ -64,9 +64,34 @@
|
|
|
|
|
<![CDATA[
|
|
|
|
|
SELECT ifnull(sum(if(l.transaction_type = 'Credit',l.clearing_amount,-l.clearing_amount)), 0)
|
|
|
|
|
FROM pmt_transactions l
|
|
|
|
|
INNER JOIN pmt_orders o ON o.order_id = l.order_id AND o.create_time >= #{begin} AND
|
|
|
|
|
o.create_time <= #{end}
|
|
|
|
|
INNER JOIN pmt_orders o ON o.order_id = l.order_id AND c.create_time >= #{begin} AND
|
|
|
|
|
c.create_time <= #{end}
|
|
|
|
|
WHERE (l.transaction_type = 'Credit' or l.refund_id is not null)
|
|
|
|
|
]]>
|
|
|
|
|
<if test="client_ids!=null">
|
|
|
|
|
AND o.client_id IN
|
|
|
|
|
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
|
|
|
|
|
#{client_id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="analysisTotalAmountProvisionService" resultType="java.math.BigDecimal">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
SELECT ifnull(sum(if(l.transaction_type = 'Credit',l.clearing_amount,0)), 0)
|
|
|
|
|
FROM pmt_transactions l
|
|
|
|
|
WHERE (l.transaction_type = 'Credit' or l.refund_id is not null)
|
|
|
|
|
AND l.channel != 'Settlement'
|
|
|
|
|
AND l.channel != 'System'
|
|
|
|
|
AND l.create_time >= #{begin}
|
|
|
|
|
AND l.create_time <= #{end}
|
|
|
|
|
]]>
|
|
|
|
|
<if test="client_ids!=null">
|
|
|
|
|
AND o.client_id IN
|
|
|
|
|