Commit 25d31d5f authored by huangcb's avatar huangcb

Merge branch 'master' into huangchb

parents c5806d06 69692d73
......@@ -32,8 +32,9 @@ public class AlarmListForm {
@NotNull(message = "参数pageSize不能为空", groups = {ValidatorList.class})
private Integer pageSize;
private Long deviceType;
private String deviceName;
private Long deviceInstance;
private Integer alarmLevel;
......
......@@ -52,7 +52,13 @@ public class DashboardServiceImpl implements DashboardService {
+ " where device_id = ?"
+ " order by time desc limit 100";
log.info("select modelData sql: {}", sql);
List<Map<String, Object>> dataList = jdbcTemplate.queryForList(sql, dashboardReq.getDeviceId());
List<Map<String, Object>> dataList;
try {
dataList = jdbcTemplate.queryForList(sql, dashboardReq.getDeviceId());
} catch (Exception e) {
log.error(e.getMessage(), e);
dataList = new ArrayList<>();
}
modelDataVOList.add(new ModelDataVO(modelId, dataList));
}
return modelDataVOList;
......
......@@ -25,8 +25,11 @@
left join data_model model on rule.model_id = model.id
left join data_model_property property on rule.property_id = property.id
<where>
<if test="alarmListForm.deviceName != null">
device.name like '%${alarmListForm.deviceName}%'
<if test="alarmListForm.deviceType != null">
device.device_type_id = #{alarmListForm.deviceType}
</if>
<if test="alarmListForm.deviceInstance != null">
and device.id = #{alarmListForm.deviceInstance}
</if>
<if test="alarmListForm.alarmLevel != null">
and rule.alarm_level = #{alarmListForm.alarmLevel}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment