/// <summary>
        /// 插入记录
        /// </summary>
        /// <param name="param">ParamInsert</param>
        /// <returns></returns>
        public int Insert(ParamInsert param)
        {
            var result = 0;

            db.UseTransaction(true);
            var rtnBefore = this.OnBeforeInsert(new InsertEventArgs()
            {
                db = db, data = param.GetData()
            });

            if (!rtnBefore)
            {
                return(result);
            }
            //var Identity = BaseEntity.GetAttributeFields<T, TableAttribute>();
            var Identity = AttributeHelper.GetCustomAttribute <TableAttribute>(typeof(T)).IdentityField;

            result = Identity != "" ? BuilderParse(param).ExecuteReturnLastId <int>() : BuilderParse(param).Execute();
            this.CommandResult.Set(true, APP.Msg_Insert_Success);
            this.OnAfterInsert(new InsertEventArgs()
            {
                db = db, data = param.GetData(), executeValue = result
            });
            db.Commit();
            return(result);
        }
        /// <summary>
        /// 获取Insert参数类
        /// </summary>
        /// <param name="data">实体对象</param>
        /// <returns>ParamInsert</returns>
        public ParamInsert GetParamInsert(T data)
        {
            var paramInsert    = ParamInsert.Instance().Insert(typeof(T).Name);
            var tableAttribute = AttributeHelper.GetCustomAttribute <TableAttribute>(typeof(T));

            foreach (PropertyInfo p in typeof(T).GetProperties())
            {
                bool existsC = GetCommonFieldName().ContainsKey(p.Name); //
                if (p.Name == "tempid" || p.Name == tableAttribute.IdentityField || existsC == true)
                {
                    continue;
                }
                if (tableAttribute.IgnoreInsertFieldsList != null && tableAttribute.IgnoreInsertFieldsList.Contains(p.Name) == true)
                {
                    continue;
                }
                paramInsert.Column(p.Name, data.GetValue(p.Name));
            }
            return(paramInsert);
        }
        protected IInsertBuilder BuilderParse(ParamInsert param)
        {
            var data          = param.GetData();
            var insertBuilder = db.Insert(data.TableName.Length == 0 ? typeof(T).Name : data.TableName);

            var dict = GetCommonFieldValueForAdd();

            //除开添加人和添加日期字段外,其他data中的所有字段都加入参数内
            foreach (var column in data.Columns.Where(column => !dict.ContainsKey(column.Key)))
            {
                insertBuilder.Column(column.Key, column.Value);
            }

            //如果实体对象中有添加人和添加日期字段,则将其加入参数内
            var properties = ReflectionUtil.GetProperties(typeof(T));

            foreach (var item in dict.Where(item => properties.ContainsKey(item.Key.ToLower())))
            {
                insertBuilder.Column(item.Key, item.Value);
            }

            return(insertBuilder);
        }