Esempio n. 1
0
 public void AddAndCondition(DmlfConditionBase cond)
 {
     if (cond == null)
     {
         return;
     }
     if (Where == null)
     {
         Where = new DmlfWhere();
     }
     if (Where.Condition != null)
     {
         if (Where.Condition is DmlfAndCondition)
         {
             ((DmlfAndCondition)Where.Condition).Conditions.Add(cond);
         }
         else
         {
             var and = new DmlfAndCondition();
             and.Conditions.Add(Where.Condition);
             and.Conditions.Add(cond);
             Where.Condition = and;
         }
     }
     else
     {
         Where.Condition = cond;
     }
 }
Esempio n. 2
0
        public void CompileFilter()
        {
            if (!Filters.Any()) return;

            var type = DetectFilterType(FilterType, DbshColumns);

            var entity = Entities.First();
            var expr = new DmlfColumnRefExpression
            {
                Column = new DmlfColumnRef
                {
                    ColumnName = entity.GetColumnName(Alias),
                    Source = entity.QuerySource,
                }
            };

            var andCondition = new DmlfAndCondition();

            foreach (var filter in Filters)
            {
                var cond = FilterParser.ParseFilterExpression(type, expr, filter);
                andCondition.Conditions.Add(cond);
            }

            if (andCondition.Conditions.Count == 1)
            {
                FilterCondition = andCondition.Conditions[0];
            }
            else
            {
                FilterCondition = andCondition;
            }
        }
Esempio n. 3
0
 public void AddAndCondition(DmlfConditionBase cond)
 {
     if (cond == null) return;
     if (Where == null) Where = new DmlfWhere();
     if (Where.Condition != null)
     {
         if (Where.Condition is DmlfAndCondition)
         {
             ((DmlfAndCondition)Where.Condition).Conditions.Add(cond);
         }
         else
         {
             var and = new DmlfAndCondition();
             and.Conditions.Add(Where.Condition);
             and.Conditions.Add(cond);
             Where.Condition = and;
         }
     }
     else
     {
         Where.Condition = cond;
     }
 }
Esempio n. 4
0
 public virtual void GenSqlItem(DmlfConditionBase item, ISqlDumper dmp)
 {
     item.GenSql(dmp);
 }
Esempio n. 5
0
 public virtual void GenSqlItem(DmlfConditionBase item, ISqlDumper dmp)
 {
     item.GenSql(dmp);
 }