package com.playlet.system.service.impl;

import java.util.List;
import com.playlet.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.playlet.system.mapper.PlayletUserExpandAccountMapper;
import com.playlet.system.domain.PlayletUserExpandAccount;
import com.playlet.system.service.IPlayletUserExpandAccountService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 用户外部账号Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-14
 */
@Service
public class PlayletUserExpandAccountServiceImpl extends ServiceImpl<PlayletUserExpandAccountMapper, PlayletUserExpandAccount> implements IPlayletUserExpandAccountService
{
    @Autowired
    private PlayletUserExpandAccountMapper playletUserExpandAccountMapper;

    /**
     * 查询用户外部账号
     *
     * @param id 用户外部账号主键
     * @return 用户外部账号
     */
    @Override
    public PlayletUserExpandAccount selectPlayletUserExpandAccountById(Long id)
    {
        return playletUserExpandAccountMapper.selectPlayletUserExpandAccountById(id);
    }

    /**
     * 查询用户外部账号列表
     *
     * @param playletUserExpandAccount 用户外部账号
     * @return 用户外部账号
     */
    @Override
    public List<PlayletUserExpandAccount> selectPlayletUserExpandAccountList(PlayletUserExpandAccount playletUserExpandAccount)
    {
        return playletUserExpandAccountMapper.selectPlayletUserExpandAccountList(playletUserExpandAccount);
    }

    /**
     * 新增用户外部账号
     *
     * @param playletUserExpandAccount 用户外部账号
     * @return 结果
     */
    @Override
    public int insertPlayletUserExpandAccount(PlayletUserExpandAccount playletUserExpandAccount)
    {
        playletUserExpandAccount.setCreateTime(DateUtils.getNowDate());
        return playletUserExpandAccountMapper.insertPlayletUserExpandAccount(playletUserExpandAccount);
    }

    /**
     * 修改用户外部账号
     *
     * @param playletUserExpandAccount 用户外部账号
     * @return 结果
     */
    @Override
    public int updatePlayletUserExpandAccount(PlayletUserExpandAccount playletUserExpandAccount)
    {
        playletUserExpandAccount.setUpdateTime(DateUtils.getNowDate());
        return playletUserExpandAccountMapper.updatePlayletUserExpandAccount(playletUserExpandAccount);
    }

    /**
     * 批量删除用户外部账号
     *
     * @param ids 需要删除的用户外部账号主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserExpandAccountByIds(String ids)
    {
        return playletUserExpandAccountMapper.deletePlayletUserExpandAccountByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户外部账号信息
     *
     * @param id 用户外部账号主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserExpandAccountById(Long id)
    {
        return playletUserExpandAccountMapper.deletePlayletUserExpandAccountById(id);
    }
}
