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.RecordInvalidatedImgMapper;
import com.ruoyi.manage.domain.RecordInvalidatedImg;
import com.ruoyi.manage.service.IRecordInvalidatedImgService;
import com.ruoyi.common.core.text.Convert;

/**
 * 轮挡报废图片记录Service业务层处理
 *
 * @author wangh
 * @date 2024-09-27
 */
@Service
public class RecordInvalidatedImgServiceImpl implements IRecordInvalidatedImgService {
    @Autowired
    private RecordInvalidatedImgMapper recordInvalidatedImgMapper;

    /**
     * 查询轮挡报废图片记录
     *
     * @param objid 轮挡报废图片记录主键
     * @return 轮挡报废图片记录
     */
    @Override
    public RecordInvalidatedImg selectRecordInvalidatedImgByObjid(Long objid) {
        return recordInvalidatedImgMapper.selectRecordInvalidatedImgByObjid(objid);
    }

    /**
     * 查询轮挡报废图片记录列表
     *
     * @param recordInvalidatedImg 轮挡报废图片记录
     * @return 轮挡报废图片记录
     */
    @Override
    public List<RecordInvalidatedImg> selectRecordInvalidatedImgList(RecordInvalidatedImg recordInvalidatedImg) {
        return recordInvalidatedImgMapper.selectRecordInvalidatedImgList(recordInvalidatedImg);
    }

    /**
     * 新增轮挡报废图片记录
     *
     * @param recordInvalidatedImg 轮挡报废图片记录
     * @return 结果
     */
    @Override
    public int insertRecordInvalidatedImg(RecordInvalidatedImg recordInvalidatedImg) {
                recordInvalidatedImg.setCreateBy(ShiroUtils.getLoginName());
                recordInvalidatedImg.setCreateTime(DateUtils.getNowDate());
            return recordInvalidatedImgMapper.insertRecordInvalidatedImg(recordInvalidatedImg);
    }

    /**
     * 修改轮挡报废图片记录
     *
     * @param recordInvalidatedImg 轮挡报废图片记录
     * @return 结果
     */
    @Override
    public int updateRecordInvalidatedImg(RecordInvalidatedImg recordInvalidatedImg) {
        return recordInvalidatedImgMapper.updateRecordInvalidatedImg(recordInvalidatedImg);
    }

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

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