package com.fjhx.plan.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.entity.plan.PlanConfig;
import com.fjhx.params.plan.PlanConfigVo;
import com.fjhx.plan.mapper.PlanConfigMapper;
import com.fjhx.plan.service.PlanConfigService;
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 2023-01-06
 */
@Service
public class PlanConfigServiceImpl extends ServiceImpl<PlanConfigMapper, PlanConfig> implements PlanConfigService {

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

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

        return page(condition, wrapper);
    }

    @Override
    public void add(PlanConfigVo planConfigVo) {
        save(planConfigVo);
    }

    @Override
    public void edit(PlanConfigVo planConfigVo) {
        updateById(planConfigVo);
    }

    @Override
    public void delete(PlanConfigVo planConfigVo) {
        removeById(planConfigVo.getId());
    }

}
