告警阈值优化
This commit is contained in:
parent
fc5d6e9612
commit
9b02f59135
@ -0,0 +1,79 @@
|
||||
package com.yfd.platform.modules.basedata.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.modules.basedata.domain.AlarmThreshold;
|
||||
import com.yfd.platform.modules.basedata.service.IAlarmThresholdService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author tangwei
|
||||
* @since 2024-04-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/basedata/alarm-threshold")
|
||||
@Api(value = "AlarmThresholdController", tags = "告警阈值设置")
|
||||
public class AlarmThresholdController {
|
||||
|
||||
@Resource
|
||||
private IAlarmThresholdService alarmThresholdService;
|
||||
|
||||
@ApiOperation("分页查看告警阈值")
|
||||
@GetMapping("/getAlgorithmModelPage")
|
||||
public ResponseResult getAlgorithmModelPage(Page<Map<String, Object>> page) {
|
||||
Page<Map<String, Object>> mapPage = alarmThresholdService.pageMaps(page);
|
||||
return ResponseResult.successData(mapPage);
|
||||
}
|
||||
|
||||
@ApiOperation("根据点位ID查看告警阈值")
|
||||
@GetMapping("/getAlgorithmModelById")
|
||||
public ResponseResult getAlgorithmModelById(String id) {
|
||||
List<AlarmThreshold> list =
|
||||
alarmThresholdService.list(new LambdaQueryWrapper<AlarmThreshold>().eq(AlarmThreshold::getDeviceId,
|
||||
id));
|
||||
if (list.size() <= 0) {
|
||||
return ResponseResult.successData(null);
|
||||
}
|
||||
AlarmThreshold alarmThreshold = list.get(0);
|
||||
Map<String, Object> m = new HashMap<>(BeanUtil.beanToMap(alarmThreshold));
|
||||
Map<String, String> thresholdInterval = alarmThresholdService.getThresholdInterval(id);
|
||||
m.putAll(thresholdInterval);
|
||||
return ResponseResult.successData(m);
|
||||
}
|
||||
|
||||
@ApiOperation("设置告警阈值")
|
||||
@PostMapping("/setAlgorithmModel")
|
||||
public ResponseResult updateAlgorithmModel(@RequestBody String alarmThresholdList) {
|
||||
List<AlarmThreshold> alarmThresholds = JSONUtil.toList(alarmThresholdList, AlarmThreshold.class);
|
||||
if (alarmThresholds.size() <= 0) {
|
||||
return ResponseResult.error("数据为空");
|
||||
}
|
||||
Set<String> ids =
|
||||
alarmThresholds.stream().map(AlarmThreshold::getDeviceId).collect(Collectors.toSet());
|
||||
// 删除之前的阈值
|
||||
alarmThresholdService.remove(new LambdaQueryWrapper<AlarmThreshold>().in(AlarmThreshold::getDeviceId, ids));
|
||||
boolean ok = alarmThresholdService.saveOrUpdateBatch(alarmThresholds);
|
||||
if (ok) {
|
||||
return ResponseResult.success();
|
||||
} else {
|
||||
return ResponseResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.yfd.platform.modules.basedata.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhengsl
|
||||
* @since 2024-04-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("iis_alarm_threshold")
|
||||
public class AlarmThreshold implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 告警阈值 id:station_id 变电站编码+ device_id 设备点位 ID+ defect_type 缺陷识别类型+ alarm_type 告警类型唯一
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String alarmThresholdId;
|
||||
|
||||
/**
|
||||
* 变电站编码
|
||||
*/
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 变电站名称
|
||||
*/
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 设备点位 ID
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 设备点位名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 缺陷类型定义见 I.11
|
||||
*/
|
||||
private String defectType;
|
||||
|
||||
/**
|
||||
* 变电站编码,与业务中台保持一致
|
||||
*/
|
||||
private String stationCode;
|
||||
|
||||
/**
|
||||
* 判定规则,1 等于 ,2 不等于 ,3 包括 ,4 不包括,5 上下限 ,6 上限 ,7 下限
|
||||
*/
|
||||
private String decideRule;
|
||||
|
||||
/**
|
||||
* 判定值类别,1 数值,2 百分比
|
||||
*/
|
||||
private String decisionValueClass;
|
||||
|
||||
/**
|
||||
* 告警描述
|
||||
*/
|
||||
private String alarmDesc;
|
||||
|
||||
/**
|
||||
* 告警类型1 超温报警 2 温升报警 3 三相温差报警 4 三相对比报警 5 声音异常 6 外观异常 7 仪表越限报警 8 仪表超量程报警 9 仪表三相对比 10 变位报警
|
||||
*/
|
||||
private String alarmType;
|
||||
|
||||
/**
|
||||
* 告警类别:1:阈值类;2:状态类;3:趋势类
|
||||
*/
|
||||
private String alarmClass;
|
||||
|
||||
/**
|
||||
* 是否跟上次结果对比,1:是;0:否
|
||||
*/
|
||||
private String isLastContrast;
|
||||
|
||||
/**
|
||||
* 启用/禁用;0:禁用;1:启用
|
||||
*/
|
||||
private String isenable;
|
||||
|
||||
/**
|
||||
* 报警判断值(状态类、趋势类)
|
||||
*/
|
||||
private String baseLineValue;
|
||||
|
||||
/**
|
||||
* 报警判断值(状态类、趋势类)
|
||||
*/
|
||||
private String baseValue;
|
||||
|
||||
/**
|
||||
* <1>:一般,<2>:严重,<3>:危急
|
||||
*/
|
||||
private String alarmLevel;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.yfd.platform.modules.basedata.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.modules.basedata.domain.AlarmThreshold;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhengsl
|
||||
* @since 2024-04-16
|
||||
*/
|
||||
public interface AlarmThresholdMapper extends BaseMapper<AlarmThreshold> {
|
||||
|
||||
Map<String, String> getThresholdInterval(String deviceId);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.yfd.platform.modules.basedata.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.modules.basedata.domain.AlarmThreshold;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhengsl
|
||||
* @since 2024-04-16
|
||||
*/
|
||||
public interface IAlarmThresholdService extends IService<AlarmThreshold> {
|
||||
|
||||
Map<String, String> getThresholdInterval(String deviceId);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.yfd.platform.modules.basedata.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.modules.basedata.domain.AlarmThreshold;
|
||||
import com.yfd.platform.modules.basedata.mapper.AlarmThresholdMapper;
|
||||
import com.yfd.platform.modules.basedata.service.IAlarmThresholdService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhengsl
|
||||
* @since 2024-04-16
|
||||
*/
|
||||
@Service
|
||||
public class AlarmThresholdServiceImpl extends ServiceImpl<AlarmThresholdMapper, AlarmThreshold> implements IAlarmThresholdService {
|
||||
|
||||
@Resource
|
||||
private AlarmThresholdMapper alarmThresholdMapper;
|
||||
@Override
|
||||
public Map<String, String> getThresholdInterval(String deviceId) {
|
||||
return alarmThresholdMapper.getThresholdInterval(deviceId);
|
||||
}
|
||||
}
|
@ -60,14 +60,6 @@ public class AlarmLogController {
|
||||
if (StrUtil.isBlank(stationId)) {
|
||||
return ResponseResult.error("未传变电站信息");
|
||||
}
|
||||
//TODO 整合辅控告警
|
||||
// LambdaQueryWrapper<AlarmLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(AlarmLog::getStationId, stationId).eq(AlarmLog::getDatastatus, "1").eq
|
||||
// (AlarmLog::getCheckFlag
|
||||
// , 0).select(AlarmLog::getId,
|
||||
// AlarmLog::getContent, AlarmLog::getAlarmLevel, AlarmLog::getAlarmDate,
|
||||
// AlarmLog::getStationName).orderByDesc(AlarmLog::getAlarmDate);
|
||||
// List<Map<String, Object>> maps = alarmLogService.listMaps(queryWrapper);
|
||||
List<Map<String, Object>> maps = alarmLogService.getAlarmLogList(stationId);
|
||||
return ResponseResult.successData(maps);
|
||||
}
|
||||
|
@ -1662,4 +1662,46 @@ public class TaskTodoController {
|
||||
boolean isOk = taskTodoService.onceAnalyse(jsonObject.getStr("id"));
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/getResultByPatroldevice")
|
||||
@ApiOperation("根据设备id获取点位信息")
|
||||
public ResponseResult getResultByPatroldevice(Page<Map<String, Object>> page, String patroldeviceId,
|
||||
String mainDeviceId, String taskName, String recognitionType,
|
||||
String valid, String isReport, String startDate, String endDate) {
|
||||
// SubstationPatroldevice substationPatroldevice = substationPatroldeviceService.getById(patroldeviceId);
|
||||
String startFormat = "";
|
||||
if (StrUtil.isNotBlank(startDate)) {
|
||||
Date parseStart = DateUtil.parse(startDate);
|
||||
//一天的开始
|
||||
Date beginOfDay = DateUtil.beginOfDay(parseStart);
|
||||
startFormat = DateUtil.format(beginOfDay, "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
String endFormat = "";
|
||||
if (StrUtil.isNotBlank(startDate)) {
|
||||
Date parseEnd = DateUtil.parse(endDate);
|
||||
//一天的结束
|
||||
Date endOfDay = DateUtil.endOfDay(parseEnd);
|
||||
endFormat = DateUtil.format(endOfDay, "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
Page<Map<String, Object>> mapPage = taskTodoService.getResultByPatroldevice(page, null, mainDeviceId,
|
||||
taskName, recognitionType, valid, isReport, startFormat, endFormat);
|
||||
List<Map<String, Object>> records = mapPage.getRecords();
|
||||
records.forEach(m -> {
|
||||
String flag = m.get("flag").toString();
|
||||
String valid1 = Objects.isNull(m.get("valid1")) ? "" : m.get("valid1").toString();
|
||||
if ("4".equals(flag)) {
|
||||
m.put("analysisResult", "识别失败");
|
||||
} else if ("6".equals(flag)) {
|
||||
m.put("analysisResult", "采集失败");
|
||||
} else if (StrUtil.isNotBlank(valid1) && "1".equals(valid1)) {
|
||||
m.put("analysisResult", "正常");
|
||||
} else if (StrUtil.isNotBlank(valid1) && "2".equals(valid1)) {
|
||||
m.put("analysisResult", "异常");
|
||||
} else {
|
||||
m.put("analysisResult", "");
|
||||
}
|
||||
});
|
||||
mapPage.setRecords(records);
|
||||
return ResponseResult.successData(mapPage);
|
||||
}
|
||||
}
|
||||
|
@ -205,4 +205,6 @@ public interface TaskResultMapper extends BaseMapper<TaskResult> {
|
||||
|
||||
List<Map<String, Object>> getValueByDeviceId(String deviceId);
|
||||
|
||||
Page<Map<String, Object>> getResultByPatroldevice(Page<Map<String, Object>> page, String internationalId,String mainDeviceId, String taskName, String recognitionType, String valid,String isReport,String startDate,String endDate);
|
||||
|
||||
}
|
||||
|
@ -476,4 +476,9 @@ public interface ITaskTodoService extends IService<TaskTodo> {
|
||||
boolean onceAnalyse(String id) throws Exception;
|
||||
|
||||
void exportMeterDataByTaskTodoId(String taskTodoId, HttpServletResponse response);
|
||||
|
||||
Page<Map<String, Object>> getResultByPatroldevice(Page<Map<String, Object>> page, String patroldeviceId,
|
||||
String mainDeviceId, String taskName, String recognitionType,
|
||||
String valid, String isReport, String startDate, String endDate);
|
||||
|
||||
}
|
||||
|
@ -2805,4 +2805,15 @@ public class TaskTodoServiceImpl extends ServiceImpl<TaskTodoMapper, TaskTodo> i
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<Map<String, Object>> getResultByPatroldevice(Page<Map<String, Object>> page, String internationalId,
|
||||
String mainDeviceId,
|
||||
String taskName, String recognitionType, String valid,
|
||||
String isReport, String startDate,
|
||||
String endDate) {
|
||||
return taskResultMapper.getResultByPatroldevice(page, internationalId, mainDeviceId, taskName,
|
||||
recognitionType, valid,
|
||||
isReport, startDate, endDate);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
<?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.basedata.mapper.AlarmThresholdMapper">
|
||||
|
||||
<select id="getThresholdInterval" resultType="java.util.Map">
|
||||
|
||||
SELECT
|
||||
device_id,
|
||||
MAX(CASE WHEN (alarm_level = '2' AND decide_rule ='6') THEN base_line_value ELSE NULL END) AS commonLower,
|
||||
MAX(CASE WHEN (alarm_level = '2' AND decide_rule ='7') THEN base_line_value ELSE NULL END) AS commonUpper,
|
||||
MAX(CASE WHEN (alarm_level = '3' AND decide_rule ='6') THEN base_line_value ELSE NULL END) AS seriousLower,
|
||||
MAX(CASE WHEN (alarm_level = '3' AND decide_rule ='7') THEN base_line_value ELSE NULL END) AS seriousUpper,
|
||||
MAX(CASE WHEN (alarm_level = '4' AND decide_rule ='6') THEN base_line_value ELSE NULL END) AS dangerLower,
|
||||
MAX(CASE WHEN (alarm_level = '4' AND decide_rule ='7') THEN base_line_value ELSE NULL END) AS dangerUpper
|
||||
FROM
|
||||
iis_alarm_threshold
|
||||
WHERE device_id = #{deviceId}
|
||||
</select>
|
||||
</mapper>
|
@ -102,21 +102,11 @@
|
||||
al.id = #{id}
|
||||
</select>
|
||||
<select id="getNotCheckAlarmCount" resultType="com.yfd.platform.modules.patroltask.domain.AlarmLog">
|
||||
SELECT
|
||||
record_id AS id,
|
||||
ds.main_device_id,
|
||||
ds.main_component_id,
|
||||
'01' system_type
|
||||
FROM
|
||||
`fk_device_alarm_record` dar
|
||||
INNER JOIN fk_device_signal ds ON dar.signal_id = ds.signal_id
|
||||
WHERE
|
||||
dar.station_id = #{stationId} UNION ALL
|
||||
SELECT
|
||||
id,
|
||||
main_device_id,
|
||||
component_id,
|
||||
'02' system_type
|
||||
alarm_source_type
|
||||
FROM
|
||||
iis_alarm_log
|
||||
WHERE
|
||||
|
@ -66,18 +66,27 @@
|
||||
|
||||
<select id="getTaskDeviceList" resultType="java.util.Map">
|
||||
SELECT
|
||||
t.*,sd.station_name,sd.meter_type AS meterType,sd.patroldevice_json AS patroldeviceJson,sd.device_class AS deviceClass,sd.early_min,sd.early_max,
|
||||
sd.same_min,sd.same_max,sd.serious_min,sd.serious_max,sd.critical_min,sd.critical_max
|
||||
t.*,sd.meter_type AS meterType,sd.patroldevice_json AS patroldeviceJson,sd.device_class AS deviceClass,atd.commonLower,atd.commonUpper,atd.seriousLower,atd.seriousUpper,atd.dangerLower,atd.dangerUpper
|
||||
FROM
|
||||
( SELECT *, CASE WHEN revise_valid = '0' THEN '1' WHEN revise_valid = '1' THEN '2' ELSE valid END AS valid1 FROM
|
||||
iis_task_result ) t
|
||||
LEFT JOIN iis_substation_device sd
|
||||
ON sd.device_id= t.device_id
|
||||
INNER JOIN iis_substation_device sd ON sd.device_id= t.device_id
|
||||
INNER JOIN iis_task_todo td ON td.task_todo_id=t.task_todo_id
|
||||
LEFT JOIN (SELECT
|
||||
device_id,
|
||||
MAX(CASE WHEN (alarm_level = '1' AND decide_rule ='6') THEN base_line_value ELSE NULL END) AS commonLower,
|
||||
MAX(CASE WHEN (alarm_level = '1' AND decide_rule ='7') THEN base_line_value ELSE NULL END) AS commonUpper,
|
||||
MAX(CASE WHEN (alarm_level = '2' AND decide_rule ='6') THEN base_line_value ELSE NULL END) AS seriousLower,
|
||||
MAX(CASE WHEN (alarm_level = '2' AND decide_rule ='7') THEN base_line_value ELSE NULL END) AS seriousUpper,
|
||||
MAX(CASE WHEN (alarm_level = '3' AND decide_rule ='6') THEN base_line_value ELSE NULL END) AS dangerLower,
|
||||
MAX(CASE WHEN (alarm_level = '3' AND decide_rule ='7') THEN base_line_value ELSE NULL END) AS dangerUpper
|
||||
FROM
|
||||
iis_alarm_threshold GROUP BY device_id) atd ON atd.device_id = t.device_id
|
||||
WHERE
|
||||
t.datastatus = '1'
|
||||
AND t.task_todo_id = #{taskTodoId}
|
||||
<if test="deviceName != null and deviceName != ''">
|
||||
AND t.device_name LIKE concat('%',#{deviceName},'%')
|
||||
AND sd.device_name LIKE concat('%',#{deviceName},'%')
|
||||
</if>
|
||||
<if test="valid == 1">
|
||||
AND (t.valid1= #{valid}
|
||||
@ -87,7 +96,8 @@
|
||||
AND (t.valid1= #{valid}
|
||||
OR ( t.flag = '4' OR t.flag = '6' ))
|
||||
</if>
|
||||
ORDER BY sd.device_code
|
||||
ORDER BY
|
||||
sd.device_code ASC
|
||||
</select>
|
||||
<select id="getHistoricalCurve" resultType="java.util.Map">
|
||||
SELECT
|
||||
@ -772,6 +782,61 @@ ORDER BY
|
||||
AND (t.valid1= '2'
|
||||
OR ( t.flag = '4' OR t.flag = '6' ))
|
||||
</select>
|
||||
|
||||
<select id="getResultByPatroldevice" resultType="java.util.Map">
|
||||
SELECT
|
||||
t.*,sd.meter_type AS meterType,sd.patroldevice_json AS patroldeviceJson,sd.label_attri,sd.point_type AS deviceClass,atd.commonLower,atd.commonUpper,atd.seriousLower,atd.seriousUpper,atd.dangerLower,atd.dangerUpper
|
||||
FROM
|
||||
( SELECT *, CASE WHEN revise_valid = '0' THEN '1' WHEN revise_valid = '1' THEN '2' ELSE valid END AS valid1 FROM
|
||||
iis_task_result ) t
|
||||
INNER JOIN iis_substation_device sd ON sd.device_id= t.device_id
|
||||
INNER JOIN iis_task_todo td ON td.task_todo_id=t.task_todo_id
|
||||
LEFT JOIN (SELECT
|
||||
device_id,
|
||||
MAX(CASE WHEN (alarm_level = '1' AND decide_rule ='6') THEN base_line_value ELSE NULL END) AS commonLower,
|
||||
MAX(CASE WHEN (alarm_level = '1' AND decide_rule ='7') THEN base_line_value ELSE NULL END) AS commonUpper,
|
||||
MAX(CASE WHEN (alarm_level = '2' AND decide_rule ='6') THEN base_line_value ELSE NULL END) AS seriousLower,
|
||||
MAX(CASE WHEN (alarm_level = '2' AND decide_rule ='7') THEN base_line_value ELSE NULL END) AS seriousUpper,
|
||||
MAX(CASE WHEN (alarm_level = '3' AND decide_rule ='6') THEN base_line_value ELSE NULL END) AS dangerLower,
|
||||
MAX(CASE WHEN (alarm_level = '3' AND decide_rule ='7') THEN base_line_value ELSE NULL END) AS dangerUpper
|
||||
FROM
|
||||
iis_alarm_threshold GROUP BY device_id) atd ON atd.device_id = t.device_id
|
||||
WHERE
|
||||
t.datastatus = '1'
|
||||
<if test="taskName != null and taskName != ''">
|
||||
AND t.task_name LIKE concat('%',#{taskName},'%')
|
||||
</if>
|
||||
<if test="valid == 1">
|
||||
AND (t.valid1= #{valid}
|
||||
AND ( t.flag != '4' AND t.flag != '6' ))
|
||||
</if>
|
||||
<if test="valid == 2">
|
||||
AND (t.valid1= #{valid}
|
||||
OR ( t.flag = '4' OR t.flag = '6' ))
|
||||
</if>
|
||||
|
||||
<if test="internationalId != null and internationalId != ''">
|
||||
AND t.patroldevice_code=#{internationalId}
|
||||
</if>
|
||||
<if test="mainDeviceId != null and mainDeviceId != ''">
|
||||
AND t.main_device_id = #{mainDeviceId}
|
||||
</if>
|
||||
<if test="recognitionType != null and recognitionType != ''">
|
||||
AND t.recognition_type=#{recognitionType}
|
||||
</if>
|
||||
<if test="isReport != null and isReport != ''">
|
||||
AND t.is_report=#{isReport}
|
||||
</if>
|
||||
<if test="startDate != null and startDate != ''">
|
||||
AND t.patroldevice_date >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
AND t.patroldevice_date <= #{endDate}
|
||||
</if>
|
||||
ORDER BY
|
||||
t.order_num ASC
|
||||
</select>
|
||||
|
||||
<select id="getValueByDeviceId" resultType="java.util.Map">
|
||||
SELECT * FROM iis_recognition WHERE device_id=#{deviceId}
|
||||
</select>
|
||||
|
Loading…
Reference in New Issue
Block a user