custom_query.go 1.4 KB

1234567891011121314151617181920212223242526272829
  1. package research_report
  2. import (
  3. "hongze/hongze_yb/global"
  4. "time"
  5. )
  6. type ResearchReportTypeContent struct {
  7. ResearchReportTypeTitle string
  8. ResearchReportTypeContentId int `json:"research_report_type_content_id" description:"研究报告内容id"`
  9. ResearchReportTypeId int `json:"research_report_id" description:"报告id"`
  10. Sort int `json:"sort" description:"排序"`
  11. ContentType string `json:"content_type" description:"内容分类类型"`
  12. Content string `json:"content" description:"内容"`
  13. ImgUrl string `json:"img_url" description:"图片路径"`
  14. CreatedTime time.Time `json:"created_time" description:"创建时间"`
  15. LastUpdatedTime time.Time `json:"last_updated_time" description:"最近一次更新时间"`
  16. }
  17. // GetResearchReportTypeContentList 获取研究报告章节详情
  18. func GetResearchReportTypeContentList(researchReportTypeId uint64) (items []*ResearchReportTypeContent, err error) {
  19. sql := `select rrt.research_report_type_title,rrtc.*,rrt.research_report_type_id
  20. from research_report_type rrt
  21. inner join research_report_type_content rrtc on rrtc.research_report_type_id = rrt.research_report_type_id
  22. where rrt.research_report_type_id = ? `
  23. err = global.DEFAULT_MYSQL.Raw(sql, researchReportTypeId).Scan(&items).Error
  24. return
  25. }