/// <summary>
        /// 获取主键条件表达式
        /// </summary>
        private static string GetPrimaykeySQLConditionExpress <T>(T model) where T : ModelDbopBase
        {
            Cache_ModelInfor infor = LoadModelProperty(model.GetType());

            if (string.IsNullOrEmpty(infor.PrimaryKeyFieldName))
            {
                return(string.Empty);
            }
            object val = GetPropertyValue <T>(model, infor.PrimaryKeyFieldName);

            return(string.Format(infor.PrimaryKeySQLConditionExpress, val));
        }
        /// <summary>
        /// 删除sql语句
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="pkvalue"></param>
        /// <returns></returns>
        protected static string SQLDelete <T>(object pkvalue) where T : ModelDbopBase
        {
            Cache_ModelInfor minfor = LoadModelProperty(typeof(T));
            string           pkexp  = minfor.PrimaryKeySQLConditionExpress;

            if (string.IsNullOrEmpty(pkexp))
            {
                throw new System.Exception("无主键");
            }
            string cn = string.Format(minfor.PrimaryKeySQLConditionExpress, pkvalue);

            return(SQLDelete(minfor.TableName, cn));
        }
        /// <summary>
        /// 装载模型属性
        /// </summary>
        /// <param name="type"></param>
        /// <param name="funcEach"></param>
        /// <param name="funcIgnore"></param>
        private static Cache_ModelInfor LoadModelProperty(Type type, Action <Cache_ModelInfor_Property> funcEach, Func <Cache_ModelInfor_Property, bool> funcIgnore)
        {
            if (GLB_CACHE_MODELPROPERTYS.ContainsKey(type))
            {
                Cache_ModelInfor cminfo = GLB_CACHE_MODELPROPERTYS[type];
                List <Cache_ModelInfor_Property> t_props = cminfo.PropertyInfoList;
                foreach (Cache_ModelInfor_Property pi in t_props)
                {
                    if (!funcIgnore(pi))
                    {
                        funcEach(pi);
                    }
                }
                return(cminfo);
            }
            else
            {
                List <Cache_ModelInfor_Property> t_props;
                t_props = new List <Cache_ModelInfor_Property>();
                string
                    fieldname,
                    pkname   = string.Empty,
                    pksqlexp = string.Empty;
                bool b_pkint = false;
                Cache_ModelInfor_Property porpinfor;
                PropertyInfo        prop_idf = null, prop_pk = null;
                ModelFieldAttribute attr;
                PropertyInfo[]      props = type.GetProperties();
                foreach (PropertyInfo p in props)
                {
                    if (p.CanWrite)
                    {
                        #region 属性处理
                        object[] attrs = p.GetCustomAttributes(false);
                        if (attrs.Length > 0)
                        {
                            attr = (ModelFieldAttribute)attrs[0];
                            // 直接忽略
                            if (attr.Ignore)
                            {
                                continue;
                            }
                            // 获取自定义字段名
                            if (string.IsNullOrEmpty(attr.FieldName))
                            {
                                fieldname = p.Name;
                            }
                            else
                            {
                                fieldname = attr.FieldName;
                            }
                            // 获取自增键
                            if (attr.IdentityKey)
                            {
                                prop_idf = p;
                            }
                            // 获取主键
                            if (attr.PrimaryKey)
                            {
                                prop_pk = p;
                                pkname  = fieldname;
                                // 主键仅识别字符串类型和非字符串类型
                                if (p.PropertyType == typeof(string))
                                {
                                    pksqlexp = pkname + "='{0}'";
                                }
                                else
                                {
                                    b_pkint  = true;
                                    pksqlexp = pkname + "={0}";
                                }
                            }
                        }
                        else
                        {
                            fieldname = p.Name;
                            attr      = null;
                        }
                        #endregion
                        porpinfor = new Cache_ModelInfor_Property
                        {
                            FieldName         = fieldname,
                            Property          = p,
                            PropertyModelAttr = attr
                        };

                        t_props.Add(porpinfor);

                        try
                        {
                            if (!funcIgnore(porpinfor))
                            {
                                funcEach(porpinfor);
                            }
                        }
                        catch
                        {
                        }
                    }
                }
                string           key_tablename = GLB_GetDBTableName(type);
                Cache_ModelInfor r             = new Cache_ModelInfor
                {
                    TableName                     = key_tablename,
                    PrimaryKeyProperty            = prop_pk,
                    PrimaryKeyFieldName           = pkname,
                    PrimaryKeySQLConditionExpress = pksqlexp,
                    IdentityProperty              = prop_idf,
                    PropertyInfoList              = t_props,
                    IsIntPrimaryKey               = b_pkint
                };
                GLB_CACHE_MODELPROPERTYS.Add(type, r);
                return(r);
            }
        }