package com.fjhx.service.product.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.entity.product.ProductCombination;
import com.fjhx.params.product.ProductCombinationVo;
import com.fjhx.mapper.product.ProductCombinationMapper;
import com.fjhx.service.product.ProductCombinationService;
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-30
 */
@Service
public class ProductCombinationServiceImpl extends ServiceImpl<ProductCombinationMapper, ProductCombination> implements ProductCombinationService {

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

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

        return page(condition, wrapper);
    }

    @Override
    public void add(ProductCombinationVo productCombinationVo) {
        save(productCombinationVo);
    }

    @Override
    public void edit(ProductCombinationVo productCombinationVo) {
        updateById(productCombinationVo);
    }

    @Override
    public void delete(ProductCombinationVo productCombinationVo) {
        removeById(productCombinationVo.getId());
    }

}
