package models import ( "appPlatform/overall" "strings" ) //个人信息主表 type WorkMan struct { Id int64 `json:"id" gorm:"column:wm_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"` Number string `json:"number" gorm:"column:wm_number;type:varchar(10);not null;comment:员工编号"` Password string `json:"pwd" gorm:"column:wm_pwd;type:varchar(50);not null;comment:密码"` DepartmentId int64 `json:"departmentid" gorm:"column:wm_bf_id;type:bigint(20) unsigned;default:0;not null;comment:分厂"` WorkshopId int64 `json:"workshopid" gorm:"column:wm_ws_id;type:bigint(20) unsigned;default:0;not null;comment:工段"` PostId int64 `json:"postid" gorm:"column:wm_pt_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` Key int64 `json:"key" gorm:"column:wm_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别码"` State int `json:"state" gorm:"column:wm_set;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` HireSet int `json:"hireset" gorm:"column:wm_hire_set;type:tinyint(1) unsigned;default:1;not null;comment:雇佣状态(1:在职;2:离职)"` Time int64 `json:"time" gorm:"column:wm_time;type:bigint(20) unsigned;default:0;not null;comment:添加事件"` EiteTime int64 `json:"eitetime" gorm:"column:wm_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改事件"` UserId int64 `json:"userid" gorm:"column:wm_user_id;type:bigint(50) unsigned;default:0;not null;comment:录入人"` QuitTime int64 `json:"quitime" gorm:"column:wm_quit_time;type:bigint(20) unsigned;default:0;not null"` Group int64 `json:"group" gorm:"column:wm_group;type:bigint(20) unsigned;default:0;not null;comment:集团公司"` Soptcheck int `json:"soptcheck" gorm:"column:wm_soptcheck;type:tinyint(1) unsigned;default:1;not null"` Tema int64 `json:"tema" gorm:"column:wm_tema;type:bigint(20) unsigned;default:0;not null;comment:班组"` IsOne int `json:"isone" gorm:"column:wm_one;type:tinyint(1) unsigned;default:1;not null;comment:第一次登陆"` WorkWechatId string `json:"workwechatid" gorm:"column:qywx_key;type:varchar(255);not null;comment:企业微信KEY"` WechatId string `json:"wechatid" gorm:"column:wx_key;type:varchar(255);not null;comment:微信KEY"` } func (WorkMan *WorkMan) TableName() string { return "worker_man" } //获取职务分类内容 func (cont *WorkMan) GetCont(whereMap interface{}, field ...string) (err error) { gormDb := overall.CONSTANT_DB_Master.Model(&cont) if len(field) > 0 { fieldStr := strings.Join(field, ",") gormDb = gormDb.Select(fieldStr) } gormDb = gormDb.Where(whereMap) err = gormDb.First(&cont).Error return } //个人信息附表 type WorkManAttribute struct { KeyAttr int64 `json:"key" gorm:"column:wmd_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别符"` Name string `json:"name" gorm:"column:wmd_name;type:varchar(50);not null;comment:姓名"` Gender int `json:"gender" gorm:"column:wmd_gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男;2:女)"` Age int `json:"age" gorm:"column:wmd_age;type:tinyint(3) unsigned;default:1;not null;comment:年龄"` Tel string `json:"tel" gorm:"column:wmd_tel;type:varchar(25);not null;comment:联系方式"` Category int `json:"category" gorm:"column:wmd_category;type:tinyint(1) unsigned;default:1;not null;comment:人员类别(1:正式工;2:合同工;3:实习生)"` CertificatesType int `json:"certificatesType" gorm:"column:wmd_certificates_type;type:tinyint(1) unsigned;default:1;not null;comment:证件类型(1:身份证;2:驾驶证;3:军人证;4:护照;5:居住证)"` CertificatesNum string `json:"certificatesNum" gorm:"column:wmd_certificates_number;type:varbinary(50);comment:证件编号"` Birthday int64 `json:"birthday" gorm:"column:wmd_birthday;type:bigint(20) unsigned;default:0;not null;comment:出生日期"` EntryTime int64 `json:"entryTime" gorm:"column:wmd_entry_time;type:bigint(20) unsigned;default:0;not null;comment:入职日期"` QuitTimeAttr int64 `json:"quitTime" gorm:"column:wmd_quit_time;type:bigint(20) unsigned;default:0;not null;comment:离职日期"` EiteTimeAttr int64 `json:"eiteTime" gorm:"column:wmd_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` Addrest string `json:"addrest" gorm:"column:wmd_addrest;type:varchar(255);comment:家庭住址"` Icon string `json:"icon" gorm:"column:wmd_icon;type:varchar(255);comment:照片"` NickName string `json:"nickName" gorm:"column:wmd_nickname;type:varchar(255);comment:昵称"` } func (WorkManAttribute *WorkManAttribute) TableName() string { return "worker_man_data" } //个人详细信息 type PersonalDetails struct { WorkMan WorkManAttribute } //Redis身份识别 type RedisUserInfo struct { Id string `json:"id"` Number string `json:"number"` DepartmentId string `json:"departmentid"` WorkshopId string `json:"workshopid"` PostId string `json:"postid"` Key string `json:"key"` Group string `json:"group"` Tema string `json:"tema"` WorkWechatId string `json:"workwechatid"` WechatId string `json:"wechatid"` Name string `json:"name"` NickName string `json:"nickname"` }