package com.foreverwin.mesnac.dispatch.service.impl;

import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.dispatch.model.ItemBatch;
import com.foreverwin.mesnac.dispatch.mapper.ItemBatchMapper;
import com.foreverwin.mesnac.dispatch.service.ItemBatchService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 * 物料批次表 服务实现类
 * </p>
 *
 * @author Leon.L
 * @since 2021-06-18
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ItemBatchServiceImpl extends ServiceImpl<ItemBatchMapper, ItemBatch> implements ItemBatchService {


    @Autowired
    private ItemBatchMapper itemBatchMapper;

    @Override
    public IPage<ItemBatch> selectPage(FrontPage<ItemBatch> frontPage, ItemBatch itemBatch) {
        QueryWrapper<ItemBatch> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(itemBatch);
        return super.page(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<ItemBatch> selectList(ItemBatch itemBatch) {
        QueryWrapper<ItemBatch> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(itemBatch);
        return super.list(queryWrapper);
    }


}