package com.inspect.patrol.service.impl;

import com.inspect.base.core.utils.DateUtils;
import com.inspect.patrol.domain.PatrolVideotape;
import com.inspect.patrol.domain.PatrolVideotapeListModel;
import com.inspect.patrol.mapper.PatrolVideotapeMapper;
import com.inspect.patrol.service.IPatrolVideotapeService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PatrolVideotapeServiceImpl implements IPatrolVideotapeService {
    private final PatrolVideotapeMapper patrolVideotapeMapper;

    public PatrolVideotapeServiceImpl(PatrolVideotapeMapper patrolVideotapeMapper) {
        this.patrolVideotapeMapper = patrolVideotapeMapper;
    }

    public PatrolVideotape selectPatrolVideotapeByVideotapeId(Long videotapeId) {
        return this.patrolVideotapeMapper.selectPatrolVideotapeByVideotapeId(videotapeId);
    }

    public List<PatrolVideotape> selectPatrolVideotapeList(PatrolVideotapeListModel patrolVideotapeListModel) {
        return this.patrolVideotapeMapper.selectPatrolVideotapeList(patrolVideotapeListModel);
    }

    public int insertPatrolVideotape(PatrolVideotape patrolVideotape) {
        patrolVideotape.setCreateTime(DateUtils.getNowDate());
        return this.patrolVideotapeMapper.insertPatrolVideotape(patrolVideotape);
    }

    public int updatePatrolVideotape(PatrolVideotape patrolVideotape) {
        return this.patrolVideotapeMapper.updatePatrolVideotape(patrolVideotape);
    }

    public int deletePatrolVideotapeByVideotapeIds(Long[] videotapeIds) {
        return this.patrolVideotapeMapper.deletePatrolVideotapeByVideotapeIds(videotapeIds);
    }

    public int deletePatrolVideotapeByVideotapeId(Long videotapeId) {
        return this.patrolVideotapeMapper.deletePatrolVideotapeByVideotapeId(videotapeId);
    }
}
