# 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 clickhouse_sqlalchemy import engines
from sqlalchemy import Column, PrimaryKeyConstraint, text

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


class CnPmi(Base):
    """采购经理指数(PMI)"""

    __tablename__: str = "cn_pmi"
    __api_id__: ClassVar[int] = 325
    __api_name__: ClassVar[str] = "cn_pmi"
    __api_title__: ClassVar[str] = "采购经理指数(PMI)"
    __api_info_title__: ClassVar[str] = "采购经理人指数"
    __api_path__: ClassVar[List[str]] = ["数据接口", "宏观经济", "国内宏观", "景气度", "采购经理指数（PMI）"]
    __api_path_ids__: ClassVar[List[int]] = [2, 147, 224, 324, 325]
    __api_points_required__: ClassVar[int] = 2000
    __api_special_permission__: ClassVar[bool] = False
    __has_vip__: ClassVar[bool] = False
    __dependencies__: ClassVar[List[str]] = []
    __primary_key__: ClassVar[List[str]] = ["month"]
    __start_date__: ClassVar[str | None] = None
    __end_date__: ClassVar[str | None] = None
    __api_params__: ClassVar[Dict[str, Any]] = {
        "m": {"type": "str", "required": False, "description": "月度（202401表示，2024年1月）"},
        "start_m": {"type": "str", "required": False, "description": "开始月度"},
        "end_m": {"type": "str", "required": False, "description": "结束月度"},
        "limit": {"type": "int", "required": False, "description": "单次返回数据长度"},
        "offset": {"type": "int", "required": False, "description": "请求数据的开始位移量"},
    }

    __mapper_args__ = {"primary_key": __primary_key__}
    __table_args__ = (
        PrimaryKeyConstraint(*__primary_key__),
        # ClickHouse引擎
        engines.ReplacingMergeTree(order_by=__primary_key__),
        {
            "comment": "采购经理指数(PMI)",
            # MySQL引擎
            "mysql_engine": "InnoDB",
            # StarRocks引擎
            "starrocks_primary_key": ",".join(__primary_key__),
            "starrocks_order_by": ",".join(__primary_key__),
            # Apache Doris引擎
            "doris_unique_key": __primary_key__,
            # Databend引擎
            "databend_cluster_by": __primary_key__,
        },
    )

    month = Column("month", String(), nullable=False, default="", server_default=text("''"), comment="月份YYYYMM")
    pmi010000 = Column(
        "pmi010000", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="制造业PMI"
    )
    pmi010100 = Column(
        "pmi010100",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:企业规模/大型企业",
    )
    pmi010200 = Column(
        "pmi010200",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:企业规模/中型企业",
    )
    pmi010300 = Column(
        "pmi010300",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:企业规模/小型企业",
    )
    pmi010400 = Column(
        "pmi010400",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/生产指数",
    )
    pmi010401 = Column(
        "pmi010401",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/生产指数:企业规模/大型企业",
    )
    pmi010402 = Column(
        "pmi010402",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/生产指数:企业规模/中型企业",
    )
    pmi010403 = Column(
        "pmi010403",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/生产指数:企业规模/小型企业",
    )
    pmi010500 = Column(
        "pmi010500",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/新订单指数",
    )
    pmi010501 = Column(
        "pmi010501",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/新订单指数:企业规模/大型企业",
    )
    pmi010502 = Column(
        "pmi010502",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/新订单指数:企业规模/中型企业",
    )
    pmi010503 = Column(
        "pmi010503",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/新订单指数:企业规模/小型企业",
    )
    pmi010600 = Column(
        "pmi010600",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/供应商配送时间指数",
    )
    pmi010601 = Column(
        "pmi010601",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/供应商配送时间指数:企业规模/大型企业",
    )
    pmi010602 = Column(
        "pmi010602",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/供应商配送时间指数:企业规模/中型企业",
    )
    pmi010603 = Column(
        "pmi010603",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/供应商配送时间指数:企业规模/小型企业",
    )
    pmi010700 = Column(
        "pmi010700",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/原材料库存指数",
    )
    pmi010701 = Column(
        "pmi010701",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/原材料库存指数:企业规模/大型企业",
    )
    pmi010702 = Column(
        "pmi010702",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/原材料库存指数:企业规模/中型企业",
    )
    pmi010703 = Column(
        "pmi010703",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/原材料库存指数:企业规模/小型企业",
    )
    pmi010800 = Column(
        "pmi010800",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/从业人员指数",
    )
    pmi010801 = Column(
        "pmi010801",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/从业人员指数:企业规模/大型企业",
    )
    pmi010802 = Column(
        "pmi010802",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/从业人员指数:企业规模/中型企业",
    )
    pmi010803 = Column(
        "pmi010803",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:构成指数/从业人员指数:企业规模/小型企业",
    )
    pmi010900 = Column(
        "pmi010900",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:其他/新出口订单",
    )
    pmi011000 = Column(
        "pmi011000", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="制造业PMI:其他/进口"
    )
    pmi011100 = Column(
        "pmi011100", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="制造业PMI:其他/采购量"
    )
    pmi011200 = Column(
        "pmi011200",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:其他/主要原材料购进价格",
    )
    pmi011300 = Column(
        "pmi011300", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="制造业PMI:其他/出厂价格"
    )
    pmi011400 = Column(
        "pmi011400",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:其他/产成品库存",
    )
    pmi011500 = Column(
        "pmi011500", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="制造业PMI:其他/在手订单"
    )
    pmi011600 = Column(
        "pmi011600",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:其他/生产经营活动预期",
    )
    pmi011700 = Column(
        "pmi011700",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:分行业/装备制造业",
    )
    pmi011800 = Column(
        "pmi011800",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:分行业/高技术制造业",
    )
    pmi011900 = Column(
        "pmi011900",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:分行业/基础原材料制造业",
    )
    pmi012000 = Column(
        "pmi012000",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="制造业PMI:分行业/消费品制造业",
    )
    pmi020100 = Column(
        "pmi020100", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="非制造业PMI:商务活动"
    )
    pmi020101 = Column(
        "pmi020101",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:商务活动:分行业/建筑业",
    )
    pmi020102 = Column(
        "pmi020102",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:商务活动:分行业/服务业业",
    )
    pmi020200 = Column(
        "pmi020200", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="非制造业PMI:新订单指数"
    )
    pmi020201 = Column(
        "pmi020201",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:新订单指数:分行业/建筑业",
    )
    pmi020202 = Column(
        "pmi020202",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:新订单指数:分行业/服务业",
    )
    pmi020300 = Column(
        "pmi020300",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:投入品价格指数",
    )
    pmi020301 = Column(
        "pmi020301",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:投入品价格指数:分行业/建筑业",
    )
    pmi020302 = Column(
        "pmi020302",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:投入品价格指数:分行业/服务业",
    )
    pmi020400 = Column(
        "pmi020400",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:销售价格指数",
    )
    pmi020401 = Column(
        "pmi020401",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:销售价格指数:分行业/建筑业",
    )
    pmi020402 = Column(
        "pmi020402",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:销售价格指数:分行业/服务业",
    )
    pmi020500 = Column(
        "pmi020500",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:从业人员指数",
    )
    pmi020501 = Column(
        "pmi020501",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:从业人员指数:分行业/建筑业",
    )
    pmi020502 = Column(
        "pmi020502",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:从业人员指数:分行业/服务业",
    )
    pmi020600 = Column(
        "pmi020600",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:业务活动预期指数",
    )
    pmi020601 = Column(
        "pmi020601",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:业务活动预期指数:分行业/建筑业",
    )
    pmi020602 = Column(
        "pmi020602",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:业务活动预期指数:分行业/服务业",
    )
    pmi020700 = Column(
        "pmi020700", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="非制造业PMI:新出口订单"
    )
    pmi020800 = Column(
        "pmi020800", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="非制造业PMI:在手订单"
    )
    pmi020900 = Column(
        "pmi020900", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="非制造业PMI:存货"
    )
    pmi021000 = Column(
        "pmi021000",
        Float,
        nullable=False,
        default=0.0,
        server_default=text("'0.0'"),
        comment="非制造业PMI:供应商配送时间",
    )
    pmi030000 = Column(
        "pmi030000", Float, nullable=False, default=0.0, server_default=text("'0.0'"), comment="中国综合PMI:产出指数"
    )
