package com.ruoyi.frequency.activity.mapper;

import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.controller.req.ActivityPageReq;
import com.ruoyi.frequency.activity.entity.Activity;
import com.ruoyi.frequency.activity.model.result.ActivityCount;
import com.ruoyi.vo.UserVo;
import org.apache.ibatis.annotations.Param;

/**
 * 活动Mapper接口
 * 
 * @author liwenlong
 * @date 2024-03-19
 */
@DataSource(DataSourceType.MASTER)
public interface ActivityMapper  extends BaseMapper<Activity>
{
    /**
     * 查询活动
     * 
     * @param id 活动主键
     * @return 活动
     */
    public Activity selectActivityById(Long id);

    /**
     * 查询活动列表
     * 
     * @param activity 活动
     * @return 活动集合
     */
    public List<Activity> selectActivityList(Activity activity);

    /**
     * 新增活动
     * 
     * @param activity 活动
     * @return 结果
     */
    public int insertActivity(Activity activity);

    /**
     * 修改活动
     * 
     * @param activity 活动
     * @return 结果
     */
    public int updateActivity(Activity activity);

    Page<Activity> activityPage(@Param("page") Page<Object> objectPage,@Param("req") ActivityPageReq req, @Param("userVo") UserVo userVo);

    Activity activityDetail(@Param("id") Long id, @Param("userVo") UserVo userVo);

    ActivityCount statistics(@Param("list") List<Long> activityIdList);
}
