chart_permission_chapter_mapping.go 1.1 KB

1234567891011121314151617181920
  1. package eta
  2. import "hongze/hz_crm_eta/global"
  3. type ChartPermissionChapterMapping struct {
  4. Id int `gorm:"column:id;primary_key;AUTO_INCREMENT;NOT NULL"`
  5. ChartPermissionId int `gorm:"column:chart_permission_id;default:0"`
  6. ReportChapterTypeId int `gorm:"column:report_chapter_type_id;default:0;comment:'report_chapter_type表主键id或research_report表主键id或tactic表主键id'"`
  7. ResearchType string `gorm:"column:research_type;default:"`
  8. }
  9. func (c *ChartPermissionChapterMapping) TableName() string {
  10. return "chart_permission_chapter_mapping"
  11. }
  12. // GetChapterTypeMappingByTypeIdAndResearchType 根据章节类型ID及研报类型获取章节类型权限列表
  13. func GetChapterTypeMappingByTypeIdAndResearchType(reportChapterTypeId int, researchType string) (items []*ChartPermissionChapterMapping, err error) {
  14. err = global.MYSQL["rddp"].Model(ChartPermissionChapterMapping{}).Where("report_chapter_type_id = ? and research_type = ?", reportChapterTypeId, researchType).Order("chart_permission_id ASC").Scan(&items).Error
  15. return
  16. }