package models

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

type CygxIndustrialSubject struct {
	IndustrialSubjectId    int    `orm:"column(industrial_subject_id);pk" description:"标的id"`
	IndustrialManagementId int    `description:"产业id"`
	SubjectName            string `description:"标的名称"`
	CreateTime             string `description:"创建时间"`
	Source                 int    `description:"来源,1正常添加，2：通过文章添加，3通过活动添加(默认为1)"`
}

// 获取标的列表
func GetCygxIndustrialSubjectListCondition(condition string, pars []interface{}) (items []*CygxIndustrialSubject, err error) {
	o := orm.NewOrm()
	sql := `SELECT * 
		FROM
			cygx_industrial_subject WHERE 1 = 1 ` + condition
	_, err = o.Raw(sql, pars).QueryRows(&items)
	return
}
