package com.fs.his.service.impl;

import java.util.Collections;
import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.his.param.FsAdvUParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.his.mapper.FsAdvMapper;
import com.fs.his.domain.FsAdv;
import com.fs.his.service.IFsAdvService;

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

    /**
     * 查询广告
     *
     * @param advId 广告主键
     * @return 广告
     */
    @Override
    public FsAdv selectFsAdvByAdvId(String advId)
    {
        return fsAdvMapper.selectFsAdvByAdvId(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);
    }

    /**
     * 批量删除广告
     *
     * @param advIds 需要删除的广告主键
     * @return 结果
     */
    @Override
    public int deleteFsAdvByAdvIds(String[] advIds)
    {
        return fsAdvMapper.deleteFsAdvByAdvIds(advIds);
    }

    /**
     * 删除广告信息
     *
     * @param advId 广告主键
     * @return 结果
     */
    @Override
    public int deleteFsAdvByAdvId(String advId)
    {
        return fsAdvMapper.deleteFsAdvByAdvId(advId);
    }


    @Override
    public List<FsAdv> selectFsAppAdvList() {
        return fsAdvMapper.selectFsAppAdvList();
    }

    @Override
    public List<FsAdv> selectFsAdvListUVO(FsAdvUParam map) {
        return fsAdvMapper.selectFsAdvListUVO(map);
    }
}
