package com.inspect.guideline.service.impl;

import com.inspect.base.core.utils.DateUtils;
import com.inspect.guideline.domain.PatrolGuidelineRule;
import com.inspect.guideline.mapper.PatrolGuidelineRuleMapper;
import com.inspect.guideline.service.IPatrolGuidelineRuleService;

import java.util.List;

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

@Service
public class PatrolGuidelineRuleServiceImpl implements IPatrolGuidelineRuleService {
    private final PatrolGuidelineRuleMapper patrolGuidelineRuleMapper;

    public PatrolGuidelineRuleServiceImpl(PatrolGuidelineRuleMapper patrolGuidelineRuleMapper) {
        this.patrolGuidelineRuleMapper = patrolGuidelineRuleMapper;
    }

    public PatrolGuidelineRule selectPatrolGuidelineRuleByGuidelineRuleId(Long guidelineRuleId) {
        return this.patrolGuidelineRuleMapper.selectPatrolGuidelineRuleByGuidelineRuleId(guidelineRuleId);
    }

    public List<PatrolGuidelineRule> selectPatrolGuidelineRuleList(PatrolGuidelineRule patrolGuidelineRule) {
        return this.patrolGuidelineRuleMapper.selectPatrolGuidelineRuleList(patrolGuidelineRule);
    }

    public int insertPatrolGuidelineRule(PatrolGuidelineRule patrolGuidelineRule) {
        patrolGuidelineRule.setCreateTime(DateUtils.getNowDate());
        return this.patrolGuidelineRuleMapper.insertPatrolGuidelineRule(patrolGuidelineRule);
    }

    public int updatePatrolGuidelineRule(PatrolGuidelineRule patrolGuidelineRule) {
        return this.patrolGuidelineRuleMapper.updatePatrolGuidelineRule(patrolGuidelineRule);
    }

    public int deletePatrolGuidelineRuleByGuidelineRuleIds(Long[] guidelineRuleIds) {
        return this.patrolGuidelineRuleMapper.deletePatrolGuidelineRuleByGuidelineRuleIds(guidelineRuleIds);
    }

    public int deletePatrolGuidelineRuleByGuidelineRuleId(Long guidelineRuleId) {
        return this.patrolGuidelineRuleMapper.deletePatrolGuidelineRuleByGuidelineRuleId(guidelineRuleId);
    }
}
