소스 검색

批量修改

kobe6258 3 주 전
부모
커밋
5315c77ff7
41개의 변경된 파일214개의 추가작업 그리고 193개의 파일을 삭제
  1. 4 4
      models/data_manage/baiinfo_data.go
  2. 4 3
      models/data_manage/base_from_bloomberg_index.go
  3. 3 3
      models/data_manage/base_from_business_data.go
  4. 2 1
      models/data_manage/base_from_business_index.go
  5. 10 9
      models/data_manage/base_from_ccf.go
  6. 15 15
      models/data_manage/base_from_clarksons_index.go
  7. 14 14
      models/data_manage/base_from_eia_stero.go
  8. 7 7
      models/data_manage/base_from_fenwei.go
  9. 8 7
      models/data_manage/base_from_gpr_risk.go
  10. 9 8
      models/data_manage/base_from_hisugar.go
  11. 2 2
      models/data_manage/base_from_ly_index.go
  12. 14 14
      models/data_manage/base_from_mtjh.go
  13. 23 21
      models/data_manage/base_from_oilchem.go
  14. 2 2
      models/data_manage/base_from_rzd_data.go
  15. 4 4
      models/data_manage/base_from_rzd_index.go
  16. 2 2
      models/data_manage/base_from_trade_index.go
  17. 10 9
      models/data_manage/base_from_usda_fas.go
  18. 5 5
      models/data_manage/base_from_yongyi.go
  19. 1 1
      models/data_manage/chart_classify.go
  20. 1 1
      models/data_manage/chart_edb_mapping.go
  21. 4 3
      models/data_manage/chart_info.go
  22. 1 1
      models/data_manage/chart_info_future_good.go
  23. 1 1
      models/data_manage/edb_classify.go
  24. 1 1
      models/data_manage/edb_data_base.go
  25. 1 1
      models/data_manage/excel/excel_classify.go
  26. 1 1
      models/data_manage/excel/excel_info.go
  27. 1 1
      models/data_manage/future_good/request/future_good_chart.go
  28. 14 14
      models/data_manage/mysteel_chemical_index.go
  29. 4 4
      models/data_manage/sci_data.go
  30. 4 4
      models/data_manage/smm_data.go
  31. 5 4
      models/data_manage/trade_analysis/base_from_trade_exchange.go
  32. 5 5
      models/data_manage/trade_analysis/trade_analysis.go
  33. 4 3
      models/data_manage/trade_analysis/trade_analysis_table_column.go
  34. 2 2
      models/data_manage/trade_analysis/trade_classify.go
  35. 5 4
      models/data_manage/trade_analysis/trade_futures_company.go
  36. 5 4
      models/data_manage/trade_analysis/warehouse_process_classify.go
  37. 4 2
      models/english_report_email.go
  38. 2 1
      models/english_report_email_log.go
  39. 6 3
      models/english_report_email_pv.go
  40. 2 1
      models/report.go
  41. 2 1
      models/system/sys_role_admin.go

+ 4 - 4
models/data_manage/baiinfo_data.go

@@ -48,13 +48,13 @@ type BaiinfoIndex struct {
 	ModifyTime             string
 }
 
-func GetBaiinfoIndex(condition string, pars interface{}) (items []*BaiinfoIndex, err error) {
+func GetBaiinfoIndex(condition string, pars []interface{}) (items []*BaiinfoIndex, err error) {
 	sql := ` SELECT * FROM base_from_baiinfo_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += `ORDER BY sort ASC, base_from_baiinfo_index_id asc`
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -107,8 +107,8 @@ type BaiinfoIndexList struct {
 	StartTime              string
 	FinishTime             string
 	ModifyTime             string
-	DataList               []*BaiinfoIndexData
-	Paging                 *paging.PagingItem `description:"分页数据"`
+	DataList               []*BaiinfoIndexData `gorm:"-"`
+	Paging                 *paging.PagingItem  `description:"分页数据" gorm:"-"`
 }
 
 type BaiinfoIndexData struct {

+ 4 - 3
models/data_manage/base_from_bloomberg_index.go

@@ -119,7 +119,7 @@ func (m *BaseFromBloombergIndex) GetItemByCondition(condition string, pars []int
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).First(&item).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).First(&item).Error
 	return
 }
 
@@ -148,7 +148,7 @@ func (m *BaseFromBloombergIndex) GetItemsByCondition(condition string, pars []in
 	if limit > 0 {
 		sql += fmt.Sprintf(` LIMIT %d`, limit)
 	}
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -162,7 +162,8 @@ func (m *BaseFromBloombergIndex) GetPageItemsByCondition(condition string, pars
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 3 - 3
models/data_manage/base_from_business_data.go

@@ -77,7 +77,7 @@ func (m *BaseFromBusinessData) GetAllDataList(condition string, pars []interface
 		sql += ` ORDER BY ` + order
 	}
 
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&result).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&result).Error
 
 	return
 }
@@ -103,7 +103,7 @@ func (m *BaseFromBusinessData) GetLimitDataList(condition string, pars []interfa
 
 	sql += fmt.Sprintf(` LIMIT %d`, size)
 
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&result).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&result).Error
 	return
 }
 
@@ -129,7 +129,7 @@ func (m *BaseFromBusinessData) GetPageDataList(condition []string, pars []interf
 	}
 
 	sql += fmt.Sprintf(` LIMIT %d,%d`, startSize, size)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&result).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&result).Error
 
 	return
 }

+ 2 - 1
models/data_manage/base_from_business_index.go

@@ -136,7 +136,8 @@ func (m *BaseFromBusinessIndex) GetList(condition string, pars []interface{}, st
 		sql += condition
 	}
 	sql += ` order by a.base_from_business_index_id desc limit ?,? `
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 
 	return
 }

+ 10 - 9
models/data_manage/base_from_ccf.go

@@ -34,9 +34,9 @@ type BaseFromCCFIndexList struct {
 	ModifyTime         string
 	EndDate            string
 	EndValue           string
-	EdbExist           int `description:"指标库是否已添加:0-否;1-是"`
-	DataList           []*BaseFromCCFData
-	Paging             *paging.PagingItem `description:"分页数据"`
+	EdbExist           int                `description:"指标库是否已添加:0-否;1-是"`
+	DataList           []*BaseFromCCFData `gorm:"-"`
+	Paging             *paging.PagingItem `description:"分页数据" gorm:"-"`
 }
 
 type CCFSingleDataResp struct {
@@ -56,13 +56,13 @@ type CCFSingleData struct {
 	DataTime string `orm:"column(data_time)" description:"值"`
 }
 
-func GetCCFIndex(condition string, pars interface{}) (items []*BaseFromCCFIndexList, err error) {
+func GetCCFIndex(condition string, pars []interface{}) (items []*BaseFromCCFIndexList, err error) {
 	sql := ` SELECT * FROM base_from_ccf_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` ORDER BY sort ASC, base_from_ccf_index_id asc`
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -162,22 +162,23 @@ func GetBaseFromCCFIndexByIndexCode(indexCode string) (list *BaseFromCCFIndex, e
 	return
 }
 
-func GetCCFIndexPage(condition string, pars interface{}, startSize, pageSize int) (items []*BaseFromCCFIndexList, err error) {
+func GetCCFIndexPage(condition string, pars []interface{}, startSize, pageSize int) (items []*BaseFromCCFIndexList, err error) {
 	sql := ` SELECT * FROM base_from_ccf_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` ORDER BY sort ASC, base_from_ccf_index_id asc LIMIT ?,?`
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
-func GetCCFIndexPageCount(condition string, pars interface{}) (count int, err error) {
+func GetCCFIndexPageCount(condition string, pars []interface{}) (count int, err error) {
 	sql := ` SELECT COUNT(1) AS count  FROM base_from_ccf_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Scan(&count).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Scan(&count).Error
 	return
 }
 

+ 15 - 15
models/data_manage/base_from_clarksons_index.go

@@ -40,17 +40,17 @@ type BaseFromClarksonsIndexView struct {
 }
 
 type BaseFromClarksonsIndexList struct {
-	BaseFromClarksonsIndexId int    `orm:"pk"`
-	IndexCode                string // 指标编码
-	IndexName                string // 指标名称
-	ClassifyId               int    // 分类Id
-	Unit                     string // 单位
-	Frequency                string // 频度
-	Describe                 string // 指标描述
-	CreateTime               string // 创建时间
-	ModifyTime               string // 修改时间
-	DataList                 []*BaseFromClarksonsData
-	Paging                   *paging.PagingItem `description:"分页数据"`
+	BaseFromClarksonsIndexId int                      `orm:"pk"`
+	IndexCode                string                   // 指标编码
+	IndexName                string                   // 指标名称
+	ClassifyId               int                      // 分类Id
+	Unit                     string                   // 单位
+	Frequency                string                   // 频度
+	Describe                 string                   // 指标描述
+	CreateTime               string                   // 创建时间
+	ModifyTime               string                   // 修改时间
+	DataList                 []*BaseFromClarksonsData `gorm:"-"`
+	Paging                   *paging.PagingItem       `description:"分页数据" gorm:"-"`
 }
 
 func (b *BaseFromClarksonsIndex) Update(cols []string) (err error) {
@@ -66,7 +66,7 @@ func GetClarksonsIndexByCondition(condition string, pars []interface{}) (items [
 		sql += condition
 	}
 	sql += ` ORDER BY sort ASC, base_from_clarksons_index_id ASC`
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -414,18 +414,18 @@ func GetClarksonsIndexInfoPage(condition string, pars []interface{}) (items []*B
 	if condition != "" {
 		sql += condition
 	}
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 
 }
 
-func GetClarksonsIndex(condition string, pars interface{}) (items []*BaseFromClarksonsIndexView, err error) {
+func GetClarksonsIndex(condition string, pars []interface{}) (items []*BaseFromClarksonsIndexView, err error) {
 	sql := ` SELECT * FROM base_from_clarksons_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += `ORDER BY base_from_clarksons_index_id ASC `
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 14 - 14
models/data_manage/base_from_eia_stero.go

@@ -106,19 +106,19 @@ func GetChildEiaSteoClassifyById(classifyId int) (items []*BaseFromEiaSteoClassi
 }
 
 type EiaSteoIndexListResp struct {
-	BaseFromEiaSteoIndexId    int                `orm:"column(base_from_eia_steo_index_id);pk"`
-	BaseFromEiaSteoClassifyId int                `description:"指标分类id"`
-	IndexCode                 string             `description:"指标编码"`
-	IndexName                 string             `description:"指标名称(中文名称)"`
-	EdbInfoId                 int                `description:"指标库id"`
-	Unit                      string             `description:"单位"`
-	Frequency                 string             `description:"频度"`
-	StartDate                 string             `description:"开始日期"`
-	EndDate                   string             `description:"结束日期"`
-	ModifyTime                string             `description:"最新更新时间"`
-	CreateTime                string             `description:"创建时间"`
-	Paging                    *paging.PagingItem `description:"分页数据"`
-	DataList                  []*BaseFromEiaSteoDataItem
+	BaseFromEiaSteoIndexId    int                        `orm:"column(base_from_eia_steo_index_id);pk"`
+	BaseFromEiaSteoClassifyId int                        `description:"指标分类id"`
+	IndexCode                 string                     `description:"指标编码"`
+	IndexName                 string                     `description:"指标名称(中文名称)"`
+	EdbInfoId                 int                        `description:"指标库id"`
+	Unit                      string                     `description:"单位"`
+	Frequency                 string                     `description:"频度"`
+	StartDate                 string                     `description:"开始日期"`
+	EndDate                   string                     `description:"结束日期"`
+	ModifyTime                string                     `description:"最新更新时间"`
+	CreateTime                string                     `description:"创建时间"`
+	Paging                    *paging.PagingItem         `description:"分页数据" gorm:"-"`
+	DataList                  []*BaseFromEiaSteoDataItem `gorm:"-"`
 }
 
 // GetEiaSteoIndexList 获取指标列表
@@ -126,7 +126,7 @@ func GetEiaSteoIndexList(condition string, pars []interface{}) (items []*BaseFro
 	sql := ` SELECT *  FROM base_from_eia_steo_index WHERE 1=1  `
 	sql += condition
 	sql += ` ORDER BY base_from_eia_steo_index_id ASC `
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 7 - 7
models/data_manage/base_from_fenwei.go

@@ -29,9 +29,9 @@ type BaseFromFenweiIndexList struct {
 	Sort          int
 	CreateTime    string
 	ModifyTime    string
-	DataList      []*BaseFromFenweiData
-	Paging        *paging.PagingItem `description:"分页数据"`
-	EdbInfoId     int                `description:"指标库主键id"`
+	DataList      []*BaseFromFenweiData `gorm:"-"`
+	Paging        *paging.PagingItem    `description:"分页数据" gorm:"-"`
+	EdbInfoId     int                   `description:"指标库主键id"`
 }
 
 type FenweiSingleDataResp struct {
@@ -91,13 +91,13 @@ type BaseFromFenWeiIndexPage struct {
 	Paging *paging.PagingItem     `description:"分页数据"`
 }
 
-func GetFenweiIndex(condition string, pars interface{}) (items []*BaseFromFenweiIndexList, err error) {
+func GetFenweiIndex(condition string, pars []interface{}) (items []*BaseFromFenweiIndexList, err error) {
 	sql := ` SELECT * FROM base_from_fenwei_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` ORDER BY sort ASC, fenwei_index_id asc`
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -254,7 +254,7 @@ func GetFenWeiIndexInfoPage(condition string, pars []interface{}) (items []*Base
 		sql += condition
 	}
 	sql += ` ORDER BY fenwei_index_id asc`
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 
 }
@@ -265,7 +265,7 @@ func GetFenWeiIndexInfoCount(condition string, pars []interface{}) (count int, e
 	if condition != "" {
 		sql += condition
 	}
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Scan(&count).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Scan(&count).Error
 	return
 }
 

+ 8 - 7
models/data_manage/base_from_gpr_risk.go

@@ -60,9 +60,9 @@ type GprRiskSingleDataResp struct {
 	StartTime              string
 	CreateTime             string
 	ModifyTime             string
-	EdbExist               int `description:"指标库是否已添加:0-否;1-是"`
-	Data                   []*GprRiskSingleData
-	Paging                 *paging.PagingItem `description:"分页数据"`
+	EdbExist               int                  `description:"指标库是否已添加:0-否;1-是"`
+	Data                   []*GprRiskSingleData `gorm:"-"`
+	Paging                 *paging.PagingItem   `description:"分页数据" gorm:"-"`
 }
 
 type GprRiskSingleData struct {
@@ -86,22 +86,23 @@ func GetGprRiskIndex(condition string, pars []interface{}) (items []*BaseFromGpr
 	return
 }
 
-func GetGprRiskIndexPage(condition string, pars interface{}, startSize, pageSize int) (items []*BaseFromGprRiskIndexList, err error) {
+func GetGprRiskIndexPage(condition string, pars []interface{}, startSize, pageSize int) (items []*BaseFromGprRiskIndexList, err error) {
 	sql := ` SELECT * FROM base_from_gpr_risk_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` ORDER BY sort ASC, base_from_gpr_risk_index_id asc LIMIT ?,?`
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
-func GetGprRiskIndexPageCount(condition string, pars interface{}) (count int, err error) {
+func GetGprRiskIndexPageCount(condition string, pars []interface{}) (count int, err error) {
 	sql := ` SELECT COUNT(1) AS count  FROM base_from_gpr_risk_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Scan(&count).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Scan(&count).Error
 	return
 }
 

+ 9 - 8
models/data_manage/base_from_hisugar.go

@@ -101,27 +101,27 @@ func GetHisugarIndexList(condition string, pars interface{}, startSize, pageSize
 	return
 }
 
-func GetHisugarIndexListCount(condition string, pars interface{}) (count int, err error) {
+func GetHisugarIndexListCount(condition string, pars []interface{}) (count int, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT COUNT(1) AS count FROM base_from_hisugar_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
-	err = o.Raw(sql, pars).Scan(&count).Error
+	err = o.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
-func GetHisugarDataListCount(condition string, pars interface{}) (count int, err error) {
+func GetHisugarDataListCount(condition string, pars []interface{}) (count int, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT COUNT(1) AS count FROM base_from_hisugar_data WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
-	err = o.Raw(sql, pars).Scan(&count).Error
+	err = o.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
-func GetHisugarIndexData(condition string, pars interface{}, startSize, pageSize int) (items []*BaseFromHisugarData, err error) {
+func GetHisugarIndexData(condition string, pars []interface{}, startSize, pageSize int) (items []*BaseFromHisugarData, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_hisugar_data WHERE 1=1  `
 	if condition != "" {
@@ -129,7 +129,8 @@ func GetHisugarIndexData(condition string, pars interface{}, startSize, pageSize
 	}
 
 	sql += ` order by data_time DESC LIMIT ?,? `
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -355,14 +356,14 @@ func GetHisugarClassifyAll() (items []*BaseFromHisugarClassifyItem, err error) {
 	return
 }
 
-func GetHisugarIndex(condition string, pars interface{}) (items []*BaseFromHisugarIndexList, err error) {
+func GetHisugarIndex(condition string, pars []interface{}) (items []*BaseFromHisugarIndexList, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_hisugar_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` ORDER BY sort ASC, base_from_hisugar_index_id asc`
-	err = o.Raw(sql, pars).Find(&items).Error
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 2 - 2
models/data_manage/base_from_ly_index.go

@@ -160,14 +160,14 @@ func UpdateLyIndexEdbExist(indexCode string, isExist int) (err error) {
 }
 
 // GetLyIndexList 根据传入条件查询指标列表
-func GetLyIndexList(condition string, pars interface{}) (items []*BaseFromLyIndex, err error) {
+func GetLyIndexList(condition string, pars []interface{}) (items []*BaseFromLyIndex, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_ly_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += `ORDER BY base_from_ly_index_id ASC `
-	err = o.Raw(sql, pars).Find(&items).Error
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 14 - 14
models/data_manage/base_from_mtjh.go

@@ -121,30 +121,30 @@ type BaseFromMtjhMappingItem struct {
 	Frequency             string `description:"频率"`
 }
 
-func GetMtjhMapping(condition string, pars interface{}) (items []*BaseFromMtjhMappingItem, err error) {
+func GetMtjhMapping(condition string, pars []interface{}) (items []*BaseFromMtjhMappingItem, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_mtjh_mapping WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` ORDER BY base_from_mtjh_mapping_id asc`
-	err = o.Raw(sql, pars).Find(&items).Error
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 
 type BaseFromMtjhIndexList struct {
-	BaseFromMtjhMappingId int    `orm:"column(base_from_mtjh_mapping_id);pk" gorm:"primaryKey"`
-	IndexName             string `description:"持买单量指标名称"`
-	IndexCode             string `description:"持买单量指标编码"`
-	Area                  string `description:"区域"`
-	Port                  string `description:"港口或码头"`
-	Unit                  string `description:"单位"`
-	Frequency             string `description:"频率"`
-	CreateTime            string `description:"插入时间"`
-	ModifyTime            string `description:"修改时间"`
-	Variety               string `description:"品种"`
-	DataList              []*BaseFromMtjhIndexItem
-	Paging                *paging.PagingItem `description:"分页数据"`
+	BaseFromMtjhMappingId int                      `orm:"column(base_from_mtjh_mapping_id);pk" gorm:"primaryKey"`
+	IndexName             string                   `description:"持买单量指标名称"`
+	IndexCode             string                   `description:"持买单量指标编码"`
+	Area                  string                   `description:"区域"`
+	Port                  string                   `description:"港口或码头"`
+	Unit                  string                   `description:"单位"`
+	Frequency             string                   `description:"频率"`
+	CreateTime            string                   `description:"插入时间"`
+	ModifyTime            string                   `description:"修改时间"`
+	Variety               string                   `description:"品种"`
+	DataList              []*BaseFromMtjhIndexItem `gorm:"-"`
+	Paging                *paging.PagingItem       `description:"分页数据" gorm:"-"`
 }
 
 func GetMtjhIndexDataCount(indexCode string) (count int, err error) {

+ 23 - 21
models/data_manage/base_from_oilchem.go

@@ -75,19 +75,19 @@ func GetOilchemClassifyList() (list []*BaseFromOilchemClassify, err error) {
 }
 
 type BaseFromOilchemIndexList struct {
-	BaseFromOilchemIndexId int    // 主键ID
-	IndexCode              string // 指标编码
-	IndexName              string // 指标名称
-	ClassifyId             int    // 分类ID
-	Unit                   string // 单位
-	Frequency              string // 频度
-	Describe               string // 指标描述
-	Sort                   int    // 排序
-	CreateTime             string // 创建时间
-	ModifyTime             string // 修改时间
-	EdbExist               int    `description:"edb是否存在"`
-	DataList               []*BaseFromOilchemData
-	Paging                 *paging.PagingItem `description:"分页数据"`
+	BaseFromOilchemIndexId int                    // 主键ID
+	IndexCode              string                 // 指标编码
+	IndexName              string                 // 指标名称
+	ClassifyId             int                    // 分类ID
+	Unit                   string                 // 单位
+	Frequency              string                 // 频度
+	Describe               string                 // 指标描述
+	Sort                   int                    // 排序
+	CreateTime             string                 // 创建时间
+	ModifyTime             string                 // 修改时间
+	EdbExist               int                    `description:"edb是否存在"`
+	DataList               []*BaseFromOilchemData `gorm:"-"`
+	Paging                 *paging.PagingItem     `description:"分页数据" gorm:"-"`
 }
 
 type BaseFromOilchemIndexListResp struct {
@@ -113,7 +113,7 @@ LEFT JOIN edb_info AS e ON a.index_code=e.edb_code AND e.source=89
 	return
 }
 
-func GetOilchemIndexList(condition string, pars interface{}, startSize, pageSize int) (items []*BaseFromOilchemIndex, err error) {
+func GetOilchemIndexList(condition string, pars []interface{}, startSize, pageSize int) (items []*BaseFromOilchemIndex, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_oilchem_index WHERE 1=1  `
 	if condition != "" {
@@ -121,31 +121,32 @@ func GetOilchemIndexList(condition string, pars interface{}, startSize, pageSize
 	}
 
 	sql += `group BY index_code ASC order by create_time DESC LIMIT ?,? `
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 
-func GetOilchemIndexListCount(condition string, pars interface{}) (count int, err error) {
+func GetOilchemIndexListCount(condition string, pars []interface{}) (count int, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT COUNT(1) AS count FROM base_from_oilchem_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
-	err = o.Raw(sql, pars).Scan(&count).Error
+	err = o.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
-func GetOilchemDataListCount(condition string, pars interface{}) (count int, err error) {
+func GetOilchemDataListCount(condition string, pars []interface{}) (count int, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT COUNT(1) AS count FROM base_from_oilchem_data WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
-	err = o.Raw(sql, pars).Scan(&count).Error
+	err = o.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
-func GetOilchemIndexData(condition string, pars interface{}, startSize, pageSize int) (items []*BaseFromOilchemData, err error) {
+func GetOilchemIndexData(condition string, pars []interface{}, startSize, pageSize int) (items []*BaseFromOilchemData, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_oilchem_data WHERE 1=1  `
 	if condition != "" {
@@ -153,7 +154,8 @@ func GetOilchemIndexData(condition string, pars interface{}, startSize, pageSize
 	}
 
 	sql += ` order by data_time DESC LIMIT ?,? `
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 2 - 2
models/data_manage/base_from_rzd_data.go

@@ -63,13 +63,13 @@ func GetBaseFormRzdDataByIndexCode(indexCode string) (items []*BaseFromRzdData,
 	return
 }
 
-func GetBaseFormRzdDataByConditionCount(condition string, pars interface{}) (count int, err error) {
+func GetBaseFormRzdDataByConditionCount(condition string, pars []interface{}) (count int, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT count(1) FROM base_from_rzd_data WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
-	err = o.Raw(sql, pars).Scan(&count).Error
+	err = o.Raw(sql, pars...).Scan(&count).Error
 	if err != nil {
 		return 0, err
 	}

+ 4 - 4
models/data_manage/base_from_rzd_index.go

@@ -109,23 +109,23 @@ func GetRzdIndex(condition string, pars []interface{}) (items []*BaseFromRzdInde
 	return
 }
 
-func GetRzdIndexNotExistEdbInfoCount(condition string, pars interface{}) (count int, err error) {
+func GetRzdIndexNotExistEdbInfoCount(condition string, pars []interface{}) (count int, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT count(1) FROM base_from_rzd_index WHERE index_code not in (select edb_code from edb_info) `
 	if condition != "" {
 		sql += condition
 	}
-	err = o.Raw(sql, pars).Scan(&count).Error
+	err = o.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
-func GetRzdIndexNotExistEdbInfoPage(condition string, pars interface{}) (items []*BaseFromRzdIndexAndData, err error) {
+func GetRzdIndexNotExistEdbInfoPage(condition string, pars []interface{}) (items []*BaseFromRzdIndexAndData, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_rzd_index WHERE index_code not in (select edb_code from edb_info) `
 	if condition != "" {
 		sql += condition
 	}
-	err = o.Raw(sql, pars).Find(&items).Error
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 2 - 2
models/data_manage/base_from_trade_index.go

@@ -349,8 +349,8 @@ type CoalmineDataPageResp struct {
 	Unit       string // 来源
 	Frequency  string
 	ModifyTime string
-	Paging     *paging.PagingItem `description:"分页数据"`
-	DataList   []DataList
+	Paging     *paging.PagingItem `description:"分页数据" gorm:"-"`
+	DataList   []DataList         `gorm:"-"`
 }
 
 type CoalmineSingalDataResp struct {

+ 10 - 9
models/data_manage/base_from_usda_fas.go

@@ -40,9 +40,9 @@ type BaseFromUsdaFasIndexList struct {
 	Sort                   int
 	CreateTime             string
 	ModifyTime             string
-	EdbExist               int `description:"指标库是否已添加:0-否;1-是"`
-	DataList               []*BaseFromUsdaFasData
-	Paging                 *paging.PagingItem `description:"分页数据"`
+	EdbExist               int                    `description:"指标库是否已添加:0-否;1-是"`
+	DataList               []*BaseFromUsdaFasData `gorm:"-"`
+	Paging                 *paging.PagingItem     `description:"分页数据" gorm:"-"`
 }
 type BaseFromUsdaFasIndexSearchList struct {
 	List   []*BaseFromUsdaFasIndexList
@@ -75,35 +75,36 @@ func GetUsdaFasIndexByClassifyId(classifyId int) (items []*BaseFromUsdaFasIndex,
 	return
 }
 
-func GetUsdaFasIndex(condition string, pars interface{}) (items []*BaseFromUsdaFasIndexList, err error) {
+func GetUsdaFasIndex(condition string, pars []interface{}) (items []*BaseFromUsdaFasIndexList, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_usda_fas_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` ORDER BY sort ASC, base_from_usda_fas_index_id asc`
-	err = o.Raw(sql, pars).Find(&items).Error
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 
-func GetUsdaFasIndexPage(condition string, pars interface{}, startSize, pageSize int) (items []*BaseFromUsdaFasIndexList, err error) {
+func GetUsdaFasIndexPage(condition string, pars []interface{}, startSize, pageSize int) (items []*BaseFromUsdaFasIndexList, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_usda_fas_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` ORDER BY sort ASC, base_from_usda_fas_index_id asc LIMIT ?,?`
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&items).Error 
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 
-func GetUsdaFasIndexPageCount(condition string, pars interface{}) (count int, err error) {
+func GetUsdaFasIndexPageCount(condition string, pars []interface{}) (count int, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT COUNT(1) AS count  FROM base_from_usda_fas_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
-	err = o.Raw(sql, pars).Scan(&count).Error
+	err = o.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 

+ 5 - 5
models/data_manage/base_from_yongyi.go

@@ -34,9 +34,9 @@ type BaseFromYongyiIndexList struct {
 	Sort          int
 	CreateTime    string
 	ModifyTime    string
-	EdbExist      int `description:"指标库是否已添加:0-否;1-是"`
-	DataList      []*BaseFromYongyiData
-	Paging        *paging.PagingItem `description:"分页数据"`
+	EdbExist      int                   `description:"指标库是否已添加:0-否;1-是"`
+	DataList      []*BaseFromYongyiData `gorm:"-"`
+	Paging        *paging.PagingItem    `description:"分页数据" gorm:"-"`
 }
 
 type YongyiSingleDataResp struct {
@@ -66,14 +66,14 @@ func GetYongyiIndexByClassifyId(classifyId int) (items []*BaseFromYongyiIndex, e
 	return
 }
 
-func GetYongyiIndex(condition string, pars interface{}) (items []*BaseFromYongyiIndexList, err error) {
+func GetYongyiIndex(condition string, pars []interface{}) (items []*BaseFromYongyiIndexList, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_yongyi_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` ORDER BY sort ASC, yongyi_index_id asc`
-	err = o.Raw(sql, pars).Find(&items).Error
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 1 - 1
models/data_manage/chart_classify.go

@@ -502,7 +502,7 @@ func GetChartClassifyIdListByAdminId(adminId, source int) (chartClassifyIdList [
 
 	pars := []interface{}{adminId, source}
 	sql += ` group by chart_classify_id `
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&chartClassifyIdList).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&chartClassifyIdList).Error
 
 	return
 }

+ 1 - 1
models/data_manage/chart_edb_mapping.go

@@ -361,6 +361,6 @@ func GetRelationEdbInfoListMappingByCondition(condition string, pars []interface
 	if condition != "" {
 		sql += condition
 	}
-	err = o.Raw(sql, pars).Find(&item).Error
+	err = o.Raw(sql, pars...).Find(&item).Error
 	return
 }

+ 4 - 3
models/data_manage/chart_info.go

@@ -745,8 +745,8 @@ type ChartEdbInfoMapping struct {
 
 type QuarterData struct {
 	Year                 int
-	DataList             []*EdbDataList
-	CuttingDataTimestamp int64 `description:"切割的时间戳"`
+	DataList             []*EdbDataList `gorm:"-"`
+	CuttingDataTimestamp int64          `description:"切割的时间戳"`
 	ChartLegend          string
 	Years                string
 }
@@ -2078,7 +2078,8 @@ func GetChartInfoListByCondition(condition string, pars []interface{}, startSize
 		sql += condition
 	}
 	sql += ` ORDER BY chart_info_id DESC LIMIT ?,? `
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 1 - 1
models/data_manage/chart_info_future_good.go

@@ -8,7 +8,7 @@ type FutureGoodProfitChartInfoReq struct {
 	DateList                []FutureGoodProfitChartInfoDateReq `description:"日期配置"`
 	ProfitNameEn            string                             `description:"利润英文名称"`
 	EdbInfoIdList           []int                              `description:"现货指标ID列表"`
-	XDataList               []XData                            `description:"横轴配置"`
+	XDataList               []XData                            `description:"横轴配置" gorm:"-"`
 }
 
 // FutureGoodProfitChartInfoDateReq 图表的日期数据(日期相关)

+ 1 - 1
models/data_manage/edb_classify.go

@@ -644,7 +644,7 @@ func UpdateEdbClassifyChildByParentClassifyId(classifyIds []int, rootId int, lev
 	sql := `update edb_classify 
 SET root_id = ?, level = level+?
 where classify_id IN (` + utils.GetOrmInReplace(len(classifyIds)) + `)`
-	//_, err = o.Raw(sql, pars).Exec()
+	//_, err = o.Raw(sql, pars...).Exec()
 	err = global.DbMap[utils.DbNameIndex].Exec(sql, pars...).Error
 	if err != nil {
 		return

+ 1 - 1
models/data_manage/edb_data_base.go

@@ -258,7 +258,7 @@ func GetEdbDataAllByEdbCodeByMysql(edbCode string, source, subSource, limit int)
 		pars = append(pars, limit)
 	}
 	sql = fmt.Sprintf(sql, tableName)
-	//_, err = o.Raw(sql, pars).QueryRows(&items)
+	//_, err = o.Raw(sql, pars...).QueryRows(&items)
 	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }

+ 1 - 1
models/data_manage/excel/excel_classify.go

@@ -138,7 +138,7 @@ func GetNextExcelClassifyByCondition(condition string, pars []interface{}) (item
 		sql += condition
 	}
 	sql += " ORDER BY sort asc , create_time ASC LIMIT 1 "
-	err = o.Raw(sql, pars).QueryRow(&item)
+	err = o.Raw(sql, pars...).QueryRow(&item)
 	return
 }
 

+ 1 - 1
models/data_manage/excel/excel_info.go

@@ -799,6 +799,6 @@ func (m *ExcelInfo) Create() (err error) {
 func (m *ExcelInfo) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
 	o := orm.NewOrmUsingDB("data")
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM excel_info WHERE 1=1 %s`, condition)
-	err = o.Raw(sql, pars).QueryRow(&count)
+	err = o.Raw(sql, pars...).QueryRow(&count)
 	return
 }

+ 1 - 1
models/data_manage/future_good/request/future_good_chart.go

@@ -59,7 +59,7 @@ type ChartInfoReq struct {
 	DateList                []ChartInfoDateReq           `description:"日期配置"`
 	ProfitNameEn            string                       `description:"利润英文名称"`
 	EdbInfoIdList           []int                        `description:"现货指标ID列表"`
-	XDataList               []data_manage.XData          `description:"横轴配置"`
+	XDataList               []data_manage.XData          `description:"横轴配置" gorm:"-"`
 }
 
 // ChartInfoDateReq 图表的日期数据(日期相关)

+ 14 - 14
models/data_manage/mysteel_chemical_index.go

@@ -180,20 +180,20 @@ func GetMysteelChemicalFrequency(condition string, pars []interface{}) (items []
 
 // MysteelChemicalList 钢联化工指标列表
 type MysteelChemicalList struct {
-	Id                                int                `orm:"column(base_from_mysteel_chemical_index_id)"`
-	BaseFromMysteelChemicalClassifyId int                `orm:"column(base_from_mysteel_chemical_classify_id)" description:"钢联化工指标分类id"`
-	ParentClassifyId                  int                `description:"钢联化工指标父级分类id"`
-	IndexCode                         string             `description:"指标编码"`
-	IndexName                         string             `description:"指标名称"`
-	UnitName                          string             `orm:"column(unit)"`
-	UniqueCode                        string             `description:"唯一编码"`
-	FrequencyName                     string             `orm:"column(frequency)"`
-	EdbInfoId                         int                `description:"指标库的id"`
-	UpdateTime                        string             `orm:"column(modify_time)"`
-	IsStop                            int                `description:"是否停更:1:停更,0:未停更"`
-	IsSupplierStop                    int                `description:"是否供应商停更:1:停更,0:未停更"`
-	Paging                            *paging.PagingItem `description:"分页数据"`
-	DataList                          []*MysteelChemicalData
+	Id                                int                    `orm:"column(base_from_mysteel_chemical_index_id)"`
+	BaseFromMysteelChemicalClassifyId int                    `orm:"column(base_from_mysteel_chemical_classify_id)" description:"钢联化工指标分类id"`
+	ParentClassifyId                  int                    `description:"钢联化工指标父级分类id"`
+	IndexCode                         string                 `description:"指标编码"`
+	IndexName                         string                 `description:"指标名称"`
+	UnitName                          string                 `orm:"column(unit)"`
+	UniqueCode                        string                 `description:"唯一编码"`
+	FrequencyName                     string                 `orm:"column(frequency)"`
+	EdbInfoId                         int                    `description:"指标库的id"`
+	UpdateTime                        string                 `orm:"column(modify_time)"`
+	IsStop                            int                    `description:"是否停更:1:停更,0:未停更"`
+	IsSupplierStop                    int                    `description:"是否供应商停更:1:停更,0:未停更"`
+	Paging                            *paging.PagingItem     `description:"分页数据" gorm:"-"`
+	DataList                          []*MysteelChemicalData `gorm:"-"`
 }
 
 // MysteelChemicalData 钢联化工数据列表

+ 4 - 4
models/data_manage/sci_data.go

@@ -49,14 +49,14 @@ type SciIndex struct {
 	ModifyTime         string
 }
 
-func GetSciIndex(condition string, pars interface{}) (items []*SciIndex, err error) {
+func GetSciIndex(condition string, pars []interface{}) (items []*SciIndex, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_sci_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += `ORDER BY sort ASC, base_from_sci_index_id asc`
-	err = o.Raw(sql, pars).Find(&items).Error
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -112,8 +112,8 @@ type SciIndexList struct {
 	StartTime          string
 	FinishTime         string
 	ModifyTime         string
-	DataList           []*SciIndexData
-	Paging             *paging.PagingItem `description:"分页数据"`
+	DataList           []*SciIndexData    `gorm:"-"`
+	Paging             *paging.PagingItem `description:"分页数据" gorm:"-"`
 }
 
 type SciIndexData struct {

+ 4 - 4
models/data_manage/smm_data.go

@@ -75,14 +75,14 @@ type SmmIndexItem struct {
 	EndValue           float64 `description:"指标的最新值"`
 }
 
-func GetSmmIndex(condition string, pars interface{}) (items []*SmmIndex, err error) {
+func GetSmmIndex(condition string, pars []interface{}) (items []*SmmIndex, err error) {
 	o := global.DbMap[utils.DbNameIndex]
 	sql := ` SELECT * FROM base_from_smm_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
 	sql += `ORDER BY sort ASC, base_from_smm_index_id asc`
-	err = o.Raw(sql, pars).Find(&items).Error
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -153,8 +153,8 @@ type SmmIndexList struct {
 	StartTime          string
 	FinishTime         string
 	ModifyTime         string
-	DataList           []*SmmIndexData
-	Paging             *paging.PagingItem `description:"分页数据"`
+	DataList           []*SmmIndexData    `gorm:"-"`
+	Paging             *paging.PagingItem `description:"分页数据" gorm:"-"`
 }
 
 type SmmIndexData struct {

+ 5 - 4
models/data_manage/trade_analysis/base_from_trade_exchange.go

@@ -61,14 +61,14 @@ func (m *BaseFromTradeExchange) GetItemByCondition(condition string, pars []inte
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).First(&item).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).First(&item).Error
 	return
 }
 
 func (m *BaseFromTradeExchange) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
 	var totalNull sql.NullInt64
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Scan(&totalNull).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Scan(&totalNull).Error
 	if !totalNull.Valid {
 		count = 0
 	} else {
@@ -87,7 +87,7 @@ func (m *BaseFromTradeExchange) GetItemsByCondition(condition string, pars []int
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -101,7 +101,8 @@ func (m *BaseFromTradeExchange) GetPageItemsByCondition(condition string, pars [
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 5 - 5
models/data_manage/trade_analysis/trade_analysis.go

@@ -278,7 +278,7 @@ func GetTradeDataByContracts(exchange string, classifyNames, contracts []string,
 	fields := []string{"rank", "buy_short_name", "buy_value", "buy_change", "sold_short_name", "sold_value", "sold_change", "classify_name", "classify_type", "data_time"}
 	tableName := fmt.Sprintf("base_from_trade_%s_index", exchange)
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s ORDER BY data_time DESC`, strings.Join(fields, ","), tableName, cond)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -297,7 +297,7 @@ func GetZhengzhouTradeDataByContracts(classifyNames []string, startDate, endDate
 	// ps.classify_name实为合约代码
 	fields := []string{"rank", "buy_short_name", "buy_value", "buy_change", "sold_short_name", "sold_value", "sold_change", "classify_name AS classify_type", "data_time"}
 	sql := fmt.Sprintf(`SELECT %s FROM base_from_trade_zhengzhou_index WHERE 1=1 %s ORDER BY data_time DESC`, strings.Join(fields, ","), cond)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -362,7 +362,7 @@ func GetBaseFromTradeGuangzhouIndex(classifyIds []int, contracts []string, index
 		JOIN base_from_trade_guangzhou_contract AS b ON a.base_from_trade_guangzhou_contract_id = b.base_from_trade_guangzhou_contract_id
 		WHERE 1=1 %s`
 	sql = fmt.Sprintf(sql, cond)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&list).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&list).Error
 	return
 }
 
@@ -396,7 +396,7 @@ func GetBaseFromTradeGuangzhouDataByIndexIds(indexIds []int, startDate, endDate
 		}
 	}
 	sql := fmt.Sprintf(`SELECT * FROM base_from_trade_guangzhou_data WHERE 1=1 %s ORDER BY base_from_trade_guangzhou_index_id`, cond)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&list).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&list).Error
 	return
 }
 
@@ -491,6 +491,6 @@ func GetGuangzhouClassifyNewestDataTime(indexIds []int) (dateTime time.Time, err
 	pars := make([]interface{}, 0)
 	pars = append(pars, indexIds)
 	sql := fmt.Sprintf(`SELECT data_time FROM base_from_trade_guangzhou_data WHERE 1=1 %s ORDER BY data_time DESC LIMIT 1`, cond)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&dateTime).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&dateTime).Error
 	return
 }

+ 4 - 3
models/data_manage/trade_analysis/trade_analysis_table_column.go

@@ -112,7 +112,7 @@ func (m *TradeAnalysisTableColumn) GetItemByCondition(condition string, pars []i
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&item).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&item).Error
 	return
 }
 
@@ -138,7 +138,7 @@ func (m *TradeAnalysisTableColumn) GetItemsByCondition(condition string, pars []
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -152,7 +152,8 @@ func (m *TradeAnalysisTableColumn) GetPageItemsByCondition(condition string, par
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 2 - 2
models/data_manage/trade_analysis/trade_classify.go

@@ -88,7 +88,7 @@ func (m *BaseFromTradeClassify) GetItemsByCondition(condition string, pars []int
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -103,7 +103,7 @@ func (m *BaseFromTradeClassify) GetClassifyItemsByCondition(condition string, pa
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s GROUP BY %s %s`, fields, m.TableName(), condition, m.Cols().ClassifyName, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 5 - 4
models/data_manage/trade_analysis/trade_futures_company.go

@@ -72,14 +72,14 @@ func (m *TradeFuturesCompany) GetItemByCondition(condition string, pars []interf
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).First(&item).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).First(&item).Error
 	return
 }
 
 func (m *TradeFuturesCompany) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
 	var totalNull sql.NullInt64
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Scan(&count).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Scan(&count).Error
 	if !totalNull.Valid {
 		count = 0
 	} else {
@@ -98,7 +98,7 @@ func (m *TradeFuturesCompany) GetItemsByCondition(condition string, pars []inter
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -112,7 +112,8 @@ func (m *TradeFuturesCompany) GetPageItemsByCondition(condition string, pars []i
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 5 - 4
models/data_manage/trade_analysis/warehouse_process_classify.go

@@ -122,14 +122,14 @@ func (m *WareHouseProcessClassify) GetItemByCondition(condition string, pars []i
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).First(&item).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).First(&item).Error
 	return
 }
 
 func (m *WareHouseProcessClassify) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
 	var totalNull sql.NullInt64
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Scan(&count).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Scan(&count).Error
 	if !totalNull.Valid {
 		count = 0
 	} else {
@@ -148,7 +148,7 @@ func (m *WareHouseProcessClassify) GetItemsByCondition(condition string, pars []
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -162,7 +162,8 @@ func (m *WareHouseProcessClassify) GetPageItemsByCondition(condition string, par
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 4 - 2
models/english_report_email.go

@@ -134,7 +134,8 @@ WHERE a.is_deleted = 0 `
 		total = int(totalNull.Int64)
 	}
 	sql += ` LIMIT ?,?`
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&list).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&list).Error
 	return
 }
 
@@ -218,7 +219,8 @@ func GetEnglishCompanyViewPageList(condition string, pars []interface{}, order s
 		total = int(totalNull.Int64)
 	}
 	sql += ` LIMIT ?,?`
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&list).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&list).Error
 	return
 }
 

+ 2 - 1
models/english_report_email_log.go

@@ -103,7 +103,8 @@ func GetEnglishReportEmailLogPageList(condition string, pars []interface{}, orde
 		total = int(totalNull.Int64)
 	}
 	sql += ` LIMIT ?,?`
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&list).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&list).Error
 	return
 }
 

+ 6 - 3
models/english_report_email_pv.go

@@ -78,7 +78,8 @@ func GetEnglishReportEmailPvPageList(condition string, pars []interface{}, start
 		total = int(totalNull.Int64)
 	}
 	sql += ` ORDER BY recent_click_time DESC LIMIT ?,?`
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&list).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&list).Error
 	return
 }
 
@@ -108,7 +109,8 @@ func GetEnglishReportEmailUvPageList(condition string, pars []interface{}, start
 		total = int(totalNull.Int64)
 	}
 	sql += ` ORDER BY recent_click_time DESC LIMIT ?,?`
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&list).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&list).Error
 	return
 }
 
@@ -158,6 +160,7 @@ func GetEnglishEmailViewPageList(condition string, pars []interface{}, orderRule
 		sql += orderRule
 	}
 	sql += ` LIMIT ?,?`
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&list).Error
+	pars = append(pars, startSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&list).Error
 	return
 }

+ 2 - 1
models/report.go

@@ -202,7 +202,8 @@ func GetReportListV1(condition string, pars []interface{}, startSize, pageSize i
 	}
 	// 排序:1:未发布;2:已发布;3-待提交;4-待审批;5-已驳回;6-已通过
 	sql += ` ORDER BY FIELD(state,3,1,4,5,6,2), modify_time DESC LIMIT ?,?`
-	err = o.Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, (startSize-1)*pageSize, pageSize)
+	err = o.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 2 - 1
models/system/sys_role_admin.go

@@ -74,7 +74,8 @@ where 1=1`
 		sql += condition
 	}
 	sql += ` ORDER BY s.id DESC limit ?, ?`
-	err = global.DbMap[utils.DbNameMaster].Raw(sql, pars, startSize, pageSize).Find(&list).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DbMap[utils.DbNameMaster].Raw(sql, pars...).Find(&list).Error
 	return
 }