|
@@ -21,8 +21,8 @@ func MultiInsertTradeGuangzhouDataToTop(exchange string, startDate, endDate stri
|
|
|
//WHERE
|
|
|
// a.data_time between ? and ?
|
|
|
// and c.base_from_trade_guangzhou_classify_id in (7,8)
|
|
|
- // and c.index_name like "%持买单量%"
|
|
|
- // and c.index_name not like "%日成交持仓排名%"`
|
|
|
+ // and c.index_name like '%持买单量%'
|
|
|
+ // and c.index_name not like '%日成交持仓排名%'`
|
|
|
// _, err = o.Raw(sql1, now, now, startDate, endDate).Exec()
|
|
|
// if err != nil {
|
|
|
// return
|
|
@@ -38,8 +38,8 @@ func MultiInsertTradeGuangzhouDataToTop(exchange string, startDate, endDate stri
|
|
|
//WHERE
|
|
|
// a.data_time between ? and ?
|
|
|
// and c.base_from_trade_guangzhou_classify_id in (7,8)
|
|
|
- // and c.index_name like "%持卖单量%"
|
|
|
- // and c.index_name not like "%日成交持仓排名%"`
|
|
|
+ // and c.index_name like '%持卖单量%'
|
|
|
+ // and c.index_name not like '%日成交持仓排名%'`
|
|
|
// _, err = o.Raw(sql2, now, now, startDate, endDate).Exec()
|
|
|
// if err != nil {
|
|
|
// return
|
|
@@ -52,8 +52,8 @@ func MultiInsertTradeGuangzhouDataToTop(exchange string, startDate, endDate stri
|
|
|
// deal_short_name,
|
|
|
// data_time,
|
|
|
// deal_type,
|
|
|
- // (@row_number := IF(@prev_year = CONCAT_WS( "_", data_time, deal_type, classify_type), @row_number + 1, 1) ) AS row_number,
|
|
|
- // @prev_year := CONCAT_WS( "_", data_time, deal_type, classify_type)
|
|
|
+ // (@row_number := IF(@prev_year = CONCAT_WS( '_', data_time, deal_type, classify_type), @row_number + 1, 1) ) AS row_number,
|
|
|
+ // @prev_year := CONCAT_WS( '_', data_time, deal_type, classify_type)
|
|
|
//FROM
|
|
|
// trade_position_guangzhou_top,(SELECT @row_number := 0, @prev_year := NULL) r
|
|
|
// where data_time between ? and ?
|
|
@@ -83,8 +83,8 @@ func MultiInsertTradeGuangzhouDataToTop(exchange string, startDate, endDate stri
|
|
|
WHERE
|
|
|
a.data_time between ? and ?
|
|
|
and c.base_from_trade_guangzhou_classify_id in (7,8)
|
|
|
- and c.index_name like "%持买单量%"
|
|
|
- and c.index_name not like "%日成交持仓排名%"`
|
|
|
+ and c.index_name like '%持买单量%'
|
|
|
+ and c.index_name not like '%日成交持仓排名%'`
|
|
|
err = global.DEFAULT_DmSQL.Exec(sql1, now, now, startDate, endDate).Error
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -100,8 +100,8 @@ func MultiInsertTradeGuangzhouDataToTop(exchange string, startDate, endDate stri
|
|
|
WHERE
|
|
|
a.data_time between ? and ?
|
|
|
and c.base_from_trade_guangzhou_classify_id in (7,8)
|
|
|
- and c.index_name like "%持卖单量%"
|
|
|
- and c.index_name not like "%日成交持仓排名%"`
|
|
|
+ and c.index_name like '%持卖单量%'
|
|
|
+ and c.index_name not like '%日成交持仓排名%'`
|
|
|
err = global.DEFAULT_DmSQL.Exec(sql2, now, now, startDate, endDate).Error
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -114,8 +114,8 @@ func MultiInsertTradeGuangzhouDataToTop(exchange string, startDate, endDate stri
|
|
|
deal_short_name,
|
|
|
data_time,
|
|
|
deal_type,
|
|
|
- (@row_number := IF(@prev_year = CONCAT_WS( "_", data_time, deal_type, classify_type), @row_number + 1, 1) ) AS row_number,
|
|
|
- @prev_year := CONCAT_WS( "_", data_time, deal_type, classify_type)
|
|
|
+ (@row_number := IF(@prev_year = CONCAT_WS( '_', data_time, deal_type, classify_type), @row_number + 1, 1) ) AS row_number,
|
|
|
+ @prev_year := CONCAT_WS( '_', data_time, deal_type, classify_type)
|
|
|
FROM
|
|
|
trade_position_guangzhou_top,(SELECT @row_number := 0, @prev_year := NULL) r
|
|
|
where data_time between ? and ?
|
|
@@ -143,8 +143,8 @@ func GetTradePositionTopOriginGuangzhouDataTimes(exchange string) (dates []strin
|
|
|
// LEFT JOIN base_from_trade_guangzhou_index c ON a.base_from_trade_guangzhou_index_id = c.base_from_trade_guangzhou_index_id
|
|
|
//WHERE
|
|
|
// c.base_from_trade_guangzhou_classify_id IN ( 7, 8 )
|
|
|
- // AND ( c.index_name LIKE "%持买单量%" OR c.index_name LIKE "%持卖单量%" )
|
|
|
- // AND c.index_name NOT LIKE "%日成交持仓排名%"
|
|
|
+ // AND ( c.index_name LIKE '%持买单量%' OR c.index_name LIKE '%持卖单量%' )
|
|
|
+ // AND c.index_name NOT LIKE '%日成交持仓排名%'
|
|
|
//ORDER BY
|
|
|
// a.data_time asc`
|
|
|
// _, err = o.Raw(sql).QueryRows(&dates)
|
|
@@ -156,8 +156,8 @@ func GetTradePositionTopOriginGuangzhouDataTimes(exchange string) (dates []strin
|
|
|
LEFT JOIN base_from_trade_guangzhou_index c ON a.base_from_trade_guangzhou_index_id = c.base_from_trade_guangzhou_index_id
|
|
|
WHERE
|
|
|
c.base_from_trade_guangzhou_classify_id IN ( 7, 8 )
|
|
|
- AND ( c.index_name LIKE "%持买单量%" OR c.index_name LIKE "%持卖单量%" )
|
|
|
- AND c.index_name NOT LIKE "%日成交持仓排名%"
|
|
|
+ AND ( c.index_name LIKE '%持买单量%' OR c.index_name LIKE '%持卖单量%' )
|
|
|
+ AND c.index_name NOT LIKE '%日成交持仓排名%'
|
|
|
ORDER BY
|
|
|
a.data_time asc`
|
|
|
err = global.DEFAULT_DmSQL.Raw(sql).Find(&dates).Error
|
|
@@ -175,8 +175,8 @@ func GetTradePositionOriginGuangzhouClassifyCountByExchangeDataTime(exchange str
|
|
|
//WHERE
|
|
|
// a.data_time between ? and ?
|
|
|
// AND c.base_from_trade_guangzhou_classify_id IN ( 7, 8 )
|
|
|
- // AND ( c.index_name LIKE "%持买单量%" OR c.index_name LIKE "%持卖单量%" )
|
|
|
- // AND c.index_name NOT LIKE "%日成交持仓排名%"
|
|
|
+ // AND ( c.index_name LIKE '%持买单量%' OR c.index_name LIKE '%持卖单量%' )
|
|
|
+ // AND c.index_name NOT LIKE '%日成交持仓排名%'
|
|
|
//ORDER BY
|
|
|
// a.value DESC`
|
|
|
// err = o.Raw(sql, startDate, endDate).QueryRow(&count)
|
|
@@ -190,8 +190,8 @@ func GetTradePositionOriginGuangzhouClassifyCountByExchangeDataTime(exchange str
|
|
|
WHERE
|
|
|
a.data_time between ? and ?
|
|
|
AND c.base_from_trade_guangzhou_classify_id IN ( 7, 8 )
|
|
|
- AND ( c.index_name LIKE "%持买单量%" OR c.index_name LIKE "%持卖单量%" )
|
|
|
- AND c.index_name NOT LIKE "%日成交持仓排名%"
|
|
|
+ AND ( c.index_name LIKE '%持买单量%' OR c.index_name LIKE '%持卖单量%' )
|
|
|
+ AND c.index_name NOT LIKE '%日成交持仓排名%'
|
|
|
ORDER BY
|
|
|
a.value DESC`
|
|
|
err = global.DEFAULT_DmSQL.Raw(sql, startDate, endDate).Scan(&count).Error
|
|
@@ -207,8 +207,8 @@ func GetFirstBaseFromTradeGuangzhouIndexByDate(exchange string) (item *GetFirstB
|
|
|
// LEFT JOIN base_from_trade_guangzhou_index c ON a.base_from_trade_guangzhou_index_id = c.base_from_trade_guangzhou_index_id
|
|
|
//WHERE
|
|
|
// c.base_from_trade_guangzhou_classify_id IN ( 7, 8 )
|
|
|
- // AND ( c.index_name LIKE "%持买单量%" OR c.index_name LIKE "%持卖单量%" )
|
|
|
- // AND c.index_name NOT LIKE "%日成交持仓排名%"
|
|
|
+ // AND ( c.index_name LIKE '%持买单量%' OR c.index_name LIKE '%持卖单量%' )
|
|
|
+ // AND c.index_name NOT LIKE '%日成交持仓排名%'
|
|
|
//ORDER BY
|
|
|
// a.data_time asc`
|
|
|
// err = o.Raw(sql).QueryRow(&item)
|
|
@@ -220,8 +220,8 @@ func GetFirstBaseFromTradeGuangzhouIndexByDate(exchange string) (item *GetFirstB
|
|
|
LEFT JOIN base_from_trade_guangzhou_index c ON a.base_from_trade_guangzhou_index_id = c.base_from_trade_guangzhou_index_id
|
|
|
WHERE
|
|
|
c.base_from_trade_guangzhou_classify_id IN ( 7, 8 )
|
|
|
- AND ( c.index_name LIKE "%持买单量%" OR c.index_name LIKE "%持卖单量%" )
|
|
|
- AND c.index_name NOT LIKE "%日成交持仓排名%"
|
|
|
+ AND ( c.index_name LIKE '%持买单量%' OR c.index_name LIKE '%持卖单量%' )
|
|
|
+ AND c.index_name NOT LIKE '%日成交持仓排名%'
|
|
|
ORDER BY
|
|
|
a.data_time asc`
|
|
|
err = global.DEFAULT_DmSQL.Raw(sql).First(&item).Error
|
|
@@ -254,8 +254,8 @@ func MultiInsertTradeBaseDataToTopGuangzhouByClassify(exchange string, startDate
|
|
|
// a.data_time between ? and ?
|
|
|
// and c.base_from_trade_guangzhou_classify_id in (7,8)
|
|
|
// and n.classify_code in (` + utils.GetOrmInReplace(len(classifyNames)) + `) and n.contract in (` + utils.GetOrmInReplace(len(classifyTypes)) + `)
|
|
|
- // and c.index_name like "%持买单量%"
|
|
|
- // and c.index_name not like "%日成交持仓排名%"`
|
|
|
+ // and c.index_name like '%持买单量%'
|
|
|
+ // and c.index_name not like '%日成交持仓排名%'`
|
|
|
// _, err = o.Raw(sql1, now, now, startDate, endDate, classifyNames, classifyTypes).Exec()
|
|
|
// if err != nil {
|
|
|
// return
|
|
@@ -272,8 +272,8 @@ func MultiInsertTradeBaseDataToTopGuangzhouByClassify(exchange string, startDate
|
|
|
// a.data_time between ? and ?
|
|
|
// and c.base_from_trade_guangzhou_classify_id in (7,8)
|
|
|
// and n.classify_code in (` + utils.GetOrmInReplace(len(classifyNames)) + `) and n.contract in (` + utils.GetOrmInReplace(len(classifyTypes)) + `)
|
|
|
- // and c.index_name like "%持卖单量%"
|
|
|
- // and c.index_name not like "%日成交持仓排名%"`
|
|
|
+ // and c.index_name like '%持卖单量%'
|
|
|
+ // and c.index_name not like '%日成交持仓排名%'`
|
|
|
// _, err = o.Raw(sql2, now, now, startDate, endDate, classifyNames, classifyTypes).Exec()
|
|
|
// if err != nil {
|
|
|
// return
|
|
@@ -286,8 +286,8 @@ func MultiInsertTradeBaseDataToTopGuangzhouByClassify(exchange string, startDate
|
|
|
// deal_short_name,
|
|
|
// data_time,
|
|
|
// deal_type,
|
|
|
- // (@row_number := IF(@prev_year = CONCAT_WS( "_", data_time, deal_type, classify_type), @row_number + 1, 1) ) AS row_number,
|
|
|
- // @prev_year := CONCAT_WS( "_", data_time, deal_type, classify_type)
|
|
|
+ // (@row_number := IF(@prev_year = CONCAT_WS( '_', data_time, deal_type, classify_type), @row_number + 1, 1) ) AS row_number,
|
|
|
+ // @prev_year := CONCAT_WS( '_', data_time, deal_type, classify_type)
|
|
|
//FROM
|
|
|
// trade_position_guangzhou_top,(SELECT @row_number := 0, @prev_year := NULL) r
|
|
|
// where data_time between ? and ? and classify_type in (` + utils.GetOrmInReplace(len(classifyTypes)) + `)
|
|
@@ -317,8 +317,8 @@ func MultiInsertTradeBaseDataToTopGuangzhouByClassify(exchange string, startDate
|
|
|
a.data_time between ? and ?
|
|
|
and c.base_from_trade_guangzhou_classify_id in (7,8)
|
|
|
and n.classify_code in (` + utils.GetOrmInReplace(len(classifyNames)) + `) and n.contract in (` + utils.GetOrmInReplace(len(classifyTypes)) + `)
|
|
|
- and c.index_name like "%持买单量%"
|
|
|
- and c.index_name not like "%日成交持仓排名%"`
|
|
|
+ and c.index_name like '%持买单量%'
|
|
|
+ and c.index_name not like '%日成交持仓排名%'`
|
|
|
err = global.DEFAULT_DmSQL.Exec(sql1, now, now, startDate, endDate, classifyNames, classifyTypes).Error
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -335,8 +335,8 @@ func MultiInsertTradeBaseDataToTopGuangzhouByClassify(exchange string, startDate
|
|
|
a.data_time between ? and ?
|
|
|
and c.base_from_trade_guangzhou_classify_id in (7,8)
|
|
|
and n.classify_code in (` + utils.GetOrmInReplace(len(classifyNames)) + `) and n.contract in (` + utils.GetOrmInReplace(len(classifyTypes)) + `)
|
|
|
- and c.index_name like "%持卖单量%"
|
|
|
- and c.index_name not like "%日成交持仓排名%"`
|
|
|
+ and c.index_name like '%持卖单量%'
|
|
|
+ and c.index_name not like '%日成交持仓排名%'`
|
|
|
err = global.DEFAULT_DmSQL.Exec(sql2, now, now, startDate, endDate, classifyNames, classifyTypes).Error
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -349,8 +349,8 @@ func MultiInsertTradeBaseDataToTopGuangzhouByClassify(exchange string, startDate
|
|
|
deal_short_name,
|
|
|
data_time,
|
|
|
deal_type,
|
|
|
- (@row_number := IF(@prev_year = CONCAT_WS( "_", data_time, deal_type, classify_type), @row_number + 1, 1) ) AS row_number,
|
|
|
- @prev_year := CONCAT_WS( "_", data_time, deal_type, classify_type)
|
|
|
+ (@row_number := IF(@prev_year = CONCAT_WS( '_', data_time, deal_type, classify_type), @row_number + 1, 1) ) AS row_number,
|
|
|
+ @prev_year := CONCAT_WS( '_', data_time, deal_type, classify_type)
|
|
|
FROM
|
|
|
trade_position_guangzhou_top,(SELECT @row_number := 0, @prev_year := NULL) r
|
|
|
where data_time between ? and ? and classify_type in (` + utils.GetOrmInReplace(len(classifyTypes)) + `)
|