ow
This commit is contained in:
1 parent
2e990e687f
commit
4ec2502778
53 files changed
+365
-1854
No files matched your search
@@ -13,56 +13,56 @@ namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
}
|
||||
|
||||
[Column("description")]
|
||||
public string? Description { get; set; }
|
||||
[Column("book_type")]
|
||||
public string? BookType { get; set; }
|
||||
[Column("file_id")]
|
||||
public int FileId { get; set; }
|
||||
[Column("status")]
|
||||
public string Status { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Key]
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("book_id")]
|
||||
public string BookId { get; set; }
|
||||
[Column("title")]
|
||||
public string Title { get; set; }
|
||||
[Column("author")]
|
||||
public string? Author { get; set; }
|
||||
[Column("description")]
|
||||
public string? Description { get; set; }
|
||||
[Column("book_type")]
|
||||
public string? BookType { get; set; }
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
|
||||
public const string DESCRIPTION = "Description";
|
||||
public const string BOOK_TYPE = "BookType";
|
||||
public const string FILE_ID = "FileId";
|
||||
public const string STATUS = "Status";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
public const string UPDATED_BY = "UpdatedBy";
|
||||
public const string GUID = "Guid";
|
||||
public const string BOOK_ID = "BookId";
|
||||
public const string TITLE = "Title";
|
||||
public const string AUTHOR = "Author";
|
||||
public const string DESCRIPTION = "Description";
|
||||
public const string BOOK_TYPE = "BookType";
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
|
||||
public const string DB_NAME_AI_BOOK = "ai_book";
|
||||
public const string DB_NAME_FIELDS="description,book_type,file_id,status,created_by,updated_datetime,updated_by,guid,title,author,created_datetime";
|
||||
public const string DB_NAME_FIELDS="file_id,status,updated_by,book_id,title,author,description,book_type,created_datetime,created_by,updated_datetime";
|
||||
|
||||
public const string DB_DESCRIPTION = "description";
|
||||
public const string DB_BOOK_TYPE = "book_type";
|
||||
public const string DB_FILE_ID = "file_id";
|
||||
public const string DB_STATUS = "status";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
public const string DB_UPDATED_BY = "updated_by";
|
||||
public const string DB_GUID = "guid";
|
||||
public const string DB_BOOK_ID = "book_id";
|
||||
public const string DB_TITLE = "title";
|
||||
public const string DB_AUTHOR = "author";
|
||||
public const string DB_DESCRIPTION = "description";
|
||||
public const string DB_BOOK_TYPE = "book_type";
|
||||
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
|
||||
|
||||
public static AiBookEntity GetInstance()
|
||||
@@ -82,24 +82,24 @@ namespace CloudBuilder.AI.Entity
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.Description = source.Description;
|
||||
this.BookType = source.BookType;
|
||||
this.FileId = source.FileId;
|
||||
this.Status = source.Status;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.BookId = source.BookId;
|
||||
this.Title = source.Title;
|
||||
this.Author = source.Author;
|
||||
this.Description = source.Description;
|
||||
this.BookType = source.BookType;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace CloudBuilder.AI.Entity
|
||||
public override string GetSelectTopFrom(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_GUID ;
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_BOOK_ID ;
|
||||
string top = limit > 0 ? $"top {limit}" : "";
|
||||
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_AI_BOOK} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user