package com.ruoyi.system.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.system.mapper.ClewPhoneMapper;
import com.ruoyi.system.domain.ClewPhone;
import com.ruoyi.system.service.IClewPhoneService;
import com.ruoyi.common.core.text.Convert;

/**
 * 线索手机号Service业务层处理
 *
 * @author ruoyi
 * @date 2023-07-19
 */
@Service
public class ClewPhoneServiceImpl implements IClewPhoneService
{
    @Autowired
    private ClewPhoneMapper clewPhoneMapper;

    /**
     * 查询线索手机号
     *
     * @param id 线索手机号主键
     * @return 线索手机号
     */
    @Override
    public ClewPhone selectClewPhoneById(Long id)
    {
        return clewPhoneMapper.selectClewPhoneById(id);
    }

    /**
     * 查询线索手机号列表
     *
     * @param clewPhone 线索手机号
     * @return 线索手机号
     */
    @Override
    public List<ClewPhone> selectClewPhoneList(ClewPhone clewPhone)
    {
        return clewPhoneMapper.selectClewPhoneList(clewPhone);
    }

    /**
     * 新增线索手机号
     *
     * @param clewPhone 线索手机号
     * @return 结果
     */
    @Override
    public int insertClewPhone(ClewPhone clewPhone)
    {
        clewPhone.setCreateTime(DateUtils.getNowDate());
        return clewPhoneMapper.insertClewPhone(clewPhone);
    }

    /**
     * 修改线索手机号
     *
     * @param clewPhone 线索手机号
     * @return 结果
     */
    @Override
    public int updateClewPhone(ClewPhone clewPhone)
    {
        clewPhone.setUpdateTime(DateUtils.getNowDate());
        return clewPhoneMapper.updateClewPhone(clewPhone);
    }

    /**
     * 批量删除线索手机号
     *
     * @param ids 需要删除的线索手机号主键
     * @return 结果
     */
    @Override
    public int deleteClewPhoneByIds(String ids)
    {
        return clewPhoneMapper.deleteClewPhoneByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除线索手机号信息
     *
     * @param id 线索手机号主键
     * @return 结果
     */
    @Override
    public int deleteClewPhoneById(Long id)
    {
        return clewPhoneMapper.deleteClewPhoneById(id);
    }
}
