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.
40 lines
1.6 KiB
40 lines
1.6 KiB
package models
|
|
|
|
import (
|
|
"hr_server/overall"
|
|
"strings"
|
|
)
|
|
|
|
// 绩效考核成绩
|
|
type Meritslog struct {
|
|
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"`
|
|
Score int64 `json:"score" gorm:"column:score;type:bigint(20) unsigned;default:0;not null;comment:绩效分数*10000保存"`
|
|
UserKey int64 `json:"userkey" gorm:"column:userkey;type:bigint(20) unsigned;default:0;not null;comment:获得人员"`
|
|
Status int `json:"status" gorm:"column:status;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)`
|
|
TimeData int64 `json:"timedata" gorm:"column:timedata;type:bigint(20) unsigned;default:0;not null;comment:获得时间"`
|
|
Years int `json:"years" gorm:"column:years;type:int(7) unsigned;default:0;not null;comment:年"`
|
|
Months int `json:"months" gorm:"column:months;type:int(7) unsigned;default:0;not null;comment:月"`
|
|
Level string `json:"level" gorm:"column:level;type:varchar(255);not null;comment:考核等级"`
|
|
}
|
|
|
|
func (Meritslog *Meritslog) TableName() string {
|
|
return "meritslog"
|
|
}
|
|
|
|
// 编辑双职工内容
|
|
func (Meritslog *Meritslog) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
|
|
err = overall.CONSTANT_DB_HR.Model(&Meritslog).Where(whereMap).Updates(saveData).Error
|
|
return
|
|
}
|
|
|
|
// 获取双职工内容
|
|
func (cont *Meritslog) 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
|
|
}
|
|
|