public double GetRealValue(string id) { double d_value = 0;//T_INFO_REALTIMEVALUE原本是实时表 DAL.DALDefault dal_df = new DALDefault(); // string sql = "select * from (select * from t_info_histvalue where T_TAG='" + id + "' and " + //"t_time<=to_date('" + DateTime.Now + "','yyyy-MM-dd HH24:MI:SS') order by t_time desc) where ROWNUM =1 order by ROWNUM asc"; DataTable dt = dal_df.GetDT(id, DateTime.Now); if (dt.Rows.Count > 0) { d_value = Convert.ToDouble(dt.Rows[0]["D_VALUE"].ToString()); } return(Math.Round(d_value, 2)); }
public double GetPointValue(string id) { double d_value = 0; string sql = "select * from T_BASE_POINTS_UNIT where T_ORGID ='" + id + "'"; DataTable dt = dl.RunDataTable(sql, out errMsg); if (dt.Rows.Count > 0) { DAL.DALDefault dal_df = new DALDefault(); DataTable dtt = dal_df.GetDT(id, DateTime.Now); //T_INFO_REALTIMEVALUE原本是实时表 // string sql1 = "select * from (select * from t_info_histvalue where T_TAG='" + dt.Rows[0]["T_POWERTAG"].ToString() + "' and " + //"t_time<=to_date('" + DateTime.Now + "','yyyy-MM-dd HH24:MI:SS') order by t_time desc) where ROWNUM =1 order by ROWNUM asc"; // DataTable dtt = dl.RunDataTable(sql1,out errMsg); if (dtt.Rows[0][0].ToString() != "") { d_value = Convert.ToDouble(dtt.Rows[0][0].ToString()); } } return(Math.Round(d_value, 2)); }
public double GetRealValue(string id) { double d_value = 0;//T_INFO_REALTIMEVALUE原本是实时表 DAL.DALDefault dal_df = new DALDefault(); // string sql = "select * from (select * from t_info_histvalue where T_TAG='" + id + "' and " + //"t_time<=to_date('" + DateTime.Now + "','yyyy-MM-dd HH24:MI:SS') order by t_time desc) where ROWNUM =1 order by ROWNUM asc"; DataTable dt = dal_df.GetDT(id, DateTime.Now); if (dt.Rows.Count > 0) { d_value =Convert.ToDouble( dt.Rows[0]["D_VALUE"].ToString()); } return Math.Round(d_value, 2); }
public double GetPointValue(string id) { double d_value = 0; string sql = "select * from T_BASE_POINTS_UNIT where T_ORGID ='"+id+"'"; DataTable dt = dl.RunDataTable(sql,out errMsg); if (dt.Rows.Count > 0) { DAL.DALDefault dal_df = new DALDefault(); DataTable dtt = dal_df.GetDT(id, DateTime.Now); //T_INFO_REALTIMEVALUE原本是实时表 // string sql1 = "select * from (select * from t_info_histvalue where T_TAG='" + dt.Rows[0]["T_POWERTAG"].ToString() + "' and " + //"t_time<=to_date('" + DateTime.Now + "','yyyy-MM-dd HH24:MI:SS') order by t_time desc) where ROWNUM =1 order by ROWNUM asc"; // DataTable dtt = dl.RunDataTable(sql1,out errMsg); if (dtt.Rows[0][0].ToString() != "") { d_value = Convert.ToDouble(dtt.Rows[0][0].ToString()); } } return Math.Round(d_value, 2); }
public IList<Hashtable> GetLineData(string id) { string errMsg = ""; DataTable dt = null; DAL.DALDefault dal_df = new DALDefault(); string sql = ""; if (id == "1") { sql = "select t_base_points_org.t_orgid,t_base_points_org.T_POWERTAG,T_BASE_COMPANY.t_comname,T_BASE_COMPANY.t_comid "+ "from t_base_points_org inner join T_BASE_COMPANY on t_base_points_org.t_orgid=T_BASE_COMPANY.t_comid"; } else if (id == "2") { sql = "select t_base_points_org.t_orgid,t_base_points_org.T_POWERTAG,t_base_department.t_depname as t_comname from t_base_points_org inner join t_base_department on " + "t_base_points_org.t_orgid=t_base_department.t_depid and t_base_department.t_depid ='D_CN'"; } else if (id == "3") { sql = " select t_base_points_org.t_orgid,t_base_points_org.T_POWERTAG,t_base_plant.t_plantname as t_comname, "+ "t_base_plant.t_plantid as T_COMID from t_base_points_org inner join t_base_plant on "+ "t_base_points_org.t_orgid=t_base_plant.t_plantid and t_base_plant.t_comid='C_DIMIAN' "+ "order by t_base_plant.t_plantid asc"; } else if (id == "4") { sql = " select t_base_points_org.t_orgid,t_base_points_org.T_POWERTAG,t_base_plant.t_plantname as t_comname, " + "t_base_plant.t_plantid as T_COMID from t_base_points_org inner join t_base_plant on " + "t_base_points_org.t_orgid=t_base_plant.t_plantid and t_base_plant.t_comid='C_BAPV' " + "order by t_base_plant.t_plantid asc"; } dt = dl.RunDataTable(sql, out errMsg); IList<Hashtable> listdata = new List<Hashtable>(); Hashtable ht = new Hashtable(); ArrayList ld = new ArrayList(); ArrayList lt = new ArrayList(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataTable DTT = dal_df.GetDT(dt.Rows[i]["T_POWERTAG"].ToString(), DateTime.Now); // DataTable DTT = null;//T_INFO_REALTIMEVALUE原本是实时表 // string sql1 = "select * from (select * from t_info_histvalue where T_TAG='" + dt.Rows[i]["T_POWERTAG"].ToString() + "' and " + //"t_time<=to_date('" + DateTime.Now + "','yyyy-MM-dd HH24:MI:SS') order by t_time desc) where ROWNUM =1 order by ROWNUM asc"; // DTT = dl.RunDataTable(sql1, out errMsg); if (DTT.Rows.Count > 0) { ld.Add(Math.Round(Convert.ToDouble(DTT.Rows[0]["D_VALUE"].ToString()), 2)); ht.Add("name", dt.Rows[i]["t_comname"].ToString()); ht.Add("data", ld); ld = new ArrayList(); listdata.Add(ht); ht = new Hashtable(); } } } return listdata; }
public IList <Hashtable> GetLineData(string id) { string errMsg = ""; DataTable dt = null; DAL.DALDefault dal_df = new DALDefault(); string sql = ""; if (id == "1") { sql = "select t_base_points_org.t_orgid,t_base_points_org.T_POWERTAG,T_BASE_COMPANY.t_comname,T_BASE_COMPANY.t_comid " + "from t_base_points_org inner join T_BASE_COMPANY on t_base_points_org.t_orgid=T_BASE_COMPANY.t_comid"; } else if (id == "2") { sql = "select t_base_points_org.t_orgid,t_base_points_org.T_POWERTAG,t_base_department.t_depname as t_comname from t_base_points_org inner join t_base_department on " + "t_base_points_org.t_orgid=t_base_department.t_depid and t_base_department.t_depid ='D_CN'"; } else if (id == "3") { sql = " select t_base_points_org.t_orgid,t_base_points_org.T_POWERTAG,t_base_plant.t_plantname as t_comname, " + "t_base_plant.t_plantid as T_COMID from t_base_points_org inner join t_base_plant on " + "t_base_points_org.t_orgid=t_base_plant.t_plantid and t_base_plant.t_comid='C_DIMIAN' " + "order by t_base_plant.t_plantid asc"; } else if (id == "4") { sql = " select t_base_points_org.t_orgid,t_base_points_org.T_POWERTAG,t_base_plant.t_plantname as t_comname, " + "t_base_plant.t_plantid as T_COMID from t_base_points_org inner join t_base_plant on " + "t_base_points_org.t_orgid=t_base_plant.t_plantid and t_base_plant.t_comid='C_BAPV' " + "order by t_base_plant.t_plantid asc"; } dt = dl.RunDataTable(sql, out errMsg); IList <Hashtable> listdata = new List <Hashtable>(); Hashtable ht = new Hashtable(); ArrayList ld = new ArrayList(); ArrayList lt = new ArrayList(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataTable DTT = dal_df.GetDT(dt.Rows[i]["T_POWERTAG"].ToString(), DateTime.Now); // DataTable DTT = null;//T_INFO_REALTIMEVALUE原本是实时表 // string sql1 = "select * from (select * from t_info_histvalue where T_TAG='" + dt.Rows[i]["T_POWERTAG"].ToString() + "' and " + //"t_time<=to_date('" + DateTime.Now + "','yyyy-MM-dd HH24:MI:SS') order by t_time desc) where ROWNUM =1 order by ROWNUM asc"; // DTT = dl.RunDataTable(sql1, out errMsg); if (DTT.Rows.Count > 0) { ld.Add(Math.Round(Convert.ToDouble(DTT.Rows[0]["D_VALUE"].ToString()), 2)); ht.Add("name", dt.Rows[i]["t_comname"].ToString()); ht.Add("data", ld); ld = new ArrayList(); listdata.Add(ht); ht = new Hashtable(); } } } return(listdata); }