package com.fjhx.service.abnormal.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.entity.abnormal.AbnormalInfo;
import com.fjhx.params.abnormal.AbnormalInfoVo;
import com.fjhx.mapper.abnormal.AbnormalInfoMapper;
import com.fjhx.service.abnormal.AbnormalInfoService;
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-09
 */
@Service
public class AbnormalInfoServiceImpl extends ServiceImpl<AbnormalInfoMapper, AbnormalInfo> implements AbnormalInfoService {

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

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

        return page(condition, wrapper);
    }

    @Override
    public void add(AbnormalInfoVo abnormalInfoVo) {
        save(abnormalInfoVo);
    }

    @Override
    public void edit(AbnormalInfoVo abnormalInfoVo) {
        updateById(abnormalInfoVo);
    }

    @Override
    public void delete(AbnormalInfoVo abnormalInfoVo) {
        removeById(abnormalInfoVo.getId());
    }

}
