/// <summary> /// 解释Condition条件 /// </summary> /// <param name="scope">条件</param> /// <param name="list"></param> /// <param name="entityType"></param> /// <param name="paramName"></param> /// <param name="type"></param> /// <param name="lstIndex"></param> public static string Condition(Scope scope, ParamList list, Type entityType, string paramName, DbType type, int lstIndex) { DBInfo db = EntityInfoManager.GetEntityHandle(entityType).DBInfo; string paramVal = db.CurrentDbAdapter.FormatValueName(DataAccessCommon.FormatParam(paramName, lstIndex)); string paramKey = db.CurrentDbAdapter.FormatParamKeyName(DataAccessCommon.FormatParam(paramName, lstIndex)); StringBuilder sql = new StringBuilder(500); ScopeType ctype = scope.ScopeType; string connectString = DataAccessCommon.GetConnectString(scope); BQLCondition fhandle = scope.Value1 as BQLCondition; if (!CommonMethods.IsNull(fhandle)) { KeyWordInfomation info = new KeyWordInfomation(); info.Infos = new Buffalo.DB.BQLCommon.BQLInfos(); info.DBInfo = db; info.ParamList = list; sql.Append(" "); sql.Append(connectString); sql.Append(" (" + fhandle.DisplayValue(info) + ")"); } return(sql.ToString()); }
/// <summary> /// 加载表的别名信息 /// </summary> /// <param name="info"></param> //internal void LoadTableInfo(KeyWordInfomation info) //{ // joinTable.FillInfo(info); //} internal override void Tran(KeyWordInfomation info) { string table0 = _tables[0].DisplayValue(info); string table1 = _condition.DisplayValue(info); string ret = " " + _keyWord + " join " + table0 + " on " + table1; info.Condition.Tables.Append(ret); }
///// <summary> ///// 查询范围 ///// </summary> ///// <param name="star">开始条数</param> ///// <param name="totalRecord">显示条数</param> ///// <returns></returns> //public KeyWordLimitItem Limit(uint star, uint totalRecord) //{ // KeyWordLimitItem item = new KeyWordLimitItem(star, totalRecord, this); // return item; //} internal override void Tran(KeyWordInfomation info) { info.IsWhere = true; string strCondition = _condition.DisplayValue(info); info.Condition.Condition.Append(strCondition); info.IsWhere = false; }
///// <summary> ///// 条件 ///// </summary> //internal BQLCondition Condition //{ // get // { // return condition; // } //} internal override void Tran(KeyWordInfomation info) { info.IsWhere = true; info.Condition.Having.Append(condition.DisplayValue(info)); info.IsWhere = false; }