|
@@ -66,7 +66,7 @@ namespace GxPress.Repository.Implement
|
|
|
{
|
|
|
if (middles.Count == 0)
|
|
|
return false;
|
|
|
- var sql = "INSERT INTO `tede_middle`(`Guid`,`CreatedDate`,`LastModifiedDate`,`FolderName`,`FolderType`,`IsTop`,`RoleId`,`Sort`,`MiddleId`,`ParentId`,`UserId`,`MiddleSonId`,`IsRead`,`NoticeAddresseeType`,`IsAdmin`,`IsDelete`,`AttributeValue`,`IsDefault`,`IsUpload`,`Title`,`TitleLong`,`Content`,`AddressUser`,`CcUser`,`AddressUserComplete`,`CcUserComplete`,`IsRecall`)VALUES";
|
|
|
+ var sql = "INSERT INTO `tede_middle`(`Guid`,`CreatedDate`,`LastModifiedDate`,`FolderName`,`FolderType`,`IsTop`,`RoleId`,`Sort`,`MiddleId`,`ParentId`,`UserId`,`MiddleSonId`,`IsRead`,`NoticeAddresseeType`,`IsAdmin`,`IsDelete`,`AttributeValue`,`IsDefault`,`IsUpload`,`IsRecall`)VALUES";
|
|
|
foreach (var item in middles)
|
|
|
{
|
|
|
var guId = Guid.NewGuid().ToString();
|
|
@@ -76,7 +76,7 @@ namespace GxPress.Repository.Implement
|
|
|
var isDelete = item.IsDelete == true ? 1 : 0;
|
|
|
var isAdmin = item.IsAdmin == true ? 1 : 0;
|
|
|
var isRecall = item.IsRecall == true ? 1 : 0;
|
|
|
- sql += $"('{guId}','{createdDate}','{createdDate}','{item.FolderName}',{item.FolderType},{item.IsTop},{item.RoleId},{item.Sort},{item.MiddleId},{item.ParentId},{item.UserId},{item.MiddleSonId},{isRead},{item.NoticeAddresseeType.GetHashCode()},{isAdmin},{isDelete},{item.AttributeValue},{isDefault},0,'{item.Title}','{item.TitleLong}','{item.Content}','{item.AddressUser}','{item.CcUser}','{item.AddressUserComplete}','{item.CcUserComplete}',{isRecall}),";
|
|
|
+ sql += $"('{guId}','{createdDate}','{createdDate}','{item.FolderName}',{item.FolderType},{item.IsTop},{item.RoleId},{item.Sort},{item.MiddleId},{item.ParentId},{item.UserId},{item.MiddleSonId},{isRead},{item.NoticeAddresseeType.GetHashCode()},{isAdmin},{isDelete},{item.AttributeValue},{isDefault},0,{isRecall}),";
|
|
|
}
|
|
|
sql = sql.Remove(sql.Length - 1, 1);
|
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
@@ -280,13 +280,6 @@ namespace GxPress.Repository.Implement
|
|
|
var listType = new List<int> { GxPress.EnumConst.FolderTypeConst.Notice.GetHashCode(), GxPress.EnumConst.FolderTypeConst.Missive.GetHashCode(), GxPress.EnumConst.FolderTypeConst.Submitted.GetHashCode(), GxPress.EnumConst.FolderTypeConst.Approval.GetHashCode(), GxPress.EnumConst.FolderTypeConst.Cc.GetHashCode() };
|
|
|
query.WhereIn(nameof(Middle.FolderType), listType);
|
|
|
}
|
|
|
- if (!string.IsNullOrWhiteSpace(request.KeyWord))
|
|
|
- {
|
|
|
- query.OrWhere(nameof(Middle.TitleLong), request.KeyWord);
|
|
|
- query.OrWhere(nameof(Middle.AddressUserComplete), request.KeyWord);
|
|
|
- query.OrWhere(nameof(Middle.CcUserComplete), request.KeyWord);
|
|
|
- query.OrWhere(nameof(Middle.Content), request.KeyWord);
|
|
|
- }
|
|
|
query.Where(nameof(Middle.UserId), request.UserId);
|
|
|
return await _repository.GetAllAsync(query.Select("Id", "Guid", "CreatedDate", "LastModifiedDate", "FolderName", "FolderType", "IsTop", "RoleId", "Sort", "MiddleId", "ParentId", "UserId", "MiddleSonId", "IsRead", "NoticeAddresseeType", "IsAdmin", "IsDelete", "AttributeValue", "IsDefault", "IsUpload", "Title", "AddressUser", "CcUser"));
|
|
|
}
|