package com.inspect.img.service.impl;

import com.inspect.img.domain.InspectionReportImg;
import com.inspect.img.mapper.InspectionReportImgMapper;
import com.inspect.img.service.IInspectionReportImgService;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class InspectionReportImgServiceImpl implements IInspectionReportImgService {
    private final InspectionReportImgMapper inspectionReportImgMapper;

    public InspectionReportImgServiceImpl(InspectionReportImgMapper inspectionReportImgMapper) {
        this.inspectionReportImgMapper = inspectionReportImgMapper;
    }

    public InspectionReportImg selectInspectionReportImgByLineId(Long lineId) {
        return this.inspectionReportImgMapper.selectInspectionReportImgByLineId(lineId);
    }

    public List<InspectionReportImg> selectInspectionReportImgList(InspectionReportImg inspectionReportImg) {
        return this.inspectionReportImgMapper.selectInspectionReportImgList(inspectionReportImg);
    }

    public int insertInspectionReportImg(InspectionReportImg inspectionReportImg) {
        inspectionReportImg.setCreatTime(new Date());
        return this.inspectionReportImgMapper.insertInspectionReportImg(inspectionReportImg);
    }

    public int updateInspectionReportImg(InspectionReportImg inspectionReportImg) {
        return this.inspectionReportImgMapper.updateInspectionReportImg(inspectionReportImg);
    }

    public int deleteInspectionReportImgByLineIds(Long[] lineIds) {
        return this.inspectionReportImgMapper.deleteInspectionReportImgByLineIds(lineIds);
    }

    public int deleteInspectionReportImgByLineId(Long lineId) {
        return this.inspectionReportImgMapper.deleteInspectionReportImgByLineId(lineId);
    }

    public int batchInsertInspectionReportImg(List<InspectionReportImg> list) {
        return this.inspectionReportImgMapper.batchInsertInspectionReportImg(list);
    }

    @Override
    public List<InspectionReportImg> selectByReportInfoIds(List<String> lineIds) {
        return this.inspectionReportImgMapper.selectByReportInfoIds(lineIds);
    }
}
