private void GenerateNull(StringBuilder sbSql, DBFieldInfo dbFieldInfo, string tableAliaName, CompareOperater operater) { sbSql.Append($"{tableAliaName}.{dbFieldInfo.FieldName}"); sbSql.Append(DBConstant.BLACK_SPACE); CompareOperaterAttribute compareOperaterAttribute = CompareOperaterHelper.GetCompareOperaterAttributeByCompareOperater(operater); sbSql.Append(compareOperaterAttribute.OperaterFormat); }
/// <summary> /// 根据比较运算符获取比较运算符特性 /// </summary> /// <param name="operater">参数名称</param> /// <returns>数据库字段特性</returns> public static CompareOperaterAttribute GetCompareOperaterAttributeByCompareOperater(CompareOperater operater) { if (_map.ContainsKey(operater)) { return(_map[operater]); } else { throw new ArgumentException($"无效的比较运算符[{operater.ToString()}]"); } }
/// <summary> /// 构造函数 /// </summary> /// <param name="operater">比较运算符</param> /// <param name="tableName">表名</param> /// <param name="fieldName">字段名</param> /// <param name="value">参数值</param> public ExpressionNode(CompareOperater operater, string tableName, string fieldName, object value) : this(operater, tableName, fieldName) { this.ValueList.Add(value); }
/// <summary> /// 构造函数 /// </summary> /// <param name="operater">比较运算符</param> /// <param name="tableName">表名</param> /// <param name="fieldName">字段名</param> /// <param name="valueList">参数值</param> public ExpressionNode(CompareOperater operater, string tableName, string fieldName, IEnumerable <object> valueList) : this(operater, tableName, fieldName) { this.ValueList.AddRange(valueList); }
/// <summary> /// 构造函数 /// </summary> /// <param name="operater">比较运算符</param> /// <param name="tableName">表名</param> /// <param name="fieldName">字段名</param> protected ExpressionNode(CompareOperater operater, string tableName, string fieldName) { this.Operater = operater; this.TableName = tableName; this.FieldName = fieldName; }