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

/**
 * @Date: 2024-03-25 15:45
 * @Author: 但星霖
 * @Version: v1.0
 * @Description: 用户开票信息Service业务层处理
 */
@Service
public class PlayletUserInvoiceServiceImpl extends ServiceImpl<PlayletUserInvoiceMapper, PlayletUserInvoice> implements IPlayletUserInvoiceService {
    @Autowired
    private PlayletUserInvoiceMapper playletUserInvoiceMapper;

    /**
     * 查询用户开票信息
     *
     * @param id 用户开票信息主键
     * @return 用户开票信息
     */
    @Override
    public PlayletUserInvoice selectPlayletUserInvoiceById(Long id) {
        return playletUserInvoiceMapper.selectPlayletUserInvoiceById(id);
    }

    /**
     * 查询用户开票信息列表
     *
     * @param playletUserInvoice 用户开票信息
     * @return 用户开票信息
     */
    @Override
    public List<PlayletUserInvoice> selectPlayletUserInvoiceList(PlayletUserInvoice playletUserInvoice) {
        return playletUserInvoiceMapper.selectPlayletUserInvoiceList(playletUserInvoice);
    }

    /**
     * 新增用户开票信息
     *
     * @param playletUserInvoice 用户开票信息
     * @return 结果
     */
    @Override
    public int insertPlayletUserInvoice(PlayletUserInvoice playletUserInvoice) {
        playletUserInvoice.setCreateTime(DateUtils.getNowDate());
        return playletUserInvoiceMapper.insertPlayletUserInvoice(playletUserInvoice);
    }

    /**
     * 修改用户开票信息
     *
     * @param playletUserInvoice 用户开票信息
     * @return 结果
     */
    @Override
    public int updatePlayletUserInvoice(PlayletUserInvoice playletUserInvoice) {
        playletUserInvoice.setUpdateTime(DateUtils.getNowDate());
        return playletUserInvoiceMapper.updatePlayletUserInvoice(playletUserInvoice);
    }

    /**
     * 批量删除用户开票信息
     *
     * @param ids 需要删除的用户开票信息主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserInvoiceByIds(String ids) {
        return playletUserInvoiceMapper.deletePlayletUserInvoiceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户开票信息信息
     *
     * @param id 用户开票信息主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserInvoiceById(Long id) {
        return playletUserInvoiceMapper.deletePlayletUserInvoiceById(id);
    }
}