package com.ruoyi.system.service.impl;
|
|
import java.util.List;
|
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import com.ruoyi.system.mapper.SysContactMapper;
|
import com.ruoyi.system.domain.SysContact;
|
import com.ruoyi.system.service.ISysContactService;
|
|
/**
|
* 联系人Service业务层处理
|
*
|
* @author ruoyi
|
* @date 2024-06-17
|
*/
|
@Service
|
public class SysContactServiceImpl implements ISysContactService
|
{
|
@Autowired
|
private SysContactMapper sysContactMapper;
|
|
/**
|
* 查询联系人
|
*
|
* @param id 联系人主键
|
* @return 联系人
|
*/
|
@Override
|
public SysContact selectSysContactById(Long id)
|
{
|
return sysContactMapper.selectSysContactById(id);
|
}
|
|
/**
|
* 查询联系人列表
|
*
|
* @param sysContact 联系人
|
* @return 联系人
|
*/
|
@Override
|
public List<SysContact> selectSysContactList(SysContact sysContact)
|
{
|
sysContact.setUserId(SecurityUtils.getUserId());
|
return sysContactMapper.selectSysContactList(sysContact);
|
}
|
|
/**
|
* 新增联系人
|
*
|
* @param sysContact 联系人
|
* @return 结果
|
*/
|
@Override
|
public int insertSysContact(SysContact sysContact)
|
{
|
Long userId = SecurityUtils.getUserId();
|
sysContact.setUserId(userId);
|
sysContact.setCreateTime(DateUtils.getNowDate());
|
return sysContactMapper.insertSysContact(sysContact);
|
}
|
|
/**
|
* 修改联系人
|
*
|
* @param sysContact 联系人
|
* @return 结果
|
*/
|
@Override
|
public int updateSysContact(SysContact sysContact)
|
{
|
return sysContactMapper.updateSysContact(sysContact);
|
}
|
|
/**
|
* 批量删除联系人
|
*
|
* @param ids 需要删除的联系人主键
|
* @return 结果
|
*/
|
@Override
|
public int deleteSysContactByIds(Long[] ids)
|
{
|
return sysContactMapper.deleteSysContactByIds(ids);
|
}
|
|
/**
|
* 删除联系人信息
|
*
|
* @param id 联系人主键
|
* @return 结果
|
*/
|
@Override
|
public int deleteSysContactById(Long id)
|
{
|
return sysContactMapper.deleteSysContactById(id);
|
}
|
}
|