package com.jwipc.order.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jwipc.order.entity.SapGoodReceipt;
import com.jwipc.order.mapper.SapGoodReceiptMapper;
import com.jwipc.order.model.query.SapGoodReceiptQuery;
import com.jwipc.order.service.ISapGoodReceiptService;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.baomidou.dynamic.datasource.support.DdConstants.SLAVE;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author JIEZ
 * @since 2023-09-04
 */
@Service
@DS(SLAVE)
public class SapGoodReceiptServiceImpl extends ServiceImpl<SapGoodReceiptMapper, SapGoodReceipt> implements ISapGoodReceiptService {

    @Override
    public List<SapGoodReceipt> findForPage(Page<SapGoodReceipt> toPage, SapGoodReceiptQuery query) {
        if(toPage == null){
            return baseMapper.selectForPage(query);
        }
        return baseMapper.selectForPage(toPage,query);
    }


}
