package com.inspect.patrol.service.impl;

import com.inspect.base.core.utils.DateUtils;
import com.inspect.patrol.domain.PatrolPresetAction;
import com.inspect.patrol.mapper.PatrolPresetActionMapper;
import com.inspect.patrol.service.IPatrolPresetActionService;

import java.util.List;

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

@Service
public class PatrolPresetActionServiceImpl implements IPatrolPresetActionService {
    private final PatrolPresetActionMapper patrolPresetActionMapper;

    public PatrolPresetActionServiceImpl(PatrolPresetActionMapper patrolPresetActionMapper) {
        this.patrolPresetActionMapper = patrolPresetActionMapper;
    }

    public List<PatrolPresetAction> selectPatrolPresetActionByPatrolPresetPosId(Long patrolPresetActionId) {
        return this.patrolPresetActionMapper.selectPatrolPresetActionByPatrolPresetPosId(patrolPresetActionId);
    }

    public List<PatrolPresetAction> selectPatrolPresetActionList(PatrolPresetAction patrolPresetAction) {
        return this.patrolPresetActionMapper.selectPatrolPresetActionList(patrolPresetAction);
    }

    public int insertPatrolPresetAction(PatrolPresetAction patrolPresetAction) {
        patrolPresetAction.setCreateTime(DateUtils.getNowDate());
        return this.patrolPresetActionMapper.insertPatrolPresetAction(patrolPresetAction);
    }

    public int updatePatrolPresetAction(PatrolPresetAction patrolPresetAction) {
        return this.patrolPresetActionMapper.updatePatrolPresetAction(patrolPresetAction);
    }

    public int deletePatrolPresetActionByPatrolPresetActionIds(Long[] patrolPresetActionIds) {
        return this.patrolPresetActionMapper.deletePatrolPresetActionByPatrolPresetPosIds(patrolPresetActionIds);
    }

    public int deletePatrolPresetActionByPatrolPresetActionId(Long patrolPresetActionId) {
        return this.patrolPresetActionMapper.deletePatrolPresetActionByPatrolPresetActionId(patrolPresetActionId);
    }
}
