package com.fs.store.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.store.param.FsCouponUserEnableParam;
import com.fs.store.vo.FsStoreCouponUserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.store.mapper.FsStoreCouponUserMapper;
import com.fs.store.domain.FsStoreCouponUser;
import com.fs.store.service.IFsStoreCouponUserService;

/**
 * 优惠券发放记录Service业务层处理
 * 
 * @author fs
 * @date 2022-03-15
 */
@Service
public class FsStoreCouponUserServiceImpl implements IFsStoreCouponUserService 
{
    @Autowired
    private FsStoreCouponUserMapper fsStoreCouponUserMapper;

    /**
     * 查询优惠券发放记录
     * 
     * @param id 优惠券发放记录ID
     * @return 优惠券发放记录
     */
    @Override
    public FsStoreCouponUser selectFsStoreCouponUserById(Long id)
    {
        return fsStoreCouponUserMapper.selectFsStoreCouponUserById(id);
    }

    /**
     * 查询优惠券发放记录列表
     * 
     * @param fsStoreCouponUser 优惠券发放记录
     * @return 优惠券发放记录
     */
    @Override
    public List<FsStoreCouponUser> selectFsStoreCouponUserList(FsStoreCouponUser fsStoreCouponUser)
    {
        return fsStoreCouponUserMapper.selectFsStoreCouponUserList(fsStoreCouponUser);
    }

    /**
     * 新增优惠券发放记录
     * 
     * @param fsStoreCouponUser 优惠券发放记录
     * @return 结果
     */
    @Override
    public int insertFsStoreCouponUser(FsStoreCouponUser fsStoreCouponUser)
    {
        fsStoreCouponUser.setCreateTime(DateUtils.getNowDate());
        return fsStoreCouponUserMapper.insertFsStoreCouponUser(fsStoreCouponUser);
    }

    /**
     * 修改优惠券发放记录
     * 
     * @param fsStoreCouponUser 优惠券发放记录
     * @return 结果
     */
    @Override
    public int updateFsStoreCouponUser(FsStoreCouponUser fsStoreCouponUser)
    {
        fsStoreCouponUser.setUpdateTime(DateUtils.getNowDate());
        return fsStoreCouponUserMapper.updateFsStoreCouponUser(fsStoreCouponUser);
    }

    /**
     * 批量删除优惠券发放记录
     * 
     * @param ids 需要删除的优惠券发放记录ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreCouponUserByIds(Long[] ids)
    {
        return fsStoreCouponUserMapper.deleteFsStoreCouponUserByIds(ids);
    }

    /**
     * 删除优惠券发放记录信息
     * 
     * @param id 优惠券发放记录ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreCouponUserById(Long id)
    {
        return fsStoreCouponUserMapper.deleteFsStoreCouponUserById(id);
    }

    @Override
    public int updateFsCouponByExpire() {
        return fsStoreCouponUserMapper.updateFsCouponByExpire();
    }

    @Override
    public List<FsStoreCouponUser>  selectFsStoreCouponUserListByEnable(FsCouponUserEnableParam param) {
        return fsStoreCouponUserMapper.selectFsStoreCouponUserListByEnable(param);
    }

    @Override
    public List<FsStoreCouponUserVO> selectFsStoreCouponUserListVO(FsStoreCouponUser fsStoreCouponUser) {
        return fsStoreCouponUserMapper.selectFsStoreCouponUserListVO(fsStoreCouponUser);
    }
}
