package com.dsk.system.service.impl;

import java.util.List;

import com.dsk.common.core.domain.entity.BusinessUser;
import com.dsk.common.utils.DateUtils;
import com.dsk.system.mapper.BusinessUserMapper;
import com.dsk.system.service.IBusinessUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 项目用户关联Service业务层处理
 *
 * @author lxl
 * @date 2023-05-17
 */
@Service
public class BusinessUserServiceImpl implements IBusinessUserService
{
    @Autowired
    private BusinessUserMapper businessUserMapper;

    /**
     * 查询项目用户关联
     *
     * @param id 项目用户关联主键
     * @return 项目用户关联
     */
    @Override
    public BusinessUser selectBusinessUserById(Long id)
    {
        return businessUserMapper.selectBusinessUserById(id);
    }

    /**
     * 查询项目用户关联列表
     *
     * @param businessUser 项目用户关联
     * @return 项目用户关联
     */
    @Override
    public List<BusinessUser> selectBusinessUserList(BusinessUser businessUser)
    {
        return businessUserMapper.selectBusinessUserList(businessUser);
    }

    /**
     * 新增项目用户关联
     *
     * @param businessUser 项目用户关联
     * @return 结果
     */
    @Override
    public int insertBusinessUser(BusinessUser businessUser)
    {
        businessUser.setCreateTime(DateUtils.getNowDate());
        return businessUserMapper.insertBusinessUser(businessUser);
    }

    /**
     * 修改项目用户关联
     *
     * @param businessUser 项目用户关联
     * @return 结果
     */
    @Override
    public int updateBusinessUser(BusinessUser businessUser)
    {
        businessUser.setUpdateTime(DateUtils.getNowDate());
        return businessUserMapper.updateBusinessUser(businessUser);
    }

    /**
     * 批量删除项目用户关联
     *
     * @param ids 需要删除的项目用户关联主键
     * @return 结果
     */
    @Override
    public int deleteBusinessUserByIds(Long[] ids)
    {
        return businessUserMapper.deleteBusinessUserByIds(ids);
    }

    /**
     * 删除项目用户关联信息
     *
     * @param id 项目用户关联主键
     * @return 结果
     */
    @Override
    public int deleteBusinessUserById(Long id)
    {
        return businessUserMapper.deleteBusinessUserByBusinessId(id);
    }
}
