chart_permission.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package chart_permission
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "hongze/hongze_open_api/utils"
  5. "time"
  6. )
  7. // ChartPermission 报告权限表
  8. type ChartPermission struct {
  9. ChartPermissionId int `orm:"column(chart_permission_id);pk" description:"问题ID"`
  10. ChartPermissionName string `description:"名称"`
  11. PermissionName string `description:"权限名"`
  12. Sort int `description:"排序"`
  13. Enabled int `description:"是否可用"`
  14. CreatedTime time.Time `description:"创建时间"`
  15. LastUpdatedTime time.Time `description:"更新时间"`
  16. TeleconferenceSort int `description:"电话会类型排序"`
  17. Remark string `description:"备注"`
  18. ClassifyName string `description:"分类名称"`
  19. ProductName string `description:"产品名称"`
  20. ProductID int `description:"产品ID"`
  21. ImageURL string `description:"图片地址"`
  22. ShowType int `description:"1:查研观向小程序展示"`
  23. IsOther int `description:"是否是其他,用于查研观向小程序后台展示"`
  24. IsReport int `description:"是否是报告,用于查研观向小程序前台报告展示"`
  25. CygxAuth int `description:"是否是权限,用于查研观向小程序前台权限校验"`
  26. YbImgUrl string `description:"研报小程序报告列表icon"`
  27. PriceDrivenState int `description:"品种价格驱动开启状态 0-关闭 1-开启"`
  28. }
  29. // GetListByIds 通过IDs获取图表权限集合
  30. func GetListByIds(permissionIds []int) (list []*ChartPermission, err error) {
  31. lenNum := len(permissionIds)
  32. if lenNum == 0 {
  33. return
  34. }
  35. o := orm.NewOrm()
  36. sql := "SELECT * from chart_permission_chapter_mapping WHERE chart_permission_id in (" + utils.GetOrmInReplace(lenNum) + ") "
  37. _, err = o.Raw(sql, permissionIds).QueryRows(&list)
  38. return
  39. }