12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package biapprove
- import (
- "eta_gn/eta_api/global"
- "time"
- )
- type BiApprove struct {
- BiApproveId int `gorm:"column:bi_approve_id;primary_key"`
- BiId int `gorm:"column:bi_id"`
- BiTitle string `gorm:"column:bi_title"`
- ClassifyId int `gorm:"column:classify_id"`
- State int `gorm:"column:state"` // '审批状态:1-待审批;2-已审批;3-已驳回;4-已撤回'
- FlowId int `gorm:"column:flow_id"`
- FlowVersion int `gorm:"column:flow_version"`
- StartNodeId int `gorm:"column:start_node_id"`
- CurrNodeId int `gorm:"column:curr_node_id"`
- ApplyUserId int `gorm:"column:apply_user_id"`
- ApplyUserName string `gorm:"column:apply_user_name"`
- ApproveRemark string `gorm:"column:approve_remark"`
- ApproveTime time.Time `gorm:"column:approve_time"`
- CreateTime time.Time `gorm:"column:create_time"`
- ModifyTime time.Time `gorm:"column:update_time"`
- }
- func (b *BiApprove) TableName() string {
- return "bi_approve"
- }
- func (b *BiApprove) Update(cols []string) (err error) {
- db := global.DmSQL["rddp"]
- err = db.Model(b).Select(cols).Updates(b).Error
- return
- }
- func GetBiApproveByFlowIdAndVersionId(biFlowId int, flowVersion int) (item []*BiApprove, err error) {
- db := global.DmSQL["rddp"]
- err = db.Where("flow_id = ? AND flow_version = ?", biFlowId, flowVersion).Find(&item).Error
- return
- }
- func GetBiApproveById(biApproveId int) (item *BiApprove, err error) {
- db := global.DmSQL["rddp"]
- err = db.Where("bi_approve_id = ?", biApproveId).First(&item).Error
- return
- }
|