YLShipBuildLandMapContext.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. using System;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.EntityFrameworkCore.Metadata;
  4. #nullable disable
  5. namespace YLShipBuildLandMap.Entity
  6. {
  7. public partial class YLShipBuildLandMapContext : DbContext
  8. {
  9. public YLShipBuildLandMapContext()
  10. {
  11. }
  12. public YLShipBuildLandMapContext(DbContextOptions<YLShipBuildLandMapContext> options)
  13. : base(options)
  14. {
  15. }
  16. public virtual DbSet<BackBdBuildingXyAxis> BackBdBuildingXyAxis { get; set; }
  17. public virtual DbSet<BdBuilding> BdBuilding { get; set; }
  18. public virtual DbSet<BdBuildingFloor> BdBuildingFloor { get; set; }
  19. public virtual DbSet<BdBuildingFloorRoom> BdBuildingFloorRoom { get; set; }
  20. public virtual DbSet<BdBuildingXyAxis> BdBuildingXyAxis { get; set; }
  21. public virtual DbSet<BdDepartmentOrServicePoint> BdDepartmentOrServicePoint { get; set; }
  22. public virtual DbSet<BdDepartmentOrServicePointBmBuildingFloorRoom> BdDepartmentOrServicePointBmBuildingFloorRoom { get; set; }
  23. public virtual DbSet<SysAnnouncement> SysAnnouncement { get; set; }
  24. public virtual DbSet<SysAnnouncementSysRole> SysAnnouncementSysRole { get; set; }
  25. public virtual DbSet<SysAnnouncementSysUser> SysAnnouncementSysUser { get; set; }
  26. public virtual DbSet<SysApiScope> SysApiScope { get; set; }
  27. public virtual DbSet<SysAttachment> SysAttachment { get; set; }
  28. public virtual DbSet<SysDictionary> SysDictionary { get; set; }
  29. public virtual DbSet<SysDictionaryItem> SysDictionaryItem { get; set; }
  30. public virtual DbSet<SysFunctionCode> SysFunctionCode { get; set; }
  31. public virtual DbSet<SysLog> SysLog { get; set; }
  32. public virtual DbSet<SysMenu> SysMenu { get; set; }
  33. public virtual DbSet<SysNoticeHistory> SysNoticeHistory { get; set; }
  34. public virtual DbSet<SysParameter> SysParameter { get; set; }
  35. public virtual DbSet<SysRole> SysRole { get; set; }
  36. public virtual DbSet<SysRoleSysFunctionCode> SysRoleSysFunctionCode { get; set; }
  37. public virtual DbSet<SysSerialNumber> SysSerialNumber { get; set; }
  38. public virtual DbSet<SysSystem> SysSystem { get; set; }
  39. public virtual DbSet<SysSystemSysApiScope> SysSystemSysApiScope { get; set; }
  40. public virtual DbSet<SysUser> SysUser { get; set; }
  41. public virtual DbSet<SysUserSysRole> SysUserSysRole { get; set; }
  42. public virtual DbSet<数据导入> 数据导入 { get; set; }
  43. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  44. {
  45. if (!optionsBuilder.IsConfigured)
  46. {
  47. #warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
  48. optionsBuilder.UseSqlServer("Server=192.168.0.66\\sql2012;User Id=sa;Password=Bowin2023!;Database=YLShipBuildLandMap");
  49. }
  50. }
  51. protected override void OnModelCreating(ModelBuilder modelBuilder)
  52. {
  53. modelBuilder.HasAnnotation("Relational:Collation", "Chinese_PRC_CI_AS");
  54. modelBuilder.Entity<BackBdBuildingXyAxis>(entity =>
  55. {
  56. entity.HasNoKey();
  57. entity.ToTable("back_BD_Building_XY_Axis");
  58. entity.Property(e => e.BuildingId).HasColumnName("BuildingID");
  59. entity.Property(e => e.Xaxis)
  60. .HasColumnType("decimal(18, 8)")
  61. .HasColumnName("XAxis");
  62. entity.Property(e => e.XyaxisId).HasColumnName("XYAxisID");
  63. entity.Property(e => e.Yaxis)
  64. .HasColumnType("decimal(18, 8)")
  65. .HasColumnName("YAxis");
  66. });
  67. modelBuilder.Entity<BdBuilding>(entity =>
  68. {
  69. entity.HasKey(e => e.BuildingId)
  70. .HasName("PK_BD_BUILDING");
  71. entity.ToTable("BD_Building");
  72. entity.Property(e => e.BuildingId)
  73. .ValueGeneratedNever()
  74. .HasColumnName("BuildingID");
  75. entity.Property(e => e.CreateTime).HasColumnType("datetime");
  76. entity.Property(e => e.CreateUserId).HasColumnName("CreateUserID");
  77. entity.Property(e => e.ModifyTime).HasColumnType("datetime");
  78. entity.Property(e => e.ModifyUserId).HasColumnName("ModifyUserID");
  79. entity.Property(e => e.Name).HasMaxLength(300);
  80. });
  81. modelBuilder.Entity<BdBuildingFloor>(entity =>
  82. {
  83. entity.HasKey(e => e.BuildingFloorId)
  84. .HasName("PK_BD_BUILDING_FLOOR");
  85. entity.ToTable("BD_Building_Floor");
  86. entity.Property(e => e.BuildingFloorId)
  87. .ValueGeneratedNever()
  88. .HasColumnName("BuildingFloorID");
  89. entity.Property(e => e.BuildingId).HasColumnName("BuildingID");
  90. entity.Property(e => e.CreateTime).HasColumnType("datetime");
  91. entity.Property(e => e.CreateUserId).HasColumnName("CreateUserID");
  92. entity.Property(e => e.ModifyTime).HasColumnType("datetime");
  93. entity.Property(e => e.ModifyUserId).HasColumnName("ModifyUserID");
  94. entity.Property(e => e.Name).HasMaxLength(100);
  95. entity.HasOne(d => d.Building)
  96. .WithMany(p => p.BdBuildingFloor)
  97. .HasForeignKey(d => d.BuildingId)
  98. .HasConstraintName("FK_BM_BUILD_Floor_REFERENCE_BD_BUILD");
  99. });
  100. modelBuilder.Entity<BdBuildingFloorRoom>(entity =>
  101. {
  102. entity.HasKey(e => e.BuildingFloorRoomId)
  103. .HasName("PK_BD_BUILDING_FLOOR_ROOM");
  104. entity.ToTable("BD_Building_Floor_Room");
  105. entity.Property(e => e.BuildingFloorRoomId)
  106. .ValueGeneratedNever()
  107. .HasColumnName("BuildingFloorRoomID");
  108. entity.Property(e => e.BuildingFloorId).HasColumnName("BuildingFloorID");
  109. entity.Property(e => e.CreateTime).HasColumnType("datetime");
  110. entity.Property(e => e.CreateUserId).HasColumnName("CreateUserID");
  111. entity.Property(e => e.ModifyTime).HasColumnType("datetime");
  112. entity.Property(e => e.ModifyUserId).HasColumnName("ModifyUserID");
  113. entity.Property(e => e.Name).HasMaxLength(100);
  114. entity.HasOne(d => d.BuildingFloor)
  115. .WithMany(p => p.BdBuildingFloorRoom)
  116. .HasForeignKey(d => d.BuildingFloorId)
  117. .HasConstraintName("FK_BM_Build_Floor_Room_REFERENCE_BM_Build_Floor");
  118. });
  119. modelBuilder.Entity<BdBuildingXyAxis>(entity =>
  120. {
  121. entity.HasKey(e => e.XyaxisId)
  122. .HasName("PK_BD_BUILDING_XY_AXIS");
  123. entity.ToTable("BD_Building_XY_Axis");
  124. entity.Property(e => e.XyaxisId)
  125. .ValueGeneratedNever()
  126. .HasColumnName("XYAxisID");
  127. entity.Property(e => e.BuildingId).HasColumnName("BuildingID");
  128. entity.Property(e => e.Xaxis)
  129. .HasColumnType("decimal(18, 8)")
  130. .HasColumnName("XAxis");
  131. entity.Property(e => e.Yaxis)
  132. .HasColumnType("decimal(18, 8)")
  133. .HasColumnName("YAxis");
  134. entity.HasOne(d => d.Building)
  135. .WithMany(p => p.BdBuildingXyAxis)
  136. .HasForeignKey(d => d.BuildingId)
  137. .HasConstraintName("FK_BD_Building_XY_Axis_REFERENCE_BD_BUILD");
  138. });
  139. modelBuilder.Entity<BdDepartmentOrServicePoint>(entity =>
  140. {
  141. entity.HasKey(e => e.DepartmentOrServicePointId)
  142. .HasName("PK_BD_DEPARTMENTORSERVICEPOINT");
  143. entity.ToTable("BD_DepartmentOrServicePoint");
  144. entity.Property(e => e.DepartmentOrServicePointId)
  145. .ValueGeneratedNever()
  146. .HasColumnName("DepartmentOrServicePointID");
  147. entity.Property(e => e.ContactType).HasMaxLength(300);
  148. entity.Property(e => e.CreateTime).HasColumnType("datetime");
  149. entity.Property(e => e.CreateUserId).HasColumnName("CreateUserID");
  150. entity.Property(e => e.ModifyTime).HasColumnType("datetime");
  151. entity.Property(e => e.ModifyUserId).HasColumnName("ModifyUserID");
  152. entity.Property(e => e.Name).HasMaxLength(300);
  153. entity.Property(e => e.OpenTime).HasMaxLength(2000);
  154. });
  155. modelBuilder.Entity<BdDepartmentOrServicePointBmBuildingFloorRoom>(entity =>
  156. {
  157. entity.HasKey(e => new { e.DepartmentOrServicePointId, e.BuildingFloorRoomId });
  158. entity.ToTable("BD_DepartmentOrServicePoint_BM_Building_Floor_Room");
  159. entity.Property(e => e.DepartmentOrServicePointId).HasColumnName("DepartmentOrServicePointID");
  160. entity.Property(e => e.BuildingFloorRoomId).HasColumnName("BuildingFloorRoomID");
  161. entity.HasOne(d => d.BuildingFloorRoom)
  162. .WithMany(p => p.BdDepartmentOrServicePointBmBuildingFloorRoom)
  163. .HasForeignKey(d => d.BuildingFloorRoomId)
  164. .OnDelete(DeleteBehavior.ClientSetNull)
  165. .HasConstraintName("FK_BD_DEPAR_REFERENCE_BD_Building_Floor_Room");
  166. entity.HasOne(d => d.DepartmentOrServicePoint)
  167. .WithMany(p => p.BdDepartmentOrServicePointBmBuildingFloorRoom)
  168. .HasForeignKey(d => d.DepartmentOrServicePointId)
  169. .OnDelete(DeleteBehavior.ClientSetNull)
  170. .HasConstraintName("FK_BD_DEPAR_REFERENCE_BD_DepartmentOrServicePoint");
  171. });
  172. modelBuilder.Entity<SysAnnouncement>(entity =>
  173. {
  174. entity.HasKey(e => e.AnnouncementId)
  175. .HasName("PK_SYS_ANNOUNCEMENT");
  176. entity.ToTable("Sys_Announcement");
  177. entity.Property(e => e.AnnouncementId)
  178. .ValueGeneratedNever()
  179. .HasColumnName("AnnouncementID");
  180. entity.Property(e => e.AnnouncementTypeId).HasColumnName("AnnouncementTypeID");
  181. entity.Property(e => e.CreateTime).HasColumnType("datetime");
  182. entity.Property(e => e.CreateUserId).HasColumnName("CreateUserID");
  183. entity.Property(e => e.EndTime).HasColumnType("datetime");
  184. entity.Property(e => e.ModifyTime).HasColumnType("datetime");
  185. entity.Property(e => e.ModifyUserId).HasColumnName("ModifyUserID");
  186. entity.Property(e => e.StartTime).HasColumnType("datetime");
  187. entity.Property(e => e.Title).HasMaxLength(100);
  188. entity.Property(e => e.Url)
  189. .HasMaxLength(1024)
  190. .IsUnicode(false);
  191. });
  192. modelBuilder.Entity<SysAnnouncementSysRole>(entity =>
  193. {
  194. entity.HasKey(e => new { e.AnnouncementId, e.RoleId })
  195. .HasName("PK_SYS_ANNOUNCEMENT_SYS_ROLE");
  196. entity.ToTable("Sys_Announcement_Sys_Role");
  197. entity.Property(e => e.AnnouncementId).HasColumnName("AnnouncementID");
  198. entity.Property(e => e.RoleId).HasColumnName("RoleID");
  199. entity.HasOne(d => d.Announcement)
  200. .WithMany(p => p.SysAnnouncementSysRole)
  201. .HasForeignKey(d => d.AnnouncementId)
  202. .HasConstraintName("FK_Sys_Announcement_REFERENCE_Sys_Announcement_Sys_Role");
  203. entity.HasOne(d => d.Role)
  204. .WithMany(p => p.SysAnnouncementSysRole)
  205. .HasForeignKey(d => d.RoleId)
  206. .HasConstraintName("FK_Sys_Announcement_Sys_Role_REFERENCE_SYS_ROLE");
  207. });
  208. modelBuilder.Entity<SysAnnouncementSysUser>(entity =>
  209. {
  210. entity.HasKey(e => new { e.AnnouncementId, e.UserId })
  211. .HasName("PK_SYS_ANNOUNCEMENT_SYS_USER");
  212. entity.ToTable("Sys_Announcement_Sys_User");
  213. entity.Property(e => e.AnnouncementId).HasColumnName("AnnouncementID");
  214. entity.Property(e => e.UserId).HasColumnName("UserID");
  215. entity.HasOne(d => d.Announcement)
  216. .WithMany(p => p.SysAnnouncementSysUser)
  217. .HasForeignKey(d => d.AnnouncementId)
  218. .OnDelete(DeleteBehavior.ClientSetNull)
  219. .HasConstraintName("FK_SYS_ANNO_REFERENCE_SYS_ANNO");
  220. entity.HasOne(d => d.User)
  221. .WithMany(p => p.SysAnnouncementSysUser)
  222. .HasForeignKey(d => d.UserId)
  223. .OnDelete(DeleteBehavior.ClientSetNull)
  224. .HasConstraintName("FK_SYS_ANNO_REFERENCE_SYS_USER");
  225. });
  226. modelBuilder.Entity<SysApiScope>(entity =>
  227. {
  228. entity.HasKey(e => e.ApiScopeId)
  229. .HasName("PK_SYS_APISCOPE");
  230. entity.ToTable("Sys_ApiScope");
  231. entity.Property(e => e.ApiScopeId)
  232. .HasMaxLength(64)
  233. .IsUnicode(false)
  234. .HasColumnName("ApiScopeID");
  235. entity.Property(e => e.Name).HasMaxLength(50);
  236. });
  237. modelBuilder.Entity<SysAttachment>(entity =>
  238. {
  239. entity.HasKey(e => e.AttachmentId)
  240. .HasName("PK_SYS_ATTACHMENT");
  241. entity.ToTable("Sys_Attachment");
  242. entity.Property(e => e.AttachmentId)
  243. .ValueGeneratedNever()
  244. .HasColumnName("AttachmentID");
  245. entity.Property(e => e.CreateTime).HasColumnType("datetime");
  246. entity.Property(e => e.CreateUserId).HasColumnName("CreateUserID");
  247. entity.Property(e => e.Name).HasMaxLength(255);
  248. entity.Property(e => e.ReferenceId).HasColumnName("ReferenceID");
  249. entity.Property(e => e.Suffix)
  250. .HasMaxLength(100)
  251. .IsUnicode(false);
  252. });
  253. modelBuilder.Entity<SysDictionary>(entity =>
  254. {
  255. entity.HasKey(e => e.DictionaryCode)
  256. .HasName("PK_SYS_DICTIONARY");
  257. entity.ToTable("Sys_Dictionary");
  258. entity.Property(e => e.DictionaryCode).HasMaxLength(50);
  259. entity.Property(e => e.Name).HasMaxLength(500);
  260. });
  261. modelBuilder.Entity<SysDictionaryItem>(entity =>
  262. {
  263. entity.HasKey(e => e.DictionaryItemId)
  264. .HasName("PK_SYS_DICTIONARYITEM");
  265. entity.ToTable("Sys_DictionaryItem");
  266. entity.Property(e => e.DictionaryItemId)
  267. .ValueGeneratedNever()
  268. .HasColumnName("DictionaryItemID");
  269. entity.Property(e => e.Code)
  270. .IsRequired()
  271. .HasMaxLength(50);
  272. entity.Property(e => e.DictionaryCode).HasMaxLength(50);
  273. entity.Property(e => e.Name).HasMaxLength(100);
  274. entity.HasOne(d => d.DictionaryCodeNavigation)
  275. .WithMany(p => p.SysDictionaryItem)
  276. .HasForeignKey(d => d.DictionaryCode)
  277. .HasConstraintName("FK_Sys_DictionaryItem_Sys_Dictionary");
  278. });
  279. modelBuilder.Entity<SysFunctionCode>(entity =>
  280. {
  281. entity.HasKey(e => e.FunctionCode)
  282. .HasName("PK_SYS_FUNCTIONCODE");
  283. entity.ToTable("Sys_FunctionCode");
  284. entity.Property(e => e.FunctionCode).HasMaxLength(50);
  285. entity.Property(e => e.FunctionName).HasMaxLength(50);
  286. entity.Property(e => e.ParentFunctionCode).HasMaxLength(50);
  287. entity.HasOne(d => d.ParentFunctionCodeNavigation)
  288. .WithMany(p => p.InverseParentFunctionCodeNavigation)
  289. .HasForeignKey(d => d.ParentFunctionCode)
  290. .HasConstraintName("FK_SYS_FUNC_REFERENCE_SYS_FUNC");
  291. });
  292. modelBuilder.Entity<SysLog>(entity =>
  293. {
  294. entity.HasKey(e => e.LogId)
  295. .HasName("PK_SYS_LOG");
  296. entity.ToTable("Sys_log");
  297. entity.Property(e => e.LogId).ValueGeneratedNever();
  298. entity.Property(e => e.ClientIp)
  299. .HasMaxLength(100)
  300. .IsUnicode(false);
  301. entity.Property(e => e.LogDescribe)
  302. .HasMaxLength(800)
  303. .IsUnicode(false);
  304. entity.Property(e => e.LogTime).HasColumnType("datetime");
  305. entity.Property(e => e.LogTitle)
  306. .HasMaxLength(800)
  307. .HasColumnName("logTitle");
  308. entity.Property(e => e.LogUser).HasMaxLength(100);
  309. });
  310. modelBuilder.Entity<SysMenu>(entity =>
  311. {
  312. entity.HasKey(e => e.MenuNo)
  313. .HasName("PK_SYS_MENU");
  314. entity.ToTable("Sys_Menu");
  315. entity.Property(e => e.MenuNo).HasMaxLength(30);
  316. entity.Property(e => e.FunctionCode).HasMaxLength(50);
  317. entity.Property(e => e.Icon).HasMaxLength(50);
  318. entity.Property(e => e.MenuName)
  319. .IsRequired()
  320. .HasMaxLength(60)
  321. .HasDefaultValueSql("('请翻译')");
  322. entity.Property(e => e.ParentMenuNo).HasMaxLength(30);
  323. entity.Property(e => e.Url)
  324. .HasMaxLength(500)
  325. .IsUnicode(false);
  326. entity.HasOne(d => d.FunctionCodeNavigation)
  327. .WithMany(p => p.SysMenu)
  328. .HasForeignKey(d => d.FunctionCode)
  329. .HasConstraintName("FK_SYS_MENU_REFERENCE_SYS_FUNC");
  330. entity.HasOne(d => d.ParentMenuNoNavigation)
  331. .WithMany(p => p.InverseParentMenuNoNavigation)
  332. .HasForeignKey(d => d.ParentMenuNo)
  333. .HasConstraintName("FK_SYS_MENU_REFERENCE_SYS_MENU");
  334. });
  335. modelBuilder.Entity<SysNoticeHistory>(entity =>
  336. {
  337. entity.HasKey(e => e.NoticeHistoryId)
  338. .HasName("PK_SYS_NOTICEHISTORY");
  339. entity.ToTable("Sys_NoticeHistory");
  340. entity.Property(e => e.NoticeHistoryId)
  341. .ValueGeneratedNever()
  342. .HasColumnName("NoticeHistoryID");
  343. entity.Property(e => e.CreateTime).HasColumnType("datetime");
  344. entity.Property(e => e.CreateUserId).HasColumnName("CreateUserID");
  345. entity.Property(e => e.DepartmentId).HasColumnName("DepartmentID");
  346. entity.Property(e => e.ModifyTime).HasColumnType("datetime");
  347. entity.Property(e => e.ModifyUserId).HasColumnName("ModifyUserID");
  348. entity.Property(e => e.NoticeTypeId).HasColumnName("NoticeTypeID");
  349. entity.Property(e => e.SentTime).HasColumnType("datetime");
  350. entity.Property(e => e.SourceId).HasColumnName("SourceID");
  351. entity.Property(e => e.Title).HasMaxLength(100);
  352. entity.Property(e => e.Url)
  353. .HasMaxLength(255)
  354. .IsUnicode(false);
  355. entity.Property(e => e.UserId).HasColumnName("UserID");
  356. entity.HasOne(d => d.User)
  357. .WithMany(p => p.SysNoticeHistory)
  358. .HasForeignKey(d => d.UserId)
  359. .HasConstraintName("FK_Sys_NoticeHistory_REFERENCE_SYS_USER");
  360. });
  361. modelBuilder.Entity<SysParameter>(entity =>
  362. {
  363. entity.HasKey(e => e.ParameterKey)
  364. .HasName("PK_SYS_PARAMETER");
  365. entity.ToTable("Sys_Parameter");
  366. entity.Property(e => e.ParameterKey)
  367. .HasMaxLength(50)
  368. .IsUnicode(false);
  369. });
  370. modelBuilder.Entity<SysRole>(entity =>
  371. {
  372. entity.HasKey(e => e.RoleId)
  373. .HasName("PK_SYS_ROLE");
  374. entity.ToTable("Sys_Role");
  375. entity.Property(e => e.RoleId)
  376. .ValueGeneratedNever()
  377. .HasColumnName("RoleID");
  378. entity.Property(e => e.CreateTime).HasColumnType("datetime");
  379. entity.Property(e => e.CreateUserId).HasColumnName("CreateUserID");
  380. entity.Property(e => e.Description).HasMaxLength(500);
  381. entity.Property(e => e.ModifyTime).HasColumnType("datetime");
  382. entity.Property(e => e.ModifyUserId).HasColumnName("ModifyUserID");
  383. entity.Property(e => e.RoleName)
  384. .IsRequired()
  385. .HasMaxLength(100);
  386. });
  387. modelBuilder.Entity<SysRoleSysFunctionCode>(entity =>
  388. {
  389. entity.HasKey(e => new { e.RoleId, e.FunctionCode })
  390. .HasName("PK_SYS_ROLE_SYS_FUNCTIONCODE");
  391. entity.ToTable("Sys_Role_Sys_FunctionCode");
  392. entity.Property(e => e.RoleId).HasColumnName("RoleID");
  393. entity.Property(e => e.FunctionCode).HasMaxLength(50);
  394. entity.HasOne(d => d.FunctionCodeNavigation)
  395. .WithMany(p => p.SysRoleSysFunctionCode)
  396. .HasForeignKey(d => d.FunctionCode)
  397. .HasConstraintName("FK_Sys_Role_Sys_FunctionCode_REFERENCE_SYS_FUNCTION");
  398. entity.HasOne(d => d.Role)
  399. .WithMany(p => p.SysRoleSysFunctionCode)
  400. .HasForeignKey(d => d.RoleId)
  401. .HasConstraintName("FK_Sys_Role_Sys_FunctionCode_REFERENCE_SYS_ROLE");
  402. });
  403. modelBuilder.Entity<SysSerialNumber>(entity =>
  404. {
  405. entity.HasKey(e => e.SerialNumberKey)
  406. .HasName("PK_tb_sn");
  407. entity.ToTable("Sys_SerialNumber");
  408. entity.Property(e => e.SerialNumberKey)
  409. .HasMaxLength(50)
  410. .IsUnicode(false);
  411. entity.Property(e => e.ResetTime).HasColumnType("datetime");
  412. });
  413. modelBuilder.Entity<SysSystem>(entity =>
  414. {
  415. entity.HasKey(e => e.SystemId)
  416. .HasName("PK_SYS_SYSTEM");
  417. entity.ToTable("Sys_System");
  418. entity.Property(e => e.SystemId)
  419. .HasMaxLength(64)
  420. .IsUnicode(false)
  421. .HasColumnName("SystemID");
  422. entity.Property(e => e.Secret)
  423. .HasMaxLength(8)
  424. .IsUnicode(false);
  425. entity.Property(e => e.SystemName).HasMaxLength(100);
  426. });
  427. modelBuilder.Entity<SysSystemSysApiScope>(entity =>
  428. {
  429. entity.HasKey(e => new { e.SystemId, e.ApiScopeId })
  430. .HasName("PK_SYS_SYSTEM_SYS_APISCOPE");
  431. entity.ToTable("Sys_System_Sys_ApiScope");
  432. entity.Property(e => e.SystemId)
  433. .HasMaxLength(64)
  434. .IsUnicode(false)
  435. .HasColumnName("SystemID");
  436. entity.Property(e => e.ApiScopeId)
  437. .HasMaxLength(64)
  438. .IsUnicode(false)
  439. .HasColumnName("ApiScopeID");
  440. entity.HasOne(d => d.ApiScope)
  441. .WithMany(p => p.SysSystemSysApiScope)
  442. .HasForeignKey(d => d.ApiScopeId)
  443. .OnDelete(DeleteBehavior.ClientSetNull)
  444. .HasConstraintName("FK_Sys_System_Sys_ApiScope_REFERENCE_Sys_ApiScope");
  445. entity.HasOne(d => d.System)
  446. .WithMany(p => p.SysSystemSysApiScope)
  447. .HasForeignKey(d => d.SystemId)
  448. .OnDelete(DeleteBehavior.ClientSetNull)
  449. .HasConstraintName("FK_Sys_System_Sys_ApiScope_REFERENCE_Sys_System");
  450. });
  451. modelBuilder.Entity<SysUser>(entity =>
  452. {
  453. entity.HasKey(e => e.UserId)
  454. .HasName("PK_SYS_USER");
  455. entity.ToTable("Sys_User");
  456. entity.HasIndex(e => e.LoginId, "IX_Sys_User_LoginID")
  457. .IsUnique();
  458. entity.Property(e => e.UserId)
  459. .ValueGeneratedNever()
  460. .HasColumnName("UserID");
  461. entity.Property(e => e.CmWorkLinkAccountDomain)
  462. .HasMaxLength(100)
  463. .HasColumnName("CmWorkLink_Account_Domain");
  464. entity.Property(e => e.CmWorkLinkAccountPsid)
  465. .HasMaxLength(100)
  466. .HasColumnName("CmWorkLink_Account_Psid");
  467. entity.Property(e => e.CmWorkLinkAccountPstel)
  468. .HasMaxLength(100)
  469. .HasColumnName("CmWorkLink_Account_Pstel");
  470. entity.Property(e => e.CmWorkLinkLoginTime)
  471. .HasColumnType("datetime")
  472. .HasColumnName("CmWorkLink_LoginTime");
  473. entity.Property(e => e.CreateTime).HasColumnType("datetime");
  474. entity.Property(e => e.CreateUserId).HasColumnName("CreateUserID");
  475. entity.Property(e => e.LoginId)
  476. .HasMaxLength(50)
  477. .IsUnicode(false)
  478. .HasColumnName("LoginID");
  479. entity.Property(e => e.ModifyTime).HasColumnType("datetime");
  480. entity.Property(e => e.ModifyUserId).HasColumnName("ModifyUserID");
  481. entity.Property(e => e.Name).HasMaxLength(50);
  482. entity.Property(e => e.Password)
  483. .HasMaxLength(50)
  484. .IsUnicode(false);
  485. entity.Property(e => e.WeChatLoginTime).HasColumnType("datetime");
  486. entity.Property(e => e.WeChatUserId).HasMaxLength(300);
  487. });
  488. modelBuilder.Entity<SysUserSysRole>(entity =>
  489. {
  490. entity.HasKey(e => new { e.UserId, e.RoleId })
  491. .HasName("PK_SYS_USER_SYS_ROLE");
  492. entity.ToTable("Sys_User_Sys_Role");
  493. entity.Property(e => e.UserId).HasColumnName("UserID");
  494. entity.Property(e => e.RoleId).HasColumnName("RoleID");
  495. entity.HasOne(d => d.Role)
  496. .WithMany(p => p.SysUserSysRole)
  497. .HasForeignKey(d => d.RoleId)
  498. .HasConstraintName("FK_Sys_User_Sys_Role_REFERENCE_SYS_ROLE");
  499. entity.HasOne(d => d.User)
  500. .WithMany(p => p.SysUserSysRole)
  501. .HasForeignKey(d => d.UserId)
  502. .OnDelete(DeleteBehavior.ClientSetNull)
  503. .HasConstraintName("FK_Sys_User_Sys_Role_REFERENCE_SYS_USER");
  504. });
  505. modelBuilder.Entity<数据导入>(entity =>
  506. {
  507. entity.HasNoKey();
  508. entity.Property(e => e.F9).HasMaxLength(255);
  509. entity.Property(e => e.为必填项)
  510. .HasMaxLength(255)
  511. .HasColumnName("*为必填项");
  512. entity.Property(e => e.图片).HasMaxLength(255);
  513. entity.Property(e => e.大楼名)
  514. .HasMaxLength(255)
  515. .HasColumnName("大楼名*");
  516. entity.Property(e => e.开放时间).HasMaxLength(255);
  517. entity.Property(e => e.房间号)
  518. .HasMaxLength(255)
  519. .HasColumnName("房间号*");
  520. entity.Property(e => e.楼层)
  521. .HasMaxLength(255)
  522. .HasColumnName("楼层*");
  523. entity.Property(e => e.简介).HasMaxLength(255);
  524. entity.Property(e => e.联系方式).HasMaxLength(255);
  525. entity.Property(e => e.部门服务点)
  526. .HasMaxLength(255)
  527. .HasColumnName("部门/服务点*");
  528. });
  529. OnModelCreatingPartial(modelBuilder);
  530. }
  531. partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
  532. }
  533. }