public override string GetSQLString(ISQL.DBType type) { StringBuilder sb = new StringBuilder(); if (type == ISQL.DBType.mysql) { if (ignore) { sb.Append("insert "); sb.Append(" ignore "); } else { sb.Append("replace"); } } else { sb.Append("insert "); } sb.Append(" into "); sb.Append(tables.GetSQLString(type)); if (type == ISQL.DBType.mysql) { sb.Append(" set "); sb.Append(fieldValues.GetSQLString(type)); } else { ISQL[] fields = Sharpen.Collections.ToArray(fieldValues.GetFieldMap(), new ISQL[0]); if (fields.Length > 0) { IList <string> fList = new List <string>(); IList <string> vList = new List <string>(); foreach (ISQL f in fields) { SQLCondition sc = (SQLCondition)f; fList.Add("\"" + sc.GetField() + "\""); vList.Add(" '" + SQLUtils.GetStandardSQLValue(sc.GetValue()) + "' "); } sb.Append(" (" + StringUtil.GetStringFromStrings(fList, ",") + ") values(" + StringUtil.GetStringFromStrings(vList, ",") + ") "); } } return(SQLUtils.RemoveMultiBlank(sb.ToString().Trim())); }
public virtual void AddWhereCondition(SQLCondition condition) { this.where.AddCondition(condition); }
public virtual void AddCondition(SQLCondition condition) { this.fieldValues.AddSQLCondition(condition); }