package com.dcsoft.system.service.impl;

import java.util.List;
import com.dcsoft.common.core.utils.DateUtils;
import com.dcsoft.system.visitor.domain.Visitor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dcsoft.system.mapper.SysBlackListMapper;
import com.dcsoft.system.domain.SysBlackList;
import com.dcsoft.system.service.ISysBlackListService;

/**
 * 黑名单管理Service业务层处理
 *
 * @author nichun
 * @date 2023-07-03
 */
@Service
public class SysBlackListServiceImpl implements ISysBlackListService
{
    @Autowired
    private SysBlackListMapper sysBlackListMapper;

    /**
     * 查询黑名单管理
     *
     * @param id 黑名单管理主键
     * @return 黑名单管理
     */
    @Override
    public SysBlackList selectSysBlackListById(Long id)
    {
        return sysBlackListMapper.selectSysBlackListById(id);
    }

    /**
     * 查询黑名单管理列表
     *
     * @param sysBlackList 黑名单管理
     * @return 黑名单管理
     */
    @Override
    public List<SysBlackList> selectSysBlackListList(SysBlackList sysBlackList)
    {
        return sysBlackListMapper.selectSysBlackListList(sysBlackList);
    }

    /**
     * 新增黑名单管理
     *
     * @param sysBlackList 黑名单管理
     * @return 结果
     */
    @Override
    public int insertSysBlackList(SysBlackList sysBlackList)
    {
        sysBlackList.setCreateTime(DateUtils.getNowDate());
        return sysBlackListMapper.insertSysBlackList(sysBlackList);
    }

    /**
     * 修改黑名单管理
     *
     * @param sysBlackList 黑名单管理
     * @return 结果
     */
    @Override
    public int updateSysBlackList(SysBlackList sysBlackList)
    {
        sysBlackList.setUpdateTime(DateUtils.getNowDate());
        return sysBlackListMapper.updateSysBlackList(sysBlackList);
    }

    /**
     * 批量删除黑名单管理
     *
     * @param ids 需要删除的黑名单管理主键
     * @return 结果
     */
    @Override
    public int deleteSysBlackListByIds(Long[] ids)
    {
        return sysBlackListMapper.deleteSysBlackListByIds(ids);
    }

    /**
     * 删除黑名单管理信息
     *
     * @param id 黑名单管理主键
     * @return 结果
     */
    @Override
    public int deleteSysBlackListById(Long id)
    {
        return sysBlackListMapper.deleteSysBlackListById(id);
    }

    @Override
    public SysBlackList queryBlackById(Visitor visitor) {
        return sysBlackListMapper.queryBlackById(visitor);
    }
}
