|
@@ -94,7 +94,7 @@ namespace GxPress.Repository.Implement.Collection
|
|
|
{
|
|
|
|
|
|
sql =
|
|
|
- $@"SELECT a.*,(SELECT GROUP_CONCAT(SourceName Separator'、') from tede_user_middle where MiddleType=3 and DataSourceId=a.MiddleSonId) as EnjoyUser,(select count(1) from tede_middle where ParentId=a.Id) as FileCount, b.* FROM ccpph.tede_middle a LEFT JOIN ccpph.tede_collection b ON a.MiddleId = b.Id WHERE a.UserId = {request.VisitUserId} AND a.FolderType = 3 AND a.IsDelete = 0";
|
|
|
+ $@"SELECT a.*,(SELECT GROUP_CONCAT(SourceName Separator'、') from tede_user_middle where MiddleType=3 and DataSourceId=a.MiddleSonId) as EnjoyUser,(select count(1) from tede_middle where ParentId=a.Id) as FileCount, b.* FROM tede_middle a LEFT JOIN tede_collection b ON a.MiddleId = b.Id WHERE a.UserId = {request.VisitUserId} AND a.FolderType = 3 AND a.IsDelete = 0";
|
|
|
if (request.FolderId == 0)
|
|
|
sql += @" AND(a.RoleId = 1 OR a.RoleId = 3) AND a.ParentId = 0";
|
|
|
else
|
|
@@ -102,7 +102,7 @@ namespace GxPress.Repository.Implement.Collection
|
|
|
if (!string.IsNullOrEmpty(request.SearchKey))
|
|
|
sql += $@" AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%')";
|
|
|
sql +=
|
|
|
- $@" OR a.id IN(SELECT MiddleId FROM ccpph.tede_folder_user WHERE UserId = {request.UserId}) AND a.FolderType = 3 AND a.UserId = {request.VisitUserId}";
|
|
|
+ $@" OR a.id IN(SELECT MiddleId FROM tede_folder_user WHERE UserId = {request.UserId}) AND a.FolderType = 3 AND a.UserId = {request.VisitUserId}";
|
|
|
if (request.FolderId > 0)
|
|
|
sql += $" and a.ParentId={request.FolderId}";
|
|
|
if (!string.IsNullOrEmpty(request.SearchKey))
|
|
@@ -115,7 +115,7 @@ namespace GxPress.Repository.Implement.Collection
|
|
|
else
|
|
|
{
|
|
|
sql =
|
|
|
- $@"SELECT a.*,(SELECT GROUP_CONCAT(SourceName Separator'、') from tede_user_middle where MiddleType=3 and DataSourceId=a.MiddleSonId) as EnjoyUser,(select count(1) from tede_middle where ParentId=a.Id) as FileCount, b.* FROM ccpph.tede_middle a LEFT JOIN ccpph.tede_collection b ON a.MiddleId = b.Id WHERE a.UserId = {request.UserId} AND a.FolderType = 3 AND a.IsDelete = 0";
|
|
|
+ $@"SELECT a.*,(SELECT GROUP_CONCAT(SourceName Separator'、') from tede_user_middle where MiddleType=3 and DataSourceId=a.MiddleSonId) as EnjoyUser,(select count(1) from tede_middle where ParentId=a.Id) as FileCount, b.* FROM tede_middle a LEFT JOIN tede_collection b ON a.MiddleId = b.Id WHERE a.UserId = {request.UserId} AND a.FolderType = 3 AND a.IsDelete = 0";
|
|
|
if (!string.IsNullOrEmpty(request.SearchKey) && request.FolderId > 0)
|
|
|
{
|
|
|
sql += $" AND a.ParentId={request.FolderId}";
|
|
@@ -147,7 +147,7 @@ namespace GxPress.Repository.Implement.Collection
|
|
|
{
|
|
|
|
|
|
sql =
|
|
|
- $@"SELECT count(1) FROM ccpph.tede_middle a LEFT JOIN ccpph.tede_collection b ON a.MiddleId = b.Id WHERE a.UserId = {request.VisitUserId} AND a.FolderType = 3 AND a.IsDelete = 0";
|
|
|
+ $@"SELECT count(1) FROM tede_middle a LEFT JOIN tede_collection b ON a.MiddleId = b.Id WHERE a.UserId = {request.VisitUserId} AND a.FolderType = 3 AND a.IsDelete = 0";
|
|
|
if (request.FolderId == 0)
|
|
|
sql += @" AND(a.RoleId = 1 OR a.RoleId = 3) AND a.ParentId = 0";
|
|
|
else
|
|
@@ -155,7 +155,7 @@ namespace GxPress.Repository.Implement.Collection
|
|
|
if (!string.IsNullOrEmpty(request.SearchKey))
|
|
|
sql += $@" AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%')";
|
|
|
sql +=
|
|
|
- $@" OR a.id IN(SELECT MiddleId FROM ccpph.tede_folder_user WHERE UserId = {request.UserId}) AND a.FolderType = 3 AND a.UserId = {request.VisitUserId}";
|
|
|
+ $@" OR a.id IN(SELECT MiddleId FROM tede_folder_user WHERE UserId = {request.UserId}) AND a.FolderType = 3 AND a.UserId = {request.VisitUserId}";
|
|
|
if (request.FolderId > 0)
|
|
|
sql += $" and a.ParentId={request.FolderId}";
|
|
|
if (!string.IsNullOrEmpty(request.SearchKey))
|
|
@@ -165,7 +165,7 @@ namespace GxPress.Repository.Implement.Collection
|
|
|
else
|
|
|
{
|
|
|
sql =
|
|
|
- $@"SELECT count(1) FROM ccpph.tede_middle a LEFT JOIN ccpph.tede_collection b ON a.MiddleId = b.Id WHERE a.UserId = {request.UserId} AND a.FolderType = 3 AND a.IsDelete = 0";
|
|
|
+ $@"SELECT count(1) FROM tede_middle a LEFT JOIN tede_collection b ON a.MiddleId = b.Id WHERE a.UserId = {request.UserId} AND a.FolderType = 3 AND a.IsDelete = 0";
|
|
|
if (!string.IsNullOrEmpty(request.SearchKey) && request.FolderId > 0)
|
|
|
{
|
|
|
sql += $" AND a.ParentId={request.FolderId}";
|