package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ClewVideoMapper;
import com.ruoyi.system.domain.ClewVideo;
import com.ruoyi.system.service.IClewVideoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 线索视频Service业务层处理
 *
 * @author ruoyi
 * @date 2023-11-06
 */
@Service
public class ClewVideoServiceImpl implements IClewVideoService
{
    @Autowired
    private ClewVideoMapper clewVideoMapper;

    /**
     * 查询线索视频
     *
     * @param id 线索视频主键
     * @return 线索视频
     */
    @Override
    public ClewVideo selectClewVideoById(Long id)
    {
        return clewVideoMapper.selectClewVideoById(id);
    }

    /**
     * 查询线索视频列表
     *
     * @param clewVideo 线索视频
     * @return 线索视频
     */
    @Override
    public List<ClewVideo> selectClewVideoList(ClewVideo clewVideo)
    {
        return clewVideoMapper.selectClewVideoList(clewVideo);
    }

    /**
     * 新增线索视频
     *
     * @param clewVideo 线索视频
     * @return 结果
     */
    @Override
    public int insertClewVideo(ClewVideo clewVideo)
    {
        clewVideo.setCreateTime(DateUtils.getNowDate());
        return clewVideoMapper.insertClewVideo(clewVideo);
    }

    /**
     * 修改线索视频
     *
     * @param clewVideo 线索视频
     * @return 结果
     */
    @Override
    public int updateClewVideo(ClewVideo clewVideo)
    {
        clewVideo.setUpdateTime(DateUtils.getNowDate());
        return clewVideoMapper.updateClewVideo(clewVideo);
    }

    /**
     * 批量删除线索视频
     *
     * @param ids 需要删除的线索视频主键
     * @return 结果
     */
    @Override
    public int deleteClewVideoByIds(String ids)
    {
        return clewVideoMapper.deleteClewVideoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除线索视频信息
     *
     * @param id 线索视频主键
     * @return 结果
     */
    @Override
    public int deleteClewVideoById(Long id)
    {
        return clewVideoMapper.deleteClewVideoById(id);
    }
}
