package com.inspect.patrol.service.impl;

import com.inspect.base.core.utils.DateUtils;
import com.inspect.patrol.domain.PatrolLinkageStrategyRef;
import com.inspect.patrol.mapper.PatrolLinkageStrategyRefMapper;
import com.inspect.patrol.service.IPatrolLinkageStrategyRefService;

import java.util.List;

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

@Service
public class PatrolLinkageStrategyRefServiceImpl implements IPatrolLinkageStrategyRefService {
    private final PatrolLinkageStrategyRefMapper patrolLinkageStrategyRefMapper;

    public PatrolLinkageStrategyRefServiceImpl(PatrolLinkageStrategyRefMapper patrolLinkageStrategyRefMapper) {
        this.patrolLinkageStrategyRefMapper = patrolLinkageStrategyRefMapper;
    }

    public PatrolLinkageStrategyRef selectPatrolLinkageStrategyRefByLinkageStrategyRefId(Long linkageStrategyRefId) {
        return this.patrolLinkageStrategyRefMapper.selectPatrolLinkageStrategyRefByLinkageStrategyRefId(linkageStrategyRefId);
    }

    public List<PatrolLinkageStrategyRef> selectPatrolLinkageStrategyRefList(PatrolLinkageStrategyRef patrolLinkageStrategyRef) {
        return this.patrolLinkageStrategyRefMapper.selectPatrolLinkageStrategyRefList(patrolLinkageStrategyRef);
    }

    public int insertPatrolLinkageStrategyRef(PatrolLinkageStrategyRef patrolLinkageStrategyRef) {
        patrolLinkageStrategyRef.setCreateTime(DateUtils.getNowDate());
        return this.patrolLinkageStrategyRefMapper.insertPatrolLinkageStrategyRef(patrolLinkageStrategyRef);
    }

    public int updatePatrolLinkageStrategyRef(PatrolLinkageStrategyRef patrolLinkageStrategyRef) {
        return this.patrolLinkageStrategyRefMapper.updatePatrolLinkageStrategyRef(patrolLinkageStrategyRef);
    }

    public int deletePatrolLinkageStrategyRefByLinkageStrategyRefIds(Long[] linkageStrategyRefIds) {
        return this.patrolLinkageStrategyRefMapper.deletePatrolLinkageStrategyRefByLinkageStrategyRefIds(linkageStrategyRefIds);
    }

    public int deletePatrolLinkageStrategyRefByLinkageStrategyRefId(Long linkageStrategyRefId) {
        return this.patrolLinkageStrategyRefMapper.deletePatrolLinkageStrategyRefByLinkageStrategyRefId(linkageStrategyRefId);
    }
}
