package com.ruoyi.ss.customerService.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ss.customerService.mapper.CustomerServiceMapper;
import com.ruoyi.ss.customerService.domain.CustomerService;
import com.ruoyi.ss.customerService.domain.CustomerServiceVO;
import com.ruoyi.ss.customerService.domain.CustomerServiceQuery;
import com.ruoyi.ss.customerService.service.CustomerServiceService;

/**
 * 客服Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-19
 */
@Service
public class CustomerServiceServiceImpl implements CustomerServiceService
{
    @Autowired
    private CustomerServiceMapper customerServiceMapper;

    /**
     * 查询客服
     *
     * @param id 客服主键
     * @return 客服
     */
    @Override
    public CustomerServiceVO selectCustomerServiceById(Long id)
    {
        return customerServiceMapper.selectCustomerServiceById(id);
    }

    /**
     * 查询客服列表
     *
     * @param customerService 客服
     * @return 客服
     */
    @Override
    public List<CustomerServiceVO> selectCustomerServiceList(CustomerServiceQuery customerService)
    {
        return customerServiceMapper.selectCustomerServiceList(customerService);
    }

    /**
     * 新增客服
     *
     * @param customerService 客服
     * @return 结果
     */
    @Override
    public int insertCustomerService(CustomerService customerService)
    {
        customerService.setCreateTime(DateUtils.getNowDate());
        return customerServiceMapper.insertCustomerService(customerService);
    }

    /**
     * 修改客服
     *
     * @param customerService 客服
     * @return 结果
     */
    @Override
    public int updateCustomerService(CustomerService customerService)
    {
        return customerServiceMapper.updateCustomerService(customerService);
    }

    /**
     * 批量删除客服
     *
     * @param ids 需要删除的客服主键
     * @return 结果
     */
    @Override
    public int deleteCustomerServiceByIds(Long[] ids)
    {
        return customerServiceMapper.deleteCustomerServiceByIds(ids);
    }

    /**
     * 删除客服信息
     *
     * @param id 客服主键
     * @return 结果
     */
    @Override
    public int deleteCustomerServiceById(Long id)
    {
        return customerServiceMapper.deleteCustomerServiceById(id);
    }
}
