package com.fjhx.service.factory.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.entity.factory.FactoryProduct;
import com.fjhx.params.factory.FactoryProductVo;
import com.fjhx.mapper.factory.FactoryProductMapper;
import com.fjhx.service.factory.FactoryProductService;
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-14
 */
@Service
public class FactoryProductServiceImpl extends ServiceImpl<FactoryProductMapper, FactoryProduct> implements FactoryProductService {

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

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

        return page(condition, wrapper);
    }

    @Override
    public void add(FactoryProductVo factoryProductVo) {
        save(factoryProductVo);
    }

    @Override
    public void edit(FactoryProductVo factoryProductVo) {
        updateById(factoryProductVo);
    }

    @Override
    public void delete(FactoryProductVo factoryProductVo) {
        removeById(factoryProductVo.getId());
    }

}
