package com.fs.company.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.company.mapper.CompanyVoiceBlacklistMapper;
import com.fs.company.domain.CompanyVoiceBlacklist;
import com.fs.company.service.ICompanyVoiceBlacklistService;

/**
 * 黑名单Service业务层处理
 * 
 * @author fs
 * @date 2023-02-23
 */
@Service
public class CompanyVoiceBlacklistServiceImpl implements ICompanyVoiceBlacklistService 
{
    @Autowired
    private CompanyVoiceBlacklistMapper companyVoiceBlacklistMapper;

    /**
     * 查询黑名单
     * 
     * @param blacklistId 黑名单ID
     * @return 黑名单
     */
    @Override
    public CompanyVoiceBlacklist selectCompanyVoiceBlacklistById(Long blacklistId)
    {
        return companyVoiceBlacklistMapper.selectCompanyVoiceBlacklistById(blacklistId);
    }

    /**
     * 查询黑名单列表
     * 
     * @param companyVoiceBlacklist 黑名单
     * @return 黑名单
     */
    @Override
    public List<CompanyVoiceBlacklist> selectCompanyVoiceBlacklistList(CompanyVoiceBlacklist companyVoiceBlacklist)
    {
        return companyVoiceBlacklistMapper.selectCompanyVoiceBlacklistList(companyVoiceBlacklist);
    }

    /**
     * 新增黑名单
     * 
     * @param companyVoiceBlacklist 黑名单
     * @return 结果
     */
    @Override
    public int insertCompanyVoiceBlacklist(CompanyVoiceBlacklist companyVoiceBlacklist)
    {
        companyVoiceBlacklist.setCreateTime(DateUtils.getNowDate());
        return companyVoiceBlacklistMapper.insertCompanyVoiceBlacklist(companyVoiceBlacklist);
    }

    /**
     * 修改黑名单
     * 
     * @param companyVoiceBlacklist 黑名单
     * @return 结果
     */
    @Override
    public int updateCompanyVoiceBlacklist(CompanyVoiceBlacklist companyVoiceBlacklist)
    {
        companyVoiceBlacklist.setUpdateTime(DateUtils.getNowDate());
        return companyVoiceBlacklistMapper.updateCompanyVoiceBlacklist(companyVoiceBlacklist);
    }

    /**
     * 批量删除黑名单
     * 
     * @param blacklistIds 需要删除的黑名单ID
     * @return 结果
     */
    @Override
    public int deleteCompanyVoiceBlacklistByIds(Long[] blacklistIds)
    {
        return companyVoiceBlacklistMapper.deleteCompanyVoiceBlacklistByIds(blacklistIds);
    }

    /**
     * 删除黑名单信息
     * 
     * @param blacklistId 黑名单ID
     * @return 结果
     */
    @Override
    public int deleteCompanyVoiceBlacklistById(Long blacklistId)
    {
        return companyVoiceBlacklistMapper.deleteCompanyVoiceBlacklistById(blacklistId);
    }

    @Override
    public int selectCompanyVoiceBlacklistByMobile(String mobile) {
        return companyVoiceBlacklistMapper.selectCompanyVoiceBlacklistByMobile(mobile);
    }
}
