package com.fjhx.stock.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.entity.stock.StockCheckrecorddetail;
import com.fjhx.params.stock.StockCheckrecorddetailVo;
import com.fjhx.stock.mapper.StockCheckrecorddetailMapper;
import com.fjhx.stock.service.StockCheckrecorddetailService;
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-05
 */
@Service
public class StockCheckrecorddetailServiceImpl extends ServiceImpl<StockCheckrecorddetailMapper, StockCheckrecorddetail> implements StockCheckrecorddetailService {

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

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

        return page(condition, wrapper);
    }

    @Override
    public void add(StockCheckrecorddetailVo stockCheckrecorddetailVo) {
        save(stockCheckrecorddetailVo);
    }

    @Override
    public void edit(StockCheckrecorddetailVo stockCheckrecorddetailVo) {
        updateById(stockCheckrecorddetailVo);
    }

    @Override
    public void delete(StockCheckrecorddetailVo stockCheckrecorddetailVo) {
        removeById(stockCheckrecorddetailVo.getId());
    }

}
