You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(!string.IsNullOrEmpty(queryDto.StatusName))where+=" and statusname=@StatusName";
90
+
if(!string.IsNullOrEmpty(queryDto.StatusName))where+=" AND [StatusName]=@StatusName";
91
91
92
-
if(!string.IsNullOrEmpty(queryDto.Name))where+=" and name=@Name";
92
+
if(!string.IsNullOrEmpty(queryDto.Name))where+=" AND [Name]=@Name";
93
93
94
-
if(!string.IsNullOrEmpty(queryDto.Group))where+=" and [group]=@Group";
94
+
if(!string.IsNullOrEmpty(queryDto.Group))where+=" AND [Group]=@Group";
95
95
96
-
if(!string.IsNullOrEmpty(queryDto.Content))where+=" and content like @Content";
96
+
if(!string.IsNullOrEmpty(queryDto.Content))where+=" AND [Content] LIKE @Content";
97
97
98
98
varsqlQuery2008=
99
-
$@"select * from
100
-
(SELECT t.*, ROW_NUMBER() OVER(order by t.Added desc) AS row_number
101
-
from {tableName} as t
102
-
where 1=1 {where}) as tbl
103
-
where tbl.row_number between @offset and @offset + @limit";
99
+
$@"SELECT * FROM (SELECT p.*, ROW_NUMBER() OVER(ORDER BY p.Added DESC) AS RowNum FROM {tableName} as p WHERE 1=1 {where}) as tbl WHERE tbl.RowNum BETWEEN @Offset AND @Offset + @Limit";
104
100
105
101
varsqlQuery=
106
-
$"select * from{tableName}where 1=1 {where}order by Added desc offset @Offset rows fetch next @Limit rows only";
102
+
$"SELECT * FROM{tableName}WHERE 1=1 {where}ORDER BY Added DESC OFFSET @Offset ROWS FETCH NEXT @Limit ROWS ONLY";
107
103
108
104
object[]sqlParams=
109
105
{
@@ -118,7 +114,7 @@ public async Task<PagedQueryResult<MessageDto>> GetMessagesAsync(MessageQueryDto
0 commit comments