package com.dxhy.customs.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dxhy.common.service.impl.MpBaseServiceImpl;
import com.dxhy.customs.dao.CustomsInvoiceImgDao;
import com.dxhy.customs.entity.TdxInvoiceImg;
import com.dxhy.customs.service.CustomsInvoiceImgService;

import lombok.extern.slf4j.Slf4j;

/**
 * @author jiaohongyang
 */
@Service("customsInvoiceImgService")
@Slf4j
public class CustomsInvoiceImgServiceImpl extends MpBaseServiceImpl<CustomsInvoiceImgDao, TdxInvoiceImg>
    implements CustomsInvoiceImgService {
    /**
     * @param imgQueryWrapper
     * @return
     */
    @Override
    public List<TdxInvoiceImg> list(LambdaQueryWrapper<TdxInvoiceImg> imgQueryWrapper) {
        return super.list(imgQueryWrapper);
    }

    /**
     * @param uuid
     * @return
     */
    @Override
    public TdxInvoiceImg selectByUuid(String uuid) {
        LambdaQueryWrapper<TdxInvoiceImg> imgQueryWrapper = new LambdaQueryWrapper<>();
        imgQueryWrapper.eq(TdxInvoiceImg::getScanId, uuid);
        return super.getOne(imgQueryWrapper);
    }

    @Override
    public TdxInvoiceImg selectByScanId(String scanId) {
        LambdaQueryWrapper<TdxInvoiceImg> imgQueryWrapper = new LambdaQueryWrapper<>();
        imgQueryWrapper.eq(TdxInvoiceImg::getScanId, scanId);
        return super.getOne(imgQueryWrapper);
    }

    /**
     * @param invoiceImg
     */
    @Override
    public void insertOrUpdate(TdxInvoiceImg invoiceImg) {
        super.saveOrUpdate(invoiceImg);
    }
}
