package com.jkcredit.invoice.service.nocar.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jkcredit.invoice.mapper.waybill.NoCarWaybillImprtMapper;
import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
import com.jkcredit.invoice.service.nocar.NoCarBillWayImportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 导入运单维护接口实现类
 * @author mumuxigua
 */
@Service
public class NoCarBillWayImportServiceImpl extends ServiceImpl<NoCarWaybillImprtMapper, NoCarWayBill> implements NoCarBillWayImportService {


    @Autowired
    NoCarWaybillImprtMapper noCarWaybillMapperImprt;

    @Override
    public IPage<List<NoCarWayBill>> findByPageAndWayBill(Page page, NoCarWayBill noCarWayBill) {
        return noCarWaybillMapperImprt.selectAllByPage(page, noCarWayBill);
    }

    @Override
    public IPage<List<NoCarWayBill>> findByPageAndWayBillException(Page page, NoCarWayBill noCarWayBill) {
        return noCarWaybillMapperImprt.selectAllByPageException(page, noCarWayBill);
    }

    @Override
    public void updateBillway(int status, String msg, NoCarWayBill noCarWayBill) {
        noCarWayBill.setFailReason(msg);
        noCarWayBill.setBillwayStatus(status);
        noCarWaybillMapperImprt.updateByBillNum(noCarWayBill);
    }

    @Override
    public void insertImport(NoCarWayBill record) {
        noCarWaybillMapperImprt.insertImport(record);
    }

}
