package research_report_type

import (
	"hongze/hongze_yb/global"
)

type ResearchReportTypeInfo struct {
	ResearchReportTypeTitle string `json:"research_report_type_title" description:"研究报告标题"`
	BannerUrl               string `json:"banner_url" description:"banner url"`
	ReportChapterTypeName   string `json:"report_chapter_type_name" description:"章节名称"`
	ResearchReportID        uint64 `json:"research_report_id" description:"报告id"`
	ResearchReportTypeID    uint64 `json:"research_report_type_id" description:"研究报告id"`
	TypeID                  int    `json:"type_id" description:"分类id"`
	ReportChapterTypeId     uint64 `json:"report_chapter_type_id" description:"章节名称"`
}

// GetResearchReportTypeInfo 获取研究报告类型详情
func GetResearchReportTypeInfo(researchReportTypeId uint64) (item *ResearchReportTypeInfo, err error) {
	sql := ` select rrt.research_report_type_title,rct.banner_url,rct.report_chapter_type_name,rrt.research_report_id,rrt.research_report_type_id,rrt.type_id,rct.report_chapter_type_name,rct.report_chapter_type_id
            from research_report_type rrt
            left join report_chapter_type rct on rct.report_chapter_type_id = rrt.type_id
            where rrt.research_report_type_id =? limit 1`

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