|
@@ -301,9 +301,9 @@ namespace GxPress.Repository.Implement.Note
|
|
|
sql += "and (a.RoleId in(1,3))";
|
|
|
}
|
|
|
if (request.FolderId == 0 && !string.IsNullOrEmpty(request.SearchKey))
|
|
|
- sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.Content LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
+ sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
else if (!string.IsNullOrEmpty(request.SearchKey))
|
|
|
- sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.Content LIKE '%{request.SearchKey}%')";
|
|
|
+ sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%')";
|
|
|
else
|
|
|
sql += $" and a.ParentId={request.FolderId}";
|
|
|
sql +=
|
|
@@ -419,9 +419,9 @@ namespace GxPress.Repository.Implement.Note
|
|
|
sql += "and (a.RoleId in(1,3))";
|
|
|
}
|
|
|
if (request.FolderId == 0 && !string.IsNullOrEmpty(request.SearchKey))
|
|
|
- sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.Content LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
+ sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
else if (!string.IsNullOrEmpty(request.SearchKey))
|
|
|
- sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.Content LIKE '%{request.SearchKey}%')";
|
|
|
+ sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%')";
|
|
|
else
|
|
|
sql += $" and a.ParentId={request.FolderId}";
|
|
|
sql +=
|
|
@@ -483,9 +483,9 @@ namespace GxPress.Repository.Implement.Note
|
|
|
sql += "and (a.RoleId in(1,3))";
|
|
|
}
|
|
|
if (request.FolderId == 0 && !string.IsNullOrEmpty(request.SearchKey))
|
|
|
- sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.Content LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
+ sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
else if (!string.IsNullOrEmpty(request.SearchKey))
|
|
|
- sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.Content LIKE '%{request.SearchKey}%')";
|
|
|
+ sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%')";
|
|
|
else
|
|
|
sql += $" and a.ParentId={request.FolderId}";
|
|
|
}
|
|
@@ -503,9 +503,9 @@ namespace GxPress.Repository.Implement.Note
|
|
|
sql += " and (a.RoleId in(1,3))";
|
|
|
}
|
|
|
if (request.FolderId == 0 && !string.IsNullOrEmpty(request.SearchKey))
|
|
|
- sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.Content LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
+ sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
else if (!string.IsNullOrEmpty(request.SearchKey))
|
|
|
- sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.Content LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
+ sql += $@" and a.ParentId={request.FolderId} AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%' or b.UserId in (select Id from tede_user where name like '%{request.SearchKey}%'))";
|
|
|
else
|
|
|
sql += $" and a.ParentId={request.FolderId}";
|
|
|
}
|
|
@@ -697,7 +697,7 @@ namespace GxPress.Repository.Implement.Note
|
|
|
a.IsTopic = 1";
|
|
|
if (!string.IsNullOrEmpty(request.SearchKey))
|
|
|
{
|
|
|
- sql += $@" and (b.Name like '%11%' or a.Title like '%11%' or a.Content like '%11%')";
|
|
|
+ sql += $@" and (b.Name like '%11%' or a.Title like '%11%' or a.TextContent like '%11%')";
|
|
|
}
|
|
|
sql += $@" AND (a.FolderId IN (SELECT
|
|
|
Id
|
|
@@ -746,7 +746,7 @@ namespace GxPress.Repository.Implement.Note
|
|
|
a.IsTopic = 1";
|
|
|
if (!string.IsNullOrEmpty(request.SearchKey))
|
|
|
{
|
|
|
- sql += $@" and (b.Name like '%11%' or a.Title like '%11%' or a.Content like '%11%')";
|
|
|
+ sql += $@" and (b.Name like '%11%' or a.Title like '%11%' or a.TextContent like '%11%')";
|
|
|
}
|
|
|
sql += $@" AND (a.FolderId IN (SELECT
|
|
|
Id
|
|
@@ -780,7 +780,7 @@ namespace GxPress.Repository.Implement.Note
|
|
|
var sqlValue = "";
|
|
|
if (!string.IsNullOrEmpty(request.SearchKey))
|
|
|
{
|
|
|
- sqlValue += $" and (a.Title like '%{request.SearchKey}%' or a.Content like '%{request.SearchKey}%')";
|
|
|
+ sqlValue += $" and (a.Title like '%{request.SearchKey}%' or a.TextContent like '%{request.SearchKey}%')";
|
|
|
}
|
|
|
var noteConstValue = GxPress.EnumConst.AllTypeConst.Note.GetHashCode();
|
|
|
var sql = $@"SELECT
|
|
@@ -977,6 +977,11 @@ namespace GxPress.Repository.Implement.Note
|
|
|
query.Where(nameof(Entity.Note.Note.IsDraft), true);
|
|
|
return await _repository.DeleteAsync(query) > 0;
|
|
|
}
|
|
|
+
|
|
|
+ public async Task<IEnumerable<Entity.Note.Note>> GetAllAsync(SqlKata.Query query)
|
|
|
+ {
|
|
|
+ return await _repository.GetAllAsync(query);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|