package com.inspect.insreport.service.impl;

import com.inspect.insreport.domain.InspectionReport;
import com.inspect.insreport.mapper.InspectionReportMapper;
import com.inspect.insreport.service.IInspectionReportService;

import java.util.List;

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

@Service
public class InspectionReportServiceImpl implements IInspectionReportService {
    private final InspectionReportMapper inspectionReportMapper;

    public InspectionReportServiceImpl(InspectionReportMapper inspectionReportMapper) {
        this.inspectionReportMapper = inspectionReportMapper;
    }

    public InspectionReport selectInspectionReportByLineId(Long lineId) {
        return this.inspectionReportMapper.selectInspectionReportByLineId(lineId);
    }

    public List<InspectionReport> selectInspectionReportList(InspectionReport inspectionReport) {
        return this.inspectionReportMapper.selectInspectionReportList(inspectionReport);
    }

    public List<InspectionReport> selectByAllList(InspectionReport inspectionReport) {
        return this.inspectionReportMapper.selectByAllList(inspectionReport);
    }

    public int insertInspectionReport(InspectionReport inspectionReport) {
        this.inspectionReportMapper.insertInspectionReport(inspectionReport);
        return inspectionReport.getLineId().intValue();
    }

    public int updateInspectionReport(InspectionReport inspectionReport) {
        return this.inspectionReportMapper.updateInspectionReport(inspectionReport);
    }

    public int deleteInspectionReportByLineIds(Long[] lineIds) {
        return this.inspectionReportMapper.deleteInspectionReportByLineIds(lineIds);
    }

    public int deleteInspectionReportByLineId(Long lineId) {
        return this.inspectionReportMapper.deleteInspectionReportByLineId(lineId);
    }
}
