package com.inspect.metadata.patrolpointmnt.service.impl;

import com.inspect.metadata.patrolpointmnt.domain.BasedataPatrolPointPreset;
import com.inspect.metadata.patrolpointmnt.mapper.BasedataPatrolPointPresetMapper;
import com.inspect.metadata.patrolpointmnt.service.IBasedataPatrolPointPresetService;
import com.inspect.base.core.utils.DateUtils;

import java.util.List;

import org.springframework.stereotype.Service;

@Service
public class BasedataPatrolPointPresetServiceImpl implements IBasedataPatrolPointPresetService {
    private final BasedataPatrolPointPresetMapper basedataPatrolPointPresetMapper;

    public BasedataPatrolPointPresetServiceImpl(BasedataPatrolPointPresetMapper basedataPatrolPointPresetMapper) {
        this.basedataPatrolPointPresetMapper = basedataPatrolPointPresetMapper;
    }

    public BasedataPatrolPointPreset selectBasedataPatrolPointPresetByPatrolPointPresetId(Long patrolpointPresetId) {
        return this.basedataPatrolPointPresetMapper.selectBasedataPatrolPointPresetByPatrolPointPresetId(patrolpointPresetId);
    }

    public List<BasedataPatrolPointPreset> selectBasedataPatrolPointPresetList(BasedataPatrolPointPreset basedataPatrolpointPreset) {
        return this.basedataPatrolPointPresetMapper.selectBasedataPatrolPointPresetList(basedataPatrolpointPreset);
    }

    public int insertBasedataPatrolPointPreset(BasedataPatrolPointPreset basedataPatrolpointPreset) {
        basedataPatrolpointPreset.setCreateTime(DateUtils.getNowDate());
        this.basedataPatrolPointPresetMapper.insertBasedataPatrolPointPreset(basedataPatrolpointPreset);
        return Integer.parseInt(basedataPatrolpointPreset.getPatrolPointPresetId() + "");
    }

    public int updateBasedataPatrolPointPreset(BasedataPatrolPointPreset basedataPatrolpointPreset) {
        basedataPatrolpointPreset.setUpdateTime(DateUtils.getNowDate());
        return this.basedataPatrolPointPresetMapper.updateBasedataPatrolPointPreset(basedataPatrolpointPreset);
    }

    public int deleteBasedataPatrolPointPresetByPatrolPointPresetIds(Long[] patrolpointPresetIds) {
        return this.basedataPatrolPointPresetMapper.deleteBasedataPatrolPointPresetByPatrolPointPresetIds(patrolpointPresetIds);
    }

    public int deleteBasedataPatrolPointPresetByPatrolPointPresetId(Long patrolpointPresetId) {
        return this.basedataPatrolPointPresetMapper.deleteBasedataPatrolPointPresetByPatrolPointPresetId(patrolpointPresetId);
    }

    public BasedataPatrolPointPreset selectBasedataPatrolPointPresetByPatrolPointId(Long patrolpointPresetId) {
        return this.basedataPatrolPointPresetMapper.selectBasedataPatrolPointPresetByPatrolPointId(patrolpointPresetId);
    }
}
