package com.zd.laboratory.service.impl;

import java.util.List;

import com.zd.common.datascope.annotation.DataScope;
import com.zd.laboratory.domain.vo.LabSecurityMaterialVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zd.laboratory.mapper.LabSecurityMaterialMapper;
import com.zd.laboratory.domain.LabSecurityMaterial;
import com.zd.laboratory.service.ILabSecurityMaterialService;

/**
 * 安全准入资格材料Service业务层处理
 *
 * @author zd
 * @date 2021-09-10
 */
@Service
public class LabSecurityMaterialServiceImpl implements ILabSecurityMaterialService {
    @Autowired
    private LabSecurityMaterialMapper labSecurityMaterialMapper;

    /**
     * 查询安全准入资格材料
     *
     * @param id 安全准入资格材料主键
     * @return 安全准入资格材料
     */
    @Override
    public LabSecurityMaterial selectLabSecurityMaterialById(Long id) {
        return labSecurityMaterialMapper.selectLabSecurityMaterialById(id);
    }

    /**
     * 查询安全准入资格材料列表
     *
     * @param labSecurityMaterial 安全准入资格材料
     * @return 安全准入资格材料
     */
    @Override
    @DataScope(deptAlias = "sm")
    public List<LabSecurityMaterial> selectLabSecurityMaterialList(LabSecurityMaterial labSecurityMaterial) {
        return labSecurityMaterialMapper.selectLabSecurityMaterialList(labSecurityMaterial);
    }

    /**
     * 新增安全准入资格材料
     *
     * @param labSecurityMaterial 安全准入资格材料
     * @return 结果
     */
    @Override
    public int insertLabSecurityMaterial(LabSecurityMaterial labSecurityMaterial) {
        return labSecurityMaterialMapper.insertLabSecurityMaterial(labSecurityMaterial);
    }

    /**
     * 修改安全准入资格材料
     *
     * @param labSecurityMaterial 安全准入资格材料
     * @return 结果
     */
    @Override
    public int updateLabSecurityMaterial(LabSecurityMaterial labSecurityMaterial) {
        return labSecurityMaterialMapper.updateLabSecurityMaterial(labSecurityMaterial);
    }

    /**
     * 批量删除安全准入资格材料
     *
     * @param ids 需要删除的安全准入资格材料主键
     * @return 结果
     */
    @Override
    public int deleteLabSecurityMaterialByIds(Long[] ids) {
        return labSecurityMaterialMapper.deleteLabSecurityMaterialByIds(ids);
    }

    /**
     * 删除安全准入资格材料信息
     *
     * @param id 安全准入资格材料主键
     * @return 结果
     */
    @Override
    public int deleteLabSecurityMaterialById(Long id) {
        return labSecurityMaterialMapper.deleteLabSecurityMaterialById(id);
    }

    /**
     * 查询实验室下的安全准入资格材料列表
     *
     * @param labSecurityMaterial 安全准入资格材料
     * @return 查询实验室下的安全准入资格材料列表
     */
    @Override
    public List<LabSecurityMaterialVO> subjectMaterialList(LabSecurityMaterialVO labSecurityMaterial) {
        return labSecurityMaterialMapper.subjectMaterialList(labSecurityMaterial);
    }
}
