package com.fs.crm.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.crm.param.CrmEventListQueryParam;
import com.fs.crm.vo.CrmEventListQueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.crm.mapper.CrmEventMapper;
import com.fs.crm.domain.CrmEvent;
import com.fs.crm.service.ICrmEventService;

/**
 * 代办事项Service业务层处理
 * 
 * @author fs
 * @date 2022-12-21
 */
@Service
public class CrmEventServiceImpl implements ICrmEventService 
{
    @Autowired
    private CrmEventMapper crmEventMapper;

    /**
     * 查询代办事项
     * 
     * @param eventId 代办事项ID
     * @return 代办事项
     */
    @Override
    public CrmEvent selectCrmEventById(Long eventId)
    {
        return crmEventMapper.selectCrmEventById(eventId);
    }

    /**
     * 查询代办事项列表
     * 
     * @param crmEvent 代办事项
     * @return 代办事项
     */
    @Override
    public List<CrmEvent> selectCrmEventList(CrmEvent crmEvent)
    {
        return crmEventMapper.selectCrmEventList(crmEvent);
    }

    /**
     * 新增代办事项
     * 
     * @param crmEvent 代办事项
     * @return 结果
     */
    @Override
    public int insertCrmEvent(CrmEvent crmEvent)
    {
        crmEvent.setCreateTime(DateUtils.getNowDate());
        return crmEventMapper.insertCrmEvent(crmEvent);
    }

    /**
     * 修改代办事项
     * 
     * @param crmEvent 代办事项
     * @return 结果
     */
    @Override
    public int updateCrmEvent(CrmEvent crmEvent)
    {
        crmEvent.setUpdateTime(DateUtils.getNowDate());
        return crmEventMapper.updateCrmEvent(crmEvent);
    }

    /**
     * 批量删除代办事项
     * 
     * @param eventIds 需要删除的代办事项ID
     * @return 结果
     */
    @Override
    public int deleteCrmEventByIds(Long[] eventIds)
    {
        return crmEventMapper.deleteCrmEventByIds(eventIds);
    }

    /**
     * 删除代办事项信息
     * 
     * @param eventId 代办事项ID
     * @return 结果
     */
    @Override
    public int deleteCrmEventById(Long eventId)
    {
        return crmEventMapper.deleteCrmEventById(eventId);
    }

    @Override
    public List<CrmEventListQueryVO> selectCrmEventListQuery(CrmEventListQueryParam param) {
        return crmEventMapper.selectCrmEventListQuery(param);
    }
}
