You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

102 lines
4.1 KiB

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Shentun.WebPeis.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
namespace Shentun.WebPeis.Configures
{
internal class PersonConfigure : IEntityTypeConfiguration<Person>
{
public void Configure(EntityTypeBuilder<Person> entity)
{
entity.HasKey(e => e.UserId).HasName("PK_patient");
entity.ToTable("person", tb => tb.HasComment("体检人员档案"));
entity.HasIndex(e => e.PersonNo, "IX_person_person_no").IsUnique();
entity.HasIndex(e => e.IdNo, "ix_person_id_no").IsUnique();
entity.Property(e => e.UserId)
.ValueGeneratedNever()
.HasColumnName("user_id");
entity.Property(e => e.Address)
.HasMaxLength(100)
.HasComment("地址")
.HasColumnName("address");
entity.Property(e => e.BirthDate)
.HasComment("出生日期")
.HasColumnType("timestamp(6) without time zone")
.HasColumnName("birth_date").IsRequired();
entity.Property(e => e.BirthPlaceId)
.HasComment("出生地")
.HasColumnName("birth_place_id");
entity.Property(e => e.ConcurrencyStamp)
.HasMaxLength(40)
.HasColumnName("concurrency_stamp");
entity.Property(e => e.CountryCode)
.HasMaxLength(3)
.HasColumnName("country_code").IsRequired();
entity.Property(e => e.CreationTime)
.HasColumnType("timestamp(6) without time zone")
.HasColumnName("creation_time");
entity.Property(e => e.CreatorId).HasColumnName("creator_id");
entity.Property(e => e.IdNo)
.HasMaxLength(18)
.HasComment("身份证号")
.HasColumnName("id_no").IsRequired();
entity.Property(e => e.IdTypeId)
.HasMaxLength(2)
.IsFixedLength()
.HasColumnName("id_type_id").IsRequired();
entity.Property(e => e.IsAllowBind)
.HasMaxLength(1)
.HasColumnName("is_allow_bind").IsRequired();
entity.Property(e => e.LastModificationTime)
.HasColumnType("timestamp(6) without time zone")
.HasColumnName("last_modification_time");
entity.Property(e => e.LastModifierId).HasColumnName("last_modifier_id");
entity.Property(e => e.MaritalStatusId)
.HasMaxLength(1)
.HasDefaultValueSql("'9'::bpchar")
.HasComment("婚姻状况")
.HasColumnName("marital_status_id").IsRequired();
entity.Property(e => e.MedicalCenterId)
.HasComment("组织单位ID")
.HasColumnName("medical_center_id").IsRequired();
entity.Property(e => e.NationId)
.HasComment("民族编号")
.HasColumnName("nation_id").IsRequired();
entity.Property(e => e.PersonNo)
.HasMaxLength(30)
.HasComment("档案号")
.HasColumnName("person_no").IsRequired();
entity.Property(e => e.PostalCode)
.HasMaxLength(10)
.HasComment("邮政编码")
.HasColumnName("postal_code");
entity.Property(e => e.SexId)
.HasMaxLength(1)
.HasDefaultValueSql("'U'::bpchar")
.HasComment("性别")
.HasColumnName("sex_id").IsRequired();
entity.Property(e => e.SimpleCode)
.HasMaxLength(30)
.HasComment("简码")
.HasColumnName("simple_code");
entity.Property(e => e.WechatOpenId)
.HasMaxLength(50)
.HasColumnName("wechat_open_id");
}
}
}