|
@@ -383,11 +383,11 @@ namespace GxPress.Repository.Implement.Note
|
|
FROM tede_middle a LEFT JOIN tede_note b ON a.MiddleId = b.Id
|
|
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_user c on c.Id=b.UserId
|
|
left join tede_department d on d.Id=c.DepartmentId
|
|
left join tede_department d on d.Id=c.DepartmentId
|
|
- WHERE a.UserId = {request.UserId} AND a.IsDelete = 0 ";
|
|
|
|
|
|
+ WHERE a.FolderType = {noteTypeId} and a.UserId = {request.UserId} AND a.IsDelete = 0 ";
|
|
if (request.TypeValue == 0)
|
|
if (request.TypeValue == 0)
|
|
- sql += "and (a.RoleId=2 or a.AttributeValue<>2)";
|
|
|
|
|
|
+ sql += " AND (a.RoleId = 2 OR a.AttributeValue in( 1,2))";
|
|
else
|
|
else
|
|
- sql += "and (a.RoleId in(1,3) or a.AttributeValue<>2)";
|
|
|
|
|
|
+ sql += "and (a.RoleId in(1,3) or a.AttributeValue in( 1,2))";
|
|
if (request.FolderId == 0 && !string.IsNullOrEmpty(request.SearchKey))
|
|
if (request.FolderId == 0 && !string.IsNullOrEmpty(request.SearchKey))
|
|
sql += $@" AND (b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%')";
|
|
sql += $@" AND (b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%')";
|
|
else if (!string.IsNullOrEmpty(request.SearchKey))
|
|
else if (!string.IsNullOrEmpty(request.SearchKey))
|
|
@@ -422,7 +422,7 @@ namespace GxPress.Repository.Implement.Note
|
|
FROM tede_middle a LEFT JOIN tede_note b ON a.MiddleId = b.Id
|
|
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_user c on c.Id=b.UserId
|
|
left join tede_department d on d.Id=c.DepartmentId
|
|
left join tede_department d on d.Id=c.DepartmentId
|
|
- WHERE
|
|
|
|
|
|
+ WHERE a.FolderType = {noteTypeId} and
|
|
a.userId = {request.VisitUserId}
|
|
a.userId = {request.VisitUserId}
|
|
AND a.IsDelete = 0
|
|
AND a.IsDelete = 0
|
|
AND (a.UserId IN (SELECT
|
|
AND (a.UserId IN (SELECT
|
|
@@ -460,12 +460,12 @@ namespace GxPress.Repository.Implement.Note
|
|
{
|
|
{
|
|
sql =
|
|
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
|
|
$@"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 WHERE a.UserId = {request.UserId} AND a.IsDelete = 0";
|
|
|
|
|
|
+ on d.Id=c.DepartmentId WHERE a.FolderType = {noteTypeId} and a.UserId = {request.UserId} AND a.IsDelete = 0";
|
|
if (request.TypeValue == 0)
|
|
if (request.TypeValue == 0)
|
|
- sql += " and (a.RoleId in(2) or a.AttributeValue<>2)";
|
|
|
|
|
|
+ sql += " and (a.RoleId in(2) or a.AttributeValue in(1,2))";
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- sql += " and (a.RoleId in(1,3) or a.AttributeValue<>2)";
|
|
|
|
|
|
+ sql += " and (a.RoleId in(1,3) or a.AttributeValue in(1,2))";
|
|
}
|
|
}
|
|
if (request.FolderId == 0 && !string.IsNullOrEmpty(request.SearchKey))
|
|
if (request.FolderId == 0 && !string.IsNullOrEmpty(request.SearchKey))
|
|
sql += $@" AND (b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%')";
|
|
sql += $@" AND (b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%' or b.TextContent LIKE '%{request.SearchKey}%')";
|