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.EleTopicMapper;
import com.njcn.energy.pojo.po.EleTopic;
import com.njcn.energy.service.IEleTopicService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2022/3/22 19:04
 */
@Service
public class EleTopicServiceImpl extends ServiceImpl<EleTopicMapper, EleTopic> implements IEleTopicService {

    @Override
    public boolean addTopic(EleTopic eleTopic) {
        return this.save(eleTopic);
    }

    @Override
    public List<EleTopic> list(String id) {
        return this.lambdaQuery().eq(EleTopic::getNdid,id).list();
    }

    @Override
    public boolean delete(String id) {
        QueryWrapper<EleTopic> topicQueryWrapper = new QueryWrapper<>();
        topicQueryWrapper.eq("NDID",id);
        return this.remove(topicQueryWrapper);
    }
}
