package com.njcn.energy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.energy.mapper.EleEpdMapper;
import com.njcn.energy.pojo.po.EleEpdPqd;
import com.njcn.energy.service.IEleEpdPqdService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2022/3/15 10:08
 */
@Service
public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdMapper,EleEpdPqd> implements IEleEpdPqdService {


    @Override
    public boolean addEpd(EleEpdPqd eleEpdPqd) {
        return this.save(eleEpdPqd);
    }

    @Override
    public boolean updateEpd(EleEpdPqd eleEpdPqd) {
        return this.updateById(eleEpdPqd);
    }

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

    @Override
    public List<EleEpdPqd> getAllEpd() {
        return this.lambdaQuery().orderByDesc(EleEpdPqd::getIdx).list();
    }

}
