master
kira 6 years ago
parent 95082e96a3
commit 0bb2c9212a

@ -13,6 +13,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
@ -66,6 +67,13 @@ public class CustomServiceImpl implements CustomService {
@Override
public JSONObject query(JSONObject param, int page, int limit) {
param.put("orderStatus", OrderStatus.SUCCESS.getStatus());
List<String> channels = customSupport.customSupportedChannels(param.getIntValue("client_id"));
param.put("channels",channels);
if(!StringUtils.isEmpty(param.getString("channel"))) {
channels.clear();
channels.add(param.getString("channel"));
param.put("channels",channels);
}
return PageListUtils.buildPageListResult(customReportsMapper.queryWithTrans(param, new PageBounds(page, limit)));
}

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.custom.CustomReportsMapper">
<select id="queryWithTrans" resultType="com.alibaba.fastjson.JSONObject">
<select id="queryWithTrans" resultType="com.alibaba.fastjson.JSONObject">
select
o.order_id order_id, t.transaction_time transaction_time, t.transaction_amount transaction_amount,
t.cny_amount cny_amount ,r.report_status report_status,r.report_id report_id,o.channel channel
@ -15,7 +15,12 @@
pmt_custom_reports r
on r.order_id = o.order_id
where
o.channel = 'Alipay'
o.channel in (
<foreach collection="channels" separator="," item="item">
#{item}
</foreach>
)
and o.client_id = #{client_id}
and transaction_type = 'Credit'
and

Loading…
Cancel
Save