package com.jwipc.sys.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jwipc.sys.entity.PurchaseGroup;
import com.jwipc.sys.mapper.PurchaseGroupMapper;
import com.jwipc.sys.model.po.PurchaseGroupPO;
import com.jwipc.sys.model.query.PurchaseGroupQuery;
import com.jwipc.sys.service.IPurchaseGroupService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 采购组主数据 服务实现类
 * </p>
 *
 * @author zhangjie
 * @since 2024-01-27
 */
@Service
public class PurchaseGroupServiceImpl extends ServiceImpl<PurchaseGroupMapper, PurchaseGroup> implements IPurchaseGroupService {
    @Override
    public List<PurchaseGroupPO> findPageByQuery(Page<PurchaseGroup> dbPage, PurchaseGroupQuery query) {
        if (dbPage==null){
            return baseMapper.findPageByQuery(query);
        }
        return baseMapper.findPageByQuery(dbPage,query);
    }
    @Override
    public PurchaseGroupPO getDataById(Long id) {
        return baseMapper.getDataById(id);
    }
    @Override
    public PurchaseGroupPO getDataByCode(String purchaseGroupCode) {
        return baseMapper.getDataByCode(purchaseGroupCode);
    }
}
