package com.njcn.energy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.energy.mapper.EleEvtParamMapper;
import com.njcn.energy.pojo.po.EleEpdPqd;
import com.njcn.energy.pojo.po.EleEvt;
import com.njcn.energy.pojo.po.EleEvtParm;
import com.njcn.energy.service.IEleEvtParamService;
import org.springframework.stereotype.Service;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2022/3/15 16:20
 */
@Service
public class EleEvtParamServiceImpl extends ServiceImpl<EleEvtParamMapper, EleEvtParm> implements IEleEvtParamService {

    @Override
    public boolean addEleEvtParam(EleEvtParm eleEvtParam) {
        return this.save(eleEvtParam);
    }

    @Override
    public boolean updateEleEvtParam(EleEvtParm eleEvtParam) {
        return this.updateById(eleEvtParam);
    }

    @Override
    public EleEvtParm findByName(String name) {
        return this.lambdaQuery().eq(EleEvtParm::getName,name).one();
    }

    @Override
    public boolean deleteById(String id) {
        QueryWrapper<EleEvtParm> eleEvtParamQueryWrapper = new QueryWrapper<>();
        eleEvtParamQueryWrapper.eq("Pid",id);
        return this.remove(eleEvtParamQueryWrapper);
    }


}
