Synchronization code

This commit is contained in:
sunkaixuan 2024-05-13 03:23:58 +08:00
parent 63b75c29b4
commit 86cf98d8f8

View File

@ -1235,8 +1235,16 @@ namespace SqlSugar
public ISugarQueryable<T> SampleBy(int timeNumber, SampleByUnit timeType)
{
SampleByUnit sampleBy = timeType;
string sql = "SAMPLE BY "+timeNumber + sampleBy.ToString().Substring(0, 1).ToLower();
this.QueryBuilder.SampleBy = sql;
if (timeType == SampleByUnit.Month)
{
string sql = "SAMPLE BY " + timeNumber + sampleBy.ToString().Substring(0, 1);
this.QueryBuilder.SampleBy = sql;
}
else
{
string sql = "SAMPLE BY "+timeNumber + sampleBy.ToString().Substring(0, 1).ToLower();
this.QueryBuilder.SampleBy = sql;
}
return this;
}
public ISugarQueryable<T> SampleBy(int timeNumber, string timeType)