lihao 4 lat temu
rodzic
commit
5be285fb1d

+ 3 - 3
gx_api/GxPress/Repository/GxPress.Repository.Implement/Note/NoteRepository.cs

@@ -479,13 +479,13 @@ namespace GxPress.Repository.Implement.Note
                 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 WHERE a.UserId = {request.UserId} AND a.FolderType ={noteTypeId} AND a.IsDelete = 0";
                 if (request.TypeValue == 0)
-                    sql += "and  (a.RoleId in(2) or a.AttributeValue=1)";
+                    sql += " and  (a.RoleId in(2) or a.AttributeValue=1)";
                 else
                 {
                     if (request.FolderId != 0)
-                        sql += "and  (a.RoleId in(1,3) or a.AttributeValue=1)";
+                        sql += " and  (a.RoleId in(1,3) or a.AttributeValue=1)";
                     else
-                        sql += "and  (a.RoleId in(1,3))";
+                        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}%'))";