示例#1
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns></returns>
        public IEnumerable <OracleUser> UionSeach(OracleUserCondition.Search condition)
        {
            var page = new Pager <OracleUserCondition.Search>()
            {
                Condition   = condition,
                UnionText   = @"WITH alluser AS 
                            (
                            SELECT * FROM t_d_user
                            UNION ALL
                            SELECT * FROM t_d_user
                            )",
                Table       = "alluser",
                Key         = "id",
                Order       = string.Empty,
                Field       = "*",
                WhereAction = (Condition, Where, Paramters) =>
                {
                    if (Condition.Id > 0)
                    {
                        Where.Append("AND ID = :ID ");
                        Paramters.Add(base.CreateParameter(":ID", Condition.Id));
                    }
                }
            };

            var result = base.GetResultByPager <OracleUser, OracleUserCondition.Search>(page);

            return(result);
        }
示例#2
0
 public void PageOracleTest()
 {
     var TheService = ContextRegistry.GetContext().GetObject <OracleUserService>();
     var condition  = new OracleUserCondition.Search()
     {
     };
     var list = TheService.Seach(condition);
 }
示例#3
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns></returns>
        public IEnumerable <OracleUser> Seach(OracleUserCondition.Search condition)
        {
            var page = new Pager <OracleUserCondition.Search>()
            {
                Condition   = condition,
                Table       = "t_d_user",
                Order       = string.Empty,
                Field       = "*",
                WhereAction = (Where, Paramters) =>
                {
                    if (condition.Id > 0)
                    {
                        Where.Append("AND ID = :ID ");
                        Paramters.Add(base.CreateParameter(":ID", condition.Id));
                    }
                }
            };

            var result = base.GetResultByPager <OracleUser, OracleUserCondition.Search>(page);

            return(result);
        }