package com.yiqi.activity.service.impl;

import java.util.List;

import com.yiqi.activity.domain.ActivityInfo;
import com.yiqi.activity.domain.vo.ActivityGroupInfoQueryVO;
import com.yiqi.common.utils.DateUtils;
import com.yiqi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiqi.activity.mapper.ActivityGroupInfoMapper;
import com.yiqi.activity.domain.ActivityGroupInfo;
import com.yiqi.activity.service.IActivityGroupInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 拼团送券活动Service业务层处理
 *
 * @author xiaohei
 * @date 2023-09-12
 */
@Service
public class ActivityGroupInfoServiceImpl extends ServiceImpl<ActivityGroupInfoMapper,ActivityGroupInfo> implements IActivityGroupInfoService {

    /**
     * 查询拼团送券活动
     *
     * @param id 拼团送券活动主键
     * @return 拼团送券活动
     */
    @Override
    public ActivityGroupInfo selectActivityGroupInfoById(Long id) {
        return baseMapper.selectActivityGroupInfoById(id);
    }

    /**
     * 查询拼团送券活动列表
     *
     * @param activityInfo 拼团送券活动
     * @return 拼团送券活动
     */
    @Override
    public List<ActivityGroupInfoQueryVO> selectActivityGroupInfoList(ActivityInfo activityInfo) {
        return baseMapper.selectActivityGroupInfoList(activityInfo);
    }

    /**
     * 新增拼团送券活动
     *
     * @param activityGroupInfo 拼团送券活动
     * @return 结果
     */
    @Override
    public int insertActivityGroupInfo(ActivityGroupInfo activityGroupInfo) {
        activityGroupInfo.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertActivityGroupInfo(activityGroupInfo);
    }

    /**
     * 修改拼团送券活动
     *
     * @param activityGroupInfo 拼团送券活动
     * @return 结果
     */
    @Override
    public int updateActivityGroupInfo(ActivityGroupInfo activityGroupInfo) {
        activityGroupInfo.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateActivityGroupInfo(activityGroupInfo);
    }

    /**
     * 批量删除拼团送券活动
     *
     * @param ids 需要删除的拼团送券活动主键
     * @return 结果
     */
    @Override
    public int deleteActivityGroupInfoByIds(Long[] ids) {
        return baseMapper.deleteActivityGroupInfoByIds(ids);
    }

    /**
     * 删除拼团送券活动信息
     *
     * @param id 拼团送券活动主键
     * @return 结果
     */
    @Override
    public int deleteActivityGroupInfoById(Long id) {
        return baseMapper.deleteActivityGroupInfoById(id);
    }



}
