package com.fs.store.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.store.vo.FsAdvListQueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.store.mapper.FsAdvMapper;
import com.fs.store.domain.FsAdv;
import com.fs.store.service.IFsAdvService;

/**
 * 广告Service业务层处理
 *
 * @author fs
 * @date 2022-05-28
 */
@Service
public class FsAdvServiceImpl implements IFsAdvService
{
    @Autowired
    private FsAdvMapper fsAdvMapper;

    /**
     * 查询广告
     *
     * @param advId 广告ID
     * @return 广告
     */
    @Override
    public FsAdv selectFsAdvById(Long advId)
    {
        return fsAdvMapper.selectFsAdvById(advId);
    }

    /**
     * 查询广告列表
     *
     * @param fsAdv 广告
     * @return 广告
     */
    @Override
    public List<FsAdv> selectFsAdvList(FsAdv fsAdv)
    {
        return fsAdvMapper.selectFsAdvList(fsAdv);
    }

    /**
     * 新增广告
     *
     * @param fsAdv 广告
     * @return 结果
     */
    @Override
    public int insertFsAdv(FsAdv fsAdv)
    {
        fsAdv.setCreateTime(DateUtils.getNowDate());
        return fsAdvMapper.insertFsAdv(fsAdv);
    }

    /**
     * 修改广告
     *
     * @param fsAdv 广告
     * @return 结果
     */
    @Override
    public int updateFsAdv(FsAdv fsAdv)
    {
        fsAdv.setUpdateTime(DateUtils.getNowDate());
        return fsAdvMapper.updateFsAdv(fsAdv);
    }


    @Override
    public int deleteFsAdvByIds(Long[] advIds)
    {
        return fsAdvMapper.deleteFsAdvByIds(advIds);
    }


    @Override
    public int deleteFsAdvById(Long advId)
    {
        return fsAdvMapper.deleteFsAdvById(advId);
    }

    @Override
    public List<FsAdvListQueryVO> selectFsAdvListQuery(Integer advType) {
        return fsAdvMapper.selectFsAdvListQuery(advType);
    }
}
