package com.zd.laboratory.service.impl;

import com.zd.common.core.utils.DateUtils;
import com.zd.laboratory.domain.LabRiskPlanHardwareRelation;
import com.zd.laboratory.mapper.LabRiskPlanHardwareRelationMapper;
import com.zd.laboratory.service.ILabRiskPlanHardwareRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 风险预案与硬件关联Service业务层处理
 *
 * @author zd
 * @date 2021-09-03
 */
@Service
public class LabRiskPlanHardwareRelationServiceImpl implements ILabRiskPlanHardwareRelationService {
    @Autowired
    private LabRiskPlanHardwareRelationMapper labRiskPlanHardwareRelationMapper;

    /**
     * 查询风险预案与硬件关联
     *
     * @param id 风险预案与硬件关联主键
     * @return 风险预案与硬件关联
     */
    @Override
    public LabRiskPlanHardwareRelation selectLabRiskPlanHardwareRelationById(Long id) {
        return labRiskPlanHardwareRelationMapper.selectLabRiskPlanHardwareRelationById(id);
    }

    /**
     * 查询风险预案与硬件关联列表
     *
     * @param labRiskPlanHardwareRelation 风险预案与硬件关联
     * @return 风险预案与硬件关联
     */
    @Override
    public List<LabRiskPlanHardwareRelation> selectLabRiskPlanHardwareRelationList(LabRiskPlanHardwareRelation labRiskPlanHardwareRelation) {
        return labRiskPlanHardwareRelationMapper.selectLabRiskPlanHardwareRelationList(labRiskPlanHardwareRelation);
    }

    /**
     * 新增风险预案与硬件关联
     *
     * @param labRiskPlanHardwareRelation 风险预案与硬件关联
     * @return 结果
     */
    @Override
    public int insertLabRiskPlanHardwareRelation(LabRiskPlanHardwareRelation labRiskPlanHardwareRelation) {
        labRiskPlanHardwareRelation.setCreateTime(DateUtils.getNowDate());
        return labRiskPlanHardwareRelationMapper.insertLabRiskPlanHardwareRelation(labRiskPlanHardwareRelation);
    }

    /**
     * 修改风险预案与硬件关联
     *
     * @param labRiskPlanHardwareRelation 风险预案与硬件关联
     * @return 结果
     */
    @Override
    public int updateLabRiskPlanHardwareRelation(LabRiskPlanHardwareRelation labRiskPlanHardwareRelation) {
        return labRiskPlanHardwareRelationMapper.updateLabRiskPlanHardwareRelation(labRiskPlanHardwareRelation);
    }

    /**
     * 批量删除风险预案与硬件关联
     *
     * @param ids 需要删除的风险预案与硬件关联主键
     * @return 结果
     */
    @Override
    public int deleteLabRiskPlanHardwareRelationByIds(Long[] ids) {
        return labRiskPlanHardwareRelationMapper.deleteLabRiskPlanHardwareRelationByIds(ids);
    }

    /**
     * 删除风险预案与硬件关联信息
     *
     * @param id 风险预案与硬件关联主键
     * @return 结果
     */
    @Override
    public int deleteLabRiskPlanHardwareRelationById(Long id) {
        return labRiskPlanHardwareRelationMapper.deleteLabRiskPlanHardwareRelationById(id);
    }
}
