lefengyang
2026-08-09 c71e806d1966a83aad55880c8a456358182a82be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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);
    }
}