package com.njcn.energy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.energy.mapper.EleDiMapper;
import com.njcn.energy.pojo.po.EleDi;
import com.njcn.energy.service.IEleDiService;
import org.springframework.stereotype.Service;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2022/3/15 19:18
 */
@Service
public class EleDiServiceImpl extends ServiceImpl<EleDiMapper, EleDi> implements IEleDiService {
    @Override
    public boolean addDi(EleDi eleDi) {
        return this.save(eleDi);
    }

    @Override
    public boolean updateDi(EleDi eleDi) {
        return this.updateById(eleDi);
    }

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