知行学院重新架构Golang版后台
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.

85 lines
4.8 KiB

package models
import "database/sql"
//员工属性
type UserInfo struct {
UserKey int64 `json:"wmd_key" bson:"wmd_key"` //'唯一识别符',
USerName sql.NullString `json:"wmd_name" bson:"wmd_name"` //'姓名',
UserGender int8 `json:"wmd_gender" bson:"wmd_gender"` //'性别(1:男;2:女)',
Age int8 `json:"wmd_age" bson:"wmd_age"` // '年龄',
Tel sql.NullString `json:"wmd_tel" bson:"wmd_tel"` //'联系方式',
Category int8 `json:"wmd_category" bson:"wmd_category"` // '人员类别(1:正式工;2:合同工;3:实习生)',
CertificatesType int8 `json:"wmd_certificates_type" bson:"wmd_certificates_type"` // '证件类型(1:身份证;2:驾驶证;3:军人证;4:护照;5:居住证)',
CertificatesNumber sql.NullString `json:"wmd_certificates_number" bson:"wmd_certificates_number"` //'证件编号',
Birthday int64 `json:"wmd_birthday" bson:"wmd_birthday"` //'出生日期',
EntryTime int64 `json:"wmd_entry_time" bson:"wmd_entry_time"` //'入职日期',
QuitTime int64 `json:"wmd_quit_time" bson:"wmd_quit_time"` //'离职日期',
EiteTime int64 `json:"wmd_eite_time" bson:"wmd_eite_time"` //'0',
Addrest sql.NullString `json:"wmd_addrest" bson:"wmd_addrest"` //'家庭住址',
UserIcon sql.NullString `json:"wmd_icon" bson:"wmd_icon"` //'照片',
}
//员工主体信息
type UserAccount struct {
Id int64 `json:"wm_id" bson:"wm_id"` //,
Number sql.NullString `json:"wm_number" bson:"wm_number"` // '员工编号',
Pwd sql.NullString `json:"wm_pwd" bson:"wm_pwd"` //NOT NULL DEFAULT '' COMMENT '密码',
BfId int64 `json:"wm_bf_id" bson:"wm_bf_id"` // unsigned NOT NULL DEFAULT '0' COMMENT '分厂',
WsId int64 `json:"wm_ws_id" bson:"wm_ws_id"` // unsigned NOT NULL DEFAULT '0' COMMENT '工段',
PtId int64 `json:"wm_pt_id" bson:"wm_pt_id"` // unsigned NOT NULL DEFAULT '0' COMMENT '职务',
Key int64 `json:"wm_key" bson:"wm_key"` // unsigned NOT NULL DEFAULT '0' COMMENT '唯一识别码',
Set int8 `json:"wm_set" bson:"wm_set"` // unsigned NOT NULL DEFAULT '1' COMMENT '状态(1:启用;2:禁用;3:删除)',
HireSet int8 `json:"wm_hire_set" bson:"wm_hire_set"` // unsigned NOT NULL DEFAULT '1' COMMENT '雇佣状态(1:在职;2:离职)',
Time int64 `json:"wm_time" bson:"wm_time"` // unsigned NOT NULL DEFAULT '0',
EiteTime int64 `json:"wm_eite_time" bson:"wm_eite_time"` // unsigned NOT NULL DEFAULT '0',
UserId int64 `json:"wm_user_id" bson:"wm_user_id"` // unsigned NOT NULL DEFAULT '1' COMMENT '录入人',
QuitTime int64 `json:"wm_quit_time" bson:"wm_quit_time"` // unsigned NOT NULL DEFAULT '0',
Group int64 `json:"wm_group" bson:"wm_group"` // unsigned NOT NULL DEFAULT '1' COMMENT '集团公司',
Soptcheck int8 `json:"wm_soptcheck" bson:"wm_soptcheck"` // unsigned NOT NULL DEFAULT '1',
Tema int64 `json:"wm_tema" bson:"wm_tema"` // unsigned DEFAULT '0' COMMENT '班组',
LoginOne int8 `json:"wm_one" bson:"wm_one"` // unsigned NOT NULL DEFAULT '1' COMMENT '第一次登陆',
WorkWatchKey sql.NullString `json:"qywx_key" bson:"qywx_key"` //DEFAULT NULL COMMENT '企业微信KEY',
WatchKey sql.NullString `json:"wx_key" bson:"wx_key"` //DEFAULT NULL COMMENT '微信KEY',
}
//初始化数据
func (m *UserInfo) IniUserInfo() {
m.UserKey = 0
m.USerName = sql.NullString{"", false}
m.UserGender = 1
m.Age = 0
m.Tel = sql.NullString{"", false}
m.Category = 1
m.CertificatesType = 1
m.CertificatesNumber = sql.NullString{"", false}
m.Birthday = 0
m.EntryTime = 0
m.QuitTime = 0
m.EiteTime = 0
m.Addrest = sql.NullString{"", false}
m.UserIcon = sql.NullString{"", false}
}
func (u *UserAccount) InUserAccount() {
u.Id = 0
u.Number = sql.NullString{"", false}
u.Pwd = sql.NullString{"", false}
u.BfId = 0
u.WsId = 0
u.PtId = 0
u.Key = 0
u.Set = 0
u.HireSet = 0
u.Time = 0
u.EiteTime = 0
u.UserId = 0
u.QuitTime = 0
u.Group = 0
u.Soptcheck = 0
u.Tema = 0
u.LoginOne = 0
u.WorkWatchKey = sql.NullString{"", false}
u.WatchKey = sql.NullString{"", false}
}