master
hellolujian 6 years ago
parent 4738df4050
commit 74892d8908

@ -22,9 +22,9 @@ public interface DashboardService {
List<JSONObject> getTradeInTypes(JSONObject params); List<JSONObject> getTradeInTypes(JSONObject params);
//List<JSONObject> getTopTradePartners(JSONObject params, int limit); List<JSONObject> getTopTradePartners(JSONObject params, int limit);
List<JSONObject> getTopTradePartners(JSONObject params); List<JSONObject> getTopTradePartnersNew(JSONObject params);
List<JSONObject> getTradeAnalysisInHours(JSONObject params); List<JSONObject> getTradeAnalysisInHours(JSONObject params);

@ -161,19 +161,18 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
return transactionAnalysisMapper.getTradeAmountInTypes(params); return transactionAnalysisMapper.getTradeAmountInTypes(params);
} }
/*
@Override @Override
public List<JSONObject> getTopTradePartners(JSONObject params, int limit) { public List<JSONObject> getTopTradePartners(JSONObject params, int limit) {
params.put("rankType", "aud_fee"); return clientAnalysisMapper.listPartnersTradeAmount(params,
params.put("limit", limit); new PageBounds(1, limit, Order.formString("aud_fee.desc")));
return clientAnalysisMapper.listPartnersTradeAmount(params);
} }
*/
@Override @Override
public List<JSONObject> getTopTradePartners(JSONObject params) { public List<JSONObject> getTopTradePartnersNew(JSONObject params) {
params.putIfAbsent("rankType", "aud_fee"); params.putIfAbsent("rankType", "aud_fee");
return clientAnalysisMapper.listPartnersTradeAmount(params); return clientAnalysisMapper.listPartnersTradeAmountNew(params);
} }
@Override @Override

@ -33,7 +33,9 @@ public interface ClientAnalysisMapper {
List<JSONObject> countTradePartnersHistory(JSONObject params); List<JSONObject> countTradePartnersHistory(JSONObject params);
List<JSONObject> listPartnersTradeAmount(JSONObject params); List<JSONObject> listPartnersTradeAmountNew(JSONObject params);
List<JSONObject> listPartnersTradeAmount(JSONObject params, PageBounds pageBounds);
List<JSONObject> countClientsTypes(JSONObject params); List<JSONObject> countClientsTypes(JSONObject params);

@ -67,10 +67,11 @@ public class DashboardController {
@ManagerMapping("/top_trade_partners") @ManagerMapping("/top_trade_partners")
public List<JSONObject> topTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, public List<JSONObject> topTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
@RequestParam(defaultValue = "10") int limit) { @RequestParam(defaultValue = "10") int limit) {
JSONObject params = analysis.toParams(analysis.getTimezone()); JSONObject params = analysis.toParams(analysis.getTimezone());
orgManager.checkOrg(manager, params); orgManager.checkOrg(manager, params);
params.put("limit", limit); params.put("limit", limit);
return dashboardService.getTopTradePartners(params); return dashboardService.getTopTradePartnersNew(params);
} }
@ManagerMapping("/rank_trade_partners") @ManagerMapping("/rank_trade_partners")
@ -83,7 +84,7 @@ public class DashboardController {
params.put("bd_group_bd", analysis.getGroup_bd()); params.put("bd_group_bd", analysis.getGroup_bd());
} }
} }
return dashboardService.getTopTradePartners(params); return dashboardService.getTopTradePartnersNew(params);
} }
@ManagerMapping("/trade_in_hours") @ManagerMapping("/trade_in_hours")

@ -148,9 +148,9 @@
优化后的SQL语句 优化后的SQL语句
在之前的SQL语句中与transaction表内连接时加了and (t.transaction_type = 'Credit' or t.refund_id is not null)这个条件 在之前的SQL语句中与transaction表内连接时加了and (t.transaction_type = 'Credit' or t.refund_id is not null)这个条件
是因为在transaction_type = 'Debit'的记录中有的并没有refund_id所以剔除这些记录 是因为在transaction_type = 'Debit'的记录中有的并没有refund_id所以剔除这些记录
优化后的SQL语句去掉了这个条件而是在需要的字段中天健t.refund_id IS NOT NULL这一条件 优化后的SQL语句去掉了这个条件而是在需要的字段中添加t.refund_id IS NOT NULL这一条件
--> -->
<select id="listPartnersTradeAmount" resultType="com.alibaba.fastjson.JSONObject"> <select id="listPartnersTradeAmountNew" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT SELECT
p.short_name, p.short_name,
@ -200,7 +200,6 @@
</if> </if>
</select> </select>
<select id="countClientsTypes" resultType="com.alibaba.fastjson.JSONObject"> <select id="countClientsTypes" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.industry,c.royalpayindustry,count(1) partner_counts FROM sys_clients c SELECT c.industry,c.royalpayindustry,count(1) partner_counts FROM sys_clients c
<if test="bd_user!=null"> <if test="bd_user!=null">

Loading…
Cancel
Save