// ==========================================================================
// This is auto-generated by gf cli tool. You may not really want to edit it.
// ==========================================================================

package wf_run_process

import (
	"database/sql"
	"github.com/gogf/gf/database/gdb"
)

// Entity is the golang structure for table wf_run_process.
type Entity struct {
	Id                uint   `orm:"id,primary"          json:"id"`                  //
	Uid               uint   `orm:"uid"                 json:"uid"`                 //
	RunId             uint   `orm:"run_id"              json:"run_id"`              // 当前流转id
	RunFlow           uint   `orm:"run_flow"            json:"run_flow"`            // 属于那个流程的id
	RunFlowProcess    uint   `orm:"run_flow_process"    json:"run_flow_process"`    // 当前步骤编号
	ParentFlow        uint   `orm:"parent_flow"         json:"parent_flow"`         // 上一步流程
	ParentFlowProcess uint   `orm:"parent_flow_process" json:"parent_flow_process"` // 上一步骤号
	RunChild          uint   `orm:"run_child"           json:"run_child"`           // 开始转入子流程run_id 如果转入子流程，则在这里也记录
	Remark            string `orm:"remark"              json:"remark"`              // 备注
	IsReceiveType     uint   `orm:"is_receive_type"     json:"is_receive_type"`     // 是否先接收人为主办人
	AutoPerson        int    `orm:"auto_person"         json:"auto_person"`         //
	SponsorText       string `orm:"sponsor_text"        json:"sponsor_text"`        //
	SponsorIds        string `orm:"sponsor_ids"         json:"sponsor_ids"`         //
	IsSponsor         uint   `orm:"is_sponsor"          json:"is_sponsor"`          // 是否步骤主办人 0否(默认) 1是
	IsSingpost        uint   `orm:"is_singpost"         json:"is_singpost"`         // 是否已会签过
	IsBack            uint   `orm:"is_back"             json:"is_back"`             // 被退回的 0否(默认) 1是
	Status            uint   `orm:"status"              json:"status"`              // 状态 0为未接收（默认），1为办理中 ,2为已转交,3为已结束4为已打回
	JsTime            uint   `orm:"js_time"             json:"js_time"`             // 接收时间
	BlTime            uint   `orm:"bl_time"             json:"bl_time"`             // 办理时间
	JjTime            uint   `orm:"jj_time"             json:"jj_time"`             // 转交时间,最后一步等同办结时间
	IsDel             uint   `orm:"is_del"              json:"is_del"`              //
	Updatetime        uint   `orm:"updatetime"          json:"updatetime"`          //
	Dateline          uint   `orm:"dateline"            json:"dateline"`            //
	WfMode            int    `orm:"wf_mode"             json:"wf_mode"`             //
	WfAction          string `orm:"wf_action"           json:"wf_action"`           //
}

// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
// the data and where attributes for empty values.
func (r *Entity) OmitEmpty() *arModel {
	return Model.Data(r).OmitEmpty()
}

// Inserts does "INSERT...INTO..." statement for inserting current object into table.
func (r *Entity) Insert() (result sql.Result, err error) {
	return Model.Data(r).Insert()
}

// InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
func (r *Entity) InsertIgnore() (result sql.Result, err error) {
	return Model.Data(r).InsertIgnore()
}

// Replace does "REPLACE...INTO..." statement for inserting current object into table.
// If there's already another same record in the table (it checks using primary key or unique index),
// it deletes it and insert this one.
func (r *Entity) Replace() (result sql.Result, err error) {
	return Model.Data(r).Replace()
}

// Save does "INSERT...INTO..." statement for inserting/updating current object into table.
// It updates the record if there's already another same record in the table
// (it checks using primary key or unique index).
func (r *Entity) Save() (result sql.Result, err error) {
	return Model.Data(r).Save()
}

// Update does "UPDATE...WHERE..." statement for updating current object from table.
// It updates the record if there's already another same record in the table
// (it checks using primary key or unique index).
func (r *Entity) Update() (result sql.Result, err error) {
	return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update()
}

// Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
func (r *Entity) Delete() (result sql.Result, err error) {
	return Model.Where(gdb.GetWhereConditionOfStruct(r)).Delete()
}
