package com.fjhx.service.apply.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.entity.apply.ApplyPurchase;
import com.fjhx.params.apply.ApplyPurchaseVo;
import com.fjhx.mapper.apply.ApplyPurchaseMapper;
import com.fjhx.service.apply.ApplyPurchaseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fjhx.utils.wrapperUtil.IWrapper;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * 申购单 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2022-11-28
 */
@Service
public class ApplyPurchaseServiceImpl extends ServiceImpl<ApplyPurchaseMapper, ApplyPurchase> implements ApplyPurchaseService {

    @Override
    public Page<ApplyPurchase> getPage(Map<String, Object> condition) {

        IWrapper<ApplyPurchase> wrapper = IWrapper.getWrapper(condition);

        return page(condition, wrapper);
    }

    @Override
    public void add(ApplyPurchaseVo applyPurchaseVo) {
        save(applyPurchaseVo);
    }

    @Override
    public void edit(ApplyPurchaseVo applyPurchaseVo) {
        updateById(applyPurchaseVo);
    }

    @Override
    public void delete(ApplyPurchaseVo applyPurchaseVo) {
        removeById(applyPurchaseVo.getId());
    }

}
