| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- // ==========================================================================
- // This is auto-generated by gf cli tool. You may not really want to edit it.
- // ==========================================================================
- package role
- import (
- "database/sql"
- "github.com/gogf/gf/database/gdb"
- )
- // Entity is the golang structure for table _role.
- type Entity struct {
- Id int `orm:"id,primary" json:"id"` //
- Status int `orm:"status" json:"status"` // 状态;0:禁用;1:正常
- CreateTime int `orm:"create_time" json:"create_time"` // 创建时间
- UpdateTime int `orm:"update_time" json:"update_time"` // 更新时间
- ListOrder float64 `orm:"list_order" json:"list_order"` // 排序
- Name string `orm:"name" json:"name"` // 角色名称
- Remark string `orm:"remark" json:"remark"` // 备注
- DataScope int `orm:"data_scope" json:"data_scope"` // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)
- }
- // Role is alias of Entity, which some developers say they just want.
- type Role = Entity
- // 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()
- }
- // 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()
- }
|