KPI绩效考核系统
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.

36 lines
1.5 KiB

package models
import "key_performance_indicators/overall"
//角色组(审批流程使用)
type RoleGroup struct {
Id int64 `json:"id" gorm:"primaryKey;column:srg_id;type:bigint(20) unsigned;not null;comment:Id;index"`
Title string `json:"title" gorm:"column:srg_name;type:text;comment:角色名称"`
Group int64 `json:"group" gorm:"column:srg_group;type:bigint(20) unsigned;default:0;not null;comment:角色归属"`
Addtime int64 `json:"addtime" gorm:"column:srg_time;type:bigint(20) unsigned;default:0;not null;comment:添加时间"`
State int `json:"state" gorm:"column:srg_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"`
Contentes string `json:"content" gorm:"column:srg_extatry;type:mediumtext;comment:操作组"`
Type int `json:"type" gorm:"column:srg_type;type:int(1) unsigned;default:1;not null;comment:操作类型(1:部门矩阵;2:个人)"`
}
func (RoleGroup *RoleGroup) TableName() string {
return "step_role_group"
}
//获取详情
func (cont *RoleGroup) 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 *RoleGroup) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error
return
}