package roadshow

import (
	"github.com/beego/beego/v2/client/orm"
	"time"
)

type RsCalendarMeetingLabelGroup struct {
	LabelId      int       `orm:"column(label_id);pk" description:"主键ID"`
	RsCalendarId int       `description:"路演ID"`
	CreateTime   time.Time `description:"创建时间"`
	ModifyTime   time.Time `description:"修改时间"`
	AdminId      int       `description:"管理员ID"`
	AdminName    string    `description:"管理员姓名"`
	TagType      int       `description:"标签类型，1产业，2标的，3行业权限"`
	TagId        int       `description:"标签ID"`
}

// 获取数量
func GetRsCalendarMeetingLabelGroupByRsCalendarId(rsCalendarId int) (count int, err error) {
	o := orm.NewOrmUsingDB("weekly_report")
	sqlCount := ` SELECT COUNT(1) AS count  FROM rs_calendar_meeting_label_group WHERE   rs_calendar_id   = ?`
	err = o.Raw(sqlCount, rsCalendarId).QueryRow(&count)
	return
}

// 根据多个路演ID获取研信息
func GetRsCalendarMeetingLabelGroupListByRsCalendarId(rsCalendarId int) (item []*RsCalendarMeetingLabelGroup, err error) {
	o := orm.NewOrmUsingDB("weekly_report")
	sql := `SELECT * FROM rs_calendar_meeting_label_group WHERE rs_calendar_id  = ? `
	_, err = o.Raw(sql, rsCalendarId).QueryRows(&item)
	return
}
