package modelshr import ( "appPlatform/overall" "strings" ) // 集团内部工作经历 type InsideWorkHistory struct { Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` Key int64 `json:"key" gorm:"column:key;type:bigint(20) unsigned;default:0;not null;comment:员工识别符"` Group int64 `json:"group" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:集团"` Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:公司"` Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;not null;comment:部室"` WorkShop int64 `json:"workshop" gorm:"column:workshop;type:bigint(20) unsigned;default:0;not null;comment:二级部门或车间"` WorkshopSection int64 `json:"workshopsection" gorm:"column:workshop_section;type:bigint(20) unsigned;default:0;not null;comment:工段"` Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` GradePositions int64 `json:"gradepositions" gorm:"column:grade_positions;type:bigint(20) unsigned;default:0;not null;comment:职等"` StartTime int64 `json:"starttime" gorm:"column:start_time;type:bigint(20) unsigned;default:0;not null;comment:开始日期"` EndTime int64 `json:"endtime" gorm:"column:end_time;type:bigint(20) unsigned;default:0;not null;comment:结束日期"` Team int64 `json:"team" gorm:"column:team;type:int(1) unsigned;default:1;not null;comment:班组(1:长白;2:甲;3:乙;4:丙;5:丁)"` ChangeType int `json:"changetype" gorm:"column:change_type;type:int(1) unsigned;default:1;not null;comment:变动类型(1:预入职;2:雇佣入职;3:转正;4:晋升;5:降级;6:职等调整;7:调动调入;8:跨公司调动调入;9:借调;10:平调;11:兼职;12:预离职;13:离职;14:退休;15:返聘;16:员工初始化;)"` Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` AssignType int `json:"assigntype" gorm:"column:assign_type;type:int(1) unsigned;default:1;not null;comment:1、主职;2:兼职"` } func (InsideWorkHistory *InsideWorkHistory) TableName() string { return "inside_work_history" } // 编辑集团内部工作经历内容 func (cont *InsideWorkHistory) EditCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error return } // 获取详细内容 func (cont *InsideWorkHistory) 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 }