package com.fs.course.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.course.vo.FsUserVipPackageListUVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.course.mapper.FsUserVipPackageMapper;
import com.fs.course.domain.FsUserVipPackage;
import com.fs.course.service.IFsUserVipPackageService;

/**
 * 会员套餐Service业务层处理
 *
 * @author fs
 * @date 2024-06-27
 */
@Service
public class FsUserVipPackageServiceImpl implements IFsUserVipPackageService
{
    @Autowired
    private FsUserVipPackageMapper fsUserVipPackageMapper;

    /**
     * 查询会员套餐
     *
     * @param packageId 会员套餐主键
     * @return 会员套餐
     */
    @Override
    public FsUserVipPackage selectFsUserVipPackageByPackageId(Long packageId)
    {
        return fsUserVipPackageMapper.selectFsUserVipPackageByPackageId(packageId);
    }

    /**
     * 查询会员套餐列表
     *
     * @param fsUserVipPackage 会员套餐
     * @return 会员套餐
     */
    @Override
    public List<FsUserVipPackage> selectFsUserVipPackageList(FsUserVipPackage fsUserVipPackage)
    {
        return fsUserVipPackageMapper.selectFsUserVipPackageList(fsUserVipPackage);
    }

    /**
     * 新增会员套餐
     *
     * @param fsUserVipPackage 会员套餐
     * @return 结果
     */
    @Override
    public int insertFsUserVipPackage(FsUserVipPackage fsUserVipPackage)
    {
        fsUserVipPackage.setCreateTime(DateUtils.getNowDate());
        return fsUserVipPackageMapper.insertFsUserVipPackage(fsUserVipPackage);
    }

    /**
     * 修改会员套餐
     *
     * @param fsUserVipPackage 会员套餐
     * @return 结果
     */
    @Override
    public int updateFsUserVipPackage(FsUserVipPackage fsUserVipPackage)
    {
        fsUserVipPackage.setUpdateTime(DateUtils.getNowDate());
        return fsUserVipPackageMapper.updateFsUserVipPackage(fsUserVipPackage);
    }

    /**
     * 批量删除会员套餐
     *
     * @param packageIds 需要删除的会员套餐主键
     * @return 结果
     */
    @Override
    public int deleteFsUserVipPackageByPackageIds(Long[] packageIds)
    {
        return fsUserVipPackageMapper.deleteFsUserVipPackageByPackageIds(packageIds);
    }

    /**
     * 删除会员套餐信息
     *
     * @param packageId 会员套餐主键
     * @return 结果
     */
    @Override
    public int deleteFsUserVipPackageByPackageId(Long packageId)
    {
        return fsUserVipPackageMapper.deleteFsUserVipPackageByPackageId(packageId);
    }

    @Override
    public List<FsUserVipPackageListUVO> selectFsUserVipPackageListUVO() {
        return fsUserVipPackageMapper.selectFsUserVipPackageListUVO();
    }
}
