package com.playlet.system.service.impl;

import java.util.List;

import com.playlet.common.utils.DateUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.playlet.system.mapper.PlayletWithdrawApprovalMapper;
import com.playlet.system.domain.PlayletWithdrawApproval;
import com.playlet.system.service.IPlayletWithdrawApprovalService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Date: 2024-03-30 08:35
 * @Author: 但星霖
 * @Version: v1.0
 * @Description: 提现审批Service业务层处理
 */
@Slf4j
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PlayletWithdrawApprovalServiceImpl extends ServiceImpl<PlayletWithdrawApprovalMapper, PlayletWithdrawApproval> implements IPlayletWithdrawApprovalService {

    private final PlayletWithdrawApprovalMapper playletWithdrawApprovalMapper;

    /**
     * 查询提现审批
     *
     * @param id 提现审批主键
     * @return 提现审批
     */
    @Override
    public PlayletWithdrawApproval selectPlayletWithdrawApprovalById(Long id) {
        return playletWithdrawApprovalMapper.selectPlayletWithdrawApprovalById(id);
    }

    /**
     * 查询提现审批列表
     *
     * @param playletWithdrawApproval 提现审批
     * @return 提现审批
     */
    @Override
    public List<PlayletWithdrawApproval> selectPlayletWithdrawApprovalList(PlayletWithdrawApproval playletWithdrawApproval) {
        return playletWithdrawApprovalMapper.selectPlayletWithdrawApprovalList(playletWithdrawApproval);
    }

    /**
     * 新增提现审批
     *
     * @param playletWithdrawApproval 提现审批
     * @return 结果
     */
    @Override
    public int insertPlayletWithdrawApproval(PlayletWithdrawApproval playletWithdrawApproval) {
        playletWithdrawApproval.setCreateTime(DateUtils.getNowDate());
        return playletWithdrawApprovalMapper.insertPlayletWithdrawApproval(playletWithdrawApproval);
    }

    /**
     * 修改提现审批
     *
     * @param playletWithdrawApproval 提现审批
     * @return 结果
     */
    @Override
    public int updatePlayletWithdrawApproval(PlayletWithdrawApproval playletWithdrawApproval) {
        playletWithdrawApproval.setUpdateTime(DateUtils.getNowDate());
        return playletWithdrawApprovalMapper.updatePlayletWithdrawApproval(playletWithdrawApproval);
    }

    /**
     * 批量删除提现审批
     *
     * @param ids 需要删除的提现审批主键
     * @return 结果
     */
    @Override
    public int deletePlayletWithdrawApprovalByIds(String ids) {
        return playletWithdrawApprovalMapper.deletePlayletWithdrawApprovalByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除提现审批信息
     *
     * @param id 提现审批主键
     * @return 结果
     */
    @Override
    public int deletePlayletWithdrawApprovalById(Long id) {
        return playletWithdrawApprovalMapper.deletePlayletWithdrawApprovalById(id);
    }
}
