Commit b3ffcd33 authored by chenfm's avatar chenfm

修复监控数据表不存在时报错情况

parent fdc55079
......@@ -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;
......
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