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.
44 lines
2.9 KiB
44 lines
2.9 KiB
package models
|
|
|
|
import (
|
|
"key_performance_indicators/overall"
|
|
"strings"
|
|
)
|
|
|
|
//职务与岗位视图
|
|
|
|
type PostDutiesJob struct {
|
|
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
|
|
Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:职位编码"`
|
|
Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职位名称"`
|
|
PersonInCharge int `json:"personincharge" gorm:"column:perincha;type:int(1) unsigned;default:2;not null;comment:是否为本部门负责人(1:是;2:否)"`
|
|
Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"`
|
|
Duties int64 `json:"duties" gorm:"column:duties;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:删除)"`
|
|
AdministrativeOrganization int64 `json:"administrativeorganization" gorm:"column:adm_org;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:部门"`
|
|
MenuPermit string `json:"menupermit" gorm:"column:menu_permit;type:longtext;comment:菜单许可证"`
|
|
ButtonPermit string `json:"buttonpermit" gorm:"column:button_permit;type:longtext;comment:按钮许可"`
|
|
School int64 `json:"school" gorm:"column:school;type:bigint(20) unsigned;default:0;not null;comment:部门"`
|
|
DutiesName string `json:"dutiesname" gorm:"column:duties_name;type:varchar(255) unsigned;default:'';not null;comment:职务名称"`
|
|
DutiesNumber string `json:"dutiesnumber" gorm:"column:duties_number;type:varchar(50) unsigned;default:'';not null;comment:编码"`
|
|
Weight int64 `json:"weight" gorm:"column:weight;type:bigint(20) unsigned;default:1;not null;comment:权重"`
|
|
JobType int64 `json:"jobtype" gorm:"column:job_type;type:bigint(20) unsigned;default:0;not null;comment:归属职务类型"`
|
|
JobName string `json:"jobname" gorm:"column:job_name;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"`
|
|
}
|
|
|
|
func (PostDutiesJob *PostDutiesJob) TableName() string {
|
|
return "post_duties_job"
|
|
}
|
|
|
|
//获取详细内容
|
|
func (cont *PostDutiesJob) 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
|
|
}
|
|
|