用户活动结束统计fixed

用户活动结束统计
This commit is contained in:
2025-05-15 11:33:05 +08:00
parent 1188b66819
commit fe55badfcc
13 changed files with 173 additions and 85 deletions

View File

@@ -6,6 +6,7 @@ import com.accompany.sharding.vo.RoomRevenueExcelVo;
import com.accompany.sharding.vo.RoomSerialVo;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -66,4 +67,8 @@ public interface GiftSendRecordMapperExpand {
List<GiftSendRecord> listUserTotalGoldNum(@Param("uid")Long uid);
List<GiftSendRecord> listReceiverUserTotalGoldNum();
GiftSendRecord sumRoomFlowByDate(@Param("roomUid")Long roomUid, @Param("beginTime")Date beginTime, @Param("endTime")Date endTime,
@Param("goldCommonRate")BigDecimal goldCommonRate, @Param("gold24Rate")BigDecimal gold24Rate,
@Param("goldBravoRate")BigDecimal goldBravoRate, @Param("gold25Rate")BigDecimal gold25Rate);
}

View File

@@ -258,4 +258,15 @@
group by recive_uid
</select>
<select id="sumRoomFlowByDate" resultType="com.accompany.sharding.model.GiftSendRecord">
SELECT
sum(gsr.total_diamond_num) totalGoldNum,
sum(g.gold_price *
IF(gsr.gift_type = 18, #{gold24Rate}, IF(gsr.gift_type = 21, #{goldBravoRate}, IF(gsr.gift_type = 22, #{gold25Rate}, #{goldCommonRate})))) totalDiamondNum
FROM
gift_send_record gsr
LEFT JOIN gift g ON gsr.gift_id = g.gift_id
where gsr.create_time >= #{beginTime} and gsr.create_time &lt;= #{endTime} and gsr.room_uid = #{roomUid}
</select>
</mapper>