package models import ( "github.com/beego/beego/v2/client/orm" "time" ) // 首页资源表与产业的关系 type CygxResourceDataIndustrialGroupManagement struct { Id int `orm:"column(id);pk" description:"主键ID"` ResourceDataId int `description:"cygx_resource_data 主键ID"` SourceId int `description:"资源ID"` Source string `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"` IndustrialManagementId int `description:"cygx_industrial_management表的主键ID"` CreateTime time.Time `description:"创建时间"` } // 首页资源表与产业的关系 type CygxResourceDataIndustrialGroupSubject struct { Id int `orm:"column(id);pk" description:"主键ID"` ResourceDataId int `description:"cygx_resource_data 主键ID"` SourceId int `description:"资源ID"` Source string `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"` IndustrialSubjectId int `description:"cygx_industrial_subject表的主键ID"` CreateTime time.Time `description:"创建时间"` } // 关联产业列表 func GetCygxResourceDataIndustrialGroupManagementList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxResourceDataIndustrialGroupManagement, err error) { o := orm.NewOrm() sql := `SELECT * FROM cygx_resource_data_industrial_group_management as a WHERE 1= 1 ` if condition != "" { sql += condition } if startSize+pageSize > 0 { sql += ` LIMIT ?,? ` _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items) } else { _, err = o.Raw(sql, pars).QueryRows(&items) } return } // 关联标的列表 func GetCygxResourceDataIndustrialGroupSubjectList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxResourceDataIndustrialGroupSubject, err error) { o := orm.NewOrm() sql := `SELECT * FROM cygx_resource_data_industrial_group_subject as a WHERE 1= 1 ` if condition != "" { sql += condition } if startSize+pageSize > 0 { sql += ` LIMIT ?,? ` _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items) } else { _, err = o.Raw(sql, pars).QueryRows(&items) } return }