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<ChannelKioTagDao, ChannelKioTagEntity> implements ChannelKioTagService {
|
@Resource
|
private ChannelKioTagDao channelKioTagDao;
|
|
@Override
|
public PageResult<ChannelKioTagEntity> 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<ChannelKioTagEntity> getByDevice(String device) {
|
QueryWrapper<ChannelKioTagEntity> wrapper = new QueryWrapper<>();
|
wrapper.like("device", device);
|
wrapper.orderByAsc("tag_id");
|
List<ChannelKioTagEntity> list = channelKioTagDao.selectList(wrapper);
|
return list;
|
}
|
|
@Override
|
public ChannelKioTagEntity getByTagName(String tagName) {
|
QueryWrapper<ChannelKioTagEntity> 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<ChannelKioTagEntity>().eq("device",name));
|
}
|
}
|