|
@@ -40,12 +40,12 @@ type BaseFromMysteelChemicalIndex struct {
|
|
|
}
|
|
|
|
|
|
type BaseFromMysteelChemicalIndexItem struct {
|
|
|
- BaseFromMysteelChemicalIndexId int64 `orm:"column(base_from_mysteel_chemical_index_id);pk" gorm:"primaryKey"`
|
|
|
+ BaseFromMysteelChemicalIndexId int64 `gorm:"column:base_from_mysteel_chemical_index_id);primaryKey"`
|
|
|
IndexCode string `description:"指标编码"`
|
|
|
IndexName string `description:"指标名称"`
|
|
|
Unit string `description:"单位"`
|
|
|
Frequency string `description:"频度"`
|
|
|
- Source int `description:"数据来源"`
|
|
|
+ Source string `description:"数据来源"`
|
|
|
StartDate string `description:"开始日期"`
|
|
|
EndDate string `description:"结束日期"`
|
|
|
CreateTime string `description:"创建时间"`
|
|
@@ -56,7 +56,13 @@ type BaseFromMysteelChemicalIndexItem struct {
|
|
|
IsStop int `description:"是否停更:1:停更,0:未停更"`
|
|
|
EdbExist int `description:"指标库是否已添加:0-否;1-是"`
|
|
|
}
|
|
|
-
|
|
|
+func (m *BaseFromMysteelChemicalIndexItem) AfterFind(tx * gorm.DB) (err error) {
|
|
|
+ m.StartDate=utils.GormDateStrToDateStr(m.StartDate)
|
|
|
+ m.EndDate =utils.GormDateStrToDateStr(m.EndDate)
|
|
|
+ m.CreateTime=utils.GormDateStrToDateTimeStr(m.CreateTime)
|
|
|
+ m.ModifyTime=utils.GormDateStrToDateTimeStr(m.ModifyTime)
|
|
|
+ return
|
|
|
+}
|
|
|
var BaseFromMysteelChemicalIndexCols = struct {
|
|
|
BaseFromMysteelChemicalIndexId string
|
|
|
IndexCode string
|
|
@@ -91,7 +97,8 @@ func (m *BaseFromMysteelChemicalIndex) GeItemsByCondition(condition string, pars
|
|
|
if pars == nil {
|
|
|
pars = make([]interface{}, 0)
|
|
|
}
|
|
|
- pars = append(pars, utils.DATA_SOURCE_MYSTEEL_CHEMICAL)
|
|
|
+ //pars = append(pars, utils.DATA_SOURCE_MYSTEEL_CHEMICAL)
|
|
|
+ pars=utils.ForwardPars(pars,utils.DATA_SOURCE_MYSTEEL_CHEMICAL)
|
|
|
sql := `select a.*,b.edb_info_id,b.unique_code as edb_unique_code,b.classify_id as edb_classify_id FROM base_from_mysteel_chemical_index AS a LEFT JOIN edb_info b on a.index_code=b.edb_code AND b.source=? WHERE 1=1 `
|
|
|
if condition != "" {
|
|
|
sql += condition
|