mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 12:33:44 +08:00
Update .net core project
This commit is contained in:
@@ -645,7 +645,11 @@ namespace SqlSugar
|
|||||||
this.Where<T>(whereString, whereObj);
|
this.Where<T>(whereString, whereObj);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public virtual ISugarQueryable<T> Where(IFuncModel funcModel)
|
||||||
|
{
|
||||||
|
var obj= this.SqlBuilder.FuncModelToSql(funcModel);
|
||||||
|
return this.Where(obj.Key, obj.Value);
|
||||||
|
}
|
||||||
public virtual ISugarQueryable<T> Where(List<IConditionalModel> conditionalModels)
|
public virtual ISugarQueryable<T> Where(List<IConditionalModel> conditionalModels)
|
||||||
{
|
{
|
||||||
if (conditionalModels.IsNullOrEmpty()) return this;
|
if (conditionalModels.IsNullOrEmpty()) return this;
|
||||||
@@ -3626,7 +3630,11 @@ namespace SqlSugar
|
|||||||
base.Where(conditionalModels);
|
base.Where(conditionalModels);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public new ISugarQueryable<T,T2> Where(IFuncModel funcModel)
|
||||||
|
{
|
||||||
|
var obj = this.SqlBuilder.FuncModelToSql(funcModel);
|
||||||
|
return this.Where(obj.Key, obj.Value);
|
||||||
|
}
|
||||||
public new ISugarQueryable<T, T2> WhereIF(bool isWhere, string whereString, object whereObj)
|
public new ISugarQueryable<T, T2> WhereIF(bool isWhere, string whereString, object whereObj)
|
||||||
{
|
{
|
||||||
if (!isWhere) return this;
|
if (!isWhere) return this;
|
||||||
@@ -4233,7 +4241,11 @@ namespace SqlSugar
|
|||||||
base.Where(conditionalModels);
|
base.Where(conditionalModels);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public new ISugarQueryable<T, T2,T3> Where(IFuncModel funcModel)
|
||||||
|
{
|
||||||
|
var obj = this.SqlBuilder.FuncModelToSql(funcModel);
|
||||||
|
return this.Where(obj.Key, obj.Value);
|
||||||
|
}
|
||||||
public ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression)
|
public ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression)
|
||||||
{
|
{
|
||||||
if (isWhere)
|
if (isWhere)
|
||||||
@@ -4619,7 +4631,11 @@ namespace SqlSugar
|
|||||||
base.Where(conditionalModels);
|
base.Where(conditionalModels);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public new ISugarQueryable<T, T2,T3,T4> Where(IFuncModel funcModel)
|
||||||
|
{
|
||||||
|
var obj = this.SqlBuilder.FuncModelToSql(funcModel);
|
||||||
|
return this.Where(obj.Key, obj.Value);
|
||||||
|
}
|
||||||
public new ISugarQueryable<T, T2, T3, T4> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
|
public new ISugarQueryable<T, T2, T3, T4> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
|
||||||
{
|
{
|
||||||
if (isWhere)
|
if (isWhere)
|
||||||
@@ -5229,7 +5245,11 @@ namespace SqlSugar
|
|||||||
base.Where(conditionalModels);
|
base.Where(conditionalModels);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public new ISugarQueryable<T, T2, T3, T4,T5> Where(IFuncModel funcModel)
|
||||||
|
{
|
||||||
|
var obj = this.SqlBuilder.FuncModelToSql(funcModel);
|
||||||
|
return this.Where(obj.Key, obj.Value);
|
||||||
|
}
|
||||||
public new ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
|
public new ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
|
||||||
{
|
{
|
||||||
if (isWhere)
|
if (isWhere)
|
||||||
@@ -5778,7 +5798,11 @@ namespace SqlSugar
|
|||||||
base.Where(conditionalModels);
|
base.Where(conditionalModels);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public new ISugarQueryable<T, T2, T3, T4, T5,T6> Where(IFuncModel funcModel)
|
||||||
|
{
|
||||||
|
var obj = this.SqlBuilder.FuncModelToSql(funcModel);
|
||||||
|
return this.Where(obj.Key, obj.Value);
|
||||||
|
}
|
||||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
|
public new ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
|
||||||
{
|
{
|
||||||
if (isWhere)
|
if (isWhere)
|
||||||
|
@@ -61,6 +61,7 @@ namespace SqlSugar
|
|||||||
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);
|
||||||
|
ISugarQueryable<T> Where(IFuncModel funcModel);
|
||||||
ISugarQueryable<T> Where(List<IConditionalModel> conditionalModels);
|
ISugarQueryable<T> Where(List<IConditionalModel> conditionalModels);
|
||||||
ISugarQueryable<T> Where(List<IConditionalModel> conditionalModels,bool isWrap);
|
ISugarQueryable<T> Where(List<IConditionalModel> conditionalModels,bool isWrap);
|
||||||
ISugarQueryable<T> Where(string fieldName, string conditionalType, object fieldValue);
|
ISugarQueryable<T> Where(string fieldName, string conditionalType, object fieldValue);
|
||||||
@@ -220,6 +221,7 @@ namespace SqlSugar
|
|||||||
new ISugarQueryable<T, T2> Where(Expression<Func<T, bool>> expression);
|
new ISugarQueryable<T, T2> Where(Expression<Func<T, bool>> expression);
|
||||||
ISugarQueryable<T, T2> Where(Expression<Func<T, T2, bool>> expression);
|
ISugarQueryable<T, T2> Where(Expression<Func<T, T2, bool>> expression);
|
||||||
new ISugarQueryable<T, T2> Where(List<IConditionalModel> conditionalModels);
|
new ISugarQueryable<T, T2> Where(List<IConditionalModel> conditionalModels);
|
||||||
|
new ISugarQueryable<T,T2> Where(IFuncModel funcModel);
|
||||||
|
|
||||||
new ISugarQueryable<T, T2> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
new ISugarQueryable<T, T2> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
||||||
ISugarQueryable<T, T2> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
ISugarQueryable<T, T2> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
||||||
@@ -319,7 +321,7 @@ namespace SqlSugar
|
|||||||
ISugarQueryable<T, T2, T3> Where(Expression<Func<T, T2, bool>> expression);
|
ISugarQueryable<T, T2, T3> Where(Expression<Func<T, T2, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3> Where(Expression<Func<T, T2, T3, bool>> expression);
|
ISugarQueryable<T, T2, T3> Where(Expression<Func<T, T2, T3, bool>> expression);
|
||||||
new ISugarQueryable<T, T2, T3> Where(List<IConditionalModel> conditionalModels);
|
new ISugarQueryable<T, T2, T3> Where(List<IConditionalModel> conditionalModels);
|
||||||
|
new ISugarQueryable<T, T2,T3> Where(IFuncModel funcModel);
|
||||||
new ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
new ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
|
ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
|
||||||
@@ -434,7 +436,7 @@ namespace SqlSugar
|
|||||||
ISugarQueryable<T, T2, T3, T4> Where(Expression<Func<T, T2, T3, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4> Where(Expression<Func<T, T2, T3, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3, T4> Where(Expression<Func<T, T2, T3, T4, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4> Where(Expression<Func<T, T2, T3, T4, bool>> expression);
|
||||||
new ISugarQueryable<T, T2, T3, T4> Where(List<IConditionalModel> conditionalModels);
|
new ISugarQueryable<T, T2, T3, T4> Where(List<IConditionalModel> conditionalModels);
|
||||||
|
new ISugarQueryable<T, T2, T3,T4> Where(IFuncModel funcModel);
|
||||||
new ISugarQueryable<T, T2, T3, T4> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
new ISugarQueryable<T, T2, T3, T4> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3, T4> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3, T4> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
|
||||||
@@ -560,7 +562,7 @@ namespace SqlSugar
|
|||||||
ISugarQueryable<T, T2, T3, T4, T5> Where(Expression<Func<T, T2, T3, T4, T5, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4, T5> Where(Expression<Func<T, T2, T3, T4, T5, bool>> expression);
|
||||||
new ISugarQueryable<T, T2, T3, T4, T5> Where(List<IConditionalModel> conditionalModels);
|
new ISugarQueryable<T, T2, T3, T4, T5> Where(List<IConditionalModel> conditionalModels);
|
||||||
|
|
||||||
|
new ISugarQueryable<T, T2, T3, T4,T5> Where(IFuncModel funcModel);
|
||||||
new ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
new ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
|
||||||
@@ -678,7 +680,7 @@ namespace SqlSugar
|
|||||||
ISugarQueryable<T, T2, T3, T4, T5, T6> Where(Expression<Func<T, T2, T3, T4, T5, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4, T5, T6> Where(Expression<Func<T, T2, T3, T4, T5, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3, T4, T5, T6> Where(Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4, T5, T6> Where(Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression);
|
||||||
new ISugarQueryable<T, T2, T3, T4, T5, T6> Where(List<IConditionalModel> conditionalModels);
|
new ISugarQueryable<T, T2, T3, T4, T5, T6> Where(List<IConditionalModel> conditionalModels);
|
||||||
|
new ISugarQueryable<T, T2, T3, T4, T5,T6> Where(IFuncModel funcModel);
|
||||||
new ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
new ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
|
||||||
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
|
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
|
||||||
|
@@ -8,7 +8,7 @@ namespace SqlSugar
|
|||||||
public abstract partial class SqlBuilderProvider : SqlBuilderAccessory, ISqlBuilder
|
public abstract partial class SqlBuilderProvider : SqlBuilderAccessory, ISqlBuilder
|
||||||
{
|
{
|
||||||
#region Variable
|
#region Variable
|
||||||
private string[] SqlSplicingOperator = new string[] { ">", ">=", "<", "<=", "(", ")", "=", "||", "&&","&","|" };
|
private string[] SqlSplicingOperator = new string[] { ">", ">=", "<", "<=", "(", ")", "=", "||", "&&","&","|","null","is","isnot" };
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Root
|
#region Root
|
||||||
@@ -44,8 +44,8 @@ namespace SqlSugar
|
|||||||
private static string GetSqlSplicingOperator(object value)
|
private static string GetSqlSplicingOperator(object value)
|
||||||
{
|
{
|
||||||
var result= value.ObjToString();
|
var result= value.ObjToString();
|
||||||
if (result == "||") return "AND";
|
if (result == "||") return "OR";
|
||||||
else if (result == "&&") return "OR";
|
else if (result == "&&") return "AND";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
private static string GetSqlPartError(object value)
|
private static string GetSqlPartError(object value)
|
||||||
|
@@ -60,6 +60,10 @@ namespace SqlSugar
|
|||||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (type == UtilConstants.DateTimeOffsetType)
|
||||||
|
{
|
||||||
|
return GetDateTimeOffsetString(value);
|
||||||
|
}
|
||||||
else if (type == UtilConstants.DateType && iswhere)
|
else if (type == UtilConstants.DateType && iswhere)
|
||||||
{
|
{
|
||||||
var parameterName = this.Builder.SqlParameterKeyWord + name + i;
|
var parameterName = this.Builder.SqlParameterKeyWord + name + i;
|
||||||
@@ -97,5 +101,15 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private object GetDateTimeOffsetString(object value)
|
||||||
|
{
|
||||||
|
var date = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value);
|
||||||
|
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||||
|
{
|
||||||
|
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||||
|
}
|
||||||
|
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user