package com.ruoyi.manage.service.impl;

import java.util.List;


import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.RecordInvalidatedMapper;
import com.ruoyi.manage.domain.RecordInvalidated;
import com.ruoyi.manage.service.IRecordInvalidatedService;
import com.ruoyi.common.core.text.Convert;

/**
 * 轮挡报废记录Service业务层处理
 *
 * @author wangh
 * @date 2024-01-26
 */
@Service
public class RecordInvalidatedServiceImpl implements IRecordInvalidatedService {
    @Autowired
    private RecordInvalidatedMapper recordInvalidatedMapper;

    /**
     * 查询轮挡报废记录
     *
     * @param objid 轮挡报废记录主键
     * @return 轮挡报废记录
     */
    @Override
    public RecordInvalidated selectRecordInvalidatedByObjid(Long objid) {
        return recordInvalidatedMapper.selectRecordInvalidatedByObjid(objid);
    }

    /**
     * 查询轮挡报废记录列表
     *
     * @param recordInvalidated 轮挡报废记录
     * @return 轮挡报废记录
     */
    @Override
    public List<RecordInvalidated> selectRecordInvalidatedList(RecordInvalidated recordInvalidated) {
        return recordInvalidatedMapper.selectRecordInvalidatedList(recordInvalidated);
    }

    /**
     * 新增轮挡报废记录
     *
     * @param recordInvalidated 轮挡报废记录
     * @return 结果
     */
    @Override
    public int insertRecordInvalidated(RecordInvalidated recordInvalidated) {
        recordInvalidated.setCreateTime(DateUtils.getNowDate());
        return recordInvalidatedMapper.insertRecordInvalidated(recordInvalidated);
    }

    /**
     * 修改轮挡报废记录
     *
     * @param recordInvalidated 轮挡报废记录
     * @return 结果
     */
    @Override
    public int updateRecordInvalidated(RecordInvalidated recordInvalidated) {
        return recordInvalidatedMapper.updateRecordInvalidated(recordInvalidated);
    }

    /**
     * 批量删除轮挡报废记录
     *
     * @param objids 需要删除的轮挡报废记录主键
     * @return 结果
     */
    @Override
    public int deleteRecordInvalidatedByObjids(String objids) {
        return recordInvalidatedMapper.deleteRecordInvalidatedByObjids(Convert.toStrArray(objids));
    }

    /**
     * 删除轮挡报废记录信息
     *
     * @param objid 轮挡报废记录主键
     * @return 结果
     */
    @Override
    public int deleteRecordInvalidatedByObjid(Long objid) {
        return recordInvalidatedMapper.deleteRecordInvalidatedByObjid(objid);
    }
}
