package com.ktg.iscs.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import cn.hutool.core.lang.Assert;
import com.ktg.common.core.text.Convert;
import com.ktg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktg.iscs.mapper.IsSopUserMapper;
import com.ktg.iscs.domain.IsSopUser;
import com.ktg.iscs.service.IIsSopUserService;

/**
 * SOP用户Service业务层处理
 *
 * @author cgj
 * @date 2024-11-18
 */
@Service
public class IsSopUserServiceImpl extends ServiceImpl<IsSopUserMapper, IsSopUser> implements IIsSopUserService
{
    @Autowired
    private IsSopUserMapper isSopUserMapper;

    /**
     * 查询SOP用户
     *
     * @param recordId SOP用户主键
     * @return SOP用户
     */
    @Override
    public IsSopUser selectIsSopUserByRecordId(Long recordId)
    {
        return isSopUserMapper.selectIsSopUserByRecordId(recordId);
    }

    /**
     * 查询SOP用户列表
     *
     * @param isSopUser SOP用户
     * @return SOP用户
     */
    @Override
    public List<IsSopUser> selectIsSopUserList(IsSopUser isSopUser)
    {
        return isSopUserMapper.selectIsSopUserList(isSopUser);
    }

    /**
     * 新增SOP用户
     *
     * @param isSopUser SOP用户
     * @return 结果
     */
    @Override
    public int insertIsSopUser(IsSopUser isSopUser)
    {
        isSopUser.setCreateTime(DateUtils.getNowDate());
        return isSopUserMapper.insertIsSopUser(isSopUser);
    }

    /**
     * 修改SOP用户
     *
     * @param isSopUser SOP用户
     * @return 结果
     */
    @Override
    public int updateIsSopUser(IsSopUser isSopUser)
    {
        isSopUser.setUpdateTime(DateUtils.getNowDate());
        return isSopUserMapper.updateIsSopUser(isSopUser);
    }

    /**
     * 批量删除SOP用户
     *
     * @param recordIds 需要删除的SOP用户主键
     * @return 结果
     */
    @Override
    public int deleteIsSopUserByRecordIds(String recordIds)
    {
        Assert.notBlank(recordIds, "请选择需要删除的数据!");
        Long[] longIds = Convert.toLongArray(recordIds);
        return isSopUserMapper.deleteIsSopUserByRecordIds(longIds);
    }

    /**
     * 删除SOP用户信息
     *
     * @param recordId SOP用户主键
     * @return 结果
     */
    @Override
    public int deleteIsSopUserByRecordId(Long recordId)
    {
        return isSopUserMapper.deleteIsSopUserByRecordId(recordId);
    }
}
