|
@@ -131,7 +131,7 @@ namespace GxPress.Repository.Implement
|
|
// if (!string.IsNullOrEmpty(request.Key))
|
|
// if (!string.IsNullOrEmpty(request.Key))
|
|
// sqlValue += $"and b.Name like '%{request.Key}%'";
|
|
// sqlValue += $"and b.Name like '%{request.Key}%'";
|
|
//共享数量
|
|
//共享数量
|
|
- var topicSharingCount = "(select count(1) from ccpph.tede_group_user where GroupId=a.MiddleId) as TopicSharingCount";
|
|
|
|
|
|
+ var topicSharingCount = "(select count(1) from tede_group_user where GroupId=a.MiddleId) as TopicSharingCount";
|
|
//总话题数量
|
|
//总话题数量
|
|
var topicAllCount = "(select count(1) from tede_topic where GroupId=a.MiddleId) as TopicAllCount";
|
|
var topicAllCount = "(select count(1) from tede_topic where GroupId=a.MiddleId) as TopicAllCount";
|
|
//未读话题数量
|
|
//未读话题数量
|
|
@@ -142,14 +142,14 @@ namespace GxPress.Repository.Implement
|
|
(SELECT
|
|
(SELECT
|
|
COUNT(1)
|
|
COUNT(1)
|
|
FROM
|
|
FROM
|
|
- ccpph.tede_group
|
|
|
|
|
|
+ tede_group
|
|
WHERE
|
|
WHERE
|
|
id IN (SELECT
|
|
id IN (SELECT
|
|
MiddleId
|
|
MiddleId
|
|
FROM
|
|
FROM
|
|
- ccpph.tede_middle
|
|
|
|
|
|
+ tede_middle
|
|
WHERE
|
|
WHERE
|
|
- ParentId = a.Id)) AS FileCount,b.Id, b.AvatarUrl, b.Name FROM ccpph.tede_Middle a LEFT JOIN ccpph.tede_group b ON a.MiddleId = b.Id WHERE 1=1 ";
|
|
|
|
|
|
+ ParentId = a.Id)) AS FileCount,b.Id, b.AvatarUrl, b.Name FROM tede_Middle a LEFT JOIN tede_group b ON a.MiddleId = b.Id WHERE 1=1 ";
|
|
if (request.GroupFolderId == 0 && string.IsNullOrEmpty(request.Key))
|
|
if (request.GroupFolderId == 0 && string.IsNullOrEmpty(request.Key))
|
|
sql += $"and a.ParentId = @groupFolderId ";
|
|
sql += $"and a.ParentId = @groupFolderId ";
|
|
else if (request.GroupFolderId > 0 && !string.IsNullOrEmpty(request.Key))
|
|
else if (request.GroupFolderId > 0 && !string.IsNullOrEmpty(request.Key))
|
|
@@ -183,7 +183,7 @@ namespace GxPress.Repository.Implement
|
|
|
|
|
|
pagedList.Items = result;
|
|
pagedList.Items = result;
|
|
var sqlCount =
|
|
var sqlCount =
|
|
- @"SELECT count(1) FROM ccpph.tede_Middle a LEFT JOIN ccpph.tede_group b ON a.MiddleId = b.Id WHERE 1=1 ";
|
|
|
|
|
|
+ @"SELECT count(1) FROM tede_Middle a LEFT JOIN tede_group b ON a.MiddleId = b.Id WHERE 1=1 ";
|
|
if (request.GroupFolderId == 0 && string.IsNullOrEmpty(request.Key))
|
|
if (request.GroupFolderId == 0 && string.IsNullOrEmpty(request.Key))
|
|
sqlCount += $"and a.ParentId = {request.GroupFolderId} ";
|
|
sqlCount += $"and a.ParentId = {request.GroupFolderId} ";
|
|
else if (request.GroupFolderId > 0 && !string.IsNullOrEmpty(request.Key))
|
|
else if (request.GroupFolderId > 0 && !string.IsNullOrEmpty(request.Key))
|
|
@@ -227,7 +227,7 @@ namespace GxPress.Repository.Implement
|
|
if (!string.IsNullOrEmpty(groupDetail.QRCoder))
|
|
if (!string.IsNullOrEmpty(groupDetail.QRCoder))
|
|
groupDetail.QRCoder = StringUtils.AddDomain(groupDetail.QRCoder);
|
|
groupDetail.QRCoder = StringUtils.AddDomain(groupDetail.QRCoder);
|
|
var sql =
|
|
var sql =
|
|
- "SELECT a.*,b.Name,b.AvatarUrl,c.Name FROM ccpph.tede_group_user a inner join ccpph.tede_user b on a.UserId=b.Id inner join ccpph.tede_department c on b.DepartmentId=c.Id where a.GroupId=@groupId order by a.GroupUserRoleId";
|
|
|
|
|
|
+ "SELECT a.*,b.Name,b.AvatarUrl,c.Name FROM tede_group_user a inner join tede_user b on a.UserId=b.Id inner join tede_department c on b.DepartmentId=c.Id where a.GroupId=@groupId order by a.GroupUserRoleId";
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var connection = database.GetConnection();
|
|
var connection = database.GetConnection();
|
|
@@ -259,8 +259,8 @@ namespace GxPress.Repository.Implement
|
|
public async Task<IEnumerable<GroupUserListResult>> SearchGroupUserAsync(TopicDetailListRequest request)
|
|
public async Task<IEnumerable<GroupUserListResult>> SearchGroupUserAsync(TopicDetailListRequest request)
|
|
{
|
|
{
|
|
string sql =
|
|
string sql =
|
|
- $@"SELECT a.*, b.Name, b.AvatarUrl, c.Name FROM ccpph.tede_group_user a INNER JOIN ccpph.tede_user b ON a.UserId = b.Id INNER JOIN
|
|
|
|
- ccpph.tede_department c ON b.DepartmentId = c.Id
|
|
|
|
|
|
+ $@"SELECT a.*, b.Name, b.AvatarUrl, c.Name FROM tede_group_user a INNER JOIN tede_user b ON a.UserId = b.Id INNER JOIN
|
|
|
|
+ tede_department c ON b.DepartmentId = c.Id
|
|
WHERE a.GroupId = {request.GroupId} and b.Name like '%{request.Key}%'";
|
|
WHERE a.GroupId = {request.GroupId} and b.Name like '%{request.Key}%'";
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var database = new Database(databaseType, _connectionString);
|
|
@@ -294,7 +294,7 @@ namespace GxPress.Repository.Implement
|
|
if (!string.IsNullOrEmpty(groupDetail.QRCoder))
|
|
if (!string.IsNullOrEmpty(groupDetail.QRCoder))
|
|
groupDetail.QRCoder = StringUtils.AddDomain(groupDetail.QRCoder);
|
|
groupDetail.QRCoder = StringUtils.AddDomain(groupDetail.QRCoder);
|
|
var sql =
|
|
var sql =
|
|
- "SELECT a.*,b.Name,b.AvatarUrl,c.Name FROM ccpph.tede_group_user a inner join ccpph.tede_user b on a.UserId=b.Id inner join ccpph.tede_department c on b.DepartmentId=c.Id where a.GroupId=@groupId";
|
|
|
|
|
|
+ "SELECT a.*,b.Name,b.AvatarUrl,c.Name FROM tede_group_user a inner join tede_user b on a.UserId=b.Id inner join tede_department c on b.DepartmentId=c.Id where a.GroupId=@groupId";
|
|
|
|
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var database = new Database(databaseType, _connectionString);
|
|
@@ -328,7 +328,7 @@ namespace GxPress.Repository.Implement
|
|
public async Task<int> GetUReadCountAsync(int userId, int groupId)
|
|
public async Task<int> GetUReadCountAsync(int userId, int groupId)
|
|
{
|
|
{
|
|
string sql =
|
|
string sql =
|
|
- @"select count(1) from ccpph.tede_topic a inner join ccpph.tede_topic_addressee b on a.Id=b.TopicId where b.UserId=@userId and b.IsRead=0 and a.GroupId=@groupId";
|
|
|
|
|
|
+ @"select count(1) from tede_topic a inner join tede_topic_addressee b on a.Id=b.TopicId where b.UserId=@userId and b.IsRead=0 and a.GroupId=@groupId";
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var connection = database.GetConnection();
|
|
var connection = database.GetConnection();
|
|
@@ -344,7 +344,7 @@ namespace GxPress.Repository.Implement
|
|
public async Task<int> SharingCountAsync(int groupId)
|
|
public async Task<int> SharingCountAsync(int groupId)
|
|
{
|
|
{
|
|
var sql =
|
|
var sql =
|
|
- $"select count(1) from ccpph.tede_group_user where GroupId={groupId}";
|
|
|
|
|
|
+ $"select count(1) from tede_group_user where GroupId={groupId}";
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var connection = database.GetConnection();
|
|
var connection = database.GetConnection();
|
|
@@ -382,7 +382,7 @@ namespace GxPress.Repository.Implement
|
|
|
|
|
|
public async Task<List<JobGroupResult>> ElasticSearchGroup()
|
|
public async Task<List<JobGroupResult>> ElasticSearchGroup()
|
|
{
|
|
{
|
|
- var sql = "select a.Id,a.GuId,a.UserId,b.Id,b.Name,b.AvatarUrl,b.CreatedDate,c.Name from ccpph.tede_middle a inner join ccpph.tede_group b on a.MiddleId=b.Id inner join ccpph.tede_user c on c.Id=b.UserId where a.FolderType=7 and a.IsUpload=0 order by a.CreatedDate desc limit 0,100";
|
|
|
|
|
|
+ var sql = "select a.Id,a.GuId,a.UserId,b.Id,b.Name,b.AvatarUrl,b.CreatedDate,c.Name from tede_middle a inner join tede_group b on a.MiddleId=b.Id inner join tede_user c on c.Id=b.UserId where a.FolderType=7 and a.IsUpload=0 order by a.CreatedDate desc limit 0,100";
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var database = new Database(databaseType, _connectionString);
|
|
var connection = database.GetConnection();
|
|
var connection = database.GetConnection();
|