mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
Update Core
This commit is contained in:
parent
bd431efc1d
commit
d7cb0ef697
@ -42,12 +42,12 @@ namespace OrmTest.UnitTest
|
||||
base.Check(@"SELECT `ID`,`SchoolId`,`Name`,`CreateTime` FROM `STudent` ORDER BY `ID` ASC LIMIT 1,3", null, t4.Key, null, "single t4 Error");
|
||||
|
||||
var t5 = db.Queryable<Student>().OrderBy(it => it.Id).Skip(3).ToSql();
|
||||
base.Check(@"SELECT `ID`,`SchoolId`,`Name`,`CreateTime` FROM `STudent` LIMIT 4,9223372036854775807", null, t5.Key,null, "single t5 Error");
|
||||
base.Check(@"SELECT `ID`,`SchoolId`,`Name`,`CreateTime` FROM `STudent` LIMIT 3,9223372036854775807", null, t5.Key,null, "single t5 Error");
|
||||
|
||||
int pageIndex = 2;
|
||||
int pageSize = 10;
|
||||
var t6 = db.Queryable<Student>().OrderBy(it => it.Id,OrderByType.Desc).Skip((pageIndex-1)*pageSize).Take(pageSize).ToSql();
|
||||
base.Check(@"SELECT `ID`,`SchoolId`,`Name`,`CreateTime` FROM `STudent` ORDER BY `ID` DESC LIMIT 11,10", null, t6.Key, null, "single t6 Error");
|
||||
base.Check(@"SELECT `ID`,`SchoolId`,`Name`,`CreateTime` FROM `STudent` ORDER BY `ID` DESC LIMIT 10,10", null, t6.Key, null, "single t6 Error");
|
||||
|
||||
|
||||
int studentCount=db.Ado.GetInt("select count(1) from Student");
|
||||
@ -95,7 +95,7 @@ namespace OrmTest.UnitTest
|
||||
.Where(it=>it.Id==1)
|
||||
.WhereIF(true,it=> SqlFunc.Contains(it.Name,"a"))
|
||||
.OrderBy(it => it.Id, OrderByType.Desc).Skip((pageIndex - 1) * pageSize).Take(pageSize ).With(SqlWith.NoLock).ToSql();
|
||||
base.Check(@"SELECT `ID`,`SchoolId`,`Name`,`CreateTime` FROM `STudent` WHERE ( `ID` = @Id0 ) AND (`Name` like concat('%',@MethodConst1,'%')) ORDER BY `ID` DESC LIMIT 11,10", new List<SugarParameter>() {
|
||||
base.Check(@"SELECT `ID`,`SchoolId`,`Name`,`CreateTime` FROM `STudent` WHERE ( `ID` = @Id0 ) AND (`Name` like concat('%',@MethodConst1,'%')) ORDER BY `ID` DESC LIMIT 10,10", new List<SugarParameter>() {
|
||||
new SugarParameter("@Id0",1),new SugarParameter("@MethodConst1","a")
|
||||
}, t8.Key, t8.Value,"single t8 Error");
|
||||
|
||||
|
@ -17,5 +17,5 @@ using System.Runtime.InteropServices;
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("1c022a5c-4e4d-4026-a8a3-f659b9740a1a")]
|
||||
[assembly: AssemblyVersion("4.1.0.8")]
|
||||
[assembly: AssemblyFileVersion("4.1.0.8")]
|
||||
[assembly: AssemblyVersion("4.1.0.9")]
|
||||
[assembly: AssemblyFileVersion("4.1.0.9")]
|
||||
|
@ -37,7 +37,7 @@ namespace SqlSugar
|
||||
if (Skip != null && Take == null)
|
||||
{
|
||||
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];
|
||||
return string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, (Skip != null || Take != null) ? null : GetOrderByString, Skip.ObjToInt() + 1, long.MaxValue);
|
||||
return string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, (Skip != null || Take != null) ? null : GetOrderByString, Skip.ObjToInt(), long.MaxValue);
|
||||
}
|
||||
else if (Skip == null && Take != null)
|
||||
{
|
||||
@ -47,7 +47,7 @@ namespace SqlSugar
|
||||
else if (Skip != null && Take != null)
|
||||
{
|
||||
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];
|
||||
return string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, Skip.ObjToInt() > 0 ? Skip.ObjToInt() + 1 : 0, Take);
|
||||
return string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, Skip.ObjToInt() > 0 ? Skip.ObjToInt() : 0, Take);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user