|
@@ -4,6 +4,7 @@ import (
|
|
|
"eta/eta_api/global"
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
|
+ "gorm.io/gorm"
|
|
|
)
|
|
|
|
|
|
type BaseFromCoalmineMapping struct {
|
|
@@ -87,6 +88,20 @@ type BaseFromCoalmineIndex struct {
|
|
|
ModifyTime string `description:"修改时间"`
|
|
|
}
|
|
|
|
|
|
+func (m *BaseFromCoalmineIndex) AfterFind(db *gorm.DB) (err error) {
|
|
|
+ if utils.NeedDateOrTimeFormat(utils.DbDriverName) {
|
|
|
+ if m.CreateTime != "" {
|
|
|
+ m.CreateTime = utils.GormDateStrToDateTimeStr(m.CreateTime)
|
|
|
+ }
|
|
|
+ if m.ModifyTime != "" {
|
|
|
+ m.ModifyTime = utils.GormDateStrToDateTimeStr(m.ModifyTime)
|
|
|
+ }
|
|
|
+ if m.DataTime != "" {
|
|
|
+ m.DataTime = utils.GormDateStrToDateStr(m.DataTime)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
func GetBaseFromCoalIndexByCode(suffix, indexCode string) (items []*BaseFromCoalmineIndex, err error) {
|
|
|
o := global.DbMap[utils.DbNameIndex]
|
|
|
sql := `SELECT * FROM base_from_coalmine_%s WHERE index_code=? ORDER BY data_time DESC`
|