package research_report

import (
	"hongze/hongze_yb/global"
	"time"
)

type ResearchReportTypeContent struct {
	ResearchReportTypeTitle     string
	ResearchReportTypeContentId int       `json:"research_report_type_content_id" description:"研究报告内容id"`
	ResearchReportTypeId        int       `json:"research_report_id" description:"报告id"`
	Sort                        int       `json:"sort" description:"排序"`
	ContentType                 string    `json:"content_type" description:"内容分类类型"`
	Content                     string    `json:"content" description:"内容"`
	ImgUrl                      string    `json:"img_url" description:"图片路径"`
	CreatedTime                 time.Time `json:"created_time" description:"创建时间"`
	LastUpdatedTime             time.Time `json:"last_updated_time" description:"最近一次更新时间"`
}

// GetResearchReportTypeContentList 获取研究报告章节详情
func GetResearchReportTypeContentList(researchReportTypeId uint64) (items []*ResearchReportTypeContent, err error) {
	sql := `select rrt.research_report_type_title,rrtc.*,rrt.research_report_type_id
from research_report_type rrt
inner join research_report_type_content rrtc on rrtc.research_report_type_id = rrt.research_report_type_id
where rrt.research_report_type_id = ? `

	err = global.DEFAULT_MYSQL.Raw(sql, researchReportTypeId).Scan(&items).Error
	return
}