# This file is auto-generated by generate_models.py
# This file may be manually edited after generation
# The file has been formatted using isort and black

from typing import Any, ClassVar, Dict, List

from sqlalchemy import Column, PrimaryKeyConstraint, text

from tushare_models.core import Base, Date, DateTime, Float, Integer, String
from tushare_models.core.dialect_config import apply_table_dialect_options


class BoDaily(Base):
    """电影日度票房"""

    __tablename__: str = "bo_daily"
    __api_id__: ClassVar[int] = 115
    __api_name__: ClassVar[str] = "bo_daily"
    __api_title__: ClassVar[str] = "电影日度票房"
    __api_info_title__: ClassVar[str] = "电影日度票房"
    __api_path__: ClassVar[List[str]] = ["数据接口", "行业经济", "TMT行业"]
    __api_path_ids__: ClassVar[List[int]] = [1, 21, 22]
    __api_points_required__: ClassVar[int] = 0
    __api_special_permission__: ClassVar[bool] = False
    __has_vip__: ClassVar[bool] = False
    __dependencies__: ClassVar[List[str]] = []
    __primary_key__: ClassVar[List[str]] = ["date", "name"]
    __start_date__: ClassVar[str | None] = None
    __end_date__: ClassVar[str | None] = None
    __api_params__: ClassVar[Dict[str, Any]] = {
        "date": {"type": "String", "required": True, "description": "日期"},
        "limit": {"type": "Int64", "required": False, "description": "单次返回数据长度"},
        "offset": {"type": "Int64", "required": False, "description": "请求数据的开始位移量"},
    }

    __mapper_args__ = {"primary_key": __primary_key__}
    __table_args__ = (
        PrimaryKeyConstraint(*__primary_key__),
        {
            "comment": "电影日度票房",
            # MySQL引擎
            "mysql_engine": "InnoDB",
        },
    )

    date = Column("date", Date, nullable=False, comment="日期")
    name = Column("name", String(), nullable=False, comment="影片名称")
    avg_price = Column("avg_price", Float, nullable=True, comment="平均票价")
    day_amount = Column("day_amount", Float, nullable=True, comment="当日票房(万)")
    total = Column("total", Float, nullable=True, comment="累计票房(万)")
    list_day = Column("list_day", Integer, nullable=True, comment="上映天数")
    p_pc = Column("p_pc", Integer, nullable=True, comment="场均人次")
    wom_index = Column("wom_index", Float, nullable=True, comment="口碑指数")
    up_ratio = Column("up_ratio", Float, nullable=True, comment="环比变化 (%)")
    rank = Column("rank", Integer, nullable=True, comment="排名")

apply_table_dialect_options(BoDaily)
