|
|
@ -17,8 +17,7 @@
|
|
|
|
ORDER BY transaction_time
|
|
|
|
ORDER BY transaction_time
|
|
|
|
LIMIT 1;
|
|
|
|
LIMIT 1;
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--1.partner card 标题-->
|
|
|
|
|
|
|
|
<!--已修改 -->
|
|
|
|
|
|
|
|
<select id="getTransactionCommonAnalysis" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getTransactionCommonAnalysis" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT ifnull(sum(if(t.transaction_type = 'Credit' ,t.clearing_amount,0)), 0) total_amount,
|
|
|
|
SELECT ifnull(sum(if(t.transaction_type = 'Credit' ,t.clearing_amount,0)), 0) total_amount,
|
|
|
@ -35,11 +34,7 @@
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--1.Dashboard标题交易额(移动至getClientTransaction)
|
|
|
|
|
|
|
|
2 商户端 Dashboard 标题 交易额 (移动至getClientTransaction))
|
|
|
|
|
|
|
|
3.BD analysis bd提成
|
|
|
|
|
|
|
|
4./api/v1.0/retail/app 移动至getClientTransaction)-->
|
|
|
|
|
|
|
|
<!--不修改 -->
|
|
|
|
|
|
|
|
<select id="analysisTotalAmount" resultType="java.math.BigDecimal">
|
|
|
|
<select id="analysisTotalAmount" resultType="java.math.BigDecimal">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT ifnull(sum(if(l.transaction_type = 'Credit',l.clearing_amount,-l.clearing_amount)), 0)
|
|
|
|
SELECT ifnull(sum(if(l.transaction_type = 'Credit',l.clearing_amount,-l.clearing_amount)), 0)
|
|
|
@ -61,10 +56,7 @@
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--1.Dashboard交易笔数 (移动至getClientTransaction)
|
|
|
|
|
|
|
|
2./api/v1.0/retail/app 移动至getClientTransaction)
|
|
|
|
|
|
|
|
2.商户端 dashboard 交易笔数(移动至getClientTransaction)-->
|
|
|
|
|
|
|
|
<!--不修改-->
|
|
|
|
|
|
|
|
<select id="analysisTotalCount" resultType="java.lang.Double">
|
|
|
|
<select id="analysisTotalCount" resultType="java.lang.Double">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT ifnull(count(DISTINCT l.order_id), 0)
|
|
|
|
SELECT ifnull(count(DISTINCT l.order_id), 0)
|
|
|
@ -88,7 +80,6 @@
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!--1.商户端 dashboard退款金额 (移动至getClientTransaction)-->
|
|
|
|
|
|
|
|
<select id="analysisRefundAmount" resultType="java.lang.Double">
|
|
|
|
<select id="analysisRefundAmount" resultType="java.lang.Double">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT ifnull(sum(if(l.transaction_type='Debit',l.clearing_amount,-l.clearing_amount)), 0)
|
|
|
|
SELECT ifnull(sum(if(l.transaction_type='Debit',l.clearing_amount,-l.clearing_amount)), 0)
|
|
|
@ -108,8 +99,6 @@
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!--商户端 dashboard 未清算金额-->
|
|
|
|
|
|
|
|
<!--不修改-->
|
|
|
|
|
|
|
|
<select id="analysisNotSettled" resultType="java.lang.Double">
|
|
|
|
<select id="analysisNotSettled" resultType="java.lang.Double">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0)
|
|
|
|
SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0)
|
|
|
@ -127,8 +116,6 @@
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!--商户端 dashboard 预授权金额 -->
|
|
|
|
|
|
|
|
<!--不修改-->
|
|
|
|
|
|
|
|
<select id="analysisPreAmount" resultType="java.lang.Double">
|
|
|
|
<select id="analysisPreAmount" resultType="java.lang.Double">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT ifnull(sum(l.clearing_amount), 0)
|
|
|
|
SELECT ifnull(sum(l.clearing_amount), 0)
|
|
|
@ -148,9 +135,6 @@
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!--1.Dashboard最大交易额订单(aud_fee)
|
|
|
|
|
|
|
|
2.商户端 Dashboard最大交易额订单-->
|
|
|
|
|
|
|
|
<!-- 不修改-->
|
|
|
|
|
|
|
|
<select id="getTopOrders" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getTopOrders" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
@ -183,9 +167,7 @@
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--1.Dashboard交易类型分布-交易量
|
|
|
|
|
|
|
|
2.partner card 交易类型分布-交易量-->
|
|
|
|
|
|
|
|
<!-- 已修改-->
|
|
|
|
|
|
|
|
<select id="getTradeAmountInTypes" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getTradeAmountInTypes" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
@ -228,10 +210,7 @@
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
GROUP BY gateway_label
|
|
|
|
GROUP BY gateway_label
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--1.交易数据(日统计)交易时间分布
|
|
|
|
|
|
|
|
2.商户端 Dashboard Trading distribution chart
|
|
|
|
|
|
|
|
3.partner card Transaction Time Analysis-->
|
|
|
|
|
|
|
|
<!-- 已修改-->
|
|
|
|
|
|
|
|
<select id="tradeAnalysisInHours" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="tradeAnalysisInHours" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT h, round(sum(count)/datediff(#{end},#{begin}),1) count, round(sum(aud_fee)/datediff(#{end},#{begin}),2) aud_fee
|
|
|
|
SELECT h, round(sum(count)/datediff(#{end},#{begin}),1) count, round(sum(aud_fee)/datediff(#{end},#{begin}),2) aud_fee
|
|
|
@ -273,9 +252,7 @@
|
|
|
|
order by h
|
|
|
|
order by h
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!-- 1.Dashboard交易额趋势(aud_fee)(已不用)
|
|
|
|
|
|
|
|
2.generateReport(方法名)-->
|
|
|
|
|
|
|
|
<!--已修改 -->
|
|
|
|
|
|
|
|
<select id="tradeAnalysisInDays" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="tradeAnalysisInDays" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
@ -303,8 +280,7 @@
|
|
|
|
ORDER BY date(o.create_time)
|
|
|
|
ORDER BY date(o.create_time)
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--1.商户端 Dashboard Trading trends-->
|
|
|
|
|
|
|
|
<!--已修改 -->
|
|
|
|
|
|
|
|
<select id="tradeAnalysisInDay" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="tradeAnalysisInDay" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
@ -442,9 +418,7 @@
|
|
|
|
o.create_time < #{date} and o.status>=5
|
|
|
|
o.create_time < #{date} and o.status>=5
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--1.Dashboard 交易类型分布-商户数量
|
|
|
|
|
|
|
|
2.gataway统计 各交易类型商家数量分布(家)-->
|
|
|
|
|
|
|
|
<!-- 不修改-->
|
|
|
|
|
|
|
|
<select id="getTradePartnersInTypes" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getTradePartnersInTypes" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
@ -494,8 +468,7 @@
|
|
|
|
GROUP BY gateway_label
|
|
|
|
GROUP BY gateway_label
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!--1.getaWay统计 交易方式商户排名 -->
|
|
|
|
|
|
|
|
<!--已修改 -->
|
|
|
|
|
|
|
|
<select id="getPartnersByTradeType" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getPartnersByTradeType" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT c.short_name ,ifnull(SUM(if(l.transaction_type = 'Credit',l.clearing_amount,0)), 0) total
|
|
|
|
SELECT c.short_name ,ifnull(SUM(if(l.transaction_type = 'Credit',l.clearing_amount,0)), 0) total
|
|
|
@ -572,8 +545,7 @@
|
|
|
|
<!--</if>-->
|
|
|
|
<!--</if>-->
|
|
|
|
<!--<if test="org_id!=null">and l.org_id=#{org_id}</if>-->
|
|
|
|
<!--<if test="org_id!=null">and l.org_id=#{org_id}</if>-->
|
|
|
|
<!--</select>-->
|
|
|
|
<!--</select>-->
|
|
|
|
<!--1.Dashboard交易时间分布(order_total) -->
|
|
|
|
|
|
|
|
<!-- 不修改-->
|
|
|
|
|
|
|
|
<select id="getOrdersByGateway" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getOrdersByGateway" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT po.create_time,
|
|
|
|
SELECT po.create_time,
|
|
|
@ -663,9 +635,7 @@
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
GROUP BY date , channel ORDER BY date DESC
|
|
|
|
GROUP BY date , channel ORDER BY date DESC
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--1.合伙人 合伙人销量 各组织机构交易量分布
|
|
|
|
|
|
|
|
2.generateReport(WeekReporter)-->
|
|
|
|
|
|
|
|
<!--已修改-->
|
|
|
|
|
|
|
|
<select id="getOrgTransactionAnalysis" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getOrgTransactionAnalysis" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT o.org_id, o.name org_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) amount
|
|
|
|
SELECT o.org_id, o.name org_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) amount
|
|
|
@ -682,8 +652,7 @@
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
GROUP BY o.org_id order by amount desc
|
|
|
|
GROUP BY o.org_id order by amount desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--1.合伙人 合伙人销量 合伙人商户交易量排名 -->
|
|
|
|
|
|
|
|
<!--已修改-->
|
|
|
|
|
|
|
|
<select id="getPartnersAmountByOrg" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getPartnersAmountByOrg" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT c.client_moniker,c.short_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) amount
|
|
|
|
SELECT c.client_moniker,c.short_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) amount
|
|
|
@ -697,8 +666,7 @@
|
|
|
|
GROUP BY c.client_id order by amount desc
|
|
|
|
GROUP BY c.client_id order by amount desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- (1)Dashboard支付通道交易额,订单数-->
|
|
|
|
|
|
|
|
<!-- 已修改-->
|
|
|
|
|
|
|
|
<select id="getPlatformAmount" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getPlatformAmount" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT ifnull(sum(if(l.transaction_type = 'Credit',l.clearing_amount,0)), 0) amount,
|
|
|
|
SELECT ifnull(sum(if(l.transaction_type = 'Credit',l.clearing_amount,0)), 0) amount,
|
|
|
@ -735,8 +703,7 @@
|
|
|
|
<if test="amount_to!=null">and t.clearing_amount < #{amount_to}</if>
|
|
|
|
<if test="amount_to!=null">and t.clearing_amount < #{amount_to}</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!--1.交易金额分析 交易订单列表-->
|
|
|
|
|
|
|
|
<!--不更改 -->
|
|
|
|
|
|
|
|
<select id="listAmountRangeOrders" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="listAmountRangeOrders" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
select c.client_moniker,c.short_name,t.order_id,t.clearing_amount,t.transaction_time,t.channel,o.customer_id,o.customer_ip,o.gateway
|
|
|
|
select c.client_moniker,c.short_name,t.order_id,t.clearing_amount,t.transaction_time,t.channel,o.customer_id,o.customer_ip,o.gateway
|
|
|
|
FROM pmt_transactions t
|
|
|
|
FROM pmt_transactions t
|
|
|
@ -774,11 +741,7 @@
|
|
|
|
<if test="channel!=null">and t.channel=#{channel}</if>
|
|
|
|
<if test="channel!=null">and t.channel=#{channel}</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!--1.Dashboard标题交易额
|
|
|
|
|
|
|
|
2.Dashboard 交易笔数
|
|
|
|
|
|
|
|
3.商户端 交易额,交易笔数 退款金额
|
|
|
|
|
|
|
|
4./api/v1.0/retail/app-->
|
|
|
|
|
|
|
|
<!--新增接口-->
|
|
|
|
|
|
|
|
<select id="getClientTransaction" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getClientTransaction" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
select
|
|
|
|
select
|
|
|
|
IFNULL(sum(if(l.transaction_type='credit',l.clearing_amount,0)),0) trade_amount,
|
|
|
|
IFNULL(sum(if(l.transaction_type='credit',l.clearing_amount,0)),0) trade_amount,
|
|
|
|