mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-15 20:49:31 +08:00
Update .net core project
This commit is contained in:
parent
25e053f8ad
commit
b1ccb6b37c
@ -419,6 +419,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public ISugarQueryable<T> WhereColumns(Dictionary<string, object> dictionary)
|
||||||
|
{
|
||||||
|
return WhereColumns(new List<Dictionary<string, object>> { dictionary });
|
||||||
|
}
|
||||||
public ISugarQueryable<T> WhereColumns(List<Dictionary<string, object>> list)
|
public ISugarQueryable<T> WhereColumns(List<Dictionary<string, object>> list)
|
||||||
{
|
{
|
||||||
List<IConditionalModel> conditionalModels = new List<IConditionalModel>();
|
List<IConditionalModel> conditionalModels = new List<IConditionalModel>();
|
||||||
@ -432,7 +436,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
FieldName = item,
|
FieldName = item,
|
||||||
ConditionalType = ConditionalType.Equal,
|
ConditionalType = ConditionalType.Equal,
|
||||||
FieldValue = model[item].ObjToString(),
|
FieldValue = model[item]==null?"null" : model[item].ObjToString(),
|
||||||
CSharpTypeName = model[item] == null ? null : model[item].GetType().Name
|
CSharpTypeName = model[item] == null ? null : model[item].GetType().Name
|
||||||
}));
|
}));
|
||||||
i++;
|
i++;
|
||||||
|
@ -331,7 +331,7 @@ namespace SqlSugar
|
|||||||
FieldName = item.DbColumnName,
|
FieldName = item.DbColumnName,
|
||||||
ConditionalType = ConditionalType.Equal,
|
ConditionalType = ConditionalType.Equal,
|
||||||
CSharpTypeName=UtilMethods.GetTypeName(value),
|
CSharpTypeName=UtilMethods.GetTypeName(value),
|
||||||
FieldValue = value + "",
|
FieldValue = value==null?"null":value.ObjToString(),
|
||||||
FieldValueConvertFunc=this.Context.CurrentConnectionConfig.DbType==DbType.PostgreSQL?
|
FieldValueConvertFunc=this.Context.CurrentConnectionConfig.DbType==DbType.PostgreSQL?
|
||||||
UtilMethods.GetTypeConvert(value):null
|
UtilMethods.GetTypeConvert(value):null
|
||||||
}));
|
}));
|
||||||
|
@ -164,8 +164,19 @@ namespace SqlSugar
|
|||||||
switch (item.ConditionalType)
|
switch (item.ConditionalType)
|
||||||
{
|
{
|
||||||
case ConditionalType.Equal:
|
case ConditionalType.Equal:
|
||||||
builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "=", parameterName);
|
if (item.FieldValue!=null&&item.FieldValue == "null"&&item.FieldValue!= "[null]")
|
||||||
parameters.Add(new SugarParameter(parameterName, GetFieldValue(item)));
|
{
|
||||||
|
builder.AppendFormat($" {item.FieldName.ToSqlFilter()} is null ");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (item.FieldValue == "[null]")
|
||||||
|
{
|
||||||
|
item.FieldValue = "null";
|
||||||
|
}
|
||||||
|
builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "=", parameterName);
|
||||||
|
parameters.Add(new SugarParameter(parameterName, GetFieldValue(item)));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ConditionalType.Like:
|
case ConditionalType.Like:
|
||||||
builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "LIKE", parameterName);
|
builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "LIKE", parameterName);
|
||||||
|
@ -54,6 +54,7 @@ namespace SqlSugar
|
|||||||
ISugarQueryable<T> WhereClassByPrimaryKey(List<T> list);
|
ISugarQueryable<T> WhereClassByPrimaryKey(List<T> list);
|
||||||
ISugarQueryable<T> WhereClassByPrimaryKey(T data) ;
|
ISugarQueryable<T> WhereClassByPrimaryKey(T data) ;
|
||||||
ISugarQueryable<T> WhereColumns(List<Dictionary<string, object>> columns);
|
ISugarQueryable<T> WhereColumns(List<Dictionary<string, object>> columns);
|
||||||
|
ISugarQueryable<T> WhereColumns(Dictionary<string, object> columns);
|
||||||
ISugarQueryable<T> TranLock(DbLockType LockType = DbLockType.Wait);
|
ISugarQueryable<T> TranLock(DbLockType LockType = DbLockType.Wait);
|
||||||
ISugarQueryable<T> Where(Expression<Func<T, bool>> expression);
|
ISugarQueryable<T> Where(Expression<Func<T, bool>> expression);
|
||||||
ISugarQueryable<T> Where(string whereString, object parameters = null);
|
ISugarQueryable<T> Where(string whereString, object parameters = null);
|
||||||
|
@ -176,6 +176,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
sb.Append(row[colum].ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff"));
|
sb.Append(row[colum].ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff"));
|
||||||
}
|
}
|
||||||
|
else if (colum.DataType == UtilConstants.DateType && row[colum] != null && row[colum] == DBNull.Value)
|
||||||
|
{
|
||||||
|
sb.Append("NULL");
|
||||||
|
}
|
||||||
else sb.Append(row[colum].ToString());
|
else sb.Append(row[colum].ToString());
|
||||||
}
|
}
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
|
Loading…
Reference in New Issue
Block a user