zoukankan      html  css  js  c++  java
  • xpo 条件查询

    一般条件:Name为A

    XPCollection xp = SpecialPlayNu.GetByCompany(DataBase.XpoSession,int.Parse(Session["CompanyId"].ToString()));
    GroupOperator gxp = new GroupOperator();
    gxp.Operands.Add(new BinaryOperator("Name", "A"));
    xp.Filter = gxp;

    或条件:Name为A或B

    XPCollection xpClasses2 = PlayeType.GetAll(DataBase.XpoSession);//得到记录集
    xpClasses2.Sorting.Add(new SortProperty("Name", SortingDirection.Ascending));//设定排序规则
    GroupOperator gxp = new GroupOperator();
    gxp.Operands.Add(new GroupOperator(GroupOperatorType.Or, new BinaryOperator("Name", "A"), new BinaryOperator("Name", "B")));
    xpClasses2.Filter = gxp;

    大小条件:
    GroupOperator gxp = new GroupOperator();

    Money大于或等于1
    gxp.Operands.Add(new BinaryOperator("Money", 1, BinaryOperatorType.GreaterOrEqual));

    Money等于1
    gxp.Operands.Add(new BinaryOperator("Money", 1, BinaryOperatorType.Equal));

    Money大于1
    gxp.Operands.Add(new BinaryOperator("Money", 1, BinaryOperatorType.Greater));

    Money小于或等于1
    gxp.Operands.Add(new BinaryOperator("Money", 1, BinaryOperatorType.LessOrEqual));

    Money小于1
    gxp.Operands.Add(new BinaryOperator("Money", 1, BinaryOperatorType.Less));


    模湖条件:

    Name值包含ABC的数据

    gxp.Operands.Add(new BinaryOperator("Name","%ABC%",BinaryOperatorType.Like));


    时间条件:

    CreatTime时间在starttime到endtime
    string format = "yyyy-MM-dd 0:0:0";
    DateTime dt1 = DateTime.Now;
    dt1 = dt1.AddDays(-1);
    starttime = dt1.Date.ToString(format);
    format = "yyyy-MM-dd 23:59:59";
    dt1 = dt1.AddDays(+1);
    endtime = dt1.Date.ToString(format);

    group.Operands.Add(new BinaryOperator("CreatTime", starttime, BinaryOperatorType.GreaterOrEqual));
    group.Operands.Add(new BinaryOperator("CreatTime", endtime, BinaryOperatorType.LessOrEqual));

    //设定排序条件
    private void SetSorts(XPCollection aXp)
    {
    SortingCollection sorts = new SortingCollection();
    sorts.Add(new SortProperty("Id", SortingDirection.Descending));
    aXp.Sorting.Add(sorts);
    }
    aXp.Sorting.Add(new SortProperty("Name",SortingDirection.Ascending));//设定排序规则

  • 相关阅读:
    php pcntl 多进程学习
    php socket 学习
    linux 常用alias
    php 设置一个函数的最大运行时间
    QTableView 一列添加两个按钮
    翻译qmake文档 目录
    翻译qmake文档(四) Building Common Project Types
    算法时间复杂度
    翻译qmake文档(三) Creating Project Files
    Caliburn.Micro学习笔记目录
  • 原文地址:https://www.cnblogs.com/li-lun/p/4698679.html
Copyright © 2011-2022 走看看