<%
__header("Content-Type","text/html; charset=gb2312");
db_Open("/NandFlash/tmp/dbDat0.db3");
var sql="select DISTINCT dt.*,s.Name as SubSysName,sm.Name,sm.Note,sm.SerType,sm.SerDef,sm.SerAddr,sm.Tag2,b.Brief,df.ANote,dfv.ANote as ANote2 from tbSubSysDetail dt left join tbSubSys s on dt.SubSys=s.SubSys left join tbSM sm on dt.SID=sm.SID left join tbSMBrief b on dt.SID=b.SID left join tbSMDef df on dt.Type=df.Type and dt.Fld=df.Fld left join tbSMDefVal dfv on dt.Type=dfv.Type and dt.Fld=dfv.Fld and dt.SID=dfv.SID";
if (subsys!="qry") sql=sql+" where dt.SubSys="+subsys;
db_QryAdv(sql);
db_Close();
%>