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.RecordInspectionImgMapper;
import com.ruoyi.manage.domain.RecordInspectionImg;
import com.ruoyi.manage.service.IRecordInspectionImgService;
import com.ruoyi.common.core.text.Convert;

/**
 * 巡检历史图片Service业务层处理
 *
 * @author wangh
 * @date 2024-09-27
 */
@Service
public class RecordInspectionImgServiceImpl implements IRecordInspectionImgService {
    @Autowired
    private RecordInspectionImgMapper recordInspectionImgMapper;

    /**
     * 查询巡检历史图片
     *
     * @param inspectionId 巡检历史图片主键
     * @return 巡检历史图片
     */
    @Override
    public RecordInspectionImg selectRecordInspectionImgByInspectionId(Long inspectionId) {
        return recordInspectionImgMapper.selectRecordInspectionImgByInspectionId(inspectionId);
    }

    /**
     * 查询巡检历史图片列表
     *
     * @param recordInspectionImg 巡检历史图片
     * @return 巡检历史图片
     */
    @Override
    public List<RecordInspectionImg> selectRecordInspectionImgList(RecordInspectionImg recordInspectionImg) {
        return recordInspectionImgMapper.selectRecordInspectionImgList(recordInspectionImg);
    }

    /**
     * 新增巡检历史图片
     *
     * @param recordInspectionImg 巡检历史图片
     * @return 结果
     */
    @Override
    public int insertRecordInspectionImg(RecordInspectionImg recordInspectionImg) {




                recordInspectionImg.setCreateBy(ShiroUtils.getLoginName());
                recordInspectionImg.setCreateTime(DateUtils.getNowDate());
            return recordInspectionImgMapper.insertRecordInspectionImg(recordInspectionImg);
    }

    /**
     * 修改巡检历史图片
     *
     * @param recordInspectionImg 巡检历史图片
     * @return 结果
     */
    @Override
    public int updateRecordInspectionImg(RecordInspectionImg recordInspectionImg) {
        return recordInspectionImgMapper.updateRecordInspectionImg(recordInspectionImg);
    }

    /**
     * 批量删除巡检历史图片
     *
     * @param inspectionIds 需要删除的巡检历史图片主键
     * @return 结果
     */
    @Override
    public int deleteRecordInspectionImgByInspectionIds(String inspectionIds) {
        return recordInspectionImgMapper.deleteRecordInspectionImgByInspectionIds(Convert.toStrArray(inspectionIds));
    }

    /**
     * 删除巡检历史图片信息
     *
     * @param inspectionId 巡检历史图片主键
     * @return 结果
     */
    @Override
    public int deleteRecordInspectionImgByInspectionId(Long inspectionId) {
        return recordInspectionImgMapper.deleteRecordInspectionImgByInspectionId(inspectionId);
    }
}
