package modelshr import ( "appPlatform/overall" "strings" ) //教育经历 type PersonnelEducation struct { Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;comment:员工工号"` Education int `json:"education" gorm:"column:education;type:int(5) unsigned;default:1;comment:学历(1:初中及以下;2:中专;3:高中;4:中技;5:高技;6:函数专科;7:大学专科;8:函数本科;9:大学本科;10:硕士研究生;11:博士研究生;12:专家、教授)"` GraduationSchool string `json:"graduationschool" gorm:"column:graduation_school;type:varchar(255) unsigned;default:'';comment:毕业学校"` Subject string `json:"subject" gorm:"column:subject;type:varchar(255) unsigned;default:'';comment:专业"` AdmissionTime int64 `json:"admissiontime" gorm:"column:admission_time;type:bigint(20) unsigned;default:0;comment:入学时间"` GraduationTime int64 `json:"graduationtime" gorm:"column:graduation_time;type:bigint(20) unsigned;default:0;comment:毕业时间"` Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;comment:写入时间"` Level int `json:"level" gorm:"column:level;type:tinyint(1) unsigned;default:1;comment:学历类型(1:普通;2:第一学历;3:最高学历)"` AcademicDegree int `json:"academicdegree" gorm:"column:academic_degree;type:tinyint(2) unsigned;default:1;comment:学位(1:无;2:学士;3:硕士;4:博士)"` Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` AcademicDegreeCn string `json:"academicdegreecn" gorm:"column:academic_degree_cn;type:varchar(30) unsigned;comment:学位中文说明"` EducationCn string `json:"educationcn" gorm:"column:education_cn;type:varchar(30) unsigned;comment:学历中文说明"` } func (PersonnelEducation *PersonnelEducation) TableName() string { return "personnel_education" } // 编辑教育经历内容 func (PersonnelEducation *PersonnelEducation) EiteCont(whereMap interface{}, saveData interface{}) (err error) { err = overall.CONSTANT_DB_HR.Model(&PersonnelEducation).Where(whereMap).Updates(saveData).Error return } // 获取教育经历内容 func (cont *PersonnelEducation) GetCont(whereMap interface{}, field ...string) (err error) { gormDb := overall.CONSTANT_DB_HR.Model(&cont) if len(field) > 0 { fieldStr := strings.Join(field, ",") gormDb = gormDb.Select(fieldStr) } gormDb = gormDb.Where(whereMap) err = gormDb.First(&cont).Error return }