package com.ylx.lottery.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ylx.lottery.domain.LotteryCountLog;
import com.ylx.lottery.domain.vo.LotteryStatVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LotteryCountLogMapper extends BaseMapper<LotteryCountLog> {

    @Select("SELECT local_activity_table_id, SUM(lottery_num) as totalNum " +
            "FROM lottery_count_log " +
            "${ew.customSqlSegment} " +
            "GROUP BY local_activity_table_id")
    List<LotteryStatVO> selectSumByGroup(@Param(Constants.WRAPPER) Wrapper wrapper);
}
