a.uid as uid, a.phone as phone, a.erban_no as erban_no, a.last_login_time as last_login_time,
a.weixin_openid as weixin_openid, a.qq_openid as qq_openid, a.os as os,
a.channel as channel, u.create_time as sign_time,
u.gender as gender, u.nick as nick
select
,sum(c1.amount) as charge_amount
,sum(c2.ex_diamond_num) as exechange_diamond
,sum(c3.sum_gold) as charm_change
,sum(c4.sum_gold) as exper_change
from account a JOIN users u ON a.uid=u.uid
left join charge_record c1 on c1.uid=a.uid and c1.charge_status='2' AND c1.pingxx_charge_id IS NOT NULL
and c1.create_time BETWEEN #{beginDate} and #{endDate}
LEFT JOIN exchange_diamond_gold_record c2 on c2.uid=a.uid and c2.create_time BETWEEN #{beginDate} and
#{endDate}
LEFT JOIN one_day_room_recv_sum c3 FORCE index(key3) on c3.recv_uid=a.uid and c3.create_time BETWEEN
#{beginDate} and #{endDate}
LEFT JOIN one_day_room_send_sum c4 FORCE index(key3) on c4.send_uid=a.uid and c4.create_time BETWEEN
#{beginDate} and #{endDate}
AND u.create_time >= #{signBegin}
AND u.create_time <= #{signEnd}
AND u.erban_no=#{erbanNo}
AND a.os = #{os}
AND a.phone like concat('%', #{phone},'%')
AND u.channel=#{channel}
AND u.gender=#{gender}
AND u.nick like concat('%',#{nick},'%')
AND a.weixin_openid is null AND a.qq_openid is null
AND a.weixin_openid is not null
AND a.qq_openid is not null
group by a.uid
order by charge_amount desc
order by exechange_diamond desc
order by charm_change desc
order by exper_change desc
SELECT c.uid, sum(c.amount)/100 as num FROM charge_record c force index(uid)
WHERE c.uid in (${uidStr}) and c.charge_status='2' AND c.pingxx_charge_id IS NOT NULL and c.create_time BETWEEN #{beginDate} and #{endDate}
GROUP BY c.uid
select c.uid, sum(c.ex_diamond_num) as doubleNum FROM exchange_diamond_gold_record c force index(uid)
WHERE c.uid in (${uidStr}) and c.create_time BETWEEN #{beginDate} and #{endDate}
GROUP BY c.uid
SELECT c.recv_uid as uid, sum(c.sum_gold) as num FROM one_day_room_recv_sum c force index(key3)
WHERE c.recv_uid in (${uidStr}) and c.create_time BETWEEN #{beginDate} and #{endDate}
GROUP BY c.recv_uid
SELECT c.send_uid as uid, sum(c.sum_gold) as num
FROM one_day_room_send_sum c force index(key3)
WHERE c.send_uid in (${uidStr}) and c.create_time BETWEEN #{beginDate} and #{endDate}
GROUP BY c.send_uid
SELECT uid, max(create_time) as date FROM account_login_record
WHERE uid IN (${uidStr})
GROUP BY uid
SELECT e.record_id as record_id, e.uid as uid, e.ex_diamond_num as ex_diamond_num, e.ex_gold_num as ex_gold_num, e.create_time as create_time,
u.nick as nick ,u.erban_no as erban_no,u.phone as phone ,u.alipay_account as alipay_account,u.alipay_account_name as alipay_account_name
FROM exchange_diamond_gold_record e LEFT JOIN users u ON e.uid=u.uid
WHERE u.def_user!='3'
AND u.erban_no=#{erbanNo}
AND e.create_time >= #{beginDate}
AND e.create_time <= #{endDate}
order by e.create_time desc
select se.erban_no as sendNo, se.nick as sendNick, re.erban_no as reciveNo, re.nick as reciveNick, ro.erban_no as roomNo, ro.nick as roomNick, gi.gift_name, g.gift_num, g.total_gold_num, g.create_time
from gift_send_record g
INNER JOIN users se on g.uid = se.uid
INNER JOIN users re on g.recive_uid = re.uid
LEFT JOIN users ro on g.room_uid = ro.uid
INNER JOIN gift gi on g.gift_id = gi.gift_id
where 1=1
and g.uid = #{uid}
and g.recive_uid = #{reciveUid}
and g.create_time >= #{beginDate}
and g.create_time <= #{endDate}
order by g.create_time desc