|
@@ -157,8 +157,8 @@ namespace GxPress.Repository.Implement.Note
|
|
|
var noteTypeId = request.TypeValue == 0 ? AllTypeConst.Note.GetHashCode() : AllTypeConst.TopicNote.GetHashCode();
|
|
|
if (request.VisitUserId > 0)
|
|
|
{
|
|
|
- sql =
|
|
|
- $@"SELECT a.Id,a.MiddleId,a.RoleId,a.ParentId,a.AttributeValue,a.UserId,
|
|
|
+ sql =
|
|
|
+ $@"SELECT a.Id,a.MiddleId,a.RoleId,a.ParentId,a.AttributeValue,a.UserId,
|
|
|
a.CreatedDate,a.IsTop,a.FolderName,a.FolderType,
|
|
|
(SELECT GROUP_CONCAT(SourceName Separator'、') from tede_user_middle where MiddleType={noteTypeId}
|
|
|
and DataSourceId=a.MiddleSonId) as EnjoyUser,
|
|
@@ -275,6 +275,8 @@ namespace GxPress.Repository.Implement.Note
|
|
|
sql += $@" 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}%'))";
|
|
|
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}%')";
|
|
|
+ else
|
|
|
+ sql += $" and a.ParentId={request.FolderId}";
|
|
|
sql +=
|
|
|
$@" ORDER BY a.IsSystemDefault desc,a.AttributeValue desc,a.IsTop DESC,a.Sort DESC , a.LastModifiedDate DESC";
|
|
|
if (request.Page > 0)
|
|
@@ -408,8 +410,8 @@ namespace GxPress.Repository.Implement.Note
|
|
|
|
|
|
if (request.VisitUserId > 0)
|
|
|
{
|
|
|
- sql =
|
|
|
- $@"SELECT count(1)
|
|
|
+ sql =
|
|
|
+ $@"SELECT count(1)
|
|
|
FROM tede_middle a LEFT JOIN tede_note b ON a.MiddleId = b.Id
|
|
|
left join tede_user c on c.Id=b.UserId
|
|
|
left join tede_department d on d.Id=c.DepartmentId
|