package com.ruoyi.project.business.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.business.domain.TcAccountContactHistory;
import com.ruoyi.project.business.domain.TcAccountHistory;
import com.ruoyi.project.business.mapper.TcAccountContactHistoryMapper;
import com.ruoyi.project.business.service.ITcAccountContactHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 客户（组织）联系人履历Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-23
 */
@Service
public class TcAccountContactHistoryServiceImpl extends ServiceImpl<TcAccountContactHistoryMapper, TcAccountContactHistory> implements ITcAccountContactHistoryService
{
    @Autowired
    private TcAccountContactHistoryMapper tcAccountContactHistoryMapper;

    /**
     * 查询客户（组织）联系人履历
     * 
     * @param contactId 客户（组织）联系人履历主键
     * @return 客户（组织）联系人履历
     */
    @Override
    public TcAccountContactHistory selectTcAccountContactHistoryByContactId(Long contactId)
    {
        return tcAccountContactHistoryMapper.selectTcAccountContactHistoryByContactId(contactId);
    }

    /**
     * 查询客户（组织）联系人履历列表
     * 
     * @param tcAccountContactHistory 客户（组织）联系人履历
     * @return 客户（组织）联系人履历
     */
    @Override
    public List<TcAccountContactHistory> selectTcAccountContactHistoryList(TcAccountContactHistory tcAccountContactHistory)
    {
        return tcAccountContactHistoryMapper.selectTcAccountContactHistoryList(tcAccountContactHistory);
    }

    /**
     * 新增客户（组织）联系人履历
     * 
     * @param tcAccountContactHistory 客户（组织）联系人履历
     * @return 结果
     */
    @Override
    public int insertTcAccountContactHistory(TcAccountContactHistory tcAccountContactHistory)
    {
        tcAccountContactHistory.setCreateTime(DateUtils.getNowDate());
        return tcAccountContactHistoryMapper.insertTcAccountContactHistory(tcAccountContactHistory);
    }

    /**
     * 修改客户（组织）联系人履历
     * 
     * @param tcAccountContactHistory 客户（组织）联系人履历
     * @return 结果
     */
    @Override
    public int updateTcAccountContactHistory(TcAccountContactHistory tcAccountContactHistory)
    {
        tcAccountContactHistory.setUpdateTime(DateUtils.getNowDate());
        return tcAccountContactHistoryMapper.updateTcAccountContactHistory(tcAccountContactHistory);
    }

    /**
     * 批量删除客户（组织）联系人履历
     * 
     * @param contactIds 需要删除的客户（组织）联系人履历主键
     * @return 结果
     */
    @Override
    public int deleteTcAccountContactHistoryByContactIds(Long[] contactIds)
    {
        return tcAccountContactHistoryMapper.deleteTcAccountContactHistoryByContactIds(contactIds);
    }

    /**
     * 删除客户（组织）联系人履历信息
     * 
     * @param contactId 客户（组织）联系人履历主键
     * @return 结果
     */
    @Override
    public int deleteTcAccountContactHistoryByContactId(Long contactId)
    {
        return tcAccountContactHistoryMapper.deleteTcAccountContactHistoryByContactId(contactId);
    }
}
