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
{
///
/// 字段名称
///
public string FieldName { get; set; }
///
/// 值
///
public string Value { get; set; }
///
/// 值类型
///
public string ValueType { get; set; }
///
/// 比较符号
///
public ComparisonSymbol Operator { get; set; }
}
}