package com.fs.live.service.impl;

import java.util.Collections;
import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.live.param.CouponPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.live.mapper.LiveCouponIssueMapper;
import com.fs.live.domain.LiveCouponIssue;
import com.fs.live.service.ILiveCouponIssueService;

/**
 * 优惠券领取Service业务层处理
 *
 * @author fs
 * @date 2025-09-30
 */
@Service
public class LiveCouponIssueServiceImpl implements ILiveCouponIssueService
{
    @Autowired
    private LiveCouponIssueMapper liveCouponIssueMapper;

    /**
     * 查询优惠券领取
     *
     * @param id 优惠券领取ID
     * @return 优惠券领取
     */
    @Override
    public LiveCouponIssue selectLiveCouponIssueById(Long id)
    {
        return liveCouponIssueMapper.selectLiveCouponIssueById(id);
    }

    /**
     * 查询优惠券领取列表
     *
     * @param liveCouponIssue 优惠券领取
     * @return 优惠券领取
     */
    @Override
    public List<LiveCouponIssue> selectLiveCouponIssueList(LiveCouponIssue liveCouponIssue)
    {
        return liveCouponIssueMapper.selectLiveCouponIssueList(liveCouponIssue);
    }

    /**
     * 新增优惠券领取
     *
     * @param liveCouponIssue 优惠券领取
     * @return 结果
     */
    @Override
    public int insertLiveCouponIssue(LiveCouponIssue liveCouponIssue)
    {
        liveCouponIssue.setCreateTime(DateUtils.getNowDate());
        return liveCouponIssueMapper.insertLiveCouponIssue(liveCouponIssue);
    }

    /**
     * 修改优惠券领取
     *
     * @param liveCouponIssue 优惠券领取
     * @return 结果
     */
    @Override
    public int updateLiveCouponIssue(LiveCouponIssue liveCouponIssue)
    {
        liveCouponIssue.setUpdateTime(DateUtils.getNowDate());
        return liveCouponIssueMapper.updateLiveCouponIssue(liveCouponIssue);
    }

    /**
     * 批量删除优惠券领取
     *
     * @param ids 需要删除的优惠券领取ID
     * @return 结果
     */
    @Override
    public int deleteLiveCouponIssueByIds(Long[] ids)
    {
        return liveCouponIssueMapper.deleteLiveCouponIssueByIds(ids);
    }

    /**
     * 删除优惠券领取信息
     *
     * @param id 优惠券领取ID
     * @return 结果
     */
    @Override
    public int deleteLiveCouponIssueById(Long id)
    {
        return liveCouponIssueMapper.deleteLiveCouponIssueById(id);
    }

    @Override
    public List<LiveCouponIssue> selectLiveCouponIssueUserByCouponPO(CouponPO coupon) {
        return liveCouponIssueMapper.selectLiveCouponIssueUserByCouponPO(coupon);
    }

    @Override
    public List<LiveCouponIssue> curCoupon(CouponPO coupon) {
        return liveCouponIssueMapper.curCoupon(coupon);
    }

    @Override
    public LiveCouponIssue selectLiveCouponIssueByCouponId(Long couponId) {
        return liveCouponIssueMapper.selectLiveCouponIssueByCouponId(couponId);
    }
}
