Ejemplo n.º 1
0
        /// <summary>
        /// 创建插入SQL实参列表
        /// </summary>
        /// <param name="columns"></param>
        /// <param name="hasPrimaryKey">是否包含主键</param>
        /// <returns></returns>
        public string InsertArgumentList(bool hasKey)
        {
            ColumnMetaCollection collection = this.CurrentTable.Columns;

            if (!hasKey)
            {
                collection = collection.GetNoKeyCollection();
            }
            return(collection.Concat((col) => { return "@" + col.ColumnName; }, ","));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建实参列表
        /// </summary>
        /// <param name="columns"></param>
        /// <param name="hasPrimaryKey">是否包含主键</param>
        /// <returns></returns>
        public string MethodArgumentList(string tableName, bool hasKey)
        {
            ColumnMetaCollection collection = this.CurrentTable.Columns;

            if (!hasKey)
            {
                collection = collection.GetNoKeyCollection();
            }
            return(collection.Concat((col) => { return tableName.ToLower() + "." + col.ColumnName; }, ","));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 创建形参列表
        /// </summary>
        /// <param name="columns">列</param>
        /// <param name="hasPrimaryKey">是否包含主键</param>
        /// <returns></returns>
        public string MethodParameterList(bool hasKey)
        {
            ColumnMetaCollection collection = this.CurrentTable.Columns;

            if (!hasKey)
            {
                collection = collection.GetNoKeyCollection();
            }


            return(collection.Concat((col) => { return col.FieldTypeName + " " + col.ColumnName.ToLower(); }, ","));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 创建DBparameter列表
        /// </summary>
        /// <param name="DbHelperInstanceName"></param>
        /// <param name="columns"></param>
        /// <param name="hasPrimaryKey"></param>
        /// <returns></returns>
        public string CreateDbParameterList(string DbHelperInstanceName, string varName, bool hasKey)
        {
            ColumnMetaCollection collection = this.CurrentTable.Columns;

            if (!hasKey)
            {
                collection = collection.GetNoKeyCollection();
            }


            return(collection.Concat((col) => { return CreateDbParameter(DbHelperInstanceName, varName, col); }, ",\r\n\t\t\t\t"));
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 创建实参列表
 /// </summary>
 /// <param name="columns"></param>
 /// <param name="hasPrimaryKey">是否包含主键</param>
 /// <returns></returns>
 public static string CreateMethodArgumentList(string tableName, ColumnMetaCollection columns)
 {
     return(columns.Concat((col) => { return tableName.ToLower() + "." + col.ColumnName; }, ","));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 创建形参列表
 /// </summary>
 /// <param name="columns">列</param>
 /// <param name="hasPrimaryKey">是否包含主键</param>
 /// <returns></returns>
 public static string CreateMethodParameterList(ColumnMetaCollection columns)
 {
     return(columns.Concat((col) => { return col.FieldTypeName + " " + col.ColumnName.ToLower(); }, ","));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 拼Where
 /// </summary>
 /// <param name="columns"></param>
 /// <returns></returns>
 public static string CreateSqlWhere(ColumnMetaCollection columns)
 {
     return(columns.Concat((col) => { return " `" + col.ColumnName + "`=@" + col.ColumnName; }, "and"));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 创建DBparameter列表
 /// </summary>
 /// <param name="DbHelperInstanceName"></param>
 /// <param name="columns"></param>
 /// <param name="hasPrimaryKey"></param>
 /// <returns></returns>
 public static string CreateDbParameterList(string DbHelperInstanceName, string tableName, ColumnMetaCollection columns)
 {
     //ZTDB.Instance .MakeInParam ("@#item.ColumnName#",DbType .#item.FieldTypeName#,#item.ColumnSize#,#tolower(item.ColumnName)# )<ad:if test="#notequals(i,fields.Count)#">,
     return(columns.Concat((col) => { return CreateDbParameter(DbHelperInstanceName, tableName, col); }, ",\r\n\t\t\t\t"));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 创建Update语句参数列表
 /// </summary>
 /// <param name="columns"></param>
 /// <param name="hasPrimaryKey">是否包含主键</param>
 /// <returns></returns>
 public static string CreateUpdateArgumentList(ColumnMetaCollection columns)
 {
     return(columns.Concat((col) => { return col.ColumnName + "=@" + col.ColumnName; }, ","));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 创建插入SQL形参列表
 /// </summary>
 /// <param name="columns">列</param>
 /// <param name="hasPrimaryKey">是否包含主键</param>
 /// <returns></returns>
 public static string CreateInsertParameterList(ColumnMetaCollection columns)
 {
     return(columns.Concat((col) => { return "`" + col.ColumnName + "`"; }, ","));
 }