|
|
@@ -0,0 +1,61 @@
|
|
|
+package com.zksy.base.alarm.service.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.zksy.base.alarm.domain.WarningThreshold;
|
|
|
+import com.zksy.base.alarm.mapper.WarningThresholdMapper;
|
|
|
+import com.zksy.base.alarm.service.WarningThresholdService;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+* @author Administrator
|
|
|
+* @description 针对表【warning_threshold(预警阈值)】的数据库操作Service实现
|
|
|
+* @createDate 2025-09-01 09:59:43
|
|
|
+*/
|
|
|
+@Service
|
|
|
+public class WarningThresholdServiceImpl extends ServiceImpl<WarningThresholdMapper, WarningThreshold>
|
|
|
+ implements WarningThresholdService {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<WarningThreshold> findByPage(long pageNum, long pageSize, String deviceName, String deviceCode, String warningType, String warningCode) {
|
|
|
+ Page<WarningThreshold> page = new Page<>(pageNum, pageSize);
|
|
|
+ LambdaQueryWrapper<WarningThreshold> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.like(WarningThreshold::getDeviceName,deviceName)
|
|
|
+ .like(WarningThreshold::getDeviceCode,deviceCode)
|
|
|
+ .like(WarningThreshold::getWarningType,warningType)
|
|
|
+ .like(WarningThreshold::getWarningCode,warningCode);
|
|
|
+ queryWrapper.orderByDesc(WarningThreshold::getUpdateTime);
|
|
|
+ return this.page(page, queryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<WarningThreshold> getWarningThresholdList(String deviceName, String deviceCode, String warningType, String warningCode) {
|
|
|
+ LambdaQueryWrapper<WarningThreshold> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.like(WarningThreshold::getDeviceName,deviceName)
|
|
|
+ .like(WarningThreshold::getDeviceCode,deviceCode)
|
|
|
+ .like(WarningThreshold::getWarningType,warningType)
|
|
|
+ .like(WarningThreshold::getWarningCode,warningCode);
|
|
|
+ queryWrapper.orderByDesc(WarningThreshold::getUpdateTime);
|
|
|
+ return this.list(queryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据设备编号查询该设备所有预警值
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public WarningThreshold getWarningThresholdByDeviceAndCode(String deviceCode, String warningCodes) {
|
|
|
+ LambdaQueryWrapper<WarningThreshold> lambdaQueryWrapper = Wrappers.lambdaQuery(WarningThreshold.class)
|
|
|
+ .eq(WarningThreshold::getDeviceCode, deviceCode)
|
|
|
+ .eq(WarningThreshold::getWarningCode,warningCodes);
|
|
|
+
|
|
|
+ return baseMapper.selectOne(lambdaQueryWrapper);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|