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.
47 lines
1.8 KiB
47 lines
1.8 KiB
package assessmentmodel
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"gin_server_admin/global"
|
|
)
|
|
|
|
// 岗位定性指标子栏目
|
|
type PostSunTarget struct {
|
|
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
|
|
Title string `json:"title" gorm:"column:title;type:varchar(255) unsigned;default:'';not null;comment:标题"`
|
|
ParentId int64 `json:"parentid" gorm:"column:parent_id;type:bigint(20) unsigned;default:0;not null;comment:归属指标"`
|
|
Time int64 `json:"time" gorm:"column:time;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:删除)"`
|
|
Depart int64 `json:"depart" gorm:"column:depart;type:bigint(20) ;default:0;comment:关联部门"`
|
|
DepartPost string `json:"departpost" gorm:"column:depart_post;type:mediumtext ;default:'';comment:关联部门岗位"`
|
|
}
|
|
|
|
func (PostSunTarget *PostSunTarget) TableName() string {
|
|
return "post_sun_target"
|
|
}
|
|
|
|
// 编辑职务分类内容
|
|
func (cont *PostSunTarget) EditCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) {
|
|
|
|
err = global.GVA_DB_Performanceappraisal.Model(&cont).Where(whereMap).Updates(saveData).Error
|
|
return
|
|
}
|
|
|
|
// 获取详细内容
|
|
func (cont *PostSunTarget) GetCont(whereMap interface{}, field ...string) (err error) {
|
|
gormDb := global.GVA_DB_Performanceappraisal.Model(&cont)
|
|
if len(field) > 0 {
|
|
fieldStr := strings.Join(field, ",")
|
|
gormDb = gormDb.Select(fieldStr)
|
|
}
|
|
gormDb = gormDb.Where(whereMap)
|
|
err = gormDb.First(&cont).Error
|
|
return
|
|
}
|
|
|
|
// 删除内容
|
|
func (cont *PostSunTarget) DelCont(whereMap interface{}) (err error) {
|
|
err = global.GVA_DB_Performanceappraisal.Where(whereMap).Delete(&cont).Error
|
|
return
|
|
}
|
|
|