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.service.ChannelKioTagService;
|
import com.iailab.module.data.channel.kio.dao.ChannelKioDeviceDao;
|
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity;
|
import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService;
|
import com.iailab.module.data.channel.kio.vo.KioDevicePageReqVO;
|
|
import javax.annotation.Resource;
|
|
import com.iailab.module.data.channel.modbus.entity.ChannelModBusDeviceEntity;
|
import org.springframework.stereotype.Service;
|
|
import java.util.Date;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* @author lirm
|
* @Description
|
* @createTime 2024年08月26日
|
*/
|
@Service
|
public class ChannelKioDeviceServiceImpl extends ServiceImpl<ChannelKioDeviceDao, ChannelKioDeviceEntity> implements ChannelKioDeviceService {
|
|
@Resource
|
private ChannelKioDeviceDao channelKioDeviceDao;
|
|
@Resource
|
ChannelKioTagService channelKioTagService;
|
|
|
@Override
|
public PageResult<ChannelKioDeviceEntity> queryPage(KioDevicePageReqVO reqVO) {
|
return channelKioDeviceDao.selectPage(reqVO);
|
}
|
|
@Override
|
public ChannelKioDeviceEntity info(String id) {
|
return channelKioDeviceDao.selectById(id);
|
}
|
|
@Override
|
public void add(ChannelKioDeviceEntity channelKioDeviceEntity) {
|
channelKioDeviceDao.insert(channelKioDeviceEntity);
|
}
|
|
@Override
|
public void update(ChannelKioDeviceEntity channelKioDeviceEntity) {
|
channelKioDeviceDao.updateById(channelKioDeviceEntity);
|
}
|
|
@Override
|
public void delete(String id) {
|
//先删除device下的tag
|
channelKioTagService.deleteByDeviceName(info(id).getInstanceName());
|
|
channelKioDeviceDao.deleteById(id);
|
|
}
|
|
@Override
|
public List<ChannelKioDeviceEntity> list(Map<String, Object> params) {
|
return channelKioDeviceDao.selectList(new QueryWrapper<ChannelKioDeviceEntity>().orderByAsc("instance_name"));
|
}
|
}
|