Files
qsdk/schema/dataset_fina_indicator.go
2026-05-01 17:07:20 +08:00

227 lines
16 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package schema
import (
"strconv"
"gorm.io/gorm"
)
// DatasetStockFinaIndicator 财务指标模型
type DatasetStockFinaIndicator struct {
gorm.Model
TsCode string `gorm:"type:varchar(20);not null;index:fi_ts_code;uniqueIndex:un_fi_code_date;comment:TS代码"`
Period int `gorm:"index:idx_period;uniqueIndex:un_fi_code_date;comment:报告期数"`
AnnDate string `gorm:"index:idx_ann_date;comment:公告日期"`
EndDate string `gorm:"index:idx_end_date;comment:报告期"`
// 每股指标
Eps float64 `gorm:"type:decimal(20,4);comment:基本每股收益"`
DtEps float64 `gorm:"type:decimal(20,4);comment:稀释每股收益"`
TotalRevenuePs float64 `gorm:"type:decimal(20,4);comment:每股营业总收入"`
RevenuePs float64 `gorm:"type:decimal(20,4);comment:每股营业收入"`
CapitalResePs float64 `gorm:"type:decimal(20,4);comment:每股资本公积"`
SurplusResePs float64 `gorm:"type:decimal(20,4);comment:每股盈余公积"`
UndistProfitPs float64 `gorm:"type:decimal(20,4);comment:每股未分配利润"`
Diluted2Eps float64 `gorm:"type:decimal(20,4);comment:期末摊薄每股收益"`
Bps float64 `gorm:"type:decimal(20,4);comment:每股净资产"`
Ocfps float64 `gorm:"type:decimal(20,4);comment:每股经营活动产生的现金流量净额"`
Retainedps float64 `gorm:"type:decimal(20,4);comment:每股留存收益"`
Cfps float64 `gorm:"type:decimal(20,4);comment:每股现金流量净额"`
EbitPs float64 `gorm:"type:decimal(20,4);comment:每股息税前利润"`
FcffPs float64 `gorm:"type:decimal(20,4);comment:每股企业自由现金流量"`
FcfePs float64 `gorm:"type:decimal(20,4);comment:每股股东自由现金流量"`
// 利润表相关
ExtraItem float64 `gorm:"type:decimal(20,4);comment:非经常性损益"`
ProfitDedt float64 `gorm:"type:decimal(20,4);comment:扣除非经常性损益后的净利润"`
GrossMargin float64 `gorm:"type:decimal(20,4);comment:毛利"`
OpIncome float64 `gorm:"type:decimal(20,4);comment:经营活动净收益"`
ValuechangeIncome float64 `gorm:"type:decimal(20,4);comment:价值变动净收益"`
InterstIncome float64 `gorm:"type:decimal(20,4);comment:利息费用"`
Daa float64 `gorm:"type:decimal(20,4);comment:折旧与摊销"`
Ebit float64 `gorm:"type:decimal(20,4);comment:息税前利润"`
Ebitda float64 `gorm:"type:decimal(20,4);comment:息税折旧摊销前利润"`
Fcff float64 `gorm:"type:decimal(20,4);comment:企业自由现金流量"`
Fcfe float64 `gorm:"type:decimal(20,4);comment:股权自由现金流量"`
RdExp float64 `gorm:"type:decimal(20,4);comment:研发费用"`
FixedAssets float64 `gorm:"type:decimal(20,4);comment:固定资产合计"`
ProfitPrefinExp float64 `gorm:"type:decimal(20,4);comment:扣除财务费用前营业利润"`
NonOpProfit float64 `gorm:"type:decimal(20,4);comment:非营业利润"`
// 资产负债表相关
CurrentExint float64 `gorm:"type:decimal(20,4);comment:无息流动负债"`
NoncurrentExint float64 `gorm:"type:decimal(20,4);comment:无息非流动负债"`
Interestdebt float64 `gorm:"type:decimal(20,4);comment:带息债务"`
Netdebt float64 `gorm:"type:decimal(20,4);comment:净债务"`
TangibleAsset float64 `gorm:"type:decimal(20,4);comment:有形资产"`
WorkingCapital float64 `gorm:"type:decimal(20,4);comment:营运资金"`
NetworkingCapital float64 `gorm:"type:decimal(20,4);comment:营运流动资本"`
InvestCapital float64 `gorm:"type:decimal(20,4);comment:全部投入资本"`
RetainedEarnings float64 `gorm:"type:decimal(20,4);comment:留存收益"`
// 偿债能力指标
CurrentRatio float64 `gorm:"type:decimal(20,4);comment:流动比率"`
QuickRatio float64 `gorm:"type:decimal(20,4);comment:速动比率"`
CashRatio float64 `gorm:"type:decimal(20,4);comment:保守速动比率"`
DebtToAssets float64 `gorm:"type:decimal(20,4);comment:资产负债率"`
AssetsToEqt float64 `gorm:"type:decimal(20,4);comment:权益乘数"`
DpAssetsToEqt float64 `gorm:"type:decimal(20,4);comment:权益乘数(杜邦分析)"`
DebtToEqt float64 `gorm:"type:decimal(20,4);comment:产权比率"`
EqtToDebt float64 `gorm:"type:decimal(20,4);comment:归属于母公司的股东权益/负债合计"`
OcfToShortdebt float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额/流动负债"`
EbitToInterest float64 `gorm:"type:decimal(20,4);comment:已获利息倍数"`
// 运营能力指标
InvturnDays float64 `gorm:"type:decimal(20,4);comment:存货周转天数"`
ArturnDays float64 `gorm:"type:decimal(20,4);comment:应收账款周转天数"`
InvTurn float64 `gorm:"type:decimal(20,4);comment:存货周转率"`
ArTurn float64 `gorm:"type:decimal(20,4);comment:应收账款周转率"`
CaTurn float64 `gorm:"type:decimal(20,4);comment:流动资产周转率"`
FaTurn float64 `gorm:"type:decimal(20,4);comment:固定资产周转率"`
AssetsTurn float64 `gorm:"type:decimal(20,4);comment:总资产周转率"`
TurnDays float64 `gorm:"type:decimal(20,4);comment:营业周期"`
TotalFaTrun float64 `gorm:"type:decimal(20,4);comment:固定资产合计周转率"`
// 盈利能力指标
NetprofitMargin float64 `gorm:"type:decimal(20,4);comment:销售净利率"`
GrossprofitMargin float64 `gorm:"type:decimal(20,4);comment:销售毛利率"`
CogsOfSales float64 `gorm:"type:decimal(20,4);comment:销售成本率"`
ExpenseOfSales float64 `gorm:"type:decimal(20,4);comment:销售期间费用率"`
Roe float64 `gorm:"type:decimal(20,4);comment:净资产收益率"`
RoeWaa float64 `gorm:"type:decimal(20,4);comment:加权平均净资产收益率"`
RoeDt float64 `gorm:"type:decimal(20,4);comment:净资产收益率(扣除非经常损益)"`
Roa float64 `gorm:"type:decimal(20,4);comment:总资产报酬率"`
Npta float64 `gorm:"type:decimal(20,4);comment:总资产净利润"`
Roic float64 `gorm:"type:decimal(20,4);comment:投入资本回报率"`
RoaDp float64 `gorm:"type:decimal(20,4);comment:总资产净利率(杜邦分析)"`
// 结构指标
CaToAssets float64 `gorm:"type:decimal(20,4);comment:流动资产/总资产"`
NcaToAssets float64 `gorm:"type:decimal(20,4);comment:非流动资产/总资产"`
TbassetsToTotalassets float64 `gorm:"type:decimal(20,4);comment:有形资产/总资产"`
IntToTalcap float64 `gorm:"type:decimal(20,4);comment:带息债务/全部投入资本"`
EqtToTalcapital float64 `gorm:"type:decimal(20,4);comment:归属于母公司的股东权益/全部投入资本"`
CurrentdebtToDebt float64 `gorm:"type:decimal(20,4);comment:流动负债/负债合计"`
LongdebToDebt float64 `gorm:"type:decimal(20,4);comment:非流动负债/负债合计"`
TangibleassetToDebt float64 `gorm:"type:decimal(20,4);comment:有形资产/负债合计"`
// 单季度指标
QOpincome float64 `gorm:"type:decimal(20,4);comment:经营活动单季度净收益"`
QInvestincome float64 `gorm:"type:decimal(20,4);comment:价值变动单季度净收益"`
QDtprofit float64 `gorm:"type:decimal(20,4);comment:扣除非经常损益后的单季度净利润"`
QEps float64 `gorm:"type:decimal(20,4);comment:每股收益(单季度)"`
QNetprofitMargin float64 `gorm:"type:decimal(20,4);comment:销售净利率(单季度)"`
QGscaleprofitMargin float64 `gorm:"type:decimal(20,4);comment:销售毛利率(单季度)"`
QExpToSales float64 `gorm:"type:decimal(20,4);comment:销售期间费用率(单季度)"`
QRoe float64 `gorm:"type:decimal(20,4);comment:净资产收益率(单季度)"`
QDtRoe float64 `gorm:"type:decimal(20,4);comment:净资产单季度收益率(扣除非经常损益)"`
QNpta float64 `gorm:"type:decimal(20,4);comment:总资产净利润(单季度)"`
// 同比增长率
BasicEpsYoy float64 `gorm:"type:decimal(20,4);comment:基本每股收益同比增长率(%)"`
DtEpsYoy float64 `gorm:"type:decimal(20,4);comment:稀释每股收益同比增长率(%)"`
CfpsYoy float64 `gorm:"type:decimal(20,4);comment:每股经营活动产生的现金流量净额同比增长率(%)"`
OpYoy float64 `gorm:"type:decimal(20,4);comment:营业利润同比增长率(%)"`
EbtYoy float64 `gorm:"type:decimal(20,4);comment:利润总额同比增长率(%)"`
NetprofitYoy float64 `gorm:"type:decimal(20,4);comment:归属母公司股东的净利润同比增长率(%)"`
DtNetprofitYoy float64 `gorm:"type:decimal(20,4);comment:归属母公司股东的净利润-扣除非经常损益同比增长率(%)"`
OcfYoy float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额同比增长率(%)"`
RoeYoy float64 `gorm:"type:decimal(20,4);comment:净资产收益率(摊薄)同比增长率(%)"`
BpsYoy float64 `gorm:"type:decimal(20,4);comment:每股净资产相对年初增长率(%)"`
AssetsYoy float64 `gorm:"type:decimal(20,4);comment:资产总计相对年初增长率(%)"`
EqtYoy float64 `gorm:"type:decimal(20,4);comment:归属母公司的股东权益相对年初增长率(%)"`
TrYoy float64 `gorm:"type:decimal(20,4);comment:营业总收入同比增长率(%)"`
OrYoy float64 `gorm:"type:decimal(20,4);comment:营业收入同比增长率(%)"`
EquityYoy float64 `gorm:"type:decimal(20,4);comment:净资产同比增长率"`
// 其他比率指标
ProfitToGr float64 `gorm:"type:decimal(20,4);comment:净利润/营业总收入"`
SaleexpToGr float64 `gorm:"type:decimal(20,4);comment:销售费用/营业总收入"`
AdminexpOfGr float64 `gorm:"type:decimal(20,4);comment:管理费用/营业总收入"`
FinaexpOfGr float64 `gorm:"type:decimal(20,4);comment:财务费用/营业总收入"`
ImpaiTtm float64 `gorm:"type:decimal(20,4);comment:资产减值损失/营业总收入"`
GcOfGr float64 `gorm:"type:decimal(20,4);comment:营业总成本/营业总收入"`
OpOfGr float64 `gorm:"type:decimal(20,4);comment:营业利润/营业总收入"`
EbitOfGr float64 `gorm:"type:decimal(20,4);comment:息税前利润/营业总收入"`
OpincomeOfEbt float64 `gorm:"type:decimal(20,4);comment:经营活动净收益/利润总额"`
InvestincomeOfEbt float64 `gorm:"type:decimal(20,4);comment:价值变动净收益/利润总额"`
NOpProfitOfEbt float64 `gorm:"type:decimal(20,4);comment:营业外收支净额/利润总额"`
TaxToEbt float64 `gorm:"type:decimal(20,4);comment:所得税/利润总额"`
DtprofitToProfit float64 `gorm:"type:decimal(20,4);comment:扣除非经常损益后的净利润/净利润"`
SalescashToOr float64 `gorm:"type:decimal(20,4);comment:销售商品提供劳务收到的现金/营业收入"`
OcfToOr float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额/营业收入"`
OcfToOpincome float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额/经营活动净收益"`
CapitalizedToDa float64 `gorm:"type:decimal(20,4);comment:资本支出/折旧和摊销"`
OcfToDebt float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额/负债合计"`
OcfToInterestdebt float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额/带息债务"`
OcfToNetdebt float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额/净债务"`
LongdebtToWorkingcapital float64 `gorm:"type:decimal(20,4);comment:长期债务与营运资金比率"`
EbitdaToDebt float64 `gorm:"type:decimal(20,4);comment:息税折旧摊销前利润/负债合计"`
OpToEbt float64 `gorm:"type:decimal(20,4);comment:营业利润/利润总额"`
NopToEbt float64 `gorm:"type:decimal(20,4);comment:非营业利润/利润总额"`
OcfToProfit float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额/营业利润"`
CashToLiqdebt float64 `gorm:"type:decimal(20,4);comment:货币资金/流动负债"`
CashToLiqdebtWithinterest float64 `gorm:"type:decimal(20,4);comment:货币资金/带息流动负债"`
OpToLiqdebt float64 `gorm:"type:decimal(20,4);comment:营业利润/流动负债"`
OpToDebt float64 `gorm:"type:decimal(20,4);comment:营业利润/负债合计"`
ProfitToOp float64 `gorm:"type:decimal(20,4);comment:利润总额/营业收入"`
// 年度化指标
RoeYearly float64 `gorm:"type:decimal(20,4);comment:年化净资产收益率"`
Roa2Yearly float64 `gorm:"type:decimal(20,4);comment:年化总资产报酬率"`
RoaYearly float64 `gorm:"type:decimal(20,4);comment:年化总资产净利率"`
RoicYearly float64 `gorm:"type:decimal(20,4);comment:年化投入资本回报率"`
RoeAvg float64 `gorm:"type:decimal(20,4);comment:平均净资产收益率(增发条件)"`
// 单季度增长比率
QGrYoy float64 `gorm:"type:decimal(20,4);comment:营业总收入同比增长率(%)(单季度)"`
QGrQoq float64 `gorm:"type:decimal(20,4);comment:营业总收入环比增长率(%)(单季度)"`
QSalesYoy float64 `gorm:"type:decimal(20,4);comment:营业收入同比增长率(%)(单季度)"`
QSalesQoq float64 `gorm:"type:decimal(20,4);comment:营业收入环比增长率(%)(单季度)"`
QOpYoy float64 `gorm:"type:decimal(20,4);comment:营业利润同比增长率(%)(单季度)"`
QOpQoq float64 `gorm:"type:decimal(20,4);comment:营业利润环比增长率(%)(单季度)"`
QProfitYoy float64 `gorm:"type:decimal(20,4);comment:净利润同比增长率(%)(单季度)"`
QProfitQoq float64 `gorm:"type:decimal(20,4);comment:净利润环比增长率(%)(单季度)"`
QNetprofitYoy float64 `gorm:"type:decimal(20,4);comment:归属母公司股东的净利润同比增长率(%)(单季度)"`
QNetprofitQoq float64 `gorm:"type:decimal(20,4);comment:归属母公司股东的净利润环比增长率(%)(单季度)"`
// 单季度比率指标
QProfitToGr float64 `gorm:"type:decimal(20,4);comment:净利润/营业总收入(单季度)"`
QSaleexpToGr float64 `gorm:"type:decimal(20,4);comment:销售费用/营业总收入 (单季度)"`
QAdminexpToGr float64 `gorm:"type:decimal(20,4);comment:管理费用/营业总收入 (单季度)"`
QFinaexpToGr float64 `gorm:"type:decimal(20,4);comment:财务费用/营业总收入 (单季度)"`
QImpairToGrTtm float64 `gorm:"type:decimal(20,4);comment:资产减值损失/营业总收入(单季度)"`
QGcToGr float64 `gorm:"type:decimal(20,4);comment:营业总成本/营业总收入 (单季度)"`
QOpToGr float64 `gorm:"type:decimal(20,4);comment:营业利润/营业总收入(单季度)"`
QOpincomeToEbt float64 `gorm:"type:decimal(20,4);comment:经营活动净收益/利润总额(单季度)"`
QInvestincomeToEbt float64 `gorm:"type:decimal(20,4);comment:价值变动净收益/利润总额(单季度)"`
QDtprofitToProfit float64 `gorm:"type:decimal(20,4);comment:扣除非经常损益后的净利润/净利润(单季度)"`
QSalescashToOr float64 `gorm:"type:decimal(20,4);comment:销售商品提供劳务收到的现金/营业收入(单季度)"`
QOcfToSales float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额/营业收入(单季度)"`
QOcfToOr float64 `gorm:"type:decimal(20,4);comment:经营活动产生的现金流量净额/经营活动净收益(单季度)"`
// 其他
UpdateFlag string `gorm:"type:varchar(1);comment:更新标识"`
}
// TableName 设置表名
func (DatasetStockFinaIndicator) TableName() string {
return "dataset_fina_indicator"
}
// Key 与表 uniqueIndex un_fi_code_date 一致ts_code + period。
func (f *DatasetStockFinaIndicator) Key() string {
if f.TsCode == "" && f.Period == 0 {
return ""
}
return f.TsCode + "#" + strconv.Itoa(f.Period)
}
// RowLabel 便于日志/调试ts_code + 报告期 end_date + 公告 ann_date。
func (f *DatasetStockFinaIndicator) RowLabel() string {
if f.EndDate != "" || f.AnnDate != "" {
return f.TsCode + " end=" + f.EndDate + " ann=" + f.AnnDate
}
return f.Key()
}