package com.aucma.api.service.impl;

import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import com.aucma.api.mapper.PdaBindingMapper;
import com.aucma.api.service.IPdaBindingService;
import com.aucma.report.domain.ReportQualityInspection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wanghao
 * @date 2023/11/14  9:56
 */
@Service
public class PdaServiceImpl implements IPdaBindingService {
    @Autowired
    private PdaBindingMapper mapper;

    @Override
    public String selectBoxNameByCode(String boxCode) {

        return mapper.selectBoxNameByCode(boxCode.substring(2,12));
    }

    @Override
    public int insertBindingInfo(String boxCode, String boxName, String innerCode) {
        return mapper.insertBindingInfo(boxCode,boxName,innerCode);
    }

    @Override
    public int countQualityRecordByCode(String code) {
        return mapper.countQualityRecordByCode(code);
    }

    @Override
    public int updateCodeBinding(String boxCode, String innerCode) {
        return mapper.updateCodeBinding(boxCode,innerCode);
    }

    @Override
    public int submitRepair(RepairSubmitInfoDto info) {
        return mapper.submitRepair(info);
    }

    @Override
    public List<ReportQualityInspection> findCheckInfoByCode(String code) {
        return mapper.findCheckInfoByCode(code);
    }

    @Override
    public List<ReportQualityInspection> checkSelectRepairInfo(String code) {
        return mapper.checkSelectRepairInfo(code);
    }
}
