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

import com.inspect.metadata.patrolpointmnt.domain.BasedataPatrolType;
import com.inspect.metadata.patrolpointmnt.mapper.BasedataPatrolTypeMapper;
import com.inspect.metadata.patrolpointmnt.service.IBasedataPatrolTypeService;
import com.inspect.base.core.utils.DateUtils;

import java.util.List;

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

@Service
public class BasedataPatrolTypeServiceImpl implements IBasedataPatrolTypeService {
    private final BasedataPatrolTypeMapper basedataPatrolTypeMapper;

    public BasedataPatrolTypeServiceImpl(BasedataPatrolTypeMapper basedataPatrolTypeMapper) {
        this.basedataPatrolTypeMapper = basedataPatrolTypeMapper;
    }

    public BasedataPatrolType selectBasedataPatrolTypeByPatrolTypeId(Long patrolTypeId) {
        return this.basedataPatrolTypeMapper.selectBasedataPatrolTypeByPatrolTypeId(patrolTypeId);
    }

    public List<BasedataPatrolType> selectBasedataPatrolTypeList(BasedataPatrolType basedataPatrolType) {
        return this.basedataPatrolTypeMapper.selectBasedataPatrolTypeList(basedataPatrolType);
    }

    public int insertBasedataPatrolType(BasedataPatrolType basedataPatrolType) {
        basedataPatrolType.setCreateTime(DateUtils.getNowDate());
        return this.basedataPatrolTypeMapper.insertBasedataPatrolType(basedataPatrolType);
    }

    public int updateBasedataPatrolType(BasedataPatrolType basedataPatrolType) {
        basedataPatrolType.setUpdateTime(DateUtils.getNowDate());
        return this.basedataPatrolTypeMapper.updateBasedataPatrolType(basedataPatrolType);
    }

    public int deleteBasedataPatrolTypeByPatrolTypeIds(Long[] patrolTypeIds) {
        return this.basedataPatrolTypeMapper.deleteBasedataPatrolTypeByPatrolTypeIds(patrolTypeIds);
    }

    public int deleteBasedataPatrolTypeByPatrolTypeId(Long patrolTypeId) {
        return this.basedataPatrolTypeMapper.deleteBasedataPatrolTypeByPatrolTypeId(patrolTypeId);
    }
}
