package com.iailab.module.data.channel.kio.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.framework.common.pojo.PageResult; import com.iailab.module.data.channel.kio.dao.ChannelKioTagDao; import com.iailab.module.data.channel.kio.entity.ChannelKioTagEntity; import com.iailab.module.data.channel.kio.service.ChannelKioTagService; import com.iailab.module.data.channel.kio.vo.KioTagPageReqVO; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; import java.util.List; /** * @author lirm * @Description * @createTime 2024年08月26日 */ @Slf4j @Service public class ChannelKioTagServiceImpl extends ServiceImpl implements ChannelKioTagService { @Resource private ChannelKioTagDao channelKioTagDao; @Override public PageResult queryPage(KioTagPageReqVO reqVO) { return channelKioTagDao.selectPage(reqVO); } @Override public ChannelKioTagEntity info(String id) { return channelKioTagDao.selectById(id); } @Override public void add(ChannelKioTagEntity channelKioTagEntity) { channelKioTagDao.insert(channelKioTagEntity); } @Override public void update(ChannelKioTagEntity channelKioTagEntity) { channelKioTagDao.updateById(channelKioTagEntity); } @Override public void delete(String id) { channelKioTagDao.deleteById(id); } @Override public List getByDevice(String device) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.like("device", device); wrapper.orderByAsc("tag_id"); List list = channelKioTagDao.selectList(wrapper); return list; } @Override public ChannelKioTagEntity getByTagName(String tagName) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("tag_name", tagName); ChannelKioTagEntity entity = channelKioTagDao.selectOne(wrapper); return entity; } @Override public void deleteByDeviceName(String name) { channelKioTagDao.delete(new QueryWrapper().eq("device",name)); } }