Exemplo n.º 1
0
        /// <summary>
        /// 判断某个职位是否有子节点
        /// </summary>
        /// <param name="id">职位编号</param>
        /// <returns></returns>
        public int getSun(string id)
        {
            sql = "select count(*) from T_SYS_ORGANIZE where T_PARENTID='" + id + "'";

            try
            {
                if (DBdb2.RunRowCount(sql, out errMsg) > 0)
                {
                    count = 1;
                }
                else
                {
                    sql = "select count(*) from T_SYS_MEMBERRELATION where T_ORGID='" + id + "'";
                    if (DBdb2.RunRowCount(sql, out errMsg) > 0)
                    {
                        count = 1;
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(LogHelper.EnLogType.Run, "发生时间:" + DateTime.Now.ToString("yyyy-MM-dd H:mm:ss") + "/n错误信息:" + ex.Message);
            }

            return(count);
        }
Exemplo n.º 2
0
        public int RetTabDevByDevIDCount(string sbID)
        {
            sql = "select count(*) from T_BASE_STATUS as s inner join (SELECT i.ID_KEY,b.T_DEVICEID,b.T_DEVICEDESC,i.T_TIME,i.I_STATUS FROM T_INFO_DEVICE as i inner join T_BASE_DEVICE as b on i.T_DEVICEID=b.T_DEVICEID where i.T_DEVICEID='" + sbID + "' order by i.T_TIME desc) as t on s.I_STATUSID=t.I_STATUS";

            int count = DBdb2.RunRowCount(sql, out errMsg);

            return(count);
        }
Exemplo n.º 3
0
        public int RetTabItemByDevIDCountAll()
        {
            sql = "select * from (select rank() over(partition by T_ITEMID order by T_STARTTIME desc) rk,b.* from T_BASE_ITEM as b ) as y where y.rk<=1";

            int count = DBdb2.RunRowCount(sql, out errMsg);

            return(count);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 判断子节点是否存在
        /// </summary>
        /// <returns>1:总线路,2:线路,3:区域,4:设备,5:点检项</returns>
        public int RetCount(string nodeID)
        {
            int count      = 0;
            int countBase  = 0;
            int countRoute = 0;
            int countArea  = 0;
            int countDev   = 0;
            int countItem  = 0;

            //首先判断是否是

            sql = "select count(*) from T_INFO_ROUTE where T_NODEKEY='" + nodeID + "'";

            countRoute = DBdb2.RunRowCount(sql, out errMsg);

            sql = "select count(*) from T_BASE_ROUTE as b inner join T_INFO_ROUTE as r on r.T_NODEID=b.T_ROUTEID  where T_NODEKEY='" + nodeID + "' and r.T_DESC='XL'";

            countBase = DBdb2.RunRowCount(sql, out errMsg);

            sql = "select count(*) from T_BASE_AREA as b inner join T_INFO_ROUTE as i on b.T_AREAID=i.T_NODEID where T_NODEKEY='" + nodeID + "' and i.t_desc='QY'";

            countArea = DBdb2.RunRowCount(sql, out errMsg);

            sql = "select count(*) from T_BASE_DEVICE as b inner join T_INFO_ROUTE as i on b.T_DEVICEID=i.T_NODEID where T_NODEKEY='" + nodeID + "' and i.t_desc='SB'";

            countDev = DBdb2.RunRowCount(sql, out errMsg);

            sql = "select count(*) from T_BASE_ITEM as b inner join T_INFO_ROUTE as i on b.T_ITEMID=i.T_NODEID where T_NODEKEY='" + nodeID + "' and i.T_DESC='DJX'";

            countItem = DBdb2.RunRowCount(sql, out errMsg);

            if (countRoute != 0)
            {
                if (countBase > 0)
                {
                    count = 2;
                }
                else if (countArea > 0)
                {
                    count = 3;
                }
                else if (countDev > 0)
                {
                    count = 4;
                }
                else if (countItem > 0)
                {
                    count = 5;
                }
            }
            else
            {
                count = 1;
            }

            return(count);
        }
Exemplo n.º 5
0
        public int RetTabAreasCounts()
        {
            int count = 0;

            sql = "SELECT count(*) FROM ADMINISTRATOR.T_BASE_AREA";

            count = DBdb2.RunRowCount(sql, out errMsg);

            return(count);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 历史详细信息分页
        /// 获取ITEM历史详细信息
        /// </summary>
        /// <param name="ID_KEY">ID_KEY</param>
        /// <returns></returns>
        public int RetTabHisItemsByidKeyCount(string ID_KEY)
        {
            int count = 0;

            sql = "select * from ADMINISTRATOR.T_BASE_ITEM where t_itemid= (SELECT t_itemid FROM ADMINISTRATOR.T_BASE_ITEM where id_key=" + ID_KEY + ")  ";

            sql += "and T_DEVICEID=(SELECT t_deviceid FROM ADMINISTRATOR.T_BASE_ITEM where id_key=" + ID_KEY + ") order by T_STARTTIME desc";

            count = DBdb2.RunRowCount(sql, out errMsg);

            return(count);
        }
Exemplo n.º 7
0
        /// <summary>
        /// SQL 语句
        /// </summary>
        /// <param name="sqlWhere"></param>
        /// <returns></returns>
        public int GetCount(string sqlWhere)
        {
            try
            {
                count = DBdb2.RunRowCount(sqlWhere, out errMsg);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(LogHelper.EnLogType.Run, "发生时间:" + DateTime.Now.ToString("yyyy-MM-dd H:mm:ss") + "/n错误信息:" + ex.Message);
            }

            return(count);
        }
Exemplo n.º 8
0
 /// <summary>
 /// 获取组织岗位关系
 /// </summary>
 /// <param name="id">父类编码</param>
 /// <returns></returns>
 public int GetmenuCount(string id)
 {
     sql = "select count(*) from T_SYS_ORGANIZE where T_PARENTID='" + id + "'";
     try
     {
         count = DBdb2.RunRowCount(sql, out errMsg);
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog(LogHelper.EnLogType.Run, "发生时间:" + DateTime.Now.ToString("yyyy-MM-dd H:mm:ss") + "/n错误信息:" + ex.Message);
     }
     return(count);
 }
Exemplo n.º 9
0
        public int GetMemberCount(string id)
        {
            sql = "select count(*) from (select s.ID,s.parmentID,s.UserID,s.UserName,s.Pwd,s.Plan,rownumber() over(order by s.ID asc ) as rowid  from (select m.ID_KEY ID,m.T_ORGID ParmentID,m.T_USERID UserID,m.T_USERNAME UserName,m.T_PASSWD Pwd,c.T_CLASSNAME Plan from (select i.ID_KEY,l.T_ORGID,i.T_USERID,i.T_USERNAME,i.T_PASSWD,i.T_CLASSID from T_SYS_MEMBERRELATION l right join T_SYS_MEMBERINFO i on l.T_USERID=i.T_USERID) m left join T_SYS_CLASS c on m.T_CLASSID=c.T_CLASSID where m.T_ORGID='" + id + "') s )as a;";

            try
            {
                count = DBdb2.RunRowCount(sql, out errMsg);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(LogHelper.EnLogType.Run, "发生时间:" + DateTime.Now.ToString("yyyy-MM-dd H:mm:ss") + "/n错误信息:" + ex.Message);
            }
            return(count);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 元素
        /// </summary>
        /// <param name="para"></param>
        /// <returns></returns>
        public int InsertProductionElementData(string para)
        {
            this.init();
            string errMsg = "";
            int    num    = 0;
            string sql    = "insert into T_INFO_PROCPARA_COAL_ULTI  (T_UNITID,D_C_ar,D_H_ar,D_O_ar,D_N_ar,D_S_ar,D_Cfh_c_ulti,D_Clz_c_ulti,D_Qnet_ar_ulti,D_M_AR_ULTI,D_A_AR_ULTI,T_TIME)  values (" + para + ")";

            if (rlDBType == "SQL")
            {
            }
            else
            {
                num = DBdb2.RunRowCount(sql, out errMsg);
            }
            return(num);
        }
Exemplo n.º 11
0
        public int InsertBoilerData(string para)
        {
            this.init();
            string errMsg = "";
            int    num    = 0;
            string sql    = "insert into T_INFO_PROCPARA_BOILER  (T_UNITID,D_Alpha_fh,D_Alpha_lz,D_D_e,D_CO,D_Tlz,D_Tlk_d,D_RH,D_Tfw_d,D_H2,D_CH4,T_TIME)  values (" + para + ")";

            if (rlDBType == "SQL")
            {
            }
            else
            {
                num = DBdb2.RunRowCount(sql, out errMsg);
            }
            return(num);
        }
Exemplo n.º 12
0
        /// <summary>
        /// 工业
        /// </summary>
        /// <param name="para"></param>
        /// <returns></returns>
        public int InsertProductionIndustryData(string para)
        {
            this.init();
            string errMsg = "";
            int    num    = 0;
            string sql    = "insert into T_INFO_PROCPARA_COAL_PROX  (T_UNITID,D_CFH_C_PROX,D_CLZ_C_PROX,D_M_AD,D_A_AD,D_V_DAF,D_QNET_AR_PROX,D_ST_AD,D_ST_AR,D_M_AR_PROX,D_A_AR_PROX,T_TIME)  values (" + para + ")";

            if (rlDBType == "SQL")
            {
            }
            else
            {
                num = DBdb2.RunRowCount(sql, out errMsg);
            }
            return(num);
        }
Exemplo n.º 13
0
 /// <summary>
 /// 判断是否存在该部门
 /// </summary>
 /// <param name="id">部门ID</param>
 /// <returns></returns>
 public bool JudgeExitParent(string id)
 {
     sql = "select *From T_SYS_ORGANIZE where T_ORGID='" + id + "'";
     try
     {
         if (DBdb2.RunRowCount(sql, out errMsg) > 0)
         {
             result = true;
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog(LogHelper.EnLogType.Run, "发生时间:" + DateTime.Now.ToString("yyyy-MM-dd H:mm:ss") + "/n错误信息:" + ex.Message);
     }
     return(result);
 }
Exemplo n.º 14
0
        public int InsertSteamTurbineData(string para)
        {
            this.init();
            string errMsg = "";
            int    num    = 0;
            string sql    = "insert into T_INFO_PROCPARA_TURB  (T_UNITID,D_L1, D_L2, D_Delta_dtr, D_Rdtr, D_L_well, D_W_well, D_Eta_p, D_Delta_fdj, D_Delta_gcb, D_Delta_qbb, D_DK_e, D_DB_e, D_DM_e, D_DL_e, D_P_e, D_D_gbmfgs," +
                            "D_D_gbmfhs,D_Dphp_e ,D_DN_e,D_Djc_e,D_A,I_N_pipe,I_N_flow,D_Din,D_Dout,I_N_ball_i,D_V_xb1I,D_V_xb2I,D_Z_xb1I,D_Z_xb2I,D_W_lqt_I,D_Txhs_in_d,D_Wd ,D_Din_xb1O,D_Din_xb2O,T_Type,I_N_ball_o,D_Z_xb1O,D_Z_xb2O,D_Eta_gr_xb1,D_Eta_gr_xb2,T_TIME)  values (" + para + ")";

            if (rlDBType == "SQL")
            {
            }
            else
            {
                num = DBdb2.RunRowCount(sql, out errMsg);
            }
            return(num);
        }
Exemplo n.º 15
0
 /// <summary>
 /// 判断是否存在该人员
 /// </summary>
 /// <param name="name">人员姓名</param>
 /// <returns></returns>
 public bool JudgMemberByName(string name)
 {
     try
     {
         sql   = "select count(*) from T_SYS_MEMBERINFO where T_USERNAME='******'";
         count = DBdb2.RunRowCount(sql, out errMsg);
         if (count > 0)
         {
             result = true;
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog(LogHelper.EnLogType.Run, "发生时间:" + DateTime.Now.ToString("yyyy-MM-dd H:mm:ss") + "/n错误信息:" + ex.Message);
     }
     return(result);
 }
Exemplo n.º 16
0
        public int RetTabItemByDevIDCount(string sbID)
        {
            try
            {
                if (int.Parse(sbID) > 0)
                {
                    sql = "select * from (select rank() over(partition by T_ITEMID order by T_STARTTIME desc) rk,b.* from T_BASE_ITEM as b where b.T_DeviceID =(select T_NODEID from T_INFO_ROUTE where T_NODEKEY='10')) as y where y.rk<=1";
                }
                //sql = "select * from (select rank() over(partition by T_ITEMID order by T_STARTTIME desc) rk,b.* from T_BASE_ITEM as b where b.T_DeviceID =(select T_NODEID from T_INFO_ROUTE where T_NODEKEY='" + sbID + "')) as y where y.rk<=1;";
            }
            catch
            {
                sql = "select * from (select rank() over(partition by T_ITEMID order by T_STARTTIME desc) rk,b.* from T_BASE_ITEM as b where b.T_DeviceID ='" + sbID + "') as y where y.rk<=1;";
            }

            int count = DBdb2.RunRowCount(sql, out errMsg);

            return(count);
        }
Exemplo n.º 17
0
        /// <summary>
        /// 判断子节点是否存在
        /// </summary>
        /// <returns>1:总线路,2:线路</returns>
        public int RetCount(string parId)
        {
            int count      = 0;
            int countBase  = 0;
            int countRoute = 0;

            sql = "select count(*) from T_BASE_DEVICE where T_DEVICEID='" + parId + "'";

            countRoute = DBdb2.RunRowCount(sql, out errMsg);

            //sql = "select * from T_BASE_ROUTE as b inner join T_BASE_DEVICE as r on r.T_NODEID=b.T_ROUTEID  where T_NODEKEY='" + nodeID + "'";

            //countBase = DBdb2.RunRowCount(sql, out errMsg);

            if (countRoute != 0)
            {
                if (countRoute > 0)
                {
                    count = 2;
                }
            }
            else
            {
                count = 1;
            }


            sql = "select count(*) from T_BASE_ITEM where ID_KEY=" + parId + "";

            countRoute = DBdb2.RunRowCount(sql, out errMsg);


            if (countRoute != 0)
            {
                if (countRoute > 0)
                {
                    count = 3;
                }
            }

            return(count);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 判断子节点是否存在
        /// </summary>
        /// <returns>2:最底层设备</returns>
        public int RetCount(string nodeID)
        {
            int count    = 0;
            int countDev = 0;

            sql = "select * from T_BASE_DEVICE where T_DEVICEID='" + nodeID + "'";

            countDev = DBdb2.RunRowCount(sql, out errMsg);

            if (countDev > 0)
            {
                count = 1;
            }
            else
            {
                count = 2;
            }

            return(count);
        }
Exemplo n.º 19
0
 /// <summary>
 /// 判断某个岗位下面是否存在人员
 /// </summary>
 /// <param name="name">人员ID</param>
 /// <returns></returns>
 public bool JudgMemberByClassId(string id)
 {
     try
     {
         sql   = "select count(*) from T_SYS_MEMBERRELATION where T_ORGID='" + id + "'";
         count = DBdb2.RunRowCount(sql, out errMsg);
         if (count > 0)
         {
             result = true;
         }
         else
         {
             result = false;
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog(LogHelper.EnLogType.Run, "发生时间:" + DateTime.Now.ToString("yyyy-MM-dd H:mm:ss") + "/n错误信息:" + ex.Message);
     }
     return(result);
 }
Exemplo n.º 20
0
 /// <summary>
 /// 获取设备数量
 /// </summary>
 /// <param name="id">设备编号</param>
 /// <returns></returns>
 public int GetDeviceCount(string id)
 {
     sql = "select count(*) from (select r.ID,r.DeviceID,r.DeviceName,r.T_PARENTID,r.T_SWERK,r.T_IWERK,r.T_KOSTL,r.T_SCBS,rownumber() over(order by ID asc ) as rowid  from (select r.ID_KEY ID,r.T_DEVICEID DeviceID,r.T_DEVICEDESC DeviceName,r.T_PARENTID,r.T_SWERK,r.T_IWERK,r.T_KOSTL,r.T_SCBS from T_BASE_DEVICE r inner join (select T_NODEID from T_INFO_ROUTE where T_PARAENTID='" + id + "') rp on r.T_DEVICEID=rp.T_NODEID) r)as a;";
     return(DBdb2.RunRowCount(sql, out errMsg));
 }
Exemplo n.º 21
0
        //*********************************//



        #region 根据nodekey获取设备
        /// <summary>
        /// 获取设备数量
        /// </summary>
        /// <param name="id">区域编号</param>
        /// <returns></returns>
        public int RetSBCount(string id)
        {
            sql = "select count(*)  from (select  i.id_key as ik,d.id_key as dk ,d.t_deviceid,d.t_devicedesc,d.t_parentid,d.b_attachment, i.t_nodekey,i.T_nodeid from t_info_route as i inner join t_base_device as d on i.t_nodeid=d.t_deviceid where t_desc='SB' and i.t_paraentid='" + id + "') as c";

            return(DBdb2.RunRowCount(sql, out errMsg));
        }
Exemplo n.º 22
0
 /// <summary>
 /// 获取点检项数量
 /// </summary>
 /// <param name="id">设备编号</param>
 /// <returns></returns>
 public int GetItemCount(string id)
 {
     sql = "select count(*) from (select r.ID,r.T_ITEMID,r.T_ITEMPOSITION,r.T_ITEMDESC,r.T_CONTENT,r.T_TYPE,r.T_OBSERVE,r.T_UNIT,r.F_LOWER,r.F_UPPER,r.T_STARTTIME,r.T_PERIODVALUE,r.T_PERIODVALUE,r.T_STATUS,r.T_PERIODTYPE,rownumber() over(order by ID asc ) as rowid  from (select r.ID_KEY ID,r.T_ITEMID,r.T_ITEMPOSITION,r.T_ITEMDESC,r.T_CONTENT,r.T_TYPE,r.T_OBSERVE,r.T_UNIT,r.F_LOWER,r.F_UPPER,r.T_STARTTIME,r.T_PERIODVALUE,case when r.T_STATUS=0 then '停机检测' when r.T_STATUS=1 then '起机检测' end T_STATUS,case when r.T_PERIODTYPE=1 then '日'  when r.T_PERIODTYPE=2 then '月'  when r.T_PERIODTYPE=3 then '年'  end T_PERIODTYPE from T_BASE_ITEM r inner join (select T_NODEID from T_INFO_ROUTE where T_PARAENTID='" + id + "') rp on r.T_ITEMID=rp.T_NODEID) r)as a;";
     return(DBdb2.RunRowCount(sql, out errMsg));
 }
Exemplo n.º 23
0
        /// <summary>
        /// 获取区域数量
        /// </summary>
        /// <param name="id">区域编号</param>
        /// <returns></returns>
        public int RetAreaCount(string id)
        {
            sql = "select count(*) from T_INFO_ROUTE as i inner join T_BASE_AREA as b on i.T_NODEID=b.T_AREAID where T_PARAENTID ='" + id + "' and i.t_desc='QY'";

            return(DBdb2.RunRowCount(sql, out errMsg));
        }
Exemplo n.º 24
0
 /// <summary>
 /// 获取区域数量
 /// </summary>
 /// <param name="id">区域编号</param>
 /// <returns></returns>
 public int GetAreaCount(string id)
 {
     sql = "select count(*) from (select r.ID,r.AreaID,r.AreaName,r.AreaCD,rownumber() over(order by ID asc ) as rowid  from (select r.ID_KEY ID,r.T_AREAID AreaID,r.T_AREANAME AreaName,r.T_AREACD AreaCD from T_BASE_AREA r inner join (select T_NODEID from T_INFO_ROUTE where T_PARAENTID='" + id + "') rp on r.T_AREAID=rp.T_NODEID) r)as a;";
     return(DBdb2.RunRowCount(sql, out errMsg));
 }
Exemplo n.º 25
0
        /// <summary>
        /// 获取线路数量
        /// </summary>
        /// <param name="id">线路编号</param>
        /// <returns></returns>
        public int RetRouteCount(string id)
        {
            sql = "select count(*) from (select * from t_base_route as b inner join t_sys_organize as s on b.t_orgid=s.t_orgid) as c inner join t_info_route as i on c.t_routeid=i.t_nodeid where t_desc='XL' and i.t_paraentid='" + id + "'";

            return(DBdb2.RunRowCount(sql, out errMsg));
        }
Exemplo n.º 26
0
 /// <summary>
 /// 获取线路数量
 /// </summary>
 /// <param name="id">线路编号</param>
 /// <returns></returns>
 public int GetRountCount(string id)
 {
     sql = "select count(*) from (select r.ID,r.RouteID,r.RouteName,r.Rtype,rownumber() over(order by ID asc ) as rowid  from (select r.ID_KEY ID,r.T_ROUTEID RouteID,r.T_ROUTENAME RouteName, case when  r.I_TYPE=0 then '点检' when r.I_TYPE=1 then '巡检' end Rtype from T_BASE_ROUTE r inner join (select T_NODEID from T_INFO_ROUTE where T_DESC='XL' and T_PARAENTID='" + id + "') rp on r.T_ROUTEID=rp.T_NODEID) r)as a;";
     return(DBdb2.RunRowCount(sql, out errMsg));
 }