|
@@ -0,0 +1,57 @@
|
|
|
+package com.usky.issue.service.impl;
|
|
|
+
|
|
|
+import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.usky.issue.domain.SpDeviceData;
|
|
|
+import com.usky.issue.domain.SpOwner;
|
|
|
+import com.usky.issue.domain.SpOwnerStatus;
|
|
|
+import com.usky.issue.mapper.SpOwnerStatusMapper;
|
|
|
+import com.usky.issue.service.SpOwnerService;
|
|
|
+import com.usky.issue.service.SpOwnerStatusService;
|
|
|
+import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author fu
|
|
|
+ * @since 2024-01-24
|
|
|
+ */
|
|
|
+@Service
|
|
|
+@DS("jdxf")
|
|
|
+public class SpOwnerStatusServiceImpl extends AbstractCrudService<SpOwnerStatusMapper, SpOwnerStatus> implements SpOwnerStatusService {
|
|
|
+ @Autowired
|
|
|
+ private SpOwnerService spOwnerService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备数据更新
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<SpOwnerStatus> getOwners() {
|
|
|
+ LambdaQueryWrapper<SpOwnerStatus> device = Wrappers.lambdaQuery();
|
|
|
+ device.select(SpOwnerStatus::getId, SpOwnerStatus::getDeviceId, SpOwnerStatus::getDwtype, SpOwnerStatus::getPointName,
|
|
|
+ SpOwnerStatus::getPointCode, SpOwnerStatus::getPointData, SpOwnerStatus::getDataTime, SpOwnerStatus::getContent)
|
|
|
+ .in(SpOwnerStatus::getDeviceId, spOwnerService.getDeviceCodes());
|
|
|
+ return baseMapper.selectList(device);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<SpOwnerStatus> getOwnersAfter(Integer lastId) {
|
|
|
+ LambdaQueryWrapper<SpOwnerStatus> wrapper = Wrappers.lambdaQuery();
|
|
|
+ wrapper.select(SpOwnerStatus::getId, SpOwnerStatus::getDeviceId, SpOwnerStatus::getPointName, SpOwnerStatus::getPointCode,
|
|
|
+ SpOwnerStatus::getPointData, SpOwnerStatus::getDwtype, SpOwnerStatus::getDataTime, SpOwnerStatus::getContent)
|
|
|
+ .gt(SpOwnerStatus::getId, lastId)
|
|
|
+ .in(SpOwnerStatus::getDeviceId, spOwnerService.getDeviceCodes());
|
|
|
+ return baseMapper.selectList(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|