select DATE_FORMAT(pmt_transactions.transaction_time,'%Y-%m-%d') as weekstart from act_charity
select DATE_FORMAT(pmt_transactions.transaction_time,'%Y-%m-%d') as weekstart from act_charity
inner JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id
inner JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id
where dayofweek(pmt_transactions.transaction_time)=2 and pmt_transactions.transaction_time>=#{begin} and pmt_transactions.transaction_time<=#{end}
where dayofweek(pmt_transactions.transaction_time)=2 and pmt_transactions.transaction_time>=#{begin} and pmt_transactions.transaction_time<=#{end} and pmt_transactions.transaction_time>=act_charity.active_time
and pmt_transactions.refund_id is null and pmt_transactions.channel != 'Settlement'
and pmt_transactions.refund_id is null and pmt_transactions.channel != 'Settlement'
select count(pmt_transactions.org_id) as count_ordernum,ifnull(sum(pmt_transactions.transaction_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
select count(pmt_transactions.org_id) as count_ordernum,ifnull(sum(pmt_transactions.transaction_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>=#{begin} and pmt_transactions.transaction_time<=#{end}
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=#{begin} and pmt_transactions.transaction_time<=#{end} and pmt_transactions.transaction_time>=act_charity.active_time
and pmt_transactions.refund_id is null and pmt_transactions.channel != 'Settlement'
and pmt_transactions.refund_id is null and pmt_transactions.channel != 'Settlement'
select act_charity.client_moniker,((count(pmt_transactions.org_id)) * 0.01) as chair_ordernum,ifnull(sum(pmt_transactions.transaction_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
select act_charity.client_moniker,((count(pmt_transactions.org_id)) * 0.01) as chair_ordernum,ifnull(sum(pmt_transactions.transaction_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>=#{begin} and pmt_transactions.transaction_time<=#{end}
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=#{begin} and pmt_transactions.transaction_time<=#{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 sum_ordernum desc