package com.njcn.energy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.energy.mapper.EleMdMapper;
import com.njcn.energy.pojo.po.EleMd;
import com.njcn.energy.service.IEleMdService;
import org.springframework.stereotype.Service;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2022/3/15 13:32
 */
@Service
public class EleMdServiceImpl extends ServiceImpl<EleMdMapper, EleMd> implements IEleMdService {
    @Override
    public boolean addMd(EleMd eleMd) {
        return this.save(eleMd);
    }

    @Override
    public boolean updateMd(EleMd eleMd) {
        return this.updateById(eleMd);
    }

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