<%
' select case equipType
' case "type1"
' call type1()
' case "main"
' call main()
' case else
' call main()
' end select
if areaid = "" then
call main()
else
call testPage()
end if
If FoundErr = True Then
Call WriteErrMsg(ErrMsg, ComeUrl)
End If
sub main()
%>

|
<%
end sub
sub testPage()
%>
 |
<%=areaname%> |
|
<%
dim rsclass
if child = 0 then
sql = "select t_classid, classname from t_area where t_classid = " & areaid & " order by orderid"
else
sql = "select t_classid, classname from t_area where parentid = " & areaid & " order by orderid"
end if
set rsclass = conn.execute(sql)
if rsclass.bof and rsclass.eof then
response.write "无数据 "
else
do while not rsclass.eof
%>
 |
<%=rsclass("classname")%> |
 |
<%
dim rsc2
set rsc2 = conn.execute("select devicename, uid from t_dev_property where areaid = " & rsclass("t_classid") & " order by uid")
do while not rsc2.eof
'大循环
dim rsv, sqlv, i
sqlv = "select * from t_dev_variant where uid = '" & rsc2("uid") & "' and realtimeflag = true order by uid, description"
'sqlv = "select v.id, v.description, v.uid, v.upperlimit, v.lowerlimit, v.normalstate, v.realtimeflag from t_dev_variant v left join t_dev_property p on v.uid = p.uid where v.uid = '" & rsc2("uid") & "' and v.realtimeflag = true order by p.uid, v.description"
set rsv = server.CreateObject("ADODB.Recordset")
rsv.open sqlv, conn, 1, 1
i = 0
if rsv.bof and rsv.eof then
%>
<%
else
%>
 |
 |
 |
 |
<%
do while not rsv.eof
i = i + 1
dim sqlsl, rssl, sqlvs, rsvs
sqlsl = "select curr_value from t_summary_log where type_desc = '" & rsv("description") & "' order by varuid"
set rssl = server.CreateObject("adodb.recordset")
rssl.open sqlsl, conn, 1, 1
if rssl.bof and rssl.eof then
%>
| <%if i = 1 then getdClass(rsv("uid"))%> |
<%=rsv("description")%> |
- |
<%if rsv("upperlimit") = 0 and rsv("lowerlimit") = 0 then response.write rsv("normalstate") else response.write rsv("lowerlimit") & "~" & rsv("upperlimit")%> |
<%
else
if rsv("upperlimit") = 0 and rsv("lowerlimit") = 0 then
if rssl(0) = rsv("normalstate") then
%>
| <%if i = 1 then getdClass(rsv("uid"))%> |
<%=rsv("description")%> |
正常(<%=rssl(0)%>) |
<%if rsv("upperlimit") = 0 and rsv("lowerlimit") = 0 then response.write rsv("normalstate") else response.write rsv("lowerlimit") & "~" & rsv("upperlimit")%> |
<%
else
sqlvs = "select statusdesc from t_var_status where id = '" & rsv("id") & "' and devuid = '" & rsv("uid") & "' and statusid = '" & CInt(rssl(0)) & "'"
set rsvs = conn.execute(sqlvs)
if rsvs.bof and rsvs.eof then
%>
| <%if i = 1 then getdClass(rsv("uid"))%> |
<%=rsv("description")%> |
<%=rssl(0)%> |
- |
<%
else
%>
| <%if i = 1 then getdClass(rsv("uid"))%> |
<%=rsv("description")%> |
<%response.write rsvs(0) & "(" & rssl(0) & ")"%> |
<%if rsv("upperlimit") = 0 and rsv("lowerlimit") = 0 then response.write rsv("normalstate") else response.write rsv("lowerlimit") & "~" & rsv("upperlimit")%> |
<%
end if
end if
else
if rssl(0) < rsv("lowerlimit") then
%>
| <%if i = 1 then getdClass(rsv("uid"))%> |
<%=rsv("description")%> |
<%response.write "下限报警(" &rssl(0) & ")"%> |
<%if rsv("upperlimit") = 0 and rsv("lowerlimit") = 0 then response.write rsv("normalstate") else response.write rsv("lowerlimit") & "~" & rsv("upperlimit")%> |
<%
elseif rssl(0) > rsv("upperlimit") then
%>
| <%if i = 1 then getdClass(rsv("uid"))%> |
<%=rsv("description")%> |
<%response.write "上限报警(" &rssl(0) & ")"%> |
<%if rsv("upperlimit") = 0 and rsv("lowerlimit") = 0 then response.write rsv("normalstate") else response.write rsv("lowerlimit") & "~" & rsv("upperlimit")%> |
<%
else
%>
| <%if i = 1 then getdClass(rsv("uid"))%> |
<%=rsv("description")%> |
<%response.write "正常(" &rssl(0) & ")"%> |
<%if rsv("upperlimit") = 0 and rsv("lowerlimit") = 0 then response.write rsv("normalstate") else response.write rsv("lowerlimit") & "~" & rsv("upperlimit")%> |
<%
end if
end if
end if
rsv.movenext
loop
rsv.close
set rsv = nothing
end if
%>
<%
rsc2.movenext
loop
'大循环结束
rsclass.movenext
loop
end if
rsclass.close
set rsclass = nothing
%>
|
<%
end sub
%>
|