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>();
            }

  • 相关阅读:
    【pyarmor】代码加密
    Multi-Window Data Augmentation Approach for Speech Emotion Recognition
    SVM / SVC / SVR
    【python】不同的dropout们
    【aubio】音频处理笔记
    Git 笔记
    【stay foolish】代码片段
    BERT笔记
    【pytorch】torch.utils.data数据处理
    Scoket例子
  • 原文地址:https://www.cnblogs.com/yisheng/p/2743976.html
Copyright © 2011-2022 走看看