package com.fs.store.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.store.mapper.FsUserLevelMapper;
import com.fs.store.domain.FsUserLevel;
import com.fs.store.service.IFsUserLevelService;

/**
 * 用户等级记录Service业务层处理
 * 
 * @author fs
 * @date 2022-03-15
 */
@Service
public class FsUserLevelServiceImpl implements IFsUserLevelService 
{
    @Autowired
    private FsUserLevelMapper fsUserLevelMapper;

    /**
     * 查询用户等级记录
     * 
     * @param id 用户等级记录ID
     * @return 用户等级记录
     */
    @Override
    public FsUserLevel selectFsUserLevelById(Long id)
    {
        return fsUserLevelMapper.selectFsUserLevelById(id);
    }

    /**
     * 查询用户等级记录列表
     * 
     * @param fsUserLevel 用户等级记录
     * @return 用户等级记录
     */
    @Override
    public List<FsUserLevel> selectFsUserLevelList(FsUserLevel fsUserLevel)
    {
        return fsUserLevelMapper.selectFsUserLevelList(fsUserLevel);
    }

    /**
     * 新增用户等级记录
     * 
     * @param fsUserLevel 用户等级记录
     * @return 结果
     */
    @Override
    public int insertFsUserLevel(FsUserLevel fsUserLevel)
    {
        fsUserLevel.setCreateTime(DateUtils.getNowDate());
        return fsUserLevelMapper.insertFsUserLevel(fsUserLevel);
    }

    /**
     * 修改用户等级记录
     * 
     * @param fsUserLevel 用户等级记录
     * @return 结果
     */
    @Override
    public int updateFsUserLevel(FsUserLevel fsUserLevel)
    {
        fsUserLevel.setUpdateTime(DateUtils.getNowDate());
        return fsUserLevelMapper.updateFsUserLevel(fsUserLevel);
    }

    /**
     * 批量删除用户等级记录
     * 
     * @param ids 需要删除的用户等级记录ID
     * @return 结果
     */
    @Override
    public int deleteFsUserLevelByIds(Long[] ids)
    {
        return fsUserLevelMapper.deleteFsUserLevelByIds(ids);
    }

    /**
     * 删除用户等级记录信息
     * 
     * @param id 用户等级记录ID
     * @return 结果
     */
    @Override
    public int deleteFsUserLevelById(Long id)
    {
        return fsUserLevelMapper.deleteFsUserLevelById(id);
    }
}
