Commit 25d31d5f authored by huangcb's avatar huangcb

Merge branch 'master' into huangchb

parents c5806d06 69692d73
...@@ -32,8 +32,9 @@ public class AlarmListForm { ...@@ -32,8 +32,9 @@ public class AlarmListForm {
@NotNull(message = "参数pageSize不能为空", groups = {ValidatorList.class}) @NotNull(message = "参数pageSize不能为空", groups = {ValidatorList.class})
private Integer pageSize; private Integer pageSize;
private Long deviceType;
private String deviceName; private Long deviceInstance;
private Integer alarmLevel; private Integer alarmLevel;
......
...@@ -52,7 +52,13 @@ public class DashboardServiceImpl implements DashboardService { ...@@ -52,7 +52,13 @@ public class DashboardServiceImpl implements DashboardService {
+ " where device_id = ?" + " where device_id = ?"
+ " order by time desc limit 100"; + " order by time desc limit 100";
log.info("select modelData sql: {}", sql); 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)); modelDataVOList.add(new ModelDataVO(modelId, dataList));
} }
return modelDataVOList; return modelDataVOList;
......
...@@ -25,8 +25,11 @@ ...@@ -25,8 +25,11 @@
left join data_model model on rule.model_id = model.id left join data_model model on rule.model_id = model.id
left join data_model_property property on rule.property_id = property.id left join data_model_property property on rule.property_id = property.id
<where> <where>
<if test="alarmListForm.deviceName != null"> <if test="alarmListForm.deviceType != null">
device.name like '%${alarmListForm.deviceName}%' device.device_type_id = #{alarmListForm.deviceType}
</if>
<if test="alarmListForm.deviceInstance != null">
and device.id = #{alarmListForm.deviceInstance}
</if> </if>
<if test="alarmListForm.alarmLevel != null"> <if test="alarmListForm.alarmLevel != null">
and rule.alarm_level = #{alarmListForm.alarmLevel} 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