mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Synchronization code
This commit is contained in:
@@ -50,6 +50,20 @@ namespace SqlSugar
|
||||
this.QueryableObj = method.Invoke(QueryableObj, new object[] { tableName,shortName,onWhere,type });
|
||||
return this;
|
||||
}
|
||||
public QueryMethodInfo AddJoinInfo(string tableName, string shortName, IFuncModel onFunc, JoinType type = JoinType.Left)
|
||||
{
|
||||
var method = QueryableObj.GetType().GetMyMethod("AddJoinInfo", 4, typeof(string), typeof(string), typeof(IFuncModel), typeof(JoinType));
|
||||
this.QueryableObj = method.Invoke(QueryableObj, new object[] { tableName, shortName, onFunc, type });
|
||||
return this;
|
||||
}
|
||||
public QueryMethodInfo AddJoinInfo(List<JoinInfoParameter> joinInfoParameters)
|
||||
{
|
||||
foreach (var item in joinInfoParameters)
|
||||
{
|
||||
AddJoinInfo(item.TableName,item.ShortName,item.Models,item.Type);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public QueryMethodInfo AddJoinInfo(Type joinEntityType, string shortName, string onWhere, JoinType type = JoinType.Left)
|
||||
{
|
||||
var method = QueryableObj.GetType().GetMyMethod("AddJoinInfo", 4, typeof(string), typeof(string), typeof(string), typeof(JoinType));
|
||||
|
@@ -114,9 +114,9 @@ namespace SqlSugar
|
||||
return parname;
|
||||
}
|
||||
|
||||
private static string GetParameterName(List<SugarParameter> pars, object parvalue)
|
||||
private string GetParameterName(List<SugarParameter> pars, object parvalue)
|
||||
{
|
||||
var parname = "@p" + pars.Count();
|
||||
var parname = "@p" + pars.Count()+"_"+this.QueryBuilder.WhereIndex;
|
||||
SugarParameter parameter = new SugarParameter(parname, parvalue);
|
||||
pars.Add(parameter);
|
||||
return parname;
|
||||
|
@@ -85,6 +85,7 @@ namespace SqlSugar
|
||||
}
|
||||
public ISugarQueryable<T> Having(IFuncModel model)
|
||||
{
|
||||
this.QueryBuilder.WhereIndex++;
|
||||
var orderObj = this.SqlBuilder.FuncModelToSql(model);
|
||||
this.Having(orderObj.Key);
|
||||
this.QueryBuilder.Parameters.AddRange(orderObj.Value);
|
||||
|
@@ -172,7 +172,7 @@ namespace SqlSugar
|
||||
dbType = "varchar";
|
||||
}
|
||||
}
|
||||
return string.Format("CAST({0} AS {1})", base.GetDbColumn(it,FormatValue(it.Value,it.DbColumnName,i,it)), dbType);
|
||||
return string.Format("CAST({0} AS {1})", base.GetDbColumn(it,FormatValue(it.Value,it.DbColumnName,i+(pageIndex-1)*100000,it)), dbType);
|
||||
|
||||
})) + ")");
|
||||
++i;
|
||||
|
Reference in New Issue
Block a user