9 changed files with 763 additions and 18 deletions
@ -0,0 +1,67 @@ |
|||
package modelskpi |
|||
|
|||
import ( |
|||
"key_performance_indicators/overall" |
|||
"strings" |
|||
) |
|||
|
|||
// 岗位考核方案版本管理
|
|||
type PositionPlanVersio struct { |
|||
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` |
|||
Group int64 `json:"group" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:归属集团"` |
|||
Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;comment:归属部门"` |
|||
OrgId int64 `json:"orgid" gorm:"column:orgid;type:bigint(20) unsigned;default:0;comment:行政组织"` |
|||
Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;comment:归属岗位"` |
|||
Key string `json:"key" gorm:"column:key;type:varchar(200) unsigned;default:0;not null;comment:编码"` |
|||
Versio string `json:"versio" gorm:"column:version;type:varchar(20) unsigned;default:0;not null;comment:版本号"` |
|||
Year int64 `json:"year" gorm:"column:years;type:int(5) 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:删除)"` |
|||
AddTime int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` |
|||
EiteTime int64 `json:"eitetime" gorm:"column:eitetime;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` |
|||
Content string `json:"content" gorm:"column:content;type:longtext;comment:版本内容"` |
|||
} |
|||
|
|||
func (PositionPlanVersio *PositionPlanVersio) TableName() string { |
|||
return "position_plan_version" |
|||
} |
|||
|
|||
// 编辑内容
|
|||
func (cont *PositionPlanVersio) EiteCont(whereMap interface{}, saveData interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error |
|||
return |
|||
} |
|||
|
|||
// 获取内容
|
|||
func (cont *PositionPlanVersio) GetCont(whereMap interface{}, field ...string) (err error) { |
|||
gormDb := overall.CONSTANT_DB_KPI.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 *PositionPlanVersio) CountCont(whereMap interface{}) (countId int64) { |
|||
overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) |
|||
return |
|||
} |
|||
|
|||
// 读取全部信息
|
|||
func (cont *PositionPlanVersio) ContMap(whereMap interface{}, field ...string) (countAry []PositionPlanVersio, err error) { |
|||
gormDb := overall.CONSTANT_DB_KPI.Model(&cont) |
|||
if len(field) > 0 { |
|||
fieldStr := strings.Join(field, ",") |
|||
gormDb = gormDb.Select(fieldStr) |
|||
} |
|||
err = gormDb.Where(whereMap).Find(&countAry).Error |
|||
return |
|||
} |
|||
|
|||
// 删除内容
|
|||
func (cont *PositionPlanVersio) DelCont(whereMap interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error |
|||
return |
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
package modelskpi |
|||
|
|||
import ( |
|||
"key_performance_indicators/overall" |
|||
"strings" |
|||
) |
|||
|
|||
// 指标细则
|
|||
type PostTargetDetails 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:text;comment:指标细则"` |
|||
Content string `json:"content" gorm:"column:content;type:text;comment:指标说明"` |
|||
ParentId int64 `json:"parentid" gorm:"column:parentid;type:bigint(20) unsigned;default:0;not null;comment:归属指标栏目"` |
|||
ParentIdSun int64 `json:"parentidsun" gorm:"column:parentid_sun;type:bigint(20) unsigned;default:0;not null;comment:归属指标子栏目"` |
|||
State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` |
|||
AddTime int64 `json:"addtime" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:制定时间"` |
|||
MinScore int64 `json:"minscore" gorm:"column:min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` |
|||
MaxScore int64 `json:"maxscore" gorm:"column:max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` |
|||
Company string `json:"company" gorm:"column:company;type:varchar(20) unsigned;default:0;not null;comment:单位"` |
|||
AddReduce int `json:"addreduce" gorm:"column:add_reduce;type:int(1) unsigned;default:1;not null;comment:1:减少;2:增加;3:无属性,现场确认加或减"` |
|||
CensorType string `json:"censortype" gorm:"column:censor_type;type:text;comment:检查方式"` |
|||
CensorCont string `json:"censorcont" gorm:"column:censor_cont;type:longtext;comment:检查依据"` |
|||
CensorRate int `json:"censorrate" gorm:"column:censor_rate;type:int(5) unsigned;default:1;not null;comment:检查频次"` |
|||
Cycles int `json:"cycle" gorm:"column:cycle;type:tinyint(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"` |
|||
CycleAttres int `json:"cycleattr" gorm:"column:cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` |
|||
Paretment int64 `json:"paretment" gorm:"column:paretment;type:bigint(20);comment:接受考核的部门"` |
|||
ParetmentPost string `json:"paretmentpost" gorm:"column:paretment_post;type:longtext;comment:接受考核的部门岗位"` |
|||
Reportary string `json:"reportary" gorm:"column:reportary;type:longtext;comment:提报人"` |
|||
Punishmode int `json:"punishmode" gorm:"column:punishmode;type:tinyint(1) unsigned;default:1;not null;comment:处罚方式 1:扣分;2:现金处罚;3:扣分加现金"` |
|||
Maxmoney int64 `json:"maxmoney" gorm:"column:maxmoney;type:bigint(20) unsigned;default:0;not null;comment:最高罚款"` |
|||
Minmoney int64 `json:"minmoney" gorm:"column:minmoney;type:bigint(20) unsigned;default:0;not null;comment:最低罚款"` |
|||
} |
|||
|
|||
func (PostTargetDetails *PostTargetDetails) TableName() string { |
|||
return "post_target_details" |
|||
} |
|||
|
|||
// 编辑内容
|
|||
func (cont *PostTargetDetails) EiteCont(whereMap interface{}, saveData interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error |
|||
return |
|||
} |
|||
|
|||
// 获取内容
|
|||
func (cont *PostTargetDetails) GetCont(whereMap interface{}, field ...string) (err error) { |
|||
gormDb := overall.CONSTANT_DB_KPI.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 *PostTargetDetails) CountCont(whereMap interface{}) (countId int64) { |
|||
overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) |
|||
return |
|||
} |
|||
|
|||
// 读取全部信息
|
|||
func (cont *PostTargetDetails) ContMap(whereMap interface{}, field ...string) (countAry []PostTargetDetails, err error) { |
|||
gormDb := overall.CONSTANT_DB_KPI.Model(&cont) |
|||
if len(field) > 0 { |
|||
fieldStr := strings.Join(field, ",") |
|||
gormDb = gormDb.Select(fieldStr) |
|||
} |
|||
err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error |
|||
return |
|||
} |
|||
|
|||
// 删除内容
|
|||
func (cont *PostTargetDetails) DelCont(whereMap interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error |
|||
return |
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package modelskpi |
|||
|
|||
import ( |
|||
"key_performance_indicators/overall" |
|||
"strings" |
|||
) |
|||
|
|||
// 岗位评估方案
|
|||
type QualitativeEvaluationScheme struct { |
|||
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` |
|||
VersionNumber string `json:"versionnumber" gorm:"column:version_number;type:varchar(255) unsigned;not null;comment:版本编号"` |
|||
CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:归属公司"` |
|||
DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:归属部门"` |
|||
OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"` |
|||
PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:归属岗位"` |
|||
Title string `json:"title" gorm:"column:title;type:varchar(255) ;default:'';comment:考核项名称"` |
|||
DimensionId int64 `json:"dimensionid" gorm:"column:dimension_id;type:bigint(20) unsigned;default:0;not null;comment:维度"` |
|||
TargetId int64 `json:"targetid" gorm:"column:target_id;type:bigint(20) unsigned;default:0;not null;comment:指标"` |
|||
SonTargetId int64 `json:"sontargetid" gorm:"column:son_target_id;type:bigint(20) unsigned;default:0;not null;comment:子栏目"` |
|||
DetailsId int64 `json:"detailsid" gorm:"column:details_id;type:bigint(20) unsigned;default:0;not null;comment:细则"` |
|||
Attribute int `json:"attribute" gorm:"column:attribute;type:tinyint(1) unsigned;default:1;not null;comment:属性 1:定性考核;2:定量考核"` |
|||
MinScore int64 `json:"minscore" gorm:"column:min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` |
|||
MaxScore int64 `json:"maxscore" gorm:"column:max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` |
|||
ScoringMethod int `json:"scoringmethod" gorm:"column:scoring_method;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:删除)"` |
|||
Addtime int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` |
|||
Eitetime int64 `json:"eitetime" gorm:"column:eitetime;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` |
|||
CensorType string `json:"censortype" gorm:"column:censor_type;type:tinytext;comment:检查方式(1:现场检查;2:资料检查;3:事件触发)"` |
|||
Source int `json:"source" gorm:"column:source;type:tinyint(1) unsigned;default:1;not null;comment:来源(1:岗位;2:部门引用)"` |
|||
RunState int `json:"run_state" gorm:"column:run_state;type:tinyint(1) unsigned;default:1;not null;comment:运行状态(1:启用;2:禁用;3:观察)"` |
|||
} |
|||
|
|||
func (QualitativeEvaluationScheme *QualitativeEvaluationScheme) TableName() string { |
|||
return "qualitative_evaluation_scheme" |
|||
} |
|||
|
|||
// 编辑内容
|
|||
func (cont *QualitativeEvaluationScheme) EiteCont(whereMap interface{}, saveData interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error |
|||
return |
|||
} |
|||
|
|||
// 获取内容
|
|||
func (cont *QualitativeEvaluationScheme) GetCont(whereMap interface{}, field ...string) (err error) { |
|||
gormDb := overall.CONSTANT_DB_KPI.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 *QualitativeEvaluationScheme) CountCont(whereMap interface{}) (countId int64) { |
|||
overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) |
|||
return |
|||
} |
|||
|
|||
// 读取全部信息
|
|||
func (cont *QualitativeEvaluationScheme) ContMap(whereMap interface{}, field ...string) (countAry []QualitativeEvaluationScheme, err error) { |
|||
gormDb := overall.CONSTANT_DB_KPI.Model(&cont) |
|||
if len(field) > 0 { |
|||
fieldStr := strings.Join(field, ",") |
|||
gormDb = gormDb.Select(fieldStr) |
|||
} |
|||
err = gormDb.Where(whereMap).Find(&countAry).Error |
|||
return |
|||
} |
|||
|
|||
// 删除内容
|
|||
func (cont *QualitativeEvaluationScheme) DelCont(whereMap interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error |
|||
return |
|||
} |
|||
Loading…
Reference in new issue