Upd:服务提供spms读取数据结构查询条件

master
duLingLing 5 years ago
parent 024d2ae611
commit bcafcdcb29

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -18,6 +18,8 @@ import java.util.List;
public interface TransactionAnalysisMapper {
BigDecimal analysisTotalAmount(JSONObject params);
BigDecimal analysisTotalAmountProvisionService (JSONObject params);
double analysisTotalCount(JSONObject params);
double analysisRefundAmount(JSONObject params);

@ -33,8 +33,8 @@ public class DataAnalysisServiceImpl implements DataAnalysisService {
response.put("total_partners", clientAnalysisMapper.countClients(params));
//产生交易的商户数
response.put("traded_partners", clientAnalysisMapper.countTradedPartners(params));
//交易总额
response.put("trade_amount", transactionAnalysisMapper.analysisTotalAmount(params));
//交易总额,该处另外开启新视线接口专提供pms获取数据
response.put("trade_amount", transactionAnalysisMapper.analysisTotalAmountProvisionService(params));
return response;
}

@ -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

Loading…
Cancel
Save