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.TcAccountRelation;
import com.ruoyi.project.business.mapper.TcAccountRelationMapper;
import com.ruoyi.project.business.service.ITcAccountRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 组织(客户)合并关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-22
 */
@Service
public class TcAccountRelationServiceImpl extends ServiceImpl<TcAccountRelationMapper, TcAccountRelation> implements ITcAccountRelationService
{
    @Autowired
    private TcAccountRelationMapper tcAccountRelationMapper;

    /**
     * 查询组织(客户)合并关系
     * 
     * @param id 组织(客户)合并关系主键
     * @return 组织(客户)合并关系
     */
    @Override
    public TcAccountRelation selectTcAccountRelationById(Long id)
    {
        return tcAccountRelationMapper.selectTcAccountRelationById(id);
    }

    /**
     * 查询组织(客户)合并关系列表
     * 
     * @param tcAccountRelation 组织(客户)合并关系
     * @return 组织(客户)合并关系
     */
    @Override
    public List<TcAccountRelation> selectTcAccountRelationList(TcAccountRelation tcAccountRelation)
    {
        return tcAccountRelationMapper.selectTcAccountRelationList(tcAccountRelation);
    }

    /**
     * 新增组织(客户)合并关系
     * 
     * @param tcAccountRelation 组织(客户)合并关系
     * @return 结果
     */
    @Override
    public int insertTcAccountRelation(TcAccountRelation tcAccountRelation)
    {
        tcAccountRelation.setCreateTime(DateUtils.getNowDate());
        return tcAccountRelationMapper.insertTcAccountRelation(tcAccountRelation);
    }

    /**
     * 修改组织(客户)合并关系
     * 
     * @param tcAccountRelation 组织(客户)合并关系
     * @return 结果
     */
    @Override
    public int updateTcAccountRelation(TcAccountRelation tcAccountRelation)
    {
        tcAccountRelation.setUpdateTime(DateUtils.getNowDate());
        return tcAccountRelationMapper.updateTcAccountRelation(tcAccountRelation);
    }

    /**
     * 批量删除组织(客户)合并关系
     * 
     * @param ids 需要删除的组织(客户)合并关系主键
     * @return 结果
     */
    @Override
    public int deleteTcAccountRelationByIds(Long[] ids)
    {
        return tcAccountRelationMapper.deleteTcAccountRelationByIds(ids);
    }

    /**
     * 删除组织(客户)合并关系信息
     * 
     * @param id 组织(客户)合并关系主键
     * @return 结果
     */
    @Override
    public int deleteTcAccountRelationById(Long id)
    {
        return tcAccountRelationMapper.deleteTcAccountRelationById(id);
    }
}
