优化sql

This commit is contained in:
2026-05-07 14:32:48 +08:00
parent 373f7553cd
commit 844981a312
3 changed files with 166 additions and 1 deletions
@@ -87,6 +87,7 @@ type secondProfitListItem struct {
Market string `json:"market"`
Industry string `json:"industry"`
OpenPctChg *float64 `json:"open_pct_chg"`
NextOpenPctChg *float64 `json:"next_open_pct_chg"`
NextOpenProfitable string `json:"next_open_profitable"`
NextCloseProfitable string `json:"next_close_profitable"`
NextIntradayProfitable string `json:"next_intraday_profitable"`
@@ -398,7 +399,7 @@ ORDER BY c.trade_date ASC, l.ts_code ASC`
func secondProfitCSVHeaders() []string {
return []string{
"交易日", "股票代码", "股票简称", "市场", "行业",
"T日开盘涨跌幅%",
"T日开盘涨跌幅%", "T+1日开盘涨跌幅%",
"T+1开盘是否盈利", "T+1收盘是否盈利", "T+1盘中是否可盈利",
"T+1最高盈利%", "T+1最低盈利%", "开板次数", "换手率%",
"首次涨停时间", "封单额", "成交额",
@@ -413,6 +414,7 @@ func secondProfitCSVRecord(row secondProfitCSVRow) []string {
row.Market,
row.Industry,
secondProfitFormatNullFloat(row.OpenPctChg),
secondProfitFormatNullFloat(row.NextOpenReturnPct),
row.NextOpenProfitable,
row.NextCloseProfitable,
row.NextIntradayProfitable,
@@ -434,6 +436,7 @@ func secondProfitBuildItem(row secondProfitCSVRow) secondProfitListItem {
Market: row.Market,
Industry: row.Industry,
OpenPctChg: secondProfitNullFloatPtr(row.OpenPctChg),
NextOpenPctChg: secondProfitNullFloatPtr(row.NextOpenReturnPct),
NextOpenProfitable: row.NextOpenProfitable,
NextCloseProfitable: row.NextCloseProfitable,
NextIntradayProfitable: row.NextIntradayProfitable,