|
@@ -0,0 +1,45 @@
|
|
|
+package excel
|
|
|
+
|
|
|
+import (
|
|
|
+ "github.com/beego/beego/v2/client/orm"
|
|
|
+ "time"
|
|
|
+)
|
|
|
+
|
|
|
+type ReferencedExcelConfig struct {
|
|
|
+ ReferencedExcelConfigId int `orm:"column(referenced_excel_config_id);pk;auto" `
|
|
|
+ UniqueCode string
|
|
|
+ ReferencedID int
|
|
|
+ FromScene int
|
|
|
+ Uuid string
|
|
|
+ WidthList string
|
|
|
+ HeightList string
|
|
|
+ OpUserID int
|
|
|
+ OpUserName string
|
|
|
+ CreateTime time.Time
|
|
|
+ Content string
|
|
|
+ ModifyTime time.Time
|
|
|
+}
|
|
|
+
|
|
|
+type ExcelReferencesReq struct {
|
|
|
+ UniqueCode string `description:"表格唯一编码"`
|
|
|
+ ReferencedId int `description:"被引用的ID"`
|
|
|
+ FromScene int `description:"引用类型 1智能研报 2研报列表 3英文研报 4PPT 5英文PPT"`
|
|
|
+ Uuid string `description:"引用唯一标识"`
|
|
|
+ WidthList string `description:"宽度数组"`
|
|
|
+ HeightList string `description:"高度数组"`
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func AddReferencedExcelConfig(items []*ReferencedExcelConfig) (err error) {
|
|
|
+ o := orm.NewOrmUsingDB("data")
|
|
|
+ _, err = o.InsertMulti(len(items), items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func GetReferencedExcelConfigByUniqueCode(uniqueCode string) (item ReferencedExcelConfig, err error) {
|
|
|
+ o := orm.NewOrmUsingDB("data")
|
|
|
+ sql := ` SELECT * FROM referenced_excel_config WHERE referenced_excel_unique_code = ? `
|
|
|
+ err = o.Raw(sql, uniqueCode).QueryRow(&item)
|
|
|
+ return
|
|
|
+}
|