mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-31 15:56:25 +08:00
Code collation
This commit is contained in:
parent
d3516c872f
commit
6ec185b418
@ -9,16 +9,22 @@ namespace SqlSugar
|
||||
{
|
||||
public class SqlQueryBuilder : IDMLBuilder
|
||||
{
|
||||
public SqlSugarClient Context { get; set; }
|
||||
|
||||
private string _Fields { get; set; }
|
||||
#region Fields
|
||||
private string _Fields;
|
||||
private StringBuilder _Sql;
|
||||
private List<SugarParameter> _Parameters;
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
public SqlSugarClient Context { get; set; }
|
||||
public string Fields
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._Fields.IsNullOrEmpty())
|
||||
{
|
||||
this._Fields = Regex.Match(this.sql.ObjToString().Replace("\n",string.Empty).Replace("\r", string.Empty).Trim(), @"select(.*?)from", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
this._Fields = Regex.Match(this.sql.ObjToString().Replace("\n", string.Empty).Replace("\r", string.Empty).Trim(), @"select(.*?)from", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
if (this._Fields.IsNullOrEmpty())
|
||||
{
|
||||
this._Fields = "*";
|
||||
@ -31,8 +37,6 @@ namespace SqlSugar
|
||||
_Fields = value;
|
||||
}
|
||||
}
|
||||
|
||||
private StringBuilder _Sql;
|
||||
public StringBuilder sql
|
||||
{
|
||||
get
|
||||
@ -45,7 +49,6 @@ namespace SqlSugar
|
||||
_Sql = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string SqlTemplate
|
||||
{
|
||||
get
|
||||
@ -53,8 +56,6 @@ namespace SqlSugar
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private List<SugarParameter> _Parameters;
|
||||
public List<SugarParameter> Parameters
|
||||
{
|
||||
get
|
||||
@ -67,7 +68,9 @@ namespace SqlSugar
|
||||
_Parameters = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public string ToSqlString()
|
||||
{
|
||||
return sql.ToString();
|
||||
@ -75,6 +78,7 @@ namespace SqlSugar
|
||||
public void Clear()
|
||||
{
|
||||
this.sql = null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user