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.PlayletUserAccountMapper;
import com.playlet.system.domain.PlayletUserAccount;
import com.playlet.system.service.IPlayletUserAccountService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Date: 2024-03-24 15:29
 * @Author: 但星霖
 * @Version: v1.0
 * @Description: 短剧用户提现账户Service业务层处理
 */
@Service
public class PlayletUserAccountServiceImpl extends ServiceImpl<PlayletUserAccountMapper, PlayletUserAccount> implements IPlayletUserAccountService {
    @Autowired
    private PlayletUserAccountMapper playletUserAccountMapper;

    /**
     * 查询短剧用户提现账户
     *
     * @param id 短剧用户提现账户主键
     * @return 短剧用户提现账户
     */
    @Override
    public PlayletUserAccount selectPlayletUserAccountById(Long id) {
        return playletUserAccountMapper.selectPlayletUserAccountById(id);
    }

    /**
     * 查询短剧用户提现账户列表
     *
     * @param playletUserAccount 短剧用户提现账户
     * @return 短剧用户提现账户
     */
    @Override
    public List<PlayletUserAccount> selectPlayletUserAccountList(PlayletUserAccount playletUserAccount) {
        return playletUserAccountMapper.selectPlayletUserAccountList(playletUserAccount);
    }

    /**
     * 新增短剧用户提现账户
     *
     * @param playletUserAccount 短剧用户提现账户
     * @return 结果
     */
    @Override
    public int insertPlayletUserAccount(PlayletUserAccount playletUserAccount) {
        playletUserAccount.setCreateTime(DateUtils.getNowDate());
        return playletUserAccountMapper.insertPlayletUserAccount(playletUserAccount);
    }

    /**
     * 修改短剧用户提现账户
     *
     * @param playletUserAccount 短剧用户提现账户
     * @return 结果
     */
    @Override
    public int updatePlayletUserAccount(PlayletUserAccount playletUserAccount) {
        playletUserAccount.setUpdateTime(DateUtils.getNowDate());
        return playletUserAccountMapper.updatePlayletUserAccount(playletUserAccount);
    }

    /**
     * 批量删除短剧用户提现账户
     *
     * @param ids 需要删除的短剧用户提现账户主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserAccountByIds(String ids) {
        return playletUserAccountMapper.deletePlayletUserAccountByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除短剧用户提现账户信息
     *
     * @param id 短剧用户提现账户主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserAccountById(Long id) {
        return playletUserAccountMapper.deletePlayletUserAccountById(id);
    }
}
