package com.younike.system.service.impl;

import com.younike.system.domain.ServerUser;
import com.younike.system.mapper.ServerUserMapper;
import com.younike.system.service.IServerUserService;
import com.younike.system.service.IServerUserServiceForMerchant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 服务人员Service业务层处理
 *
 * @author jubs
 * @date 2022-01-05
 */
@Service
public class ServerUserServiceImplForMerchant implements IServerUserServiceForMerchant {
    @Autowired
    private ServerUserMapper serverUserMapper;

    /**
     * 查询服务人员
     *
     * @param serverId 服务人员主键
     * @return 服务人员
     */
    @Override
    public ServerUser selectServerUserByServerId(Long serverId)
    {
        return serverUserMapper.selectServerUserByServerId(serverId);
    }

    /**
     * 查询服务人员列表
     *
     * @param serverUser 服务人员
     * @return 服务人员
     */
    @Override
    public List<ServerUser> selectServerUserList(ServerUser serverUser)
    {
        return serverUserMapper.selectServerUserList(serverUser);
    }

    /**
     * 新增服务人员
     *
     * @param serverUser 服务人员
     * @return 结果
     */
    @Override
    public int insertServerUser(ServerUser serverUser)
    {
//        serverUser.setCreateTime(DateUtils.getNowDate());
        return serverUserMapper.insertServerUser(serverUser);
    }

    /**
     * 修改服务人员
     *
     * @param serverUser 服务人员
     * @return 结果
     */
    @Override
    public int updateServerUser(ServerUser serverUser)
    {
//        serverUser.setUpdateTime(DateUtils.getNowDate());
        return serverUserMapper.updateServerUser(serverUser);
    }

    /**
     * 批量删除服务人员
     *
     * @param serverIds 需要删除的服务人员主键
     * @return 结果
     */
    @Override
    public int deleteServerUserByServerIds(Long[] serverIds)
    {
        return serverUserMapper.deleteServerUserByServerIds(serverIds);
    }

    /**
     * 删除服务人员信息
     *
     * @param serverId 服务人员主键
     * @return 结果
     */
    @Override
    public int deleteServerUserByServerId(Long serverId)
    {
        return serverUserMapper.deleteServerUserByServerId(serverId);
    }
}
