// 创建 DELETE 命令
        protected override CommandDefine ParseDeleteCommand <T>(DbQueryableInfo_Delete <T> qDelete)
        {
            var        rInfo   = TypeRuntimeInfoCache.GetRuntimeInfo <T>();
            SqlBuilder builder = new SqlBuilder(this.EscCharLeft, this.EscCharRight);
            bool       useKey  = false;

            builder.Append("DELETE t0 FROM ");
            builder.AppendMember(rInfo.TableName);
            builder.Append(" t0 ");

            if (qDelete.Entity != null)
            {
                object entity = qDelete.Entity;

                builder.AppendNewLine();
                builder.Append("WHERE ");

                foreach (var kv in rInfo.Wrappers)
                {
                    var wrapper = kv.Value as MemberAccessWrapper;
                    var column  = wrapper.Column;

                    if (column != null && column.IsKey)
                    {
                        useKey = true;
                        var value = wrapper.Get(entity);
                        var seg   = ExpressionVisitorBase.GetSqlValue(value);
                        builder.AppendMember("t0", wrapper.Member.Name);
                        builder.Append(" = ");
                        builder.Append(seg);
                        builder.Append(" AND ");
                    }
                    ;
                }
                builder.Length -= 5;

                if (!useKey)
                {
                    throw new XfwException("Delete<T>(T value) require T must have key column.");
                }
            }
            else if (qDelete.SelectInfo != null)
            {
                TableAliasCache aliases = this.PrepareAlias <T>(qDelete.SelectInfo);
                var             sc      = new CommandDefine_Select.Builder(this.EscCharLeft, this.EscCharRight, aliases);

                ExpressionVisitorBase visitor = new JoinExpressionVisitor(this, aliases, qDelete.SelectInfo.Join);
                visitor.Write(sc.JoinFragment);

                visitor = new WhereExpressionVisitor(this, aliases, qDelete.SelectInfo.Where);
                visitor.Write(sc.WhereFragment);
                sc.AddNavigation(visitor.Navigations);

                builder.Append(sc.Command);
            }

            return(new CommandDefine(builder.ToString(), null, System.Data.CommandType.Text)); //builder.ToString();
        }
        // 创建 INSRT 命令
        protected override CommandDefine ParseInsertCommand <T>(DbQueryableInfo_Insert <T> qInsert)
        {
            SqlBuilder      builder = new SqlBuilder(this.EscCharLeft, this.EscCharRight);
            var             rInfo   = TypeRuntimeInfoCache.GetRuntimeInfo <T>();
            TableAliasCache aliases = new TableAliasCache();

            if (qInsert.Entity != null)
            {
                object     entity  = qInsert.Entity;
                SqlBuilder columns = new SqlBuilder(this.EscCharLeft, this.EscCharRight);
                SqlBuilder values  = new SqlBuilder(this.EscCharLeft, this.EscCharRight);

                foreach (var kv in rInfo.Wrappers)
                {
                    var wrapper = kv.Value as MemberAccessWrapper;
                    var column  = wrapper.Column;
                    if (column != null && column.NoMapped)
                    {
                        continue;
                    }
                    if (wrapper.ForeignKey != null)
                    {
                        continue;
                    }

                    if (wrapper != qInsert.AutoIncrement)
                    {
                        columns.AppendMember(wrapper.Member.Name);
                        columns.Append(',');

                        var    value = wrapper.Get(entity);
                        string seg   = ExpressionVisitorBase.GetSqlValue(value);
                        values.Append(seg);
                        values.Append(',');
                    }
                }
                columns.Length -= 1;
                values.Length  -= 1;

                if (qInsert.Bulk == null || !qInsert.Bulk.OnlyValue)
                {
                    builder.Append("INSERT INTO ");
                    builder.AppendMember(rInfo.TableName);
                    builder.AppendNewLine();
                    builder.Append('(');
                    builder.Append(columns);
                    builder.Append(')');
                    builder.AppendNewLine();
                    builder.Append("VALUES");
                    builder.AppendNewLine();
                }

                builder.Append('(');
                builder.Append(values);
                builder.Append(')');
                if (qInsert.Bulk != null && !qInsert.Bulk.IsOver)
                {
                    builder.Append(",");
                }

                if (qInsert.Bulk == null && qInsert.AutoIncrement != null)
                {
                    builder.AppendNewLine();
                    builder.Append("SELECT CAST(SCOPE_IDENTITY() AS INT)");
                }
            }
            else if (qInsert.SelectInfo != null)
            {
                builder.Append("INSERT INTO ");
                builder.AppendMember(rInfo.TableName);
                builder.Append('(');

                CommandDefine_Select sc = this.ParseSelectCommand(qInsert.SelectInfo) as CommandDefine_Select;
                //for (int i = 0; i < seg.Columns.Count; i++)
                int i = 0;
                foreach (var kvp in sc.Columns)
                {
                    builder.AppendMember(kvp.Key);
                    if (i < sc.Columns.Count - 1)
                    {
                        builder.Append(',');
                        builder.AppendNewLine();
                    }

                    i++;
                }

                builder.Append(')');
                builder.AppendNewLine();
                builder.Append(sc.CommandText);
            }

            return(new CommandDefine(builder.ToString(), null, System.Data.CommandType.Text)); //builder.ToString();
        }