zoukankan      html  css  js  c++  java
  • Nhibernate 中或者符号Or 的用法

            /// <summary>
            /// 根据机组编号、测点类型获取数据
            /// </summary>
            /// <param name="unitNumber"></param>
            /// <param name="tagtype"></param>
            /// <returns></returns>
            public IList<USSGS_EquStateTag> GetStateTagByUnitNodeidState(string unitNumber, string nodeid, string state)
            {
                if (dataBaseSession == null)
                {
                    throw new ApplicationException("连接数据库失败");
                }
                ICriteria criteria = dataBaseSession.CreateCriteria(typeof(USSGS_EquStateTag));
                if (!string.IsNullOrEmpty(unitNumber))
                {
                    criteria.Add(Restrictions.Eq("JZBH", unitNumber));
                }
                if (!string.IsNullOrEmpty(nodeid))
                {
                    criteria.Add(Restrictions.Eq("NodeID", nodeid)).AddOrder(new Order("ByOrder", true));
                }

        //或者符号 Or 的用法如下:           

         criteria.Add(Restrictions.Or(Restrictions.Eq("State", state),Restrictions.IsNull("State")));
                return criteria.List<USSGS_EquStateTag>();
            }

  • 相关阅读:
    关于ActionBar的向下兼容
    hdu 4869 Task(馋)
    javascritpt 原型链
    PKU 1276 Cash Machine
    前端开发——图片标注工具
    Android Notification通知详细解释
    android 如何加入第一3正方形lib图书馆kernel于
    linux 在系统启动过程
    android CountDownTimer 倒计时
    承受
  • 原文地址:https://www.cnblogs.com/yisheng/p/2743976.html
Copyright © 2011-2022 走看看