package com.inspect.guideline.service.impl;

import com.inspect.base.core.utils.DateUtils;
import com.inspect.guideline.domain.PatrolGuideline;
import com.inspect.guideline.mapper.PatrolGuidelineMapper;
import com.inspect.guideline.service.IPatrolGuidelineService;

import java.util.List;

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

@Service
public class PatrolGuidelineServiceImpl implements IPatrolGuidelineService {
    private final PatrolGuidelineMapper patrolGuidelineMapper;

    public PatrolGuidelineServiceImpl(PatrolGuidelineMapper patrolGuidelineMapper) {
        this.patrolGuidelineMapper = patrolGuidelineMapper;
    }

    public PatrolGuideline selectPatrolGuidelineByGuidelineId(Long guidelineId) {
        return this.patrolGuidelineMapper.selectPatrolGuidelineByGuidelineId(guidelineId);
    }

    public List<PatrolGuideline> selectPatrolGuidelineList(PatrolGuideline patrolGuideline) {
        return this.patrolGuidelineMapper.selectPatrolGuidelineList(patrolGuideline);
    }

    public int insertPatrolGuideline(PatrolGuideline patrolGuideline) {
        patrolGuideline.setCreateTime(DateUtils.getNowDate());
        return this.patrolGuidelineMapper.insertPatrolGuideline(patrolGuideline);
    }

    public int updatePatrolGuideline(PatrolGuideline patrolGuideline) {
        return this.patrolGuidelineMapper.updatePatrolGuideline(patrolGuideline);
    }

    public int deletePatrolGuidelineByGuidelineIds(Long[] guidelineIds) {
        return this.patrolGuidelineMapper.deletePatrolGuidelineByGuidelineIds(guidelineIds);
    }

    public int deletePatrolGuidelineByGuidelineId(Long guidelineId) {
        return this.patrolGuidelineMapper.deletePatrolGuidelineByGuidelineId(guidelineId);
    }
}
