故障诊断逻辑新增

This commit is contained in:
weitang 2025-05-15 18:34:22 +08:00
parent 05ab1e9d4d
commit d4cbebaaf4
5 changed files with 42 additions and 12 deletions

View File

@ -51,11 +51,11 @@ public class AlgorithmDeviceController {
return ResponseResult.successData(algorithmDeviceParams);
}
// @PostMapping("/getAlgorithmDeviceParams")
// @ApiOperation("查询算法部件的参数")
// public ResponseResult getAlgorithmDeviceParams(String algorithmId, String componentId) {
// List<Map<String, Object>> algorithmDeviceParams = algorithmDeviceService.getAlgorithmDeviceParams(algorithmId
// , componentId);
// return ResponseResult.successData(algorithmDeviceParams);
// }
@PostMapping("/getAlgorithmDeviceCurve")
@ApiOperation("查询算法部件的参数曲线")
public ResponseResult getAlgorithmDeviceCurve(String algorithmId, String componentId) {
Map<String, Object> algorithmDeviceCurve = algorithmDeviceService.getAlgorithmDeviceCurve(algorithmId,
componentId);
return ResponseResult.successData(algorithmDeviceCurve);
}
}

View File

@ -3,6 +3,9 @@ package com.yfd.platform.modules.algorithm.mapper;
import com.yfd.platform.modules.algorithm.domain.AlgorithmDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
* <p>
* Mapper 接口
@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface AlgorithmDeviceMapper extends BaseMapper<AlgorithmDevice> {
List<Map<String, Object>> getAlgorithmDeviceParams(String algorithmId, String componentId);
}

View File

@ -25,4 +25,6 @@ public interface IAlgorithmDeviceService extends IService<AlgorithmDevice> {
List<Map<String, Object>> getAlgorithmDeviceParams(String algorithmId, String componentId);
Map<String, Object> getAlgorithmDeviceCurve(String algorithmId, String componentId);
}

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfd.platform.utils.SecurityUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@ -24,6 +25,9 @@ import java.util.Map;
@Service
public class AlgorithmDeviceServiceImpl extends ServiceImpl<AlgorithmDeviceMapper, AlgorithmDevice> implements IAlgorithmDeviceService {
@Resource
private AlgorithmDeviceMapper algorithmDeviceMapper;
/**********************************
* 用途说明: 批量新增算法分类部件点位关联数据
* 参数说明 algorithmDeviceList
@ -41,9 +45,11 @@ public class AlgorithmDeviceServiceImpl extends ServiceImpl<AlgorithmDeviceMappe
@Override
public List<Map<String, Object>> getAlgorithmDeviceParams(String algorithmId, String componentId) {
LambdaQueryWrapper<AlgorithmDevice> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StrUtil.isNotBlank(algorithmId), AlgorithmDevice::getAlgorithmId, algorithmId);
queryWrapper.eq(StrUtil.isNotBlank(componentId), AlgorithmDevice::getComponentId, componentId).select(AlgorithmDevice::getDeviceName, AlgorithmDevice::getDeviceId, AlgorithmDevice::getParamValue);
return this.listMaps(queryWrapper);
return algorithmDeviceMapper.getAlgorithmDeviceParams(algorithmId,componentId);
}
@Override
public Map<String, Object> getAlgorithmDeviceCurve(String algorithmId, String componentId) {
return null;
}
}

View File

@ -1,5 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yfd.platform.modules.algorithm.mapper.AlgorithmDeviceMapper">
<!--String algorithmId, String componentId-->
<select id="getAlgorithmDeviceParams" resultType="java.util.Map">
SELECT
ad.param_id,
ad.param_name,
ad.param_value,
ap.param_fixed
FROM
iis_algorithm_params ap
INNER JOIN iis_algorithm_device ad ON ap.id = ad.param_id
WHERE
ap.param_fixed = '1'
<if test="algorithmId != null and algorithmId != ''">
AND ad.algorithm_id LIKE CONCAT('%',#{algorithmId},'%')
</if>
<if test="componentId != null and componentId != ''">
AND ad.component_id LIKE CONCAT('%',#{componentId},'%')
</if>
</select>
</mapper>