账单-金币统计-统计-强制使用索引
This commit is contained in:
@@ -131,14 +131,14 @@
|
||||
</select>-->
|
||||
|
||||
<select id="statDiamondBillRecord" resultType="com.accompany.sharding.vo.DiamondBillRecordStatVo">
|
||||
select br.partition_id,
|
||||
br.obj_type,
|
||||
select br.obj_type,
|
||||
br.partition_id,
|
||||
sum(br.amount) `total_diamond`
|
||||
from bill_record br
|
||||
where br.partition_id = #{partitionId}
|
||||
and br.obj_type in <foreach item="id" index="index" collection="objTypeList" open="(" close=")" separator=",">#{id}</foreach>
|
||||
and br.create_time >= #{startTime} and br.create_time <= #{endTime}
|
||||
group by br.partition_id, br.obj_type
|
||||
from bill_record br force index (idx_obj_type_partition_id_create_time)
|
||||
where br.obj_type in <foreach item="id" index="index" collection="objTypeList" open="(" close=")" separator=",">#{id}</foreach>
|
||||
and br.partition_id = #{partitionId}
|
||||
and br.create_time between #{startTime} and #{endTime}
|
||||
group by br.obj_type
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user