package com.njcn.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.system.mapper.EleWaveParmMapper;
import com.njcn.system.pojo.param.CsWaveParam;
import com.njcn.system.pojo.po.CsWaveParm;
import com.njcn.system.pojo.po.EleEvtParm;
import com.njcn.system.service.IEleWaveParmService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 事件拓展表 服务实现类
 * </p>
 *
 * @author xuyang
 * @since 2023-07-31
 */
@Service
public class EleWaveParmServiceImpl extends ServiceImpl<EleWaveParmMapper, CsWaveParm> implements IEleWaveParmService {

    @Override
    public void add(CsWaveParam waveParam) {
        CsWaveParm csWaveParm = new CsWaveParm();
        BeanUtils.copyProperties(waveParam,csWaveParm);
        this.save(csWaveParm);
    }

    @Override
    public void delete(String id) {
        LambdaQueryWrapper<CsWaveParm> deleteWrapper = new LambdaQueryWrapper<>();
        deleteWrapper.eq(CsWaveParm::getPid,id);
        this.baseMapper.delete(deleteWrapper);
    }
}
