mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
Update ado in
This commit is contained in:
parent
2a221258b1
commit
5ec247ee8d
@ -1621,9 +1621,18 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
sql = sql.Replace("@" + item.ParameterName.Substring(1), newValues.ToArray().ToJoinSqlInVals());
|
sql = sql.Replace("@" + item.ParameterName.Substring(1), newValues.ToArray().ToJoinSqlInVals());
|
||||||
}
|
}
|
||||||
if (item.ParameterName.Substring(0, 1) != this.SqlParameterKeyWord&& sql.ObjToString().Contains(this.SqlParameterKeyWord + item.ParameterName))
|
if (item.ParameterName.Substring(0, 1) != this.SqlParameterKeyWord && sql.ObjToString().Contains(this.SqlParameterKeyWord + item.ParameterName))
|
||||||
{
|
{
|
||||||
sql = sql.Replace(this.SqlParameterKeyWord+item.ParameterName, newValues.ToArray().ToJoinSqlInVals());
|
sql = sql.Replace(this.SqlParameterKeyWord + item.ParameterName, newValues.ToArray().ToJoinSqlInVals());
|
||||||
|
}
|
||||||
|
else if (item.Value!=null&&UtilMethods.IsNumberArray(item.Value.GetType()))
|
||||||
|
{
|
||||||
|
if (newValues.Any(it => it == ""))
|
||||||
|
{
|
||||||
|
newValues.RemoveAll(r => r == "");
|
||||||
|
newValues.Add("null");
|
||||||
|
}
|
||||||
|
sql = sql.Replace(item.ParameterName, string.Join(",", newValues));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1641,6 +1650,9 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private List<TResult> GetData<TResult>(Type entityType, IDataReader dataReader)
|
private List<TResult> GetData<TResult>(Type entityType, IDataReader dataReader)
|
||||||
{
|
{
|
||||||
List<TResult> result;
|
List<TResult> result;
|
||||||
|
@ -17,6 +17,22 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public class UtilMethods
|
public class UtilMethods
|
||||||
{
|
{
|
||||||
|
internal static bool IsNumberArray(Type type)
|
||||||
|
{
|
||||||
|
|
||||||
|
return type.IsIn(typeof(int[]),
|
||||||
|
typeof(long[]),
|
||||||
|
typeof(short[]),
|
||||||
|
typeof(uint[]),
|
||||||
|
typeof(ulong[]),
|
||||||
|
typeof(ushort[]),
|
||||||
|
typeof(int?[]),
|
||||||
|
typeof(long?[]),
|
||||||
|
typeof(short?[]),
|
||||||
|
typeof(uint?[]),
|
||||||
|
typeof(ulong?[]),
|
||||||
|
typeof(ushort?[]));
|
||||||
|
}
|
||||||
public static string GetNativeSql(string sql,SugarParameter[] pars)
|
public static string GetNativeSql(string sql,SugarParameter[] pars)
|
||||||
{
|
{
|
||||||
if (pars == null||pars.Length==0)
|
if (pars == null||pars.Length==0)
|
||||||
|
Loading…
Reference in New Issue
Block a user