提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.data.channel.kio.service.impl; |
H |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
aecc49
|
4 |
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
L |
5 |
import com.iailab.framework.common.pojo.PageResult; |
a6de49
|
6 |
import com.iailab.module.data.channel.kio.service.ChannelKioTagService; |
H |
7 |
import com.iailab.module.data.channel.kio.dao.ChannelKioDeviceDao; |
|
8 |
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity; |
|
9 |
import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService; |
aecc49
|
10 |
import com.iailab.module.data.channel.kio.vo.KioDevicePageReqVO; |
a6de49
|
11 |
|
aecc49
|
12 |
import javax.annotation.Resource; |
L |
13 |
|
|
14 |
import com.iailab.module.data.channel.modbus.entity.ChannelModBusDeviceEntity; |
|
15 |
import org.springframework.stereotype.Service; |
|
16 |
|
|
17 |
import java.util.Date; |
a6de49
|
18 |
import java.util.List; |
H |
19 |
import java.util.Map; |
|
20 |
|
|
21 |
/** |
aecc49
|
22 |
* @author lirm |
a6de49
|
23 |
* @Description |
aecc49
|
24 |
* @createTime 2024年08月26日 |
a6de49
|
25 |
*/ |
H |
26 |
@Service |
aecc49
|
27 |
public class ChannelKioDeviceServiceImpl extends ServiceImpl<ChannelKioDeviceDao, ChannelKioDeviceEntity> implements ChannelKioDeviceService { |
L |
28 |
|
|
29 |
@Resource |
|
30 |
private ChannelKioDeviceDao channelKioDeviceDao; |
a6de49
|
31 |
|
H |
32 |
@Resource |
|
33 |
ChannelKioTagService channelKioTagService; |
|
34 |
|
aecc49
|
35 |
|
a6de49
|
36 |
@Override |
aecc49
|
37 |
public PageResult<ChannelKioDeviceEntity> queryPage(KioDevicePageReqVO reqVO) { |
L |
38 |
return channelKioDeviceDao.selectPage(reqVO); |
a6de49
|
39 |
} |
H |
40 |
|
|
41 |
@Override |
aecc49
|
42 |
public ChannelKioDeviceEntity info(String id) { |
L |
43 |
return channelKioDeviceDao.selectById(id); |
a6de49
|
44 |
} |
H |
45 |
|
|
46 |
@Override |
aecc49
|
47 |
public void add(ChannelKioDeviceEntity channelKioDeviceEntity) { |
L |
48 |
channelKioDeviceDao.insert(channelKioDeviceEntity); |
a6de49
|
49 |
} |
H |
50 |
|
|
51 |
@Override |
aecc49
|
52 |
public void update(ChannelKioDeviceEntity channelKioDeviceEntity) { |
L |
53 |
channelKioDeviceDao.updateById(channelKioDeviceEntity); |
a6de49
|
54 |
} |
H |
55 |
|
|
56 |
@Override |
aecc49
|
57 |
public void delete(String id) { |
L |
58 |
//先删除device下的tag |
|
59 |
channelKioTagService.deleteByDeviceName(info(id).getInstanceName()); |
|
60 |
|
|
61 |
channelKioDeviceDao.deleteById(id); |
|
62 |
|
a6de49
|
63 |
} |
H |
64 |
|
|
65 |
@Override |
aecc49
|
66 |
public List<ChannelKioDeviceEntity> list(Map<String, Object> params) { |
L |
67 |
return channelKioDeviceDao.selectList(new QueryWrapper<ChannelKioDeviceEntity>().orderByAsc("instance_name")); |
a6de49
|
68 |
} |
H |
69 |
} |