package models import ( "github.com/beego/beego/v2/client/orm" "time" ) type CygxReportMappingGroup struct { Id int `orm:"column(id);pk" description:"id"` IdCygx int `description:"分类ID"` CategoryIdCelue int `description:"分类ID"` CreateTime time.Time `description:"创建时间"` ModifyTime time.Time `description:"更新时间"` } // 添加 func AddCygxReportMappingGroup(item *CygxReportMappingGroup) (lastId int64, err error) { o := orm.NewOrm() lastId, err = o.Insert(item) return } // 列表 func GetCygxReportMappingGroupList(condition string, pars []interface{}) (items []*CygxReportMappingGroup, err error) { o := orm.NewOrm() sql := `SELECT * FROM cygx_report_mapping_group WHERE 1= 1 ` if condition != "" { sql += condition } _, err = o.Raw(sql, pars).QueryRows(&items) return }