package com.fs.crm.service.impl;

import com.fs.common.utils.DateUtils;
import com.fs.crm.domain.CrmCustomerThird;
import com.fs.crm.mapper.CrmCustomerThirdMapper;
import com.fs.crm.service.ICrmCustomerThirdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客户线索三方平台Service业务层处理
 *
 * @author fs
 * @date 2023-07-11
 */
@Service
public class CrmCustomerThirdServiceImpl implements ICrmCustomerThirdService
{
    @Autowired
    private CrmCustomerThirdMapper crmCustomerThirdMapper;

    /**
     * 查询客户线索三方平台
     *
     * @param id 客户线索三方平台ID
     * @return 客户线索三方平台
     */
    @Override
    public CrmCustomerThird selectCrmCustomerThirdById(Long id)
    {
        return crmCustomerThirdMapper.selectCrmCustomerThirdById(id);
    }

    /**
     * 查询客户线索三方平台列表
     *
     * @param crmCustomerThird 客户线索三方平台
     * @return 客户线索三方平台
     */
    @Override
    public List<CrmCustomerThird> selectCrmCustomerThirdList(CrmCustomerThird crmCustomerThird)
    {
        return crmCustomerThirdMapper.selectCrmCustomerThirdList(crmCustomerThird);
    }

    /**
     * 新增客户线索三方平台
     *
     * @param crmCustomerThird 客户线索三方平台
     * @return 结果
     */
    @Override
    public int insertCrmCustomerThird(CrmCustomerThird crmCustomerThird)
    {
        crmCustomerThird.setCreateTime(DateUtils.getNowDate());
        return crmCustomerThirdMapper.insertCrmCustomerThird(crmCustomerThird);
    }

    /**
     * 修改客户线索三方平台
     *
     * @param crmCustomerThird 客户线索三方平台
     * @return 结果
     */
    @Override
    public int updateCrmCustomerThird(CrmCustomerThird crmCustomerThird)
    {
        crmCustomerThird.setUpdateTime(DateUtils.getNowDate());
        return crmCustomerThirdMapper.updateCrmCustomerThird(crmCustomerThird);
    }

    /**
     * 批量删除客户线索三方平台
     *
     * @param ids 需要删除的客户线索三方平台ID
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerThirdByIds(Long[] ids)
    {
        return crmCustomerThirdMapper.deleteCrmCustomerThirdByIds(ids);
    }

    /**
     * 删除客户线索三方平台信息
     *
     * @param id 客户线索三方平台ID
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerThirdById(Long id)
    {
        return crmCustomerThirdMapper.deleteCrmCustomerThirdById(id);
    }
}
