123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace wispro.sp.entity.workflowDefine
- {
- public class ConditionExpress
- {
- public ConditionTreeNode Root { get; set; }
- public void AddCondition(ConditionExpress express ,LogicSymbols logic)
- {
- if(express.Root != null)
- {
- if (Root != null)
- {
- ConditionTreeNode node = new LogicNode() { operate = logic };
- node.Left = Root;
- node.Right = express.Root;
- Root = node;
- }
- else
- {
- Root = express.Root;
- }
- }
- }
- }
- public class ConditionTreeNode
- {
- public ConditionTreeNode Right { get; set; }
- public ConditionTreeNode Left { get; set; }
- }
- public enum LogicSymbols
- {
- AND,
- OR,
- NOT
- }
- public enum ComparisonSymbol
- {
- Contains,
- Equal,
- Greater,
- GreaterEqual,
- Less,
- LessEqual,
- NotEqual,
- In,
- Between,
- StartsWith,
- EndWith,
- NotContains
- }
- public class LogicNode : ConditionTreeNode
- {
- public LogicSymbols operate { get; set; }
- }
- public class FieldNode : ConditionTreeNode
- {
- /// <summary>
- /// 字段名称
- /// </summary>
- public string FieldName { get; set; }
- /// <summary>
- /// 值
- /// </summary>
- public string Value { get; set; }
- /// <summary>
- /// 值类型
- /// </summary>
- public string ValueType { get; set; }
- /// <summary>
- /// 比较符号
- /// </summary>
- public ComparisonSymbol Operator { get; set; }
- }
- }
|