|
@@ -151,17 +151,17 @@ type EdbInfoList struct {
|
|
|
EdbName string `gorm:"column:edb_name" description:"指标名称"`
|
|
|
EdbNameEn string `gorm:"column:edb_name_en" description:"英文指标名称"`
|
|
|
//EdbNameSource string `gorm:"column:edb_name_source" description:"指标名称来源"`
|
|
|
- Frequency string `gorm:"column:frequency" description:"频率"`
|
|
|
- Unit string `gorm:"column:unit" description:"单位"`
|
|
|
- UnitEn string `gorm:"column:unit_en" description:"英文单位"`
|
|
|
- StartDate string `gorm:"column:start_date" description:"起始日期"`
|
|
|
- EndDate string `gorm:"column:end_date" description:"终止日期"`
|
|
|
- ClassifyId int `gorm:"column:classify_id" description:"分类id"`
|
|
|
- SysUserId int `gorm:"column:sys_user_id" description:"系统用户ID"`
|
|
|
- SysUserRealName string `gorm:"column:sys_user_real_name" description:"系统用户真实姓名"`
|
|
|
- UniqueCode string `gorm:"column:unique_code" description:"指标唯一编码"`
|
|
|
- CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
|
|
|
- ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
|
|
|
+ Frequency string `gorm:"column:frequency" description:"频率"`
|
|
|
+ Unit string `gorm:"column:unit" description:"单位"`
|
|
|
+ UnitEn string `gorm:"column:unit_en" description:"英文单位"`
|
|
|
+ StartDate string `gorm:"column:start_date" description:"起始日期"`
|
|
|
+ EndDate string `gorm:"column:end_date" description:"终止日期"`
|
|
|
+ ClassifyId int `gorm:"column:classify_id" description:"分类id"`
|
|
|
+ SysUserId int `gorm:"column:sys_user_id" description:"系统用户ID"`
|
|
|
+ SysUserRealName string `gorm:"column:sys_user_real_name" description:"系统用户真实姓名"`
|
|
|
+ UniqueCode string `gorm:"column:unique_code" description:"指标唯一编码"`
|
|
|
+ CreateTime string `gorm:"column:create_time" description:"创建时间"`
|
|
|
+ ModifyTime string `gorm:"column:modify_time" description:"修改时间"`
|
|
|
//BaseModifyTime time.Time `gorm:"column:base_modify_time" description:"基础修改时间"`
|
|
|
//MinValue float64 `gorm:"column:min_value" description:"指标最小值"`
|
|
|
/*MaxValue float64 `gorm:"column:max_value" description:"指标最大值"`
|
|
@@ -197,6 +197,8 @@ type EdbInfoList struct {
|
|
|
// @Description: 格式化EdbInfoList的日期
|
|
|
// @receiver e
|
|
|
func (e *EdbInfoList) ConvertDate() {
|
|
|
+ e.CreateTime = utils.GormDateStrToDateTimeStr(e.CreateTime)
|
|
|
+ e.ModifyTime = utils.GormDateStrToDateTimeStr(e.ModifyTime)
|
|
|
e.StartDate = utils.GormDateStrToDateStr(e.StartDate)
|
|
|
e.EndDate = utils.GormDateStrToDateStr(e.EndDate)
|
|
|
e.LatestDate = utils.GormDateStrToDateStr(e.LatestDate)
|
|
@@ -216,9 +218,17 @@ type EdbClassifyItemsButton struct {
|
|
|
|
|
|
// GetEdbInfoByName 根据指标名称获取所有的指标数据列表
|
|
|
func GetEdbInfoByName(edbName string) (items []*EdbInfoList, err error) {
|
|
|
-
|
|
|
sql := ` SELECT * FROM edb_info WHERE edb_name=? `
|
|
|
err = global.DEFAULT_DmSQL.Raw(sql, edbName).Scan(&items).Error
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, edbInfoItem := range items {
|
|
|
+ // 时间转格式
|
|
|
+ edbInfoItem.ConvertDate()
|
|
|
+ }
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1428,7 +1438,6 @@ func ModifyCalculateEdbInfo(edbName, frequency, unit, calculateFormula string, c
|
|
|
}
|
|
|
|
|
|
func GetEdbInfoItemByCondition(condition string, pars []interface{}) (item *EdbInfoList, err error) {
|
|
|
-
|
|
|
sql := ` SELECT * FROM edb_info WHERE 1=1 `
|
|
|
if condition != "" {
|
|
|
sql += condition
|
|
@@ -1437,6 +1446,7 @@ func GetEdbInfoItemByCondition(condition string, pars []interface{}) (item *EdbI
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
item.ConvertDate()
|
|
|
|
|
|
return
|