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

/**
 * @Date: 2024-03-17
 * @Author: 但星霖
 * @Version: v1.0
 * @Description: 短剧任务收益Service业务层处理
 */
@Service
public class PlayletRevenueRecordServiceImpl extends ServiceImpl<PlayletRevenueRecordMapper, PlayletRevenueRecord> implements IPlayletRevenueRecordService {

    @Autowired
    private PlayletRevenueRecordMapper playletRevenueRecordMapper;

    /**
     * 查询短剧任务收益
     *
     * @param id 短剧任务收益主键
     * @return 短剧任务收益
     */
    @Override
    public PlayletRevenueRecord selectPlayletRevenueRecordById(Long id) {
        return playletRevenueRecordMapper.selectPlayletRevenueRecordById(id);
    }

    /**
     * 查询短剧任务收益列表
     *
     * @param playletRevenueRecord 短剧任务收益
     * @return 短剧任务收益
     */
    @Override
    public List<PlayletRevenueRecord> selectPlayletRevenueRecordList(PlayletRevenueRecord playletRevenueRecord) {
        return playletRevenueRecordMapper.selectPlayletRevenueRecordList(playletRevenueRecord);
    }

    /**
     * 新增短剧任务收益
     *
     * @param playletRevenueRecord 短剧任务收益
     * @return 结果
     */
    @Override
    public int insertPlayletRevenueRecord(PlayletRevenueRecord playletRevenueRecord) {
        playletRevenueRecord.setCreateTime(DateUtils.getNowDate());
        return playletRevenueRecordMapper.insertPlayletRevenueRecord(playletRevenueRecord);
    }

    /**
     * 修改短剧任务收益
     *
     * @param playletRevenueRecord 短剧任务收益
     * @return 结果
     */
    @Override
    public int updatePlayletRevenueRecord(PlayletRevenueRecord playletRevenueRecord) {
        playletRevenueRecord.setUpdateTime(DateUtils.getNowDate());
        return playletRevenueRecordMapper.updatePlayletRevenueRecord(playletRevenueRecord);
    }

    /**
     * 批量删除短剧任务收益
     *
     * @param ids 需要删除的短剧任务收益主键
     * @return 结果
     */
    @Override
    public int deletePlayletRevenueRecordByIds(String ids) {
        return playletRevenueRecordMapper.deletePlayletRevenueRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除短剧任务收益信息
     *
     * @param id 短剧任务收益主键
     * @return 结果
     */
    @Override
    public int deletePlayletRevenueRecordById(Long id) {
        return playletRevenueRecordMapper.deletePlayletRevenueRecordById(id);
    }
}
