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.5 KiB
44 lines
2.5 KiB
package models
|
|
|
|
import (
|
|
"hr_server/overall"
|
|
"strings"
|
|
)
|
|
|
|
// 证书
|
|
type RewardsPenalties struct {
|
|
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"`
|
|
Title string `json:"title" gorm:"column:title;type:varchar(30) unsigned;not null;comment:奖励/处分项目"`
|
|
UserKey int64 `json:"userkey" gorm:"column:userkey;type:bigint(20) unsigned;default:0;not null;comment:获得人员"`
|
|
Types int `json:"types" gorm:"column:types;type:tinyint(1) unsigned;default:1;not null;comment:类型(1:奖励;2:处分;)`
|
|
State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)`
|
|
IssuingUnit string `json:"issuingUnit" gorm:"column:issuing_unit;type:varchar(255) unsigned;default:'';not null;comment:颁发单位"`
|
|
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 int `json:"level" gorm:"column:level;type:int(7) unsigned;default:0;not null;comment:奖惩级别(1:部门级;2:公司级;3:县级;4:市级;5:省级;6:国家级)"`
|
|
RewPunClass int `json:"rewPunClass" gorm:"column:rewPunClass;type:int(7) unsigned;default:0;not null;comment:奖惩类型(1:年终评优;2:表扬;3:嘉奖;4:记功;5:记大功;6:特别奖励;7:批评;8:警告;9:记过;10:记大过;11:降级;12:留用察看;13:开除)"`
|
|
RewPunNumber string `json:"rewPunNumber" gorm:"column:rewPunNumber;type:varchar(255) unsigned;not null;comment:奖惩文号"`
|
|
}
|
|
|
|
func (RewardsPenalties *RewardsPenalties) TableName() string {
|
|
return "rewards_penalties"
|
|
}
|
|
|
|
// 编辑双职工内容
|
|
func (RewardsPenalties *RewardsPenalties) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
|
|
err = overall.CONSTANT_DB_HR.Model(&RewardsPenalties).Where(whereMap).Updates(saveData).Error
|
|
return
|
|
}
|
|
|
|
// 获取双职工内容
|
|
func (cont *RewardsPenalties) 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
|
|
}
|
|
|