账单-金币统计-统计-sql优化
This commit is contained in:
@@ -120,15 +120,14 @@
|
||||
</select>
|
||||
|
||||
<select id="statDiamondBillRecord" resultType="com.accompany.sharding.vo.DiamondBillRecordStatVo">
|
||||
select u.partition_id,
|
||||
select br.partition_id,
|
||||
br.obj_type,
|
||||
sum(br.amount) `total_diamond`
|
||||
from bill_record br
|
||||
inner join users u on br.uid = u.uid
|
||||
and u.partition_id in <foreach item="id" index="index" collection="partitionIds" open="(" close=")" separator=",">#{id}</foreach>
|
||||
where br.partition_id in <foreach item="id" index="index" collection="partitionIds" open="(" close=")" separator=",">#{id}</foreach>
|
||||
and br.create_time >= #{startTime} and br.create_time <= #{endTime}
|
||||
and br.currency = 1
|
||||
group by u.partition_id, br.obj_type
|
||||
group by br.partition_id, br.obj_type
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user