package com.fjhx.test.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.entity.test.TestScan;
import com.fjhx.params.test.TestScanVo;
import com.fjhx.test.mapper.TestScanMapper;
import com.fjhx.test.service.TestScanService;
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-02-03
 */
@Service
public class TestScanServiceImpl extends ServiceImpl<TestScanMapper, TestScan> implements TestScanService {

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

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

        return page(condition, wrapper);
    }

    @Override
    public void add(TestScanVo testScanVo) {
        save(testScanVo);
    }

    @Override
    public void edit(TestScanVo testScanVo) {
        updateById(testScanVo);
    }

    @Override
    public void delete(TestScanVo testScanVo) {
        removeById(testScanVo.getId());
    }

}
