named李由2013-12-04 09:39:43
<%
Map<String, Object> data;
StringBuffer sql=new StringBuffer("select * from(")
.append(" select")
.append(" a.DATA_TIME,")
.append(" a.KPI_ID,")
.append(" b.TOPIC||'('||b.data_unit||')' as topic,")
.append(" a.KPI_VALUE,")
.append(" a.LAST_VALUE,")
.append(" decode (a.alarm_lev,0,'green',1,'yellow',2,'red','1') as levpic,")
.append(" decode (a.alarm_lev,0,'正常',1,'告警',2,'异常','1') as title,")
.append(" a.TOM_KPI_VALUE")
.append(" from kpi_daily a, kpi_define b where a.object_id=1 and a.kpi_id = b.kpi_id and a.kpi_id = ? and b.kpi_type = 1 and b.industry_id = 5")
.append(" order by data_time desc) c")
.append(" where rownum <= 1");
List<Map<String, Object>> list = JdbcUtil.getJdbcTemplate().queryForList(sql.toString(),new Object[]{5001});
data=list.get(0);
%>
<tr>
<td><%=nullToBlank(data.get("topic")) %></td>
<td align="center" ><%=nullToBlank(data.get("last_value")) %></td>
<td align="center" ><%=nullToBlank(data.get("kpi_value")) %></td>
<td align="center" ><%=nullToBlank(data.get("tom_kpi_value")) %></td>
<td align="center" ><div><font color="<%=nullToBlank(data.get("levpic")) %>"><%=nullToBlank(data.get("title")) %></font><img width="20" height="20" title="<%=nullToBlank(data.get("title")) %>" src="<%=path%>/lifeline/bigscreen/images/<%=nullToBlank(data.get("levpic")) %>1.gif"/></div></td>
</tr>
这个你研究过没,看不懂,求指教~~~
- 主人回复:这个java代码和html代码混在一起了,太难看,大概就是显示一个数据库查询出来的表格吧。