|
|
@ -600,6 +600,50 @@
|
|
|
|
order by t.clearing_time desc
|
|
|
|
order by t.clearing_time desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="listSettlementLogForDashbord" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
|
|
|
|
SELECT cd.client_id,cd.report_date clearing_time,
|
|
|
|
|
|
|
|
cd.report_date,
|
|
|
|
|
|
|
|
<if test="merge_settle!=null">
|
|
|
|
|
|
|
|
SUM(cd.tax_amount) as tax_amount,
|
|
|
|
|
|
|
|
SUM(cd.total_charge) as total_charge,
|
|
|
|
|
|
|
|
1 as merge_settle,
|
|
|
|
|
|
|
|
SUM(cd.gross_amount) total,
|
|
|
|
|
|
|
|
SUM(cd.clearing_amount) income,
|
|
|
|
|
|
|
|
SUM(cd.gross_amount-cd.clearing_amount) fee,
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="merge_settle==null">
|
|
|
|
|
|
|
|
cd.tax_amount,
|
|
|
|
|
|
|
|
cd.total_charge,
|
|
|
|
|
|
|
|
cd.gross_amount total,
|
|
|
|
|
|
|
|
cd.clearing_amount income,
|
|
|
|
|
|
|
|
cd.gross_amount-cd.clearing_amount fee,
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(SELECT min(r.rate_value) FROM sys_client_rates r WHERE r.client_id = cd.client_id
|
|
|
|
|
|
|
|
AND date(r.expiry_time) >= DATE(cd.report_date)
|
|
|
|
|
|
|
|
AND date(r.active_time) <= DATE(cd.report_date)) rate,
|
|
|
|
|
|
|
|
cd.clear_detail_id,
|
|
|
|
|
|
|
|
lc.balance_group, lc.editable
|
|
|
|
|
|
|
|
FROM log_clearing_detail cd
|
|
|
|
|
|
|
|
left join log_clearing lc on cd.clearing_id = lc.clearing_id
|
|
|
|
|
|
|
|
left join sys_clients sc on cd.client_id = sc.client_id
|
|
|
|
|
|
|
|
WHERE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="client_ids!=null">
|
|
|
|
|
|
|
|
cd.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">
|
|
|
|
|
|
|
|
(sc.client_id=#{client_id} or sc.parent_client_id =#{client_id})
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="from!=null">and cd.report_date >= #{from}</if>
|
|
|
|
|
|
|
|
<if test="to!=null">and cd.report_date < #{to}</if>
|
|
|
|
|
|
|
|
<if test="merge_settle!=null">GROUP BY report_date</if>
|
|
|
|
|
|
|
|
order by cd.report_date desc
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="listSettlementLogTotal" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="listSettlementLogTotal" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT DATE(t.transaction_time) clearing_time,date_format(t.transaction_time, '%Y-%m-%d') clear_time,SUM(t.clearing_amount) total,
|
|
|
|
SELECT DATE(t.transaction_time) clearing_time,date_format(t.transaction_time, '%Y-%m-%d') clear_time,SUM(t.clearing_amount) total,
|
|
|
|