package com.inspect.patrol.service.impl;

import com.inspect.base.core.utils.DateUtils;
import com.inspect.patrol.domain.PatrolPresetRecord;
import com.inspect.patrol.mapper.PatrolPresetRecordMapper;
import com.inspect.patrol.service.IPatrolPresetRecordService;

import java.util.List;

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

@Service
public class PatrolPresetRecordServiceImpl implements IPatrolPresetRecordService {
    private final PatrolPresetRecordMapper patrolPresetRecordMapper;

    public PatrolPresetRecordServiceImpl(PatrolPresetRecordMapper patrolPresetRecordMapper) {
        this.patrolPresetRecordMapper = patrolPresetRecordMapper;
    }

    public PatrolPresetRecord selectPatrolPresetRecordByPresetRecordId(Long presetRecordId) {
        return this.patrolPresetRecordMapper.selectPatrolPresetRecordByPresetRecordId(presetRecordId);
    }

    public List<PatrolPresetRecord> selectPatrolPresetRecordList(PatrolPresetRecord patrolPresetRecord) {
        return this.patrolPresetRecordMapper.selectPatrolPresetRecordList(patrolPresetRecord);
    }

    public int insertPatrolPresetRecord(PatrolPresetRecord patrolPresetRecord) {
        patrolPresetRecord.setCreateTime(DateUtils.getNowDate());
        return this.patrolPresetRecordMapper.insertPatrolPresetRecord(patrolPresetRecord);
    }

    public int updatePatrolPresetRecord(PatrolPresetRecord patrolPresetRecord) {
        patrolPresetRecord.setUpdateTime(DateUtils.getNowDate());
        return this.patrolPresetRecordMapper.updatePatrolPresetRecord(patrolPresetRecord);
    }

    public int deletePatrolPresetRecordByPresetRecordIds(Long[] presetRecordIds) {
        return this.patrolPresetRecordMapper.deletePatrolPresetRecordByPresetRecordIds(presetRecordIds);
    }

    public int deletePatrolPresetRecordByPresetRecordId(Long presetRecordId) {
        return this.patrolPresetRecordMapper.deletePatrolPresetRecordByPresetRecordId(presetRecordId);
    }
}
