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

/**
 * 剧场列Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-18
 */
@Service
public class PlayletItemTypeServiceImpl extends ServiceImpl<PlayletItemTypeMapper, PlayletItemType> implements IPlayletItemTypeService
{
    @Autowired
    private PlayletItemTypeMapper playletItemTypeMapper;

    /**
     * 查询剧场列
     *
     * @param id 剧场列主键
     * @return 剧场列
     */
    @Override
    public PlayletItemType selectPlayletItemTypeById(Long id)
    {
        return playletItemTypeMapper.selectPlayletItemTypeById(id);
    }

    /**
     * 查询剧场列列表
     *
     * @param playletItemType 剧场列
     * @return 剧场列
     */
    @Override
    public List<PlayletItemType> selectPlayletItemTypeList(PlayletItemType playletItemType)
    {
        return playletItemTypeMapper.selectPlayletItemTypeList(playletItemType);
    }

    /**
     * 新增剧场列
     *
     * @param playletItemType 剧场列
     * @return 结果
     */
    @Override
    public int insertPlayletItemType(PlayletItemType playletItemType)
    {
        playletItemType.setCreateTime(DateUtils.getNowDate());
        return playletItemTypeMapper.insertPlayletItemType(playletItemType);
    }

    /**
     * 修改剧场列
     *
     * @param playletItemType 剧场列
     * @return 结果
     */
    @Override
    public int updatePlayletItemType(PlayletItemType playletItemType)
    {
        playletItemType.setUpdateTime(DateUtils.getNowDate());
        return playletItemTypeMapper.updatePlayletItemType(playletItemType);
    }

    /**
     * 批量删除剧场列
     *
     * @param ids 需要删除的剧场列主键
     * @return 结果
     */
    @Override
    public int deletePlayletItemTypeByIds(String ids)
    {
        return playletItemTypeMapper.deletePlayletItemTypeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除剧场列信息
     *
     * @param id 剧场列主键
     * @return 结果
     */
    @Override
    public int deletePlayletItemTypeById(Long id)
    {
        return playletItemTypeMapper.deletePlayletItemTypeById(id);
    }
}
