package models import "key_performance_indicators/overall" //系统用户表 type SystemUser struct { Id int64 `json:"id" gorm:"column:u_id;type:bigint(20) unsigned;not null;comment:Id"` Name string `json:"name" gorm:"column:u_name;type:varchar(36);not null;comment:用户名"` PassWord string `json:"passWord" gorm:"column:u_password;type:varchar(30);not null;comment:密码"` Role int64 `json:"role" gorm:"column:u_role;type:bigint(20) unsigned;not null;default:1;comment:用户类型"` State int `json:"state" gorm:"column:u_set;type:tinyint(1) unsigned;default:1;not null;comment:是否启用(1:启用;2:禁用;3:删除)"` Attribute int64 `json:"attribute" gorm:"column:u_attribute;type:bigint(20) unsigned;not null;default:0;comment:账号属性"` Time int64 `json:"time" gorm:"column:u_time;type:bigint(30) unsigned;default:0;not null;comment:创建时间"` EiteTime int64 `json:"eiteTime" gorm:"column:u_eite_time;type:bigint(30) unsigned;default:0;not null;comment:修改时间"` Key int64 `json:"key" gorm:"column:u_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别码"` Group int64 `json:"group" gorm:"column:u_group;type:bigint(20) unsigned;not null;default:0;comment:集团公司"` Wand int `json:"wand" gorm:"column:u_wand;type:tinyint(3) unsigned;default:0;not null;comment:权重"` } func (SystemUser *SystemUser) TableName() string { return "system_user" } //获取详情 func (cont *SystemUser) GetCont(where interface{}, filed ...string) error { gormDb := overall.CONSTANT_DB_Master.Where(where) if len(filed) > 0 { for _, v := range filed { gormDb = gormDb.Select(v) } } err := gormDb.First(&cont).Error return err } //编辑内容 func (cont *SystemUser) EiteCont(whereMap interface{}, saveData interface{}) (err error) { err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error return }