package com.fjhx.stock.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.entity.stock.StockWaterdetial;
import com.fjhx.params.stock.StockWaterdetialVo;
import com.fjhx.stock.mapper.StockWaterdetialMapper;
import com.fjhx.stock.service.StockWaterdetialService;
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-12-12
 */
@Service
public class StockWaterdetialServiceImpl extends ServiceImpl<StockWaterdetialMapper, StockWaterdetial> implements StockWaterdetialService {

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

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

        return page(condition, wrapper);
    }

    @Override
    public void add(StockWaterdetialVo stockWaterdetialVo) {
        save(stockWaterdetialVo);
    }

    @Override
    public void edit(StockWaterdetialVo stockWaterdetialVo) {
        updateById(stockWaterdetialVo);
    }

    @Override
    public void delete(StockWaterdetialVo stockWaterdetialVo) {
        removeById(stockWaterdetialVo.getId());
    }

}
