Files
Mutual_Fund/model/fund_nav_history.py
T

24 lines
953 B
Python

"""fund_nav_history 基金净值历史表 ORM 模型。"""
from __future__ import annotations
from datetime import date, datetime
from decimal import Decimal
from sqlalchemy import BigInteger, Date, DateTime, Numeric, func
from sqlalchemy.orm import Mapped, mapped_column
from model.base import Base
class FundNavHistory(Base):
__tablename__ = "fund_nav_history"
__table_args__ = {"comment": "基金净值历史(业绩指标/走势图数据源)"}
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
product_id: Mapped[int] = mapped_column(BigInteger)
nav_date: Mapped[date] = mapped_column(Date)
unit_nav: Mapped[Decimal] = mapped_column(Numeric(12, 6))
accumulated_nav: Mapped[Decimal | None] = mapped_column(Numeric(12, 6))
daily_growth: Mapped[Decimal | None] = mapped_column(Numeric(8, 4))
create_time: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())