package com.fs.crm.service.impl;

import com.fs.common.utils.DateUtils;
import com.fs.crm.domain.CrmCustomerLogs;
import com.fs.crm.mapper.CrmCustomerLogsMapper;
import com.fs.crm.param.CrmCustomerLogsListQueryParam;
import com.fs.crm.service.ICrmCustomerLogsService;
import com.fs.crm.vo.CrmCustomerLogsListQueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客户日志Service业务层处理
 *
 * @author fs
 * @date 2022-12-21
 */
@Service
public class CrmCustomerLogsServiceImpl implements ICrmCustomerLogsService
{
    @Autowired
    private CrmCustomerLogsMapper crmCustomerLogsMapper;

    /**
     * 查询客户日志
     *
     * @param logsId 客户日志ID
     * @return 客户日志
     */
    @Override
    public CrmCustomerLogs selectCrmCustomerLogsById(Long logsId)
    {
        return crmCustomerLogsMapper.selectCrmCustomerLogsById(logsId);
    }

    /**
     * 查询客户日志列表
     *
     * @param crmCustomerLogs 客户日志
     * @return 客户日志
     */
    @Override
    public List<CrmCustomerLogs> selectCrmCustomerLogsList(CrmCustomerLogs crmCustomerLogs)
    {
        return crmCustomerLogsMapper.selectCrmCustomerLogsList(crmCustomerLogs);
    }

    /**
     * 新增客户日志
     *
     * @param crmCustomerLogs 客户日志
     * @return 结果
     */
    @Override
    public int insertCrmCustomerLogs(CrmCustomerLogs crmCustomerLogs)
    {
        crmCustomerLogs.setCreateTime(DateUtils.getNowDate());
        return crmCustomerLogsMapper.insertCrmCustomerLogs(crmCustomerLogs);
    }

    /**
     * 修改客户日志
     *
     * @param crmCustomerLogs 客户日志
     * @return 结果
     */
    @Override
    public int updateCrmCustomerLogs(CrmCustomerLogs crmCustomerLogs)
    {
        return crmCustomerLogsMapper.updateCrmCustomerLogs(crmCustomerLogs);
    }

    /**
     * 批量删除客户日志
     *
     * @param logsIds 需要删除的客户日志ID
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerLogsByIds(Long[] logsIds)
    {
        return crmCustomerLogsMapper.deleteCrmCustomerLogsByIds(logsIds);
    }

    /**
     * 删除客户日志信息
     *
     * @param logsId 客户日志ID
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerLogsById(Long logsId)
    {
        return crmCustomerLogsMapper.deleteCrmCustomerLogsById(logsId);
    }

    @Override
    public List<CrmCustomerLogsListQueryVO> selectCrmCustomerLogsListQuery(CrmCustomerLogsListQueryParam param) {
        return crmCustomerLogsMapper.selectCrmCustomerLogsListQuery(param);
    }
}
