/// <summary> /// 输出条件语句 /// </summary> /// <returns>条件语句</returns> public override String ToString() { String format = String.Format("({0})", SqlOperators.InternalGetOperatorFormat(this._operator)); Int32 paramCount = ((Byte)this._operator) / 100; if (paramCount == 0 && this._parameterOne != null) { return(String.Format(format, this._parameterOne.ColumnName)); } else if (paramCount == 1 && this._parameterOne != null) { return(String.Format(format, this._parameterOne.ColumnName, (this._parameterOne.IsUseParameter ? this._parameterOne.ParameterName : this._parameterOne.Value.ToString()))); } else if (paramCount == 2 && this._parameterOne != null && this._parameterTwo != null) { return(String.Format(format, this._parameterOne.ColumnName, (this._parameterOne.IsUseParameter ? this._parameterOne.ParameterName : this._parameterOne.Value.ToString()), (this._parameterTwo.IsUseParameter ? this._parameterTwo.ParameterName : this._parameterTwo.Value.ToString()))); } else { return(String.Empty); } }
/// <summary> /// 输出条件语句 /// </summary> /// <returns>条件语句</returns> public override String GetClauseText() { if (this._command == null) { return(String.Empty); } String format = String.Format("({0})", SqlOperators.InternalGetOperatorFormat(this._operator)); return(String.Format(format, this._columnName, '(' + this._command.GetCommandText() + ')')); }