增加员工档案
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// BackendEmployeeFile 员工档案主表: yz_backend_employee_file
|
||||
// 档案与员工(yz_backend_employee)按 tid + employee_id 一对一,
|
||||
// 供 OA 员工档案页面管理人事资料。日期字段与 OA 日程一致,
|
||||
// 以 "YYYY-MM-DD" 字符串存取,规避 parseTime 的时区换算问题。
|
||||
type BackendEmployeeFile struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid int `orm:"column(tid)" json:"tid"`
|
||||
EmployeeID uint64 `orm:"column(employee_id)" json:"employee_id"`
|
||||
FileNo string `orm:"column(file_no);size(50);default()" json:"file_no"`
|
||||
IDCard string `orm:"column(id_card);size(30);default()" json:"id_card"`
|
||||
IDCardFront string `orm:"column(id_card_front);size(500);default()" json:"id_card_front"`
|
||||
IDCardBack string `orm:"column(id_card_back);size(500);default()" json:"id_card_back"`
|
||||
EducationPhoto string `orm:"column(education_photo);size(500);default()" json:"education_photo"`
|
||||
PoliticalStatus string `orm:"column(political_status);size(30);default()" json:"political_status"`
|
||||
MaritalStatus int8 `orm:"column(marital_status);default(0)" json:"marital_status"`
|
||||
NativePlace string `orm:"column(native_place);size(100);default()" json:"native_place"`
|
||||
HouseholdAddress string `orm:"column(household_address);size(255);default()" json:"household_address"`
|
||||
CurrentAddress string `orm:"column(current_address);size(255);default()" json:"current_address"`
|
||||
EmergencyContact string `orm:"column(emergency_contact);size(50);default()" json:"emergency_contact"`
|
||||
EmergencyPhone string `orm:"column(emergency_phone);size(20);default()" json:"emergency_phone"`
|
||||
EmergencyRelation string `orm:"column(emergency_relation);size(30);default()" json:"emergency_relation"`
|
||||
WorkEmail string `orm:"column(work_email);size(100);default()" json:"work_email"`
|
||||
HireDate string `orm:"column(hire_date);type(date);null" json:"hire_date"`
|
||||
RegularDate string `orm:"column(regular_date);type(date);null" json:"regular_date"`
|
||||
LeaveDate string `orm:"column(leave_date);type(date);null" json:"leave_date"`
|
||||
EmploymentStatus int8 `orm:"column(employment_status);default(2)" json:"employment_status"`
|
||||
Remark string `orm:"column(remark);type(text);null" json:"remark"`
|
||||
IsDeleted int8 `orm:"column(is_deleted);default(0)" json:"is_deleted"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *BackendEmployeeFile) TableName() string {
|
||||
return "yz_backend_employee_file"
|
||||
}
|
||||
|
||||
// BackendEmployeeFileRecord 员工档案子记录表: yz_backend_employee_file_record
|
||||
// 用 type 区分四类记录:1-教育经历 2-工作经历 3-合同信息 4-证照附件。
|
||||
// title/sub_title/extra 的语义随类型变化(见建表脚本注释),
|
||||
// 避免为每类记录单独建表。
|
||||
type BackendEmployeeFileRecord struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid int `orm:"column(tid)" json:"tid"`
|
||||
EmployeeID uint64 `orm:"column(employee_id)" json:"employee_id"`
|
||||
Type int8 `orm:"column(type);default(1)" json:"type"`
|
||||
Title string `orm:"column(title);size(100);default()" json:"title"`
|
||||
SubTitle string `orm:"column(sub_title);size(100);default()" json:"sub_title"`
|
||||
Extra string `orm:"column(extra);size(100);default()" json:"extra"`
|
||||
StartDate string `orm:"column(start_date);type(date);null" json:"start_date"`
|
||||
EndDate string `orm:"column(end_date);type(date);null" json:"end_date"`
|
||||
Description string `orm:"column(description);type(text);null" json:"description"`
|
||||
AttachmentURL string `orm:"column(attachment_url);size(500);default()" json:"attachment_url"`
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
IsDeleted int8 `orm:"column(is_deleted);default(0)" json:"is_deleted"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *BackendEmployeeFileRecord) TableName() string {
|
||||
return "yz_backend_employee_file_record"
|
||||
}
|
||||
@@ -101,6 +101,8 @@ func Init(_ string) {
|
||||
new(BackendScheduleReminderSendLog),
|
||||
|
||||
new(OaSchedule),
|
||||
new(BackendEmployeeFile),
|
||||
new(BackendEmployeeFileRecord),
|
||||
)
|
||||
|
||||
// 创建全局 Ormer
|
||||
|
||||
Reference in New Issue
Block a user