fix : ActChairty

master
luoyang14z7 6 years ago
parent d5a2bfcb6f
commit ef3cd5d822

@ -2,16 +2,16 @@
<!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.act.ActChairtyMapper">
<select id="chairtyClientNum" resultType="com.alibaba.fastjson.JSONObject">
select DISTINCT (count(order_id)) as count_ordernum ,client_moniker,active_time,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum
select count(DISTINCT order_id) as count_ordernum ,client_moniker,active_time,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum
from act_charity
left JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=act_charity.active_time
and pmt_transactions.transaction_time&lt;'2018-09-01'
and pmt_transactions.channel != 'Settlement'
GROUP BY act_charity.client_id order by sum_ordernum desc
GROUP BY act_charity.client_id order by count_ordernum desc
</select>
<select id="getChairtyWeekAnalysis" resultType="com.alibaba.fastjson.JSONObject">
select DISTINCT (count(order_id)) as count_ordernum,date_format(pmt_transactions.transaction_time,'%Y-%m-%d') as orderdate,client_moniker,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum from act_charity inner JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
select count(DISTINCT order_id) as count_ordernum,date_format(pmt_transactions.transaction_time,'%Y-%m-%d') as orderdate,client_moniker,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum from act_charity inner JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=#{begin} and pmt_transactions.transaction_time&lt;=#{end} and pmt_transactions.transaction_time>=act_charity.active_time
and pmt_transactions.channel != 'Settlement'
group by date_format(pmt_transactions.transaction_time,'%Y-%m-%d')
@ -19,8 +19,8 @@
</select>
<select id="getChairtyWeekRaking" resultType="com.alibaba.fastjson.JSONObject">
select DISTINCT (count(pmt_transactions.order_id)) *0.01 as chair_ordernum,act_charity.client_moniker,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
select count(DISTINCT pmt_transactions.order_id) *0.01 as chair_ordernum,act_charity.client_moniker,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time&gt;=#{begin} and pmt_transactions.transaction_time&lt;=#{end} and pmt_transactions.transaction_time>=act_charity.active_time
GROUP BY act_charity.client_moniker order by sum_ordernum desc
GROUP BY act_charity.client_moniker order by chair_ordernum desc
</select>
</mapper>
Loading…
Cancel
Save