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

/**
 * 变现项目Service业务层处理
 *
 * @author clunt
 * @date 2024-03-10
 */
@Service
public class PlayletRealizationProjectServiceImpl extends ServiceImpl<PlayletRealizationProjectMapper, PlayletRealizationProject> implements IPlayletRealizationProjectService
{
    @Autowired
    private PlayletRealizationProjectMapper playletRealizationProjectMapper;

    /**
     * 查询变现项目
     *
     * @param id 变现项目主键
     * @return 变现项目
     */
    @Override
    public PlayletRealizationProject selectPlayletRealizationProjectById(Long id)
    {
        return playletRealizationProjectMapper.selectPlayletRealizationProjectById(id);
    }

    /**
     * 查询变现项目列表
     *
     * @param playletRealizationProject 变现项目
     * @return 变现项目
     */
    @Override
    public List<PlayletRealizationProject> selectPlayletRealizationProjectList(PlayletRealizationProject playletRealizationProject)
    {
        return playletRealizationProjectMapper.selectPlayletRealizationProjectList(playletRealizationProject);
    }

    /**
     * 新增变现项目
     *
     * @param playletRealizationProject 变现项目
     * @return 结果
     */
    @Override
    public int insertPlayletRealizationProject(PlayletRealizationProject playletRealizationProject)
    {
        playletRealizationProject.setCreateTime(DateUtils.getNowDate());
        return playletRealizationProjectMapper.insertPlayletRealizationProject(playletRealizationProject);
    }

    /**
     * 修改变现项目
     *
     * @param playletRealizationProject 变现项目
     * @return 结果
     */
    @Override
    public int updatePlayletRealizationProject(PlayletRealizationProject playletRealizationProject)
    {
        playletRealizationProject.setUpdateTime(DateUtils.getNowDate());
        return playletRealizationProjectMapper.updatePlayletRealizationProject(playletRealizationProject);
    }

    /**
     * 批量删除变现项目
     *
     * @param ids 需要删除的变现项目主键
     * @return 结果
     */
    @Override
    public int deletePlayletRealizationProjectByIds(String ids)
    {
        return playletRealizationProjectMapper.deletePlayletRealizationProjectByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除变现项目信息
     *
     * @param id 变现项目主键
     * @return 结果
     */
    @Override
    public int deletePlayletRealizationProjectById(Long id)
    {
        return playletRealizationProjectMapper.deletePlayletRealizationProjectById(id);
    }
}
