123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type CygxIndustrialActivityGroupSubject struct {
- Id int `orm:"column(id);pk" description:"主键ID"`
- ActivityId int `description:"活动ID"`
- IndustrialSubjectId int `description:"cygx_industrial_subject表的文章ID"`
- Source int `description:"来源,1 活动,2专项调研"`
- CreateTime time.Time `description:"创建时间"`
- }
- type SubjectActivityGroupManagementRep struct {
- IndustrialSubjectId int `description:"产业id"`
- SubjectName string `description:"标的名称"`
- }
- // GetCygxIndustrialActivityGroupSubjectList 获取列表
- func GetCygxIndustrialActivityGroupSubjectList(condition string, pars []interface{}) (list []*CygxIndustrialActivityGroupSubject, err error) {
- sql := `SELECT
- *
- FROM
- cygx_industrial_activity_group_subject
- WHERE
- 1 = 1 `
- if condition != `` {
- sql += condition
- }
- _, err = orm.NewOrm().Raw(sql, pars).QueryRows(&list)
- return
- }
- // 列表
- func GetSubjectActivityGroupManagementListByActivityId(activityId int) (items []*SubjectActivityGroupManagementRep, err error) {
- o := orm.NewOrm()
- sql := `SELECT
- s.subject_name
- FROM
- cygx_industrial_subject AS s
- INNER JOIN cygx_industrial_activity_group_subject AS ag ON s.industrial_subject_id = ag.industrial_subject_id
- WHERE
- ag.activity_id = ?`
- _, err = o.Raw(sql, activityId).QueryRows(&items)
- return
- }
|