package com.ruoyi.sim.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sim.mapper.RealExamCompRequestMapper;
import com.ruoyi.sim.domain.RealExamCompRequest;

/**
 * 考试更换件关联Service业务层处理
 *
 * @author tom
 * @date 2024-12-15
 */
@Service
public class RealExamCompRequestService {
    @Autowired
    private RealExamCompRequestMapper realExamCompRequestMapper;

    /**
     * 查询考试更换件关联
     *
     * @param relId 考试更换件关联主键
     * @return 考试更换件关联
     */
    public RealExamCompRequest selectRealExamCompRequestByRelId(Long relId) {
        return realExamCompRequestMapper.selectRealExamCompRequestByRelId(relId);
    }

    /**
     * 查询考试更换件关联列表
     *
     * @param realExamCompRequest 考试更换件关联
     * @return 考试更换件关联
     */
    public List<RealExamCompRequest> selectRealExamCompRequestList(RealExamCompRequest realExamCompRequest) {
        return realExamCompRequestMapper.selectRealExamCompRequestList(realExamCompRequest);
    }

    /**
     * 新增考试更换件关联
     *
     * @param realExamCompRequest 考试更换件关联
     * @return 结果
     */
    public int insertRealExamCompRequest(RealExamCompRequest realExamCompRequest) {
        realExamCompRequest.setCreateTime(DateUtils.getNowDate());
        return realExamCompRequestMapper.insertRealExamCompRequest(realExamCompRequest);
    }

    /**
     * 修改考试更换件关联
     *
     * @param realExamCompRequest 考试更换件关联
     * @return 结果
     */
    public int updateRealExamCompRequest(RealExamCompRequest realExamCompRequest) {
        realExamCompRequest.setUpdateTime(DateUtils.getNowDate());
        return realExamCompRequestMapper.updateRealExamCompRequest(realExamCompRequest);
    }

    /**
     * 批量删除考试更换件关联
     *
     * @param relIds 需要删除的考试更换件关联主键
     * @return 结果
     */
    public int deleteRealExamCompRequestByRelIds(Long[] relIds) {
        return realExamCompRequestMapper.deleteRealExamCompRequestByRelIds(relIds);
    }

    /**
     * 删除考试更换件关联信息
     *
     * @param relId 考试更换件关联主键
     * @return 结果
     */
    public int deleteRealExamCompRequestByRelId(Long relId) {
        return realExamCompRequestMapper.deleteRealExamCompRequestByRelId(relId);
    }
}
