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.
79 lines
3.9 KiB
79 lines
3.9 KiB
package customerForm
|
|
|
|
import (
|
|
"hr_server/overall"
|
|
"strings"
|
|
)
|
|
|
|
// 工作流执行主体
|
|
// 字典类型
|
|
type HuanBanShenQing struct {
|
|
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
|
|
MastersKey int64 `json:"masters_key" gorm:"column:masters_key;type:bigint(20) unsigned;default:0;not null;comment:申请人"`
|
|
Creater int64 `json:"creater" gorm:"column:creater;type:bigint(20) unsigned;default:0;not null;comment:申请人"`
|
|
CreaterTime int64 `json:"creater_time" gorm:"column:creater_time;type:bigint(20) unsigned;default:0;not null;comment:提交时间"`
|
|
EditTime int64 `json:"edit_time" gorm:"column:edit_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"`
|
|
FlowId int64 `json:"flow_id" gorm:"column:flow_id;type:bigint(20) unsigned;default:0;not null;comment:流程识别标识"`
|
|
States int `json:"states" gorm:"column:states;type:int(11) unsigned;default:1;not null;comment:状态(1:启用,2:禁用;3:删除)"`
|
|
FlowIsOpen int `json:"flowIsOpen" gorm:"column:flowIsOpen;type:int(1) unsigned;default:3;not null;comment:是否开启工作流"`
|
|
Shen3pi1bian1hao4 string `json:"shen3pi1bian1hao4" gorm:"column:shen3pi1bian1hao4;type:varchar(255);default:'';comment:审批编号"`
|
|
Fu4jian4 string `json:"fu4jian4" gorm:"column:fu4jian4;type:longtext;comment:附件"`
|
|
Org string `json:"org" gorm:"column:org;type:mediumtext;default:'';comment:申请人部门"`
|
|
Shou3ji1hao4109293 string `json:"shou3ji1hao4109293" gorm:"column:shou3ji1hao4109293;type:mediumtext;default:'';comment:手机号"`
|
|
Dang1zhi2ri4qi1 int64 `json:"dang1zhi2ri4qi1" gorm:"column:dang1zhi2ri4qi1;type:bigint(20) unsigned;default:0;not null;comment:当值日期"`
|
|
Diao4huan4ren229452110 string `json:"diao4huan4ren229452110" gorm:"column:diao4huan4ren229452110;type:longtext;comment:调换人"`
|
|
Shou3ji1 string `json:"shou3ji1" gorm:"column:shou3ji1;type:varchar(255);default:'';comment:审批编号"`
|
|
Diao4huan4ri4qi1 int64 `json:"diao4huan4ri4qi1" gorm:"column:diao4huan4ri4qi1;type:bigint(20) unsigned;default:0;not null;comment:调换日期"`
|
|
Shen1qing3yuan2yin1 string `json:"shen1qing3yuan2yin1" gorm:"column:shen1qing3yuan2yin1;type:longtext;comment:申请原因"`
|
|
}
|
|
|
|
func (HuanBanShenQing *HuanBanShenQing) TableName() string {
|
|
return "huanBanShenQing"
|
|
}
|
|
|
|
// 写入内容
|
|
func (cont *HuanBanShenQing) WriteCont() (err error) {
|
|
err = overall.CONSTANT_DB_CustomerForm.Create(&cont).Error
|
|
return
|
|
}
|
|
|
|
// 编辑内容
|
|
func (cont *HuanBanShenQing) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
|
|
err = overall.CONSTANT_DB_CustomerForm.Model(&cont).Where(whereMap).Updates(saveData).Error
|
|
return
|
|
}
|
|
|
|
// 获取内容
|
|
func (cont *HuanBanShenQing) GetCont(whereMap interface{}, field ...string) (err error) {
|
|
gormDb := overall.CONSTANT_DB_CustomerForm.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 *HuanBanShenQing) CountCont(whereMap interface{}) (countId int64) {
|
|
overall.CONSTANT_DB_CustomerForm.Model(&cont).Where(whereMap).Count(&countId)
|
|
return
|
|
}
|
|
|
|
// 读取全部信息
|
|
func (cont *HuanBanShenQing) ContMap(whereMap interface{}, field ...string) (countAry []HuanBanShenQing, err error) {
|
|
gormDb := overall.CONSTANT_DB_CustomerForm.Model(&cont)
|
|
if len(field) > 0 {
|
|
fieldStr := strings.Join(field, ",")
|
|
gormDb = gormDb.Select(fieldStr)
|
|
}
|
|
err = gormDb.Where(whereMap).Find(&countAry).Error
|
|
return
|
|
}
|
|
|
|
// 删除内容
|
|
func (cont *HuanBanShenQing) DelCont(whereMap interface{}) (err error) {
|
|
err = overall.CONSTANT_DB_CustomerForm.Where(whereMap).Delete(&cont).Error
|
|
return
|
|
}
|
|
|