提交 | 用户 | 时间
|
9d7e02
|
1 |
package com.iailab.module.data.channel.opcda.service.impl; |
潘 |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
4 |
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
5 |
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
6 |
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
aecc49
|
7 |
import com.iailab.framework.common.pojo.PageResult; |
9d7e02
|
8 |
import com.iailab.framework.common.util.object.ConvertUtils; |
潘 |
9 |
import com.iailab.module.data.channel.opcda.dao.ChannelOPCDADeviceDao; |
|
10 |
import com.iailab.module.data.channel.opcda.dto.ChannelOPCDADeviceDTO; |
|
11 |
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDADeviceEntity; |
|
12 |
import com.iailab.module.data.channel.opcda.service.ChannelOPCDADeviceService; |
|
13 |
import com.iailab.module.data.channel.opcda.service.ChannelOPCDATagService; |
aecc49
|
14 |
import com.iailab.module.data.channel.opcda.vo.OpcDaDevicePageReqVO; |
9d7e02
|
15 |
import com.iailab.module.data.common.utils.PageUtils; |
潘 |
16 |
import com.iailab.module.data.common.utils.Query; |
|
17 |
import org.springframework.beans.factory.annotation.Autowired; |
|
18 |
import org.springframework.stereotype.Service; |
|
19 |
|
|
20 |
import javax.annotation.Resource; |
|
21 |
import java.util.List; |
|
22 |
import java.util.Map; |
|
23 |
|
|
24 |
/** |
aecc49
|
25 |
* @author lirm |
9d7e02
|
26 |
* @Description |
aecc49
|
27 |
* @createTime 2024年08月26日 |
9d7e02
|
28 |
*/ |
潘 |
29 |
@Service |
|
30 |
public class ChannelOPCDADeviceServiceImpl extends ServiceImpl<ChannelOPCDADeviceDao, ChannelOPCDADeviceEntity> implements ChannelOPCDADeviceService { |
|
31 |
@Resource |
|
32 |
private ChannelOPCDADeviceDao channelOPCDADeviceDao; |
|
33 |
|
|
34 |
@Autowired |
|
35 |
private ChannelOPCDATagService channelOPCDATagService; |
|
36 |
|
aecc49
|
37 |
@Override |
L |
38 |
public PageResult<ChannelOPCDADeviceEntity> queryPage(OpcDaDevicePageReqVO reqVO) { |
|
39 |
return channelOPCDADeviceDao.selectPage(reqVO); |
9d7e02
|
40 |
} |
潘 |
41 |
|
|
42 |
@Override |
01d6f8
|
43 |
public List<ChannelOPCDADeviceEntity> list(Map<String, Object> params) { |
潘 |
44 |
QueryWrapper<ChannelOPCDADeviceEntity> queryWrapper = new QueryWrapper<>(); |
|
45 |
queryWrapper.orderByDesc("create_time"); |
|
46 |
return channelOPCDADeviceDao.selectList(queryWrapper); |
|
47 |
} |
|
48 |
|
|
49 |
@Override |
9d7e02
|
50 |
public ChannelOPCDADeviceEntity info(String id) { |
潘 |
51 |
return channelOPCDADeviceDao.selectById(id); |
|
52 |
} |
|
53 |
|
|
54 |
@Override |
|
55 |
public void add(ChannelOPCDADeviceEntity channelOPCDADeviceEntity) { |
|
56 |
channelOPCDADeviceDao.insert(channelOPCDADeviceEntity); |
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public void update(ChannelOPCDADeviceEntity channelOPCDADeviceEntity) { |
|
61 |
channelOPCDADeviceDao.updateById(channelOPCDADeviceEntity); |
|
62 |
} |
|
63 |
|
|
64 |
@Override |
|
65 |
public void delete(String id) { |
|
66 |
|
|
67 |
//先删除device下的tag |
|
68 |
channelOPCDATagService.deleteByServerId(id); |
|
69 |
|
|
70 |
channelOPCDADeviceDao.deleteById(id); |
|
71 |
} |
|
72 |
|
|
73 |
@Override |
|
74 |
public List<ChannelOPCDADeviceDTO> selectAll() { |
|
75 |
|
|
76 |
List<ChannelOPCDADeviceEntity> entityList = baseMapper.selectList( |
|
77 |
null |
|
78 |
); |
|
79 |
return ConvertUtils.sourceToTarget(entityList, ChannelOPCDADeviceDTO.class); |
|
80 |
} |
|
81 |
} |