|
@@ -123,7 +123,7 @@ namespace GxPress.Repository.Implement
|
|
|
var showKey = $@"SELECT a.*,(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
TypeValue =1
|
|
|
AND SourceId = a.Id
|
|
@@ -131,7 +131,7 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
UserId = {request.UserId} AND TypeValue = 1
|
|
|
AND SourceId = a.Id
|
|
@@ -140,14 +140,14 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_comment
|
|
|
+ tede_comment
|
|
|
WHERE
|
|
|
ArticleId = a.Id and pid=0
|
|
|
AND TypeValue = 1) AS CommentCount,
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
UserId = {request.UserId} AND TypeValue = 1
|
|
|
AND SourceId = a.Id
|
|
@@ -155,7 +155,7 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
UserId = {request.UserId} AND TypeValue = 1
|
|
|
AND SourceId = a.Id
|
|
@@ -164,7 +164,7 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
UserId = {request.UserId} AND TypeValue = 1
|
|
|
AND SourceId = a.Id
|
|
@@ -173,14 +173,14 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
UserId = {request.UserId} AND TypeValue = 1
|
|
|
AND SourceId = a.Id
|
|
|
AND AnalyzeType = 4) AS CollectCount,b.Name,b.AvatarUrl,c.Name FROM";
|
|
|
- var countSql = $"SELECT count(1) FROM ccpph.tede_topic a inner join ccpph.tede_user b on a.UserId=b.Id inner join ccpph.tede_Department c on c.Id=b.DepartmentId where a.GroupId={request.GroupId}";
|
|
|
+ var countSql = $"SELECT count(1) FROM tede_topic a inner join tede_user b on a.UserId=b.Id inner join tede_Department c on c.Id=b.DepartmentId where a.GroupId={request.GroupId}";
|
|
|
var sql =
|
|
|
- $"{showKey} ccpph.tede_topic a inner join ccpph.tede_user b on a.UserId=b.Id inner join ccpph.tede_Department c on c.Id=b.DepartmentId where a.GroupId={request.GroupId}";
|
|
|
+ $"{showKey} tede_topic a inner join tede_user b on a.UserId=b.Id inner join tede_Department c on c.Id=b.DepartmentId where a.GroupId={request.GroupId}";
|
|
|
var strValue = "";
|
|
|
if (!string.IsNullOrEmpty(request.Key))
|
|
|
strValue += $" and (a.Title like '%{request.Key}%' or a.Content like '%{request.Key}%' or b.Name like '%{request.Key}%')";
|
|
@@ -258,7 +258,7 @@ namespace GxPress.Repository.Implement
|
|
|
/// <returns></returns>
|
|
|
public async Task<List<JobTopicResult>> ExecuteTopic()
|
|
|
{
|
|
|
- string sql = "select a.*,b.UserId,b.Id,c.Name,d.AvatarUrl from ccpph.tede_topic a inner join ccpph.tede_topic_addressee b on a.Id=b.TopicId inner join ccpph.tede_user c on c.Id=b.UserId inner join ccpph.tede_user d on d.Id=a.UserId where b.IsUpload=0 order by a.CreatedDate desc limit 0,100";
|
|
|
+ string sql = "select a.*,b.UserId,b.Id,c.Name,d.AvatarUrl from tede_topic a inner join tede_topic_addressee b on a.Id=b.TopicId inner join tede_user c on c.Id=b.UserId inner join tede_user d on d.Id=a.UserId where b.IsUpload=0 order by a.CreatedDate desc limit 0,100";
|
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
|
var database = new Database(databaseType, _connectionString);
|
|
|
var connection = database.GetConnection();
|
|
@@ -309,7 +309,7 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
TypeValue = 3
|
|
|
AND SourceId = a.Id
|
|
@@ -317,7 +317,7 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
UserId = {request.UserId} AND TypeValue = 3
|
|
|
AND SourceId = a.Id
|
|
@@ -326,14 +326,14 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_comment
|
|
|
+ tede_comment
|
|
|
WHERE
|
|
|
ArticleId = a.Id AND TypeValue = 3
|
|
|
AND Pid = 0) AS CommentCount,
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
UserId = {request.UserId} AND TypeValue = 3
|
|
|
AND SourceId = a.Id
|
|
@@ -341,7 +341,7 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
UserId = {request.UserId} AND TypeValue = 3
|
|
|
AND SourceId = a.Id
|
|
@@ -350,7 +350,7 @@ namespace GxPress.Repository.Implement
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
- ccpph.tede_analyze
|
|
|
+ tede_analyze
|
|
|
WHERE
|
|
|
UserId = {request.UserId} AND TypeValue = 3
|
|
|
AND SourceId = a.Id
|
|
@@ -358,11 +358,11 @@ namespace GxPress.Repository.Implement
|
|
|
LIMIT 0 , 1) AS IsCollect,
|
|
|
b.Name, b.AvatarUrl
|
|
|
FROM
|
|
|
- ccpph.tede_note a
|
|
|
+ tede_note a
|
|
|
INNER JOIN
|
|
|
- ccpph.tede_user b ON a.UserId = b.Id
|
|
|
+ tede_user b ON a.UserId = b.Id
|
|
|
INNER JOIN
|
|
|
- ccpph.tede_middle c ON c.MiddleId = a.Id
|
|
|
+ tede_middle c ON c.MiddleId = a.Id
|
|
|
WHERE
|
|
|
c.FolderType = 4 AND a.IsTopic = 1
|
|
|
AND (a.FolderId IN (SELECT
|
|
@@ -412,11 +412,11 @@ namespace GxPress.Repository.Implement
|
|
|
public string AssembleSqlCount(TopicPageSearchRequest request)
|
|
|
{
|
|
|
var sql = $@"SELECT count(1) FROM
|
|
|
- ccpph.tede_note a
|
|
|
+ tede_note a
|
|
|
INNER JOIN
|
|
|
- ccpph.tede_user b ON a.UserId = b.Id
|
|
|
+ tede_user b ON a.UserId = b.Id
|
|
|
INNER JOIN
|
|
|
- ccpph.tede_middle c ON c.MiddleId = a.Id
|
|
|
+ tede_middle c ON c.MiddleId = a.Id
|
|
|
WHERE
|
|
|
c.FolderType = 4 AND a.IsTopic = 1
|
|
|
AND (a.FolderId IN (SELECT
|