123456789101112131415161718192021222324252627282930313233343536 |
- package models
- import (
- "time"
- "github.com/beego/beego/v2/client/orm"
- )
- type ChartDescription struct {
- Id int `gorm:"column:id;primaryKey"`
- Description string `gorm:"column:description"`
- ChartInfoId int `gorm:"column:chart_info_id"` // 图表id
- SysUserId int `gorm:"column:sys_user_id"` // 创建人id
- SysUserRealName string `gorm:"column:sys_user_real_name"` // 创建人姓名
- ModifyTime time.Time `gorm:"column:modify_time"` // 变更时间
- CreateTime time.Time `gorm:"column:create_time"` // 关系建立时间
- }
- // GetChartDescriptionByChartInfoId 根据图表ID获取图表简介
- func GetChartDescriptionByChartInfoId(chartInfoId int) (item []*ChartDescription, err error) {
- o := orm.NewOrmUsingDB("data")
- sql := `SELECT * FROM chart_description WHERE chart_info_id = ? order by create_time desc, id desc`
- _, err = o.Raw(sql, chartInfoId).QueryRows(&item)
- return
- }
- type ChartDescriptionReq struct {
- Id int
- Description string // 图表id
- ChartInfoId int
- SysUserId int // 创建人id
- SysUserRealName string // 创建人姓名
- AdminName string // 创建人姓名
- ModifyTime time.Time // 变更时间
- CreateTime time.Time // 关系建立时间
- }
|