|
|
@ -713,17 +713,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
<select id="listSettlementLogInClients" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="listSettlementLogInClients" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT c.short_name,SUM(t.clearing_amount) total,
|
|
|
|
SELECT c.short_name,SUM(cd.gross_amount) total,
|
|
|
|
sum(if(LOCATE('MERCHANT',t.system_transaction_id),t.clearing_amount,0)) income,
|
|
|
|
sum(cd.clearing_amount) income,
|
|
|
|
sum(if(LOCATE('SURCHARGE',t.system_transaction_id),t.clearing_amount,0)) fee
|
|
|
|
sum(cd.total_charge+cd.tax_amount) fee
|
|
|
|
FROM sys_clients c
|
|
|
|
FROM sys_clients c
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
|
INNER JOIN (select system_transaction_id,clearing_amount,client_id
|
|
|
|
INNER JOIN log_clearing_detail cd on c.client_id=cd.client_id
|
|
|
|
from pmt_transactions
|
|
|
|
<if test="from!=null">and cd.report_date >= #{from}</if>
|
|
|
|
where channel='Settlement'
|
|
|
|
<if test="to!=null">and cd.report_date < #{to}</if>
|
|
|
|
<if test="from!=null">and transaction_time >= #{from}</if>
|
|
|
|
|
|
|
|
<if test="to!=null">and transaction_time < #{to}</if>
|
|
|
|
|
|
|
|
) t ON t.client_id = c.client_id
|
|
|
|
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
|
|
|
|
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if>
|
|
|
@ -735,8 +732,9 @@
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="countSettlementLogInClients" resultType="int">
|
|
|
|
<select id="countSettlementLogInClients" resultType="int">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT count(1)
|
|
|
|
SELECT count(cd.clear_detail_id)
|
|
|
|
FROM sys_clients c
|
|
|
|
from log_clearing_detail
|
|
|
|
|
|
|
|
inner join sys_clients c on c.client_id=cd.client_id
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
|
|
|
|
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
|
|
|
@ -744,13 +742,9 @@
|
|
|
|
<if test="org_ids!=null">and c.org_id in
|
|
|
|
<if test="org_ids!=null">and c.org_id in
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
and exists (select client_id from pmt_transactions t where channel='Settlement'
|
|
|
|
<if test="from!=null">and cd.report_date >= #{from}</if>
|
|
|
|
<if test="from!=null">and transaction_time >= #{from}</if>
|
|
|
|
<if test="to!=null">and cd.report_date < #{to}</if>
|
|
|
|
<if test="to!=null">and transaction_time < #{to}</if>
|
|
|
|
|
|
|
|
and client_id=c.client_id
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
exists
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="analysisSettlementLog" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="analysisSettlementLog" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|