| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public partial class BimfaceFile : BaseTraceDAL_Paras_Flags_TagName_Sorter<Entity.BimfaceFile>, IBimfaceFile |
| | | public partial class BimfaceFile : BaseDAL_Paras_Flags_TagName_Sorter<Entity.BimfaceFile>, IBimfaceFile |
| | | { |
| | | /// <summary> |
| | | /// |
| | |
| | | public override ConnectionConfig ConnectionConfig |
| | | { |
| | | get { return ConfigHelper.PostgreSqlConnectionConfig; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 插入拓展 |
| | | /// </summary> |
| | | public long InsertEx(Entity.BimfaceFile entity, List<Entity.BimfaceFileLabel> entityLabelList) |
| | | { |
| | | if (entity == null) |
| | | { |
| | | return default; |
| | | } |
| | | using (var db = new SqlSugarClient(ConnectionConfig)) |
| | | { |
| | | try |
| | | { |
| | | db.BeginTran(); |
| | | if (entity.ID > 0) |
| | | { |
| | | var bol = db.Insertable(entity).ExecuteCommand() > 0; |
| | | if (!bol) |
| | | { |
| | | db.RollbackTran(); |
| | | return default; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | entity.ID = db.Insertable(entity).ExecuteReturnSnowflakeId(); |
| | | } |
| | | if (entity.ID < 1) |
| | | { |
| | | db.RollbackTran(); |
| | | return default; |
| | | } |
| | | if (entityLabelList != null && entityLabelList.Count > 0) |
| | | { |
| | | entityLabelList.ForEach(x => |
| | | { |
| | | x.BimfaceFileID = entity.ID; |
| | | if (x.ID < 1) |
| | | { |
| | | x.ID = SnowFlakeSingle.instance.NextId(); |
| | | } |
| | | }); |
| | | var bol = db.Insertable(entityLabelList).ExecuteCommand() > 0; |
| | | if (!bol) |
| | | { |
| | | db.RollbackTran(); |
| | | return default; |
| | | } |
| | | } |
| | | db.CommitTran(); |
| | | return entity.ID; |
| | | } |
| | | catch |
| | | { |
| | | db.RollbackTran(); |
| | | throw; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | return db.Updateable<Entity.BimfaceFile>() |
| | | .SetColumns(x => x.FileStatus == FileStatus) |
| | | .SetColumns(x => x.UpdateUserID == UserRegister.UserID) |
| | | .SetColumns(x => x.UpdateTime == DateTime.Now) |
| | | .SetColumns(x => x.UpdateUserName == UserRegister.UserName) |
| | | .Where(x => x.ID == ID) |
| | | .ExecuteCommandHasChange(); |
| | | } |
| | |
| | | { |
| | | return db.Updateable<Entity.BimfaceFile>() |
| | | .SetColumns(x => x.Content == Content) |
| | | .SetColumns(x => x.UpdateUserID == UserRegister.UserID) |
| | | .SetColumns(x => x.UpdateTime == DateTime.Now) |
| | | .SetColumns(x => x.UpdateUserName == UserRegister.UserName) |
| | | .Where(x => x.ID == ID) |
| | | .ExecuteCommandHasChange(); |
| | | } |