package com.inspect.patrol.service.impl;

import com.inspect.base.core.utils.DateUtils;
import com.inspect.patrol.domain.PatrolPresetParam;
import com.inspect.patrol.mapper.PatrolPresetParamMapper;
import com.inspect.patrol.service.IPatrolPresetParamService;

import java.util.List;

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

@Service
public class PatrolPresetParamServiceImpl implements IPatrolPresetParamService {
    private final PatrolPresetParamMapper patrolPresetParamMapper;

    public PatrolPresetParamServiceImpl(PatrolPresetParamMapper patrolPresetParamMapper) {
        this.patrolPresetParamMapper = patrolPresetParamMapper;
    }

    public List<PatrolPresetParam> selectPatrolPresetParamByPosPatrolPresetId(Long posParamId) {
        return this.patrolPresetParamMapper.selectPatrolPresetParamByPosId(posParamId);
    }

    public List<PatrolPresetParam> selectPatrolPresetParamList(PatrolPresetParam patrolPresetParam) {
        return this.patrolPresetParamMapper.selectPatrolPresetParamList(patrolPresetParam);
    }

    public int insertPatrolPresetParam(PatrolPresetParam patrolPresetParam) {
        patrolPresetParam.setCreateTime(DateUtils.getNowDate());
        return this.patrolPresetParamMapper.insertPatrolPresetParam(patrolPresetParam);
    }

    public int updatePatrolPresetParam(PatrolPresetParam patrolPresetParam) {
        return this.patrolPresetParamMapper.updatePatrolPresetParam(patrolPresetParam);
    }

    public int deletePatrolPresetParamByPosParamIds(Long[] posParamIds) {
        return this.patrolPresetParamMapper.deletePatrolPresetParamByPresetPosIds(posParamIds);
    }

    public int deletePatrolPresetParamByPosParamId(Long posParamId) {
        return this.patrolPresetParamMapper.deletePatrolPresetParamByPosParamId(posParamId);
    }
}
