tamp_product_models.py 102 KB
Newer Older
赵杰's avatar
赵杰 committed
1 2
# coding: utf-8
from sqlalchemy import Column, DECIMAL, Date, DateTime, String, TIMESTAMP, Text, text
3
from sqlalchemy import Column, DECIMAL, Date, DateTime, ForeignKeyConstraint, Index, LargeBinary, String, TIMESTAMP, Table, Text, text
赵杰's avatar
赵杰 committed
4
from sqlalchemy.dialects.mysql import INTEGER, MEDIUMTEXT, TINYINT
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
5
from sqlalchemy.ext.declarative import declarative_base
赵杰's avatar
赵杰 committed
6
from app.model.base import Base, BaseModel
赵杰's avatar
赵杰 committed
7 8


9
class CompanyInfo(Base, BaseModel):
赵杰's avatar
赵杰 committed
10
    __tablename__ = 'company_info'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
11
    __table_args__ = {'comment': '公司基本信息表'}
赵杰's avatar
赵杰 committed
12 13

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
    p_company_id = Column(String(64), comment='公司id')
    company_name = Column(String(255), comment='公司中文全称')
    company_short_name = Column(String(80), comment='公司中文简称')
    company_english_name = Column(String(255), comment='基金管理人全称(英文)')
    company_type = Column(INTEGER(11), comment='公司类型:1-私募证券投资、2-公募基金公司、3-银行、4-证券公司、5-信托公司、6-审计机构,7-法律顾问,8-投资顾问,9-行政管理人,10-上市公司,11-期货公司,12-基金公司子公司,13工作室,14-私募股权投资,15-证券公司子公司,16-期货公司子公司,17-私募创业投资,-1-私募其他投资')
    organization_number = Column(String(20), comment='组织机构代码')
    establish_date = Column(Date, comment='公司成立日期')
    domicile_id = Column(INTEGER(11), comment='公司注册国家:1-中国大陆、2-香港、3-新加坡、4-开曼群岛、5-台湾、6-英属维尔京群岛BVI、-1-其他')
    company_address = Column(String(255), comment='公司注册地址')
    company_address2 = Column(String(255), comment='办公地址')
    city = Column(String(100), comment='城市')
    province = Column(String(100), comment='省')
    country = Column(String(100), comment='国家')
    reg_city = Column(String(100), comment='注册城市')
    reg_province = Column(String(100), comment='注册省')
    reg_country = Column(String(100), comment='注册国家')
    contact_phone = Column(String(20), comment='联系电话')
    post_code = Column(String(40), comment='邮政编码')
    fax = Column(String(20), comment='传真')
    email = Column(String(40), comment='邮箱')
    website = Column(String(255), comment='公司网址')
    registered_capital = Column(DECIMAL(22, 6), comment='公司注册资本,<量纲:万元>\t')
    company_profile = Column(Text, comment='公司简介')
    offshore_fund = Column(INTEGER(11), comment='是否有海外基金,0-否,1-是,-1-其他')
    philosopy = Column(Text, comment='投资理念')
    company_status = Column(INTEGER(11), comment='公司状态:1-运行;2-注销')
    base_currency_crc = Column(INTEGER(11), comment='公司注册资本货币单位:1-人民币,2-港币,3-美元,-1-其他')
    register_number = Column(String(20), comment='备案编码')
    register_status = Column(INTEGER(4), comment='备案状态:0-未备案,1-备案注销,2-备案存续')
    register_date = Column(Date, comment='备案日期')
    register_number_address = Column(String(255), comment='备案地址')
    is_member = Column(TINYINT(4), comment='是否会员:1-是,0-否')
    join_date = Column(Date, comment='入会时间')
    member_type = Column(INTEGER(4), comment='会员类型:1-普通会员、2-联席会员、3-观察会员、4-特别会员')
    fund_category_ori = Column(String(50), comment='管理基金主要类别(与中基协同步)')
    business_type = Column(String(50), comment='业务类型')
    nature_business_type = Column(INTEGER(4), comment='企业性质:1 中外合作企业 2中外合资企业 3内资企业 4境外机构 5外商独资企业 6政府机构')
    capital_paid_rate = Column(DECIMAL(22, 6), comment='注册资本实缴比例')
    logo = Column(String(255), comment='公司logo')
    isvisible = Column(INTEGER(11), comment='公司是否在前台可见')
    paid_capital = Column(DECIMAL(22, 6), comment='实缴资本(万元)(人民币)')
    company_asset_size = Column(INTEGER(4), comment='公司资产规模 1:0-1亿 2:1-10亿 3:10-20亿 4:20-50亿 5:50-100亿 6:100亿以上')
    legal_representative = Column(String(100), comment='法人代表')
    representative_experience = Column(MEDIUMTEXT, comment='法人代表履历')
    is_qualify = Column(INTEGER(11), comment='是否认证 0:否 1:是')
    get_qualify_method = Column(String(50), comment='法人从业资格获得方式')
    employee_cnts = Column(INTEGER(11), comment='员工人数')
    integrity_info = Column(String(500), comment='信信息')
    special_tips = Column(String(300), comment='提示信息')
    amac_link = Column(String(200), comment='协会网站链接')
    create_time = Column(DateTime, comment='创建时间')
    create_by = Column(String(64), comment='创建人')
    update_time = Column(DateTime, comment='修改时间')
    update_by = Column(String(64), comment='修改人')
    delete_tag = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='删除标识')


71
class CompanyTnaPersonnel(Base, BaseModel):
赵杰's avatar
赵杰 committed
72
    __tablename__ = 'company_tna_personnel'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
73 74 75 76 77 78 79 80 81 82 83 84 85
    __table_args__ = {'comment': '公司管理资产及人员变动统计'}

    id = Column(String(64), primary_key=True, comment='主键ID')
    company_id = Column(String(64), nullable=False, comment='公司id')
    stat_date = Column(Date, nullable=False, comment='统计日期')
    trust_fund_asset_size = Column(DECIMAL(22, 6), comment='信托管理总资产规模,<量纲:亿元>')
    special_account_asset_size = Column(DECIMAL(22, 6), comment='专户管理总资产规模,<量纲:亿元>')
    ltdco_fund_asset_size = Column(DECIMAL(22, 6), comment='有限合伙管理总资产规模,<量纲:亿元>')
    offshore_fund_asset_size = Column(DECIMAL(22, 6), comment='海外基金管理总资产规模,<量纲:亿元>')
    fund_num = Column(INTEGER(11), comment='基金总数')
    staff_num = Column(INTEGER(11), comment='公司人数')
    analyst_num = Column(INTEGER(11), comment='投研人员数')
    total_asset_size = Column(DECIMAL(22, 6), comment='管理总资产规模,<量纲:亿元>\t')
赵杰's avatar
赵杰 committed
86 87 88 89 90 91 92
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(11), nullable=False, server_default=text("'0'"))


93
class ConfidenceIndex(Base, BaseModel):
赵杰's avatar
赵杰 committed
94
    __tablename__ = 'confidence_index'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
95
    __table_args__ = {'comment': '对冲基金经理信心指数'}
赵杰's avatar
赵杰 committed
96 97

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
    index_id = Column(String(64), nullable=False, index=True, comment='指数id')
    index_name = Column(String(50), nullable=False, comment='指数全称')
    index_date = Column(Date, nullable=False, comment='指数日期')
    index_value = Column(DECIMAL(22, 6), nullable=False, comment='信心指数值')
    market_estimation_index = Column(DECIMAL(22, 6), nullable=False, comment='A股市场趋势预期信心指标值')
    position_plan_index = Column(DECIMAL(22, 6), nullable=False, comment='仓位增减持投资计划指标值')
    me_extrem_optimistic = Column(DECIMAL(22, 6), nullable=False, comment='市场趋势预期信心极度乐观人数百分比例;<量纲:%>')
    me_optimistic = Column(DECIMAL(22, 6), nullable=False, comment='市场趋势预期信乐观人数百分比例;<量纲:%>')
    me_netural = Column(DECIMAL(22, 6), nullable=False, comment='市场趋势预期信乐观人数百分比例;<量纲:%>')
    me_pessimistic = Column(DECIMAL(22, 6), nullable=False, comment='市场趋势预期信心悲观人数百分比例;<量纲:%>')
    me_extrem_pessimistic = Column(DECIMAL(22, 6), nullable=False, comment='市场趋势预期信心极度悲观人数百分比例;<量纲:%>')
    pp_increase_significant = Column(DECIMAL(22, 6), nullable=False, comment='计划大幅增仓人数百分比例;<量纲:%>')
    pp_increase = Column(DECIMAL(22, 6), nullable=False, comment='计划增仓人数百分比例;<量纲:%>')
    pp_unchange = Column(DECIMAL(22, 6), nullable=False, comment='计划仓位不变人数百分比例;<量纲:%>')
    pp_reduce = Column(DECIMAL(22, 6), nullable=False, comment='计划减仓人数百分比例;<量纲:%>')
    pp_reduce_significant = Column(DECIMAL(22, 6), nullable=False, comment='计划大幅减仓人数百分比例;<量纲:%>')
赵杰's avatar
赵杰 committed
114 115 116 117 118
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(11), nullable=False, server_default=text("'0'"))


119
class ContractTemplateManage(Base, BaseModel):
赵杰's avatar
赵杰 committed
120
    __tablename__ = 'contract_template_manage'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
    __table_args__ = {'comment': '合同及指南管理'}

    id = Column(String(64), primary_key=True, comment='唯一主键')
    fund_id = Column(String(64), nullable=False, comment='产品id')
    trading_rules = Column(String(255), comment='交易规则')
    expense_subscription = Column(String(255), comment='基金总费用-认/申购费')
    expense_ratio = Column(DECIMAL(22, 6), comment='认购费用')
    expense_manage = Column(String(255), comment='基金总费用-管理费')
    expense_manage_ratio = Column(DECIMAL(22, 6), comment='基金管理费用')
    expense_achievement = Column(String(255), comment='基金总费用-业绩报酬')
    expense_achievement_ratio = Column(DECIMAL(22, 6), comment='基金总费用-业绩报酬比例')
    ifa_subscription = Column(String(255), comment='理财师分成-认/申购费')
    ifa_subscription_ratio = Column(DECIMAL(22, 6), comment='理财师分成-认/申购费比例')
    ifa_manage = Column(String(255), comment='理财师分成-管理费')
    ifa_manage_ratio = Column(DECIMAL(22, 6), comment='理财师分成-管理费比例')
    ifa_achievement = Column(String(255), comment='理财师分成-业绩报酬')
    ifa_achievement_ratio = Column(DECIMAL(22, 6), comment='理财师分成-业绩报酬比例')
赵杰's avatar
赵杰 committed
138 139 140 141
    create_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    creart_by = Column(String(64))
    update_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    update_by = Column(String(64))
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
142
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='删除标志位:0:未删除,1:已删除')
赵杰's avatar
赵杰 committed
143 144


145
class FileDesc(Base, BaseModel):
赵杰's avatar
赵杰 committed
146
    __tablename__ = 'file_desc'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
147
    __table_args__ = {'comment': '文件描述'}
赵杰's avatar
赵杰 committed
148 149

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
150
    rel_id = Column(String(64), nullable=False, index=True, server_default=text("''"), comment='文件id')
赵杰's avatar
赵杰 committed
151 152 153 154 155 156 157 158
    info = Column(MEDIUMTEXT, nullable=False)
    create_by = Column(String(64), nullable=False, server_default=text("''"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    update_by = Column(String(64))
    update_time = Column(TIMESTAMP)
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


159
class FundAssetSize(Base, BaseModel):
赵杰's avatar
赵杰 committed
160
    __tablename__ = 'fund_asset_size'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
161
    __table_args__ = {'comment': '基金资产规模'}
赵杰's avatar
赵杰 committed
162 163 164

    id = Column(String(64), primary_key=True)
    fund_id = Column(String(64))
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
165 166
    fund_asset_size_date = Column(Date, comment='规模日期')
    fund_asset_size = Column(DECIMAL(22, 6), comment='基金资产规模')
赵杰's avatar
赵杰 committed
167 168 169 170 171 172 173
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(TINYINT(3), nullable=False, server_default=text("'0'"))


174
class FundAttribute(Base, BaseModel):
赵杰's avatar
赵杰 committed
175
    __tablename__ = 'fund_attributes'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
176 177 178 179 180 181 182 183 184 185 186 187
    __table_args__ = {'comment': '基金属性'}

    id = Column(String(64), primary_key=True, comment='基金id')
    master_feeder_fund = Column(INTEGER(11), comment='是否为master feeder fund:1-是')
    target_return_fund = Column(INTEGER(11), comment='是否为目标回报型基金:1-是')
    risk_buffer_fund = Column(INTEGER(11), comment='是否为风险缓冲型基金:1-是')
    umbrella_fund = Column(INTEGER(11), comment='是否为伞形产品,1-是')
    share_class = Column(INTEGER(11), comment='分级基金份额标识:1-是')
    multi_advisor = Column(INTEGER(11), comment='多投顾:1-是')
    pro_class_m = Column(INTEGER(11), comment='是否为分级母基金:1-是')
    pro_class_s = Column(INTEGER(11), comment='是否为分级子基金:1-是')
    tot_sign = Column(TINYINT(4), comment='是否信托中类型TOT(一对一):1-是;0-否')
赵杰's avatar
赵杰 committed
188 189 190 191 192 193 194
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(TINYINT(4))


195
class FundBank(Base, BaseModel):
赵杰's avatar
赵杰 committed
196
    __tablename__ = 'fund_bank'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
197
    __table_args__ = {'comment': '基金托管银行信息'}
赵杰's avatar
赵杰 committed
198 199

    fund_id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
200
    bank_code = Column(String(32), comment='银行code')
赵杰's avatar
赵杰 committed
201
    bank_id = Column(String(32))
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
202 203 204
    bank_name = Column(String(64), nullable=False, comment='银行名称')
    fund_account = Column(String(64), nullable=False, comment='账号id')
    account_name = Column(String(32), nullable=False, comment='户名')
赵杰's avatar
赵杰 committed
205 206 207 208 209 210 211
    create_by = Column(String(64), nullable=False)
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    update_by = Column(String(64), nullable=False)
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


212
class FundCombineInfo(Base, BaseModel):
赵杰's avatar
赵杰 committed
213
    __tablename__ = 'fund_combine_info'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
214
    __table_args__ = {'comment': '组合基金'}
赵杰's avatar
赵杰 committed
215 216

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
217 218 219 220 221 222
    p_fund_id = Column(String(64), nullable=False, comment='组合基金id')
    fund_id = Column(String(64), nullable=False, comment='基金id')
    change_date = Column(Date, comment='最新变动日期')
    proportion_ratio = Column(DECIMAL(22, 6), comment='占比')
    compare_last = Column(DECIMAL(22, 6), comment='较上次推荐持仓变动')
    flag = Column(INTEGER(3), comment='组合基金标识 0:当前组合 1:历史组合')
赵杰's avatar
赵杰 committed
223 224 225 226 227 228 229
    create_time = Column(DateTime)
    create_by = Column(String(64))
    update_time = Column(DateTime)
    update_by = Column(String(64))
    delete_tag = Column(INTEGER(3), server_default=text("'0'"))


230
class FundCombineInfoLog(Base, BaseModel):
赵杰's avatar
赵杰 committed
231
    __tablename__ = 'fund_combine_info_log'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
232
    __table_args__ = {'comment': '组合基金变更记录表'}
赵杰's avatar
赵杰 committed
233 234

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
235 236 237 238 239
    p_fund_id = Column(String(64), nullable=False, comment='组合基金id')
    fund_id = Column(String(64), nullable=False, comment='基金id')
    change_date = Column(Date, comment='变动日期')
    proportion_ratio = Column(DECIMAL(22, 6), comment='占比')
    compare_last = Column(DECIMAL(22, 6), comment='较上次持仓变动')
赵杰's avatar
赵杰 committed
240 241 242 243 244 245 246
    create_time = Column(DateTime)
    create_by = Column(String(64))
    update_time = Column(DateTime)
    update_by = Column(String(64))
    delete_tag = Column(INTEGER(3), server_default=text("'0'"))


247
class FundCount(Base, BaseModel):
赵杰's avatar
赵杰 committed
248
    __tablename__ = 'fund_count'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
249
    __table_args__ = {'comment': '基金历史业绩'}
赵杰's avatar
赵杰 committed
250 251

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
    fund_id = Column(String(64), nullable=False, unique=True, comment='基金id')
    strategy = Column(INTEGER(4), index=True, comment='基金策略分类')
    substrategy = Column(INTEGER(4), comment="融智子策略分类:1010-主观多头 1020-股票多空 1030-量化多头 2010-宏观策略 3010-主观趋势 3020-主观套利 3030-量化趋势 3040-量化套利 3050-管理期货复合 4010-并购重组 4020-定向增发 4030-大宗交易 4040-事件驱动复合 5010-股票市场中性 5020-套利 5030-相对价值复合 6010-纯债策略 6020-强债策略 6030-固收复合 7010-MOM 7020-FOF 8010-主观多策略 8020-量化多策略 -1-其他策略'")
    type = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='是否可预约 0:不可预约 1:可预约')
    end_date = Column(Date, comment='截至日期')
    price_date = Column(Date, comment='最近累计净值日期')
    net_nav = Column(DECIMAL(22, 6), comment='单位净值')
    cumulative_nav = Column(DECIMAL(22, 6), comment='最近累计净值')
    ret_1day = Column(DECIMAL(22, 6), comment='最近一天收益率')
    ret_1day_bm1 = Column(DECIMAL(22, 6), comment='最近一天基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_1w = Column(DECIMAL(22, 6), comment='最近一个周收益率')
    ret_1w_bm1 = Column(DECIMAL(22, 6), comment='最近一个周基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_1m = Column(DECIMAL(22, 6), comment='最近一个月收益率')
    ret_1m_bm1 = Column(DECIMAL(22, 6), comment='最近一个月基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_3m = Column(DECIMAL(22, 6), comment='最近三个月收益率')
    ret_3m_bm1 = Column(DECIMAL(22, 6), comment='最近三个月基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_6m = Column(DECIMAL(22, 6), comment='最近半年收益率')
    ret_6m_bm1 = Column(DECIMAL(22, 6), comment='最近半年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_1y = Column(DECIMAL(22, 6), comment='最近一年收益率')
    ret_1y_bm1 = Column(DECIMAL(22, 6), comment='最近一年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_2y = Column(DECIMAL(22, 6), comment='最近两年收益率')
    ret_2y_bm1 = Column(DECIMAL(22, 6), comment='最近两年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_2y_a = Column(DECIMAL(22, 6), comment='最近两年收益率(年化)')
    ret_2y_bm1_a = Column(DECIMAL(22, 6), comment='最近两年基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_3y = Column(DECIMAL(22, 6), comment='最近三年收益率')
    ret_3y_bm1 = Column(DECIMAL(22, 6), comment='最近三年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_3y_a = Column(DECIMAL(22, 6), comment='最近三年收益率(年化)')
    ret_3y_bm1_a = Column(DECIMAL(22, 6), comment='最近三年基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_4y = Column(DECIMAL(22, 6), comment='最近四年收益率')
    ret_4y_bm1 = Column(DECIMAL(22, 6), comment='最近四年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_4y_a = Column(DECIMAL(22, 6), comment='最近四年收益率(年化)')
    ret_4y_bm1_a = Column(DECIMAL(22, 6), comment='最近四年基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_5y = Column(DECIMAL(22, 6), comment='最近五年收益率')
    ret_5y_bm1 = Column(DECIMAL(22, 6), comment='最近五年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_5y_a = Column(DECIMAL(22, 6), comment='最近五年收益率(年化)')
    ret_5y_bm1_a = Column(DECIMAL(22, 6), comment='最近五年基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_ytd = Column(DECIMAL(22, 6), comment='今年以来收益率')
    ret_ytd_bm1 = Column(DECIMAL(22, 6), comment='今年以来基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_incep = Column(DECIMAL(22, 6), comment='成立以来收益率')
    ret_incep_bm1 = Column(DECIMAL(22, 6), comment='成立以来基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_incep_a = Column(DECIMAL(22, 6), comment='成立以来收益率(年化)')
    ret_incep_bm1_a = Column(DECIMAL(22, 6), comment='成立以来基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
    sharperatio_1y = Column(DECIMAL(22, 6), comment='最近一年的夏普比率')
    sharperatio_2y = Column(DECIMAL(22, 6), comment='最近两年的夏普比率')
    sharperatio_3y = Column(DECIMAL(22, 6), comment='最近三年的夏普比率')
    sharperatio_4y = Column(DECIMAL(22, 6), comment='最近四年的夏普比率')
    sharperatio_5y = Column(DECIMAL(22, 6), comment='最近五年的夏普比率')
    sharperatio_incep = Column(DECIMAL(22, 6), comment='成立以来的夏普比率')
    stddev_1y = Column(DECIMAL(22, 6), comment='最近一年的年化波动率')
    stddev_2y = Column(DECIMAL(22, 6), comment='最近两年的年化波动率')
    stddev_3y = Column(DECIMAL(22, 6), comment='最近三年的年化波动率')
    stddev_4y = Column(DECIMAL(22, 6), comment='最近四年的年化波动率')
    stddev_5y = Column(DECIMAL(22, 6), comment='最近五年的年化波动率')
    stddev_10y = Column(DECIMAL(22, 6), comment='最近十年的年化波动率')
    stddev_incep = Column(DECIMAL(22, 6), comment='成立以来的年化波动率')
    stddev_ytd = Column(DECIMAL(22, 6), comment='今年以来的年化波动率')
    maxdrawdown_1y = Column(DECIMAL(22, 6), comment='最近一年的最大回撤')
    maxdrawdown_2y = Column(DECIMAL(22, 6), comment='最近两年的最大回撤')
    maxdrawdown_3y = Column(DECIMAL(22, 6), comment='最近四年的最大回撤')
    maxdrawdown_4y = Column(DECIMAL(22, 6), comment='最近四年的最大回撤')
    maxdrawdown_5y = Column(DECIMAL(22, 6), comment='最近五年的最大回撤')
    maxdrawdown_10y = Column(DECIMAL(22, 6), comment='最近十年的最大回撤')
    maxdrawdown_incep = Column(DECIMAL(22, 6), comment='成立以来的最大回撤')
    data_sources = Column(INTEGER(3), nullable=False, server_default=text("'1'"), comment='数据来源 1:tanpu,2:私募排排 3:指数')
赵杰's avatar
赵杰 committed
316 317
    update_time = Column(TIMESTAMP, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
318 319
    status = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='0:待上架  1:已上架 2:已下架')
    sort = Column(INTEGER(11), server_default=text("'0'"), comment='排序')
赵杰's avatar
赵杰 committed
320 321 322
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


323
class FundDistribution(Base, BaseModel):
赵杰's avatar
赵杰 committed
324
    __tablename__ = 'fund_distribution'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
325
    __table_args__ = {'comment': '基金分红'}
赵杰's avatar
赵杰 committed
326 327

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
328 329 330 331
    fund_id = Column(String(64), nullable=False, index=True, comment='基金Id')
    distribute_date = Column(Date, nullable=False, comment='分配日期')
    distribute_type = Column(INTEGER(11), nullable=False, comment='基金分配类型标志:-1-其他,1-分红,2-拆分 3-业绩报酬 -1-其他')
    distribution = Column(DECIMAL(22, 6), comment='分红/拆分比例')
赵杰's avatar
赵杰 committed
332 333 334 335 336 337 338
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(11), nullable=False, server_default=text("'0'"))


339
class FundExplain(Base, BaseModel):
赵杰's avatar
赵杰 committed
340
    __tablename__ = 'fund_explain'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
341
    __table_args__ = {'comment': '产品解读'}
赵杰's avatar
赵杰 committed
342

pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
343 344 345 346 347 348 349 350 351 352
    id = Column(String(64), primary_key=True, comment='主键id')
    fund_id = Column(String(64), nullable=False, comment='基金id')
    title = Column(String(128), nullable=False, comment='标题')
    content = Column(String(2000), nullable=False, comment='解读内容')
    sort = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='排序')
    create_by = Column(String(64), nullable=False, comment='创建人')
    create_time = Column(DateTime, nullable=False, comment='创建时间')
    update_by = Column(String(64), comment='更新人')
    update_time = Column(DateTime, comment='更新时间')
    delete_tag = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='删除标识')
赵杰's avatar
赵杰 committed
353 354


355
class FundFileRecord(Base, BaseModel):
赵杰's avatar
赵杰 committed
356 357
    __tablename__ = 'fund_file_record'

pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
    id = Column(String(64), primary_key=True, server_default=text("''"), comment='唯一主键')
    ref_id = Column(String(64), index=True, comment='关联数据ID')
    file_name = Column(String(128), comment='文件原始名称')
    original_url = Column(String(256), comment='文件原链接')
    type = Column(INTEGER(5), nullable=False, server_default=text("'1'"), comment='1:公告,2:附件,3:探普研报')
    file_suffix = Column(String(128), comment='文件后缀名')
    logical_name = Column(String(128), comment='文件逻辑名')
    logical_path = Column(String(256), index=True, comment='文件存放路径')
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间')
    create_by = Column(String(64), comment='创建人')
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='修改时间')
    update_by = Column(String(64), comment='修改人')
    delete_tag = Column(INTEGER(1), nullable=False, server_default=text("'0'"), comment='删除标识')
    task_id = Column(String(100), comment='任务id')
    status = Column(INTEGER(1), comment='状态 0 :待转换  1:已经转换  2:转换失败')


375
class FundFuturestypeMapping(Base, BaseModel):
赵杰's avatar
赵杰 committed
376
    __tablename__ = 'fund_futurestype_mapping'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
377
    __table_args__ = {'comment': '基金投资品种信息'}
赵杰's avatar
赵杰 committed
378 379 380

    id = Column(String(64), primary_key=True)
    fund_id = Column(String(64), nullable=False)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
381
    futures_type = Column(TINYINT(4), comment='投资品种:1-商品期货、2-金融期货、3-股票、4-债券型、5-指数型、6-期权型、7-基金型、8-新三板、-1-其他;')
赵杰's avatar
赵杰 committed
382 383 384 385 386 387 388
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(TINYINT(3), nullable=False)


赵杰's avatar
赵杰 committed
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452
class FundInfo(Base, BaseModel):
    __tablename__ = 'fund_info'
    __table_args__ = {'comment': '基金基本信息'}

    id = Column(String(64), primary_key=True, comment='基金id')
    p_fund_id = Column(String(64), comment='父级产品ID')
    fund_name = Column(String(255), nullable=False, comment='基金中文全称')
    fund_short_name = Column(String(80), nullable=False, comment='基金中文简称')
    fund_structure = Column(INTEGER(11), comment='基金形式:1-公司型,2-合伙型,3-契约型,-1-其他')
    fund_type = Column(INTEGER(4), comment='私募基金类型:1-信托计划,2-有限合伙,3-券商资管,4-公募专户,5-单账户,6-证券投资基金,7-海外基金,8-期货资管,9-保险资管、10-创业投资基金、11-股权投资基金、12-银行理财、13-类固收信托、-1其他投资基金   \t\t\\n公募基金类型:1-混合型、2-债券型、3-定开债券、4-联接基金、5-货币型、6-债券指数、7-保本型、8-理财型、9-QDII、10-股票指数、11-QDII-指数、12-股票型、13-固定收益、14-分级杠杆、15-ETF-场内、16-QDII-ETF、17-债券创新-场内、18-封闭式')
    type = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='是否可预约 0:不可预约 1:可预约')
    raise_type = Column(INTEGER(4), comment='募集方式:1-私募,2-公募')
    fund_characteristic = Column(Text, comment='券商资管产品特点')
    base_currency = Column(INTEGER(11), comment='基础货币,1-人民币,2-港币,3-美元,4-份,-1-其他')
    inception_date = Column(Date, comment='成立日期')
    domicile = Column(INTEGER(4), comment='注册国家,1-中国大陆、2-香港、3-新加坡、4-开曼群岛、5-台湾、6-英属维尔京群岛BVI、-1-其他')
    primary_benchmark_id = Column(String(64), comment="指数id,以'IN'开头(后加36进制编码格式,不足8位长度左补零) 例:IN00000001")
    lockup_period = Column(INTEGER(4), comment='封闭期 (排排数据:单位:月,-1:不确定,0:无封闭期)')
    open_day = Column(String(400), comment='开放日')
    apply_day = Column(DateTime, comment='预约开放日')
    redeem_day = Column(DateTime, comment='赎回开放日')
    duration = Column(INTEGER(11), comment='产品存续期,单位:月。-1,不确定,0,无固定期限,999999永续')
    investment_scope = Column(Text, comment='基金投资范围')
    investment_restriction = Column(Text, comment='投资限制')
    fund_investment_philosophy = Column(Text, comment='投资理念')
    fund_strategy_description = Column(Text, comment='投资策略')
    advisor_id = Column(String(64), comment='投资顾问id')
    custodian_id = Column(String(64), comment='托管银行Id')
    broker_id = Column(String(64), comment='证券经纪人Id')
    broker_future_id = Column(String(64), comment='期货经纪人id')
    liquidation_agency_id = Column(String(64), comment='外包机构Id')
    trust_id = Column(String(64), comment='基金管理公司Id')
    investment_consultant_id = Column(String(64), comment='投资顾问Id')
    administrator_id = Column(String(64), comment='行政管理人Id')
    legal_counsel_id = Column(String(64), comment='法律顾问Id')
    auditor_id = Column(String(64), comment='审计机构')
    nav_frequency = Column(INTEGER(3), comment='净值披露频率 1:天 2:周 3:月 4:半月 5:季度')
    performance_disclosure_mark = Column(INTEGER(4), comment='产品业绩披露标识:1-AAA,2-AA,3-A,4-A-,5-A+')
    register_number = Column(String(20), comment='备案编码')
    register_date = Column(Date, comment='备案日期')
    isvisible = Column(INTEGER(4), comment='基金在前台是否可见:1-可见 0-不可见')
    istiered = Column(INTEGER(4), comment='是否分级:1-分级,0-不分级;')
    is_ranking = Column(INTEGER(4), comment='是否参与排名,1-参与排名 0-不参与排名 \t')
    is_rating = Column(INTEGER(4), comment='是否参与评级,1-参与评级 0-不参与评级\t')
    special_tips = Column(String(300), comment='基金协会特别提示')
    amac_url = Column(String(255), comment='基金协会链接')
    nav_source_type = Column(INTEGER(4), comment='净值来源说明:1-托管外包、2-信托券商官网、3-私募机构')
    combine_target = Column(Text, comment='组合目标')
    fit_group = Column(Text, comment='适合群体')
    combine_comment = Column(Text, comment='组合点评')
    transfer_comment = Column(Text, comment='调仓点评')
    desc_info = Column(String(512), comment='基金描述')
    strategy = Column(INTEGER(4), comment='融智策略分类,1-股票策略,2-宏观策略,3-管理期货,4-事件驱动,5-相对价值策略,6-固定收益策略,7-组合基金,8-复合策略,-1-其它策略')
    substrategy = Column(INTEGER(4), comment="融智子策略分类:1010-主观多头 1020-股票多空 1030-量化多头 2010-宏观策略 3010-主观趋势 3020-主观套利 3030-量化趋势 3040-量化套利 3050-管理期货复合 4010-并购重组 4020-定向增发 4030-大宗交易 4040-事件驱动复合 5010-股票市场中性 5020-套利 5030-相对价值复合 6010-纯债策略 6020-强债策略 6030-固收复合 7010-MOM 7020-FOF 8010-主观多策略 8020-量化多策略 -1-其他策略'")
    risk_level = Column(INTEGER(1), comment='风险等级')
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    data_sources = Column(INTEGER(5), nullable=False, server_default=text("'1'"), comment='数据来源 1:tanpu,2:私募排排')
    status = Column(INTEGER(1), comment='0:待上架  1:已上架 2:已下架')
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='删除标识 0:否 1:是')
    sort = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='排序')

453
#
赵杰's avatar
赵杰 committed
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
# t_fund_info = Table(
#     'fund_info', metadata,
#     Column('id', String(64), primary_key=True, comment='基金id'),
#     Column('p_fund_id', String(64), comment='父级产品ID'),
#     Column('fund_name', String(255), nullable=False, comment='基金中文全称'),
#     Column('fund_short_name', String(80), nullable=False, comment='基金中文简称'),
#     Column('fund_structure', INTEGER(11), comment='基金形式:1-公司型,2-合伙型,3-契约型,-1-其他'),
#     Column('fund_type', INTEGER(4),
#            comment='私募基金类型:1-信托计划,2-有限合伙,3-券商资管,4-公募专户,5-单账户,6-证券投资基金,7-海外基金,8-期货资管,9-保险资管、10-创业投资基金、11-股权投资基金、12-银行理财、13-类固收信托、-1其他投资基金   \t\t\\n公募基金类型:1-混合型、2-债券型、3-定开债券、4-联接基金、5-货币型、6-债券指数、7-保本型、8-理财型、9-QDII、10-股票指数、11-QDII-指数、12-股票型、13-固定收益、14-分级杠杆、15-ETF-场内、16-QDII-ETF、17-债券创新-场内、18-封闭式'),
#     Column('type', INTEGER(3), nullable=False, server_default=text("'0'"), comment='是否可预约 0:不可预约 1:可预约'),
#     Column('raise_type', INTEGER(4), comment='募集方式:1-私募,2-公募'),
#     Column('fund_characteristic', Text, comment='券商资管产品特点'),
#     Column('base_currency', INTEGER(11), comment='基础货币,1-人民币,2-港币,3-美元,4-份,-1-其他'),
#     Column('inception_date', Date, comment='成立日期'),
#     Column('domicile', INTEGER(4), comment='注册国家,1-中国大陆、2-香港、3-新加坡、4-开曼群岛、5-台湾、6-英属维尔京群岛BVI、-1-其他'),
#     Column('primary_benchmark_id', String(64), comment="指数id,以'IN'开头(后加36进制编码格式,不足8位长度左补零) 例:IN00000001"),
#     Column('lockup_period', INTEGER(4), comment='封闭期 (排排数据:单位:月,-1:不确定,0:无封闭期)'),
#     Column('open_day', String(400), comment='开放日'),
#     Column('apply_day', DateTime, comment='预约开放日'),
#     Column('redeem_day', DateTime, comment='赎回开放日'),
#     Column('duration', INTEGER(11), comment='产品存续期,单位:月。-1,不确定,0,无固定期限,999999永续'),
#     Column('investment_scope', Text, comment='基金投资范围'),
#     Column('investment_restriction', Text, comment='投资限制'),
#     Column('fund_investment_philosophy', Text, comment='投资理念'),
#     Column('fund_strategy_description', Text, comment='投资策略'),
#     Column('advisor_id', String(64), comment='投资顾问id'),
#     Column('custodian_id', String(64), comment='托管银行Id'),
#     Column('broker_id', String(64), comment='证券经纪人Id'),
#     Column('broker_future_id', String(64), comment='期货经纪人id'),
#     Column('liquidation_agency_id', String(64), comment='外包机构Id'),
#     Column('trust_id', String(64), comment='基金管理公司Id'),
#     Column('investment_consultant_id', String(64), comment='投资顾问Id'),
#     Column('administrator_id', String(64), comment='行政管理人Id'),
#     Column('legal_counsel_id', String(64), comment='法律顾问Id'),
#     Column('auditor_id', String(64), comment='审计机构'),
#     Column('nav_frequency', INTEGER(3), comment='净值披露频率 1:天 2:周 3:月 4:半月 5:季度'),
#     Column('performance_disclosure_mark', INTEGER(4), comment='产品业绩披露标识:1-AAA,2-AA,3-A,4-A-,5-A+'),
#     Column('register_number', String(20), comment='备案编码'),
#     Column('register_date', Date, comment='备案日期'),
#     Column('isvisible', INTEGER(4), comment='基金在前台是否可见:1-可见 0-不可见'),
#     Column('istiered', INTEGER(4), comment='是否分级:1-分级,0-不分级;'),
#     Column('is_ranking', INTEGER(4), comment='是否参与排名,1-参与排名 0-不参与排名 \t'),
#     Column('is_rating', INTEGER(4), comment='是否参与评级,1-参与评级 0-不参与评级\t'),
#     Column('special_tips', String(300), comment='基金协会特别提示'),
#     Column('amac_url', String(255), comment='基金协会链接'),
#     Column('nav_source_type', INTEGER(4), comment='净值来源说明:1-托管外包、2-信托券商官网、3-私募机构'),
#     Column('combine_target', Text, comment='组合目标'),
#     Column('fit_group', Text, comment='适合群体'),
#     Column('combine_comment', Text, comment='组合点评'),
#     Column('transfer_comment', Text, comment='调仓点评'),
#     Column('desc_info', String(512), comment='基金描述'),
#     Column('strategy', INTEGER(4),
#            comment='融智策略分类,1-股票策略,2-宏观策略,3-管理期货,4-事件驱动,5-相对价值策略,6-固定收益策略,7-组合基金,8-复合策略,-1-其它策略'),
#     Column('substrategy', INTEGER(4),
#            comment="融智子策略分类:1010-主观多头 1020-股票多空 1030-量化多头 2010-宏观策略 3010-主观趋势 3020-主观套利 3030-量化趋势 3040-量化套利 3050-管理期货复合 4010-并购重组 4020-定向增发 4030-大宗交易 4040-事件驱动复合 5010-股票市场中性 5020-套利 5030-相对价值复合 6010-纯债策略 6020-强债策略 6030-固收复合 7010-MOM 7020-FOF 8010-主观多策略 8020-量化多策略 -1-其他策略'"),
#     Column('risk_level', INTEGER(1), comment='风险等级'),
#     Column('create_by', String(64)),
#     Column('create_time', DateTime),
#     Column('update_by', String(64)),
#     Column('update_time', DateTime),
#     Column('data_sources', INTEGER(5), nullable=False, server_default=text("'1'"), comment='数据来源 1:tanpu,2:私募排排'),
#     Column('status', INTEGER(1), comment='0:待上架  1:已上架 2:已下架'),
#     Column('delete_tag', INTEGER(3), nullable=False, server_default=text("'0'"), comment='删除标识 0:否 1:是'),
#     Column('sort', INTEGER(10), nullable=False, server_default=text("'0'"), comment='排序'),
# )
519 520 521


class FundManagerMapping(Base, BaseModel):
赵杰's avatar
赵杰 committed
522
    __tablename__ = 'fund_manager_mapping'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
523
    __table_args__ = {'comment': '基金与基金经理关联'}
赵杰's avatar
赵杰 committed
524 525

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
526 527 528 529 530
    fund_id = Column(String(64), nullable=False, index=True, comment='基金id')
    fund_manager_id = Column(String(64), index=True, comment='基金经理id,即人员id')
    management_start_date = Column(Date, comment='基金管理开始时间')
    management_end_date = Column(Date, comment='基金管理结束时间')
    isvisible = Column(INTEGER(11), comment='前台是否可见,1-可见 0-不可见')
赵杰's avatar
赵杰 committed
531 532 533 534 535 536 537
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(11), nullable=False, server_default=text("'0'"))


538
class FundMarketIndex(Base, BaseModel):
赵杰's avatar
赵杰 committed
539
    __tablename__ = 'fund_market_indexes'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
540
    __table_args__ = {'comment': '指数'}
赵杰's avatar
赵杰 committed
541 542 543

    id = Column(String(64), primary_key=True)
    index_id = Column(String(10), nullable=False)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
544 545
    index_code = Column(String(20), nullable=False, comment='指数代码')
    price_date = Column(Date, comment='更新日期')
赵杰's avatar
赵杰 committed
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563
    preclose = Column(DECIMAL(22, 6))
    open = Column(DECIMAL(22, 6))
    high = Column(DECIMAL(22, 6))
    low = Column(DECIMAL(22, 6))
    close = Column(DECIMAL(22, 6))
    trade_volumen = Column(DECIMAL(22, 6))
    trade_amount = Column(DECIMAL(22, 6))
    wave_range = Column(DECIMAL(22, 6))
    day_price_limit = Column(DECIMAL(22, 6))
    duration = Column(DECIMAL(22, 6))
    convexity = Column(String(22))
    create_time = Column(DateTime)
    create_by = Column(String(64))
    update_time = Column(DateTime)
    update_by = Column(String(64))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


564
class FundNav(Base, BaseModel):
赵杰's avatar
赵杰 committed
565
    __tablename__ = 'fund_nav'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
566
    __table_args__ = {'comment': '基金净值'}
赵杰's avatar
赵杰 committed
567 568

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
569 570 571 572 573 574 575
    fund_id = Column(String(64), nullable=False, index=True, comment="基金id,'HF'开头(后加36进制编码格式,不足8位长度左补零) 例:HF00000001")
    price_date = Column(Date, nullable=False, comment='净值日期')
    nav = Column(DECIMAL(22, 6), nullable=False, comment='单位净值')
    cumulative_nav = Column(DECIMAL(22, 6), comment='考虑分红再投资的单位累计净值')
    cumulative_nav_withdrawal = Column(DECIMAL(22, 6), comment='分红不投资的单位累计净值')
    ishigh_or_low = Column(INTEGER(11), comment='净值创新高或新低标志;1-创历史新高;2-创历史新低;3-既没有创历史新高也没有创历史新低;-1-其他')
    tohigh_nav_ratio = Column(DECIMAL(22, 6), comment='距离历史新高的距离,(历史最高累计净值-最新累计净值)*100%/最新累计净值')
赵杰's avatar
赵杰 committed
576 577 578 579 580 581 582
    create_by = Column(String(64), server_default=text("'admin'"))
    create_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    update_by = Column(String(64), nullable=False, server_default=text("'admin'"))
    update_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


583
class FundPerformance(Base, BaseModel):
赵杰's avatar
赵杰 committed
584
    __tablename__ = 'fund_performance'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
585
    __table_args__ = {'comment': '基金历史业绩'}
赵杰's avatar
赵杰 committed
586 587

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645
    fund_id = Column(String(64), nullable=False, index=True, comment='基金id')
    end_date = Column(Date, nullable=False, comment='截至日期')
    price_date = Column(Date, comment='最近累计净值日期')
    cumulative_nav = Column(DECIMAL(22, 6), comment='最近累计净值')
    ret_1day = Column(DECIMAL(22, 6), comment='最近一天收益率')
    ret_1day_bm1 = Column(DECIMAL(22, 6), comment='最近一天基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_1w = Column(DECIMAL(22, 6), comment='最近一个周收益率')
    ret_1w_bm1 = Column(DECIMAL(22, 6), comment='最近一个周基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_1m = Column(DECIMAL(22, 6), comment='最近一个月收益率')
    ret_cum_1m = Column(DECIMAL(22, 6), comment='最近一个月累计收益率')
    ret_1m_bm1 = Column(DECIMAL(22, 6), comment='最近一个月基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_1m_bm1 = Column(DECIMAL(22, 6), comment='最近一个月累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_3m = Column(DECIMAL(22, 6), comment='最近三个月收益率')
    ret_3m_bm1 = Column(DECIMAL(22, 6), comment='最近三个月基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_3m = Column(DECIMAL(22, 6), comment='最近三个月累计收益率')
    ret_cum_3m_bm1 = Column(DECIMAL(22, 6), nullable=False, comment='最近三个月累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_6m = Column(DECIMAL(22, 6), comment='最近半年收益率')
    ret_cum_6m = Column(DECIMAL(22, 6), comment='最近半年累计收益率')
    ret_6m_bm1 = Column(DECIMAL(22, 6), comment='最近半年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_6m_bm1 = Column(DECIMAL(22, 6), comment='最近半年累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_1y = Column(DECIMAL(22, 6), comment='最近一年收益率')
    ret_cum_1y = Column(DECIMAL(22, 6), comment='最近一年累计收益率')
    ret_1y_bm1 = Column(DECIMAL(22, 6), comment='最近一年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_1y_bm1 = Column(DECIMAL(22, 6), comment='最近一年累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_2y = Column(DECIMAL(22, 6), comment='最近两年收益率')
    ret_cum_2y = Column(DECIMAL(22, 6), comment='最近两年累计收益率')
    ret_2y_bm1 = Column(DECIMAL(22, 6), comment='最近两年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_2y_bm1 = Column(DECIMAL(22, 6), comment='最近两年累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_2y_a = Column(DECIMAL(22, 6), comment='最近两年收益率(年化)')
    ret_2y_bm1_a = Column(DECIMAL(22, 6), comment='最近两年基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_3y = Column(DECIMAL(22, 6), comment='最近三年收益率')
    ret_cum_3y = Column(DECIMAL(22, 6), comment='最近三年累计收益率')
    ret_3y_bm1 = Column(DECIMAL(22, 6), comment='最近三年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_3y_bm1 = Column(DECIMAL(22, 6), comment='最近三年累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_3y_a = Column(DECIMAL(22, 6), comment='最近三年收益率(年化)')
    ret_3y_bm1_a = Column(DECIMAL(22, 6), comment='最近三年基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_4y = Column(DECIMAL(22, 6), comment='最近四年收益率')
    ret_cum_4y = Column(DECIMAL(22, 6), comment='最近四年累计收益率')
    ret_4y_bm1 = Column(DECIMAL(22, 6), comment='最近四年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_4y_bm1 = Column(DECIMAL(22, 6), comment='最近四年累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_4y_a = Column(DECIMAL(22, 6), comment='最近四年收益率(年化)')
    ret_4y_bm1_a = Column(DECIMAL(22, 6), comment='最近四年基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_5y = Column(DECIMAL(22, 6), comment='最近五年收益率')
    ret_cum_5y = Column(DECIMAL(22, 6), comment='最近五年累计收益率')
    ret_5y_bm1 = Column(DECIMAL(22, 6), comment='最近五年基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_5y_bm1 = Column(DECIMAL(22, 6), comment='最近五年累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_5y_a = Column(DECIMAL(22, 6), comment='最近五年收益率(年化)')
    ret_5y_bm1_a = Column(DECIMAL(22, 6), comment='最近五年基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_ytd = Column(DECIMAL(22, 6), comment='今年以来收益率')
    ret_cum_ytd = Column(DECIMAL(22, 6), comment='今年以来累计收益率')
    ret_ytd_bm1 = Column(DECIMAL(22, 6), comment='今年以来基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_ytd_bm1 = Column(DECIMAL(22, 6), comment='今年以来累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_incep = Column(DECIMAL(22, 6), comment='成立以来收益率')
    ret_cum_incep = Column(DECIMAL(22, 6), comment='成立以来累计收益率')
    ret_incep_bm1 = Column(DECIMAL(22, 6), comment='成立以来基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_cum_incep_bm1 = Column(DECIMAL(22, 6), comment='成立以来累计基准指数收益率,基准指数bm1=沪深300(取决于基金设定的基准指数)')
    ret_incep_a = Column(DECIMAL(22, 6), comment='成立以来收益率(年化)')
    ret_incep_bm1_a = Column(DECIMAL(22, 6), comment='成立以来基准指数收益率(年化),基准指数bm1=沪深300(取决于基金设定的基准指数)')
赵杰's avatar
赵杰 committed
646 647 648 649 650
    update_time = Column(TIMESTAMP, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


651
class FundPerformanceRanking(Base, BaseModel):
赵杰's avatar
赵杰 committed
652
    __tablename__ = 'fund_performance_ranking'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
653
    __table_args__ = {'comment': '基金业绩排名'}
赵杰's avatar
赵杰 committed
654 655

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718
    class_id = Column(INTEGER(11), nullable=False, comment='排名分类,1:产品类型,2:投资策略')
    fund_id = Column(String(64), nullable=False, index=True, comment='基金id')
    end_date = Column(String(10), nullable=False, comment='截至日期')
    absrank_ret_1m = Column(INTEGER(11), comment='最近一个月收益率的绝对排名')
    perrank_ret_1m = Column(INTEGER(11), comment='最近一个月收益率的相对排名(%)')
    absrank_ret_3m = Column(INTEGER(11), comment='最近三个月收益率的绝对排名')
    perrank_ret_3m = Column(INTEGER(11), comment='最近三个月收益率的相对排名(%)')
    absrank_ret_6m = Column(INTEGER(11), comment='最近六个月收益率的绝对排名')
    perrank_ret_6m = Column(INTEGER(11), comment='最近六个月收益率的相对排名(%)')
    absrank_ret_1y = Column(INTEGER(11), comment='最近一年收益率的绝对排名')
    perrank_ret_1y = Column(INTEGER(11), comment='最近一年收益率的相对排名(%)')
    absrank_ret_2y = Column(INTEGER(11), comment='最近两年收益率的绝对排名')
    perrank_ret_2y = Column(INTEGER(11), comment='最近两年收益率的相对排名(%)')
    absrank_ret_3y = Column(INTEGER(11), comment='最近三年收益率的绝对排名')
    perrank_ret_3y = Column(INTEGER(11), comment='最近三年收益率的相对排名(%)')
    absrank_ret_4y = Column(INTEGER(11), comment='最近四年收益率的绝对排名')
    perrank_ret_4y = Column(INTEGER(11), comment='最近四年收益率的相对排名(%)')
    absrank_ret_5y = Column(INTEGER(11), comment='最近五年收益率的绝对排名')
    perrank_ret_5y = Column(INTEGER(11), comment='最近五年收益率的相对排名(%)')
    absrank_ret_ytd = Column(INTEGER(11), comment='今年以来收益率的绝对排名')
    perrank_ret_ytd = Column(INTEGER(11), comment='今年以来收益率的相对排名(%)')
    absrank_ret_incep = Column(INTEGER(11), comment='成立以来绝对排名')
    perrank_ret_incep = Column(INTEGER(11), comment='成立以来相对排名(%)')
    absrank_maxdrawdown_1y = Column(INTEGER(11), comment='最近一年最大回撤的绝对排名')
    perrank_maxdrawdown_1y = Column(INTEGER(11), comment='最近一年最大回撤的相对排名')
    absrank_maxdrawdown_2y = Column(INTEGER(11), comment='最近两年最大回撤的绝对排名')
    perrank_maxdrawdown_2y = Column(INTEGER(11), comment='最近两年最大回撤的相对排名')
    absrank_maxdrawdown_3y = Column(INTEGER(11), comment='最近三年最大回撤的绝对排名')
    perrank_maxdrawdown_3y = Column(INTEGER(11), comment='最近三年最大回撤的相对排名')
    absrank_maxdrawdown_4y = Column(INTEGER(11), comment='最近四年最大回撤的绝对排名')
    perrank_maxdrawdown_4y = Column(INTEGER(11), comment='最近四年最大回撤的相对排名')
    absrank_maxdrawdown_5y = Column(INTEGER(11), comment='最近五年最大回撤的绝对排名')
    perrank_maxdrawdown_5y = Column(INTEGER(11), comment='最近五年最大回撤的相对排名')
    absrank_adjret_1y = Column(INTEGER(11), comment='最近一年风险调整收益的绝对排名')
    perrank_adjret_1y = Column(INTEGER(11), comment='最近一年风险调整收益的相对排名')
    absrank_adjret_2y = Column(INTEGER(11), comment='最近两年风险调整收益的绝对排名')
    perrank_adjret_2y = Column(INTEGER(11), comment='最近两年风险调整收益的相对排名')
    absrank_adjret_3y = Column(INTEGER(11), comment='最近三年风险调整收益的绝对排名')
    perrank_adjret_3y = Column(INTEGER(11), comment='最近三年风险调整收益的相对排名')
    absrank_adjret_4y = Column(INTEGER(11), comment='最近四年风险调整收益的绝对排名')
    perrank_adjret_4y = Column(INTEGER(11), comment='最近四年风险调整收益的相对排名')
    absrank_adjret_5y = Column(INTEGER(11), comment='最近五年风险调整收益的绝对排名')
    perrank_adjret_5y = Column(INTEGER(11), comment='最近五年风险调整收益的相对排名')
    absrank_upsidecaptureratio_1y = Column(INTEGER(11), comment='最近一年上行捕获率的绝对排名')
    perrank_upsidecaptureratio_1y = Column(INTEGER(11), comment='最近一年上行捕获率的相对排名')
    absrank_upsidecaptureratio_2y = Column(INTEGER(11), comment='最近两年上行捕获率的绝对排名')
    perrank_upsidecaptureratio_2y = Column(INTEGER(11), comment='最近两年上行捕获率的相对排名')
    absrank_upsidecaptureratio_3y = Column(INTEGER(11), comment='最近三年上行捕获率的绝对排名')
    perrank_upsidecaptureratio_3y = Column(INTEGER(11), comment='最近三年上行捕获率的相对排名')
    absrank_upsidecaptureratio_4y = Column(INTEGER(11), comment='最近四年上行捕获率的绝对排名')
    perrank_upsidecaptureratio_4y = Column(INTEGER(11), comment='最近四年上行捕获率的相对排名')
    absrank_upsidecaptureratio_5y = Column(INTEGER(11), comment='最近五年上行捕获率的绝对排名')
    perrank_upsidecaptureratio_5y = Column(INTEGER(11), comment='最近五年上行捕获率的相对排名')
    absrank_downsidecaptureratio_1y = Column(INTEGER(11), comment='最近一年下行捕获率的绝对排名')
    perrank_downsidecaptureratio_1y = Column(INTEGER(11), comment='最近一年下行捕获率的相对排名')
    absrank_downsidecaptureratio_2y = Column(INTEGER(11), comment='最近两年下行捕获率的绝对排名')
    perRank_downsidecaptureratio_2y = Column(INTEGER(11), comment='最近两年下行捕获率的相对排名')
    absrank_downsidecaptureratio_3y = Column(INTEGER(11), comment='最近三年下行捕获率的绝对排名')
    perrank_downsidecaptureratio_3y = Column(INTEGER(11), comment='最近三年下行捕获率的相对排名')
    absrank_downsidecaptureratio_4y = Column(INTEGER(11), comment='最近四年下行捕获率的绝对排名')
    perrank_downsidecaptureratio_4y = Column(INTEGER(11), comment='最近四年下行捕获率的相对排名')
    absrank_downsidecaptureratio_5y = Column(INTEGER(11), comment='最近五年下行捕获率的绝对排名')
    perrank_downsidecaptureratio_5y = Column(INTEGER(11), comment='最近五年下行捕获率的相对排名')
赵杰's avatar
赵杰 committed
719 720 721 722 723
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


724
class FundPerformanceStrategyRating(Base, BaseModel):
赵杰's avatar
赵杰 committed
725
    __tablename__ = 'fund_performance_strategy_rating'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
726
    __table_args__ = {'comment': '基金评级'}
赵杰's avatar
赵杰 committed
727 728

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753
    fund_id = Column(String(64), nullable=False, index=True, comment='基金id')
    class_id = Column(String(64), nullable=False, index=True, comment='类型id')
    end_date = Column(String(10), nullable=False, comment='评级日期')
    strategy = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='融智策略分类,1-股票策略,2-宏观策略,3-管理期货,4-事件驱动,5-相对价值策略,6-债券策略,7-组合基金,8-复合策略,-1-其它策略')
    substrategy = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='旧:(融智子策略分类:   ')
    rating_1y = Column(INTEGER(11), comment='一年评级')
    ret_rating_1y = Column(String(20), comment='一年收益等级')
    risk_rating_1y = Column(String(20), comment='一年风险等级')
    style_1y = Column(String(20), comment='一年风格类别')
    rating_2y = Column(INTEGER(11), comment='两年评级')
    ret_rating_2y = Column(String(20), comment='两年收益等级')
    risk_rating_2y = Column(String(20), comment='两年风险等级')
    style_2y = Column(String(20), comment='两年风格类别')
    rating_3y = Column(INTEGER(11), comment='三年评级')
    ret_rating_3y = Column(String(20), comment='三年收益等级')
    risk_rating_3y = Column(String(20), comment='三年风险等级')
    style_3y = Column(String(20), comment='三年风格类别')
    rating_4y = Column(INTEGER(11), comment='四年评级')
    ret_rating_4y = Column(String(20), comment='四年收益等级')
    risk_rating_4y = Column(String(20), comment='四年风险等级')
    style_4y = Column(String(20), comment='四年风格类别')
    rating_5y = Column(INTEGER(11), comment='五年评级')
    ret_rating_5y = Column(String(20), comment='五年收益等级')
    risk_rating_5y = Column(String(20), comment='五年风险等级')
    style_5y = Column(String(20), comment='五年风格类别')
赵杰's avatar
赵杰 committed
754 755 756 757 758
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


759
class FundPortfolio(Base, BaseModel):
赵杰's avatar
赵杰 committed
760
    __tablename__ = 'fund_portfolio'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
761 762 763 764 765 766 767 768 769 770 771 772 773 774
    __table_args__ = {'comment': '基金重仓统计'}

    id = Column(String(64), primary_key=True, comment='主键id')
    fund_id = Column(String(64), nullable=False, index=True, comment='基金id')
    portfolio_date = Column(Date, nullable=False, comment='统计日期')
    sec_code = Column(String(64), nullable=False, index=True, comment='证券代码')
    sec_type = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='证券类型:1-股票,2-基金,3-债券,4-权证,-1-其他')
    sec_market_value = Column(DECIMAL(22, 6), comment='单只证券市值,<量纲:万元>')
    net_value_ratio = Column(DECIMAL(22, 6), comment='占净值比例,<量纲:%>')
    holding_num = Column(DECIMAL(22, 6), comment='持仓量,<量纲:万股>')
    holding_ratio = Column(DECIMAL(22, 6), comment='占流通比例,<量纲:%> 此字段只有信托类产品有数据,即fund_type=2 or 3')
    uni_code = Column(String(64), index=True, comment='标的代码(base_underlying_information)')
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='修改时间;第一次创建时与CreatTime值相同,修改时与修改时间相同')
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间,默认第一次创建的getdate()时间')
赵杰's avatar
赵杰 committed
775 776 777
    delete_tag = Column(INTEGER(3), server_default=text("'0'"))


778
class FundPosition(Base, BaseModel):
赵杰's avatar
赵杰 committed
779
    __tablename__ = 'fund_position'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
780
    __table_args__ = {'comment': '基金资产配置'}
赵杰's avatar
赵杰 committed
781 782

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
783 784 785 786 787
    fund_id = Column(String(64), nullable=False, index=True, comment='基金id')
    position_date = Column(Date, nullable=False, comment='基金仓位统计日期')
    sec_type = Column(TINYINT(4), comment='证券类型:1-股票,2-基金,3-债券,4-权证,5-货币资金,-1-其他(券商资管产品特有)')
    market_valule = Column(DECIMAL(22, 6), comment='市值,<量纲:万元>')
    position = Column(DECIMAL(22, 6), comment='基金仓位比例,<量纲:%>')
赵杰's avatar
赵杰 committed
788
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
789 790
    create_by = Column(String(64), index=True, comment='创建者Id,默认第一次创建者名称,创建后不变更')
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间,默认第一次创建的getdate()时间')
赵杰's avatar
赵杰 committed
791 792 793
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


794
class FundQa(Base, BaseModel):
赵杰's avatar
赵杰 committed
795
    __tablename__ = 'fund_qa'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
796
    __table_args__ = {'comment': '产品QA'}
赵杰's avatar
赵杰 committed
797 798

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
799 800 801 802 803 804 805 806 807
    qa_type = Column(INTEGER(1), nullable=False, comment='问题类型  1:提问 2回答')
    fund_id = Column(String(64), nullable=False, comment='产品ID')
    content = Column(Text, nullable=False, comment='问题/回答内容')
    ask_id = Column(String(64), comment='问题ID')
    status = Column(INTEGER(1), comment='0 :未回答  1已回答')
    verify_status = Column(INTEGER(1), nullable=False, comment='审批状态 0:待审批  1:审批通过  2:未通过')
    user_head = Column(String(255), comment='用户头像')
    user_nickname = Column(String(50), comment='用户昵称')
    qa_source = Column(String(50), comment='1:运营 2:平台用户')
赵杰's avatar
赵杰 committed
808
    sort = Column(INTEGER(3), nullable=False, server_default=text("'0'"))
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
809 810
    create_by = Column(String(64), nullable=False, comment='提问/回答人ID')
    create_time = Column(DateTime, nullable=False, comment='提问/回答时间')
赵杰's avatar
赵杰 committed
811 812 813 814 815
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


816
class FundRateMapping(Base, BaseModel):
赵杰's avatar
赵杰 committed
817
    __tablename__ = 'fund_rate_mapping'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848
    __table_args__ = {'comment': '基金费率'}

    fund_id = Column(String(64), primary_key=True, comment="基金id(私募排排:'HF'开头(后加36进制编码格式,不足8位长度左补零) 例:HF00000001)")
    initial_unit_value = Column(String(255), comment='位面值')
    initial_size = Column(DECIMAL(22, 6), comment='初始规模,<量纲:万>')
    min_investment_share = Column(DECIMAL(22, 6), comment='最低认购额,<量纲:万> 券商资管产品量纲为<万元>')
    subsequent_investment_share = Column(DECIMAL(22, 6), comment='最低追加额,<量纲:万> 券商资管产品量纲为<万元>')
    subscription_fee = Column(DECIMAL(22, 6), comment='最高认购费,量纲<%>')
    subscription_fee_note = Column(String(255), comment='认(申)购费说明')
    redemption_fee = Column(DECIMAL(22, 6), comment='最高赎回费,量纲<%>')
    redemption_fee_note = Column(String(255), comment='最高赎回费,量纲<%>')
    managementfee_deduction_frequency = Column(String(255), comment='管理费计提周期,<量纲:月>')
    managementfee_consult = Column(DECIMAL(22, 6), comment='投资顾问管理费,<量纲:%>')
    managementfee_trust = Column(DECIMAL(22, 6), comment='受托人管理费,<量纲:%>')
    managementfee_bank = Column(DECIMAL(22, 6), comment='银行托管费,<量纲:%>')
    performance_fee = Column(DECIMAL(22, 6), comment='最高绩效费,量纲<%>')
    performance_fee_deduction_method = Column(INTEGER(11), comment='业绩报酬计提方式:0-未设 1-份额计提 2-净值计提 3-混合')
    performance_fee_note = Column(Text, comment='绩效费说明')
    dividend_rule = Column(Text, comment='分红规则')
    other_fee_note = Column(String(255), comment='其他费用说明')
    guard_line = Column(DECIMAL(22, 6), comment='警戒线,<量纲:%>')
    stop_loss_line = Column(DECIMAL(22, 6), comment='止损线,<量纲:%>')
    return_guarantees = Column(DECIMAL(22, 6), comment='保底收益率,<量纲:%>')
    expected_return = Column(DECIMAL(22, 6), comment='预计收益率')
    hurdle_rate = Column(DECIMAL(22, 6), comment='费前收益率(业绩提成前最低收益率),量纲<%>')
    leverage = Column(String(10), comment='融资杠杆比率')
    manager_participate_asset = Column(String(255), comment='基金管理人参与资产比例')
    posterior = Column(DECIMAL(22, 6), comment='劣后级杠杆比率')
    intermediate = Column(DECIMAL(22, 6), comment='中间级杠杆比率')
    priority = Column(DECIMAL(22, 6), comment='优先级杠杆比率')
    outsourcing_fee = Column(DECIMAL(22, 6), comment='外包管理费,量纲<%>')
赵杰's avatar
赵杰 committed
849 850 851 852 853 854 855
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


856
class FundRiskStat(Base, BaseModel):
赵杰's avatar
赵杰 committed
857
    __tablename__ = 'fund_risk_stats'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
858
    __table_args__ = {'comment': '基金风险指标'}
赵杰's avatar
赵杰 committed
859 860

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959
    fund_id = Column(String(64), nullable=False, index=True, comment='基金id')
    end_date = Column(Date, nullable=False, comment='截至日期')
    stddev_1y = Column(DECIMAL(22, 6), comment='最近一年的年化波动率')
    stddev_2y = Column(DECIMAL(22, 6), comment='最近两年的年化波动率')
    stddev_3y = Column(DECIMAL(22, 6), comment='最近三年的年化波动率')
    stddev_4y = Column(DECIMAL(22, 6), comment='最近四年的年化波动率')
    stddev_5y = Column(DECIMAL(22, 6), comment='最近五年的年化波动率')
    stddev_10y = Column(DECIMAL(22, 6), comment='最近十年的年化波动率')
    stddev_incep = Column(DECIMAL(22, 6), comment='成立以来的年化波动率')
    stddev_ytd = Column(DECIMAL(22, 6), comment='今年以来的年化波动率')
    downsidedev_1y = Column(DECIMAL(22, 6), comment='最近一年的下行风险')
    downsidedev_2y = Column(DECIMAL(22, 6), comment='最近两年的下行风险')
    downsidedev_3y = Column(DECIMAL(22, 6), comment='最近三年的下行风险')
    downsidedev_4y = Column(DECIMAL(22, 6), comment='最近四年的下行风险')
    downsidedev_5y = Column(DECIMAL(22, 6), comment='最近五年的下行风险')
    downsidedev_10y = Column(DECIMAL(22, 6), comment='最近十年的下行风险')
    downsidedev_incep = Column(DECIMAL(22, 6), comment='成立以来的下行风险')
    downsidedev_ytd = Column(DECIMAL(22, 6), comment='今年以来的下行风险')
    alpha_1y = Column(DECIMAL(22, 6), comment='最近一年的阿尔法')
    alpha_2y = Column(DECIMAL(22, 6), comment='最近两年的阿尔法')
    alpha_3y = Column(DECIMAL(22, 6), comment='最近三年的阿尔法')
    alpha_4y = Column(DECIMAL(22, 6), comment='最近四年的阿尔法')
    alpha_5y = Column(DECIMAL(22, 6), comment='最近五年的阿尔法')
    alpha_10y = Column(DECIMAL(22, 6), comment='最近十年的阿尔法')
    alpha_incep = Column(DECIMAL(22, 6), comment='成立以来的阿尔法')
    alpha_ytd = Column(DECIMAL(22, 6), comment='今年以来的阿尔法')
    beta_1y = Column(DECIMAL(22, 6), comment='最近一年的贝塔')
    beta_2y = Column(DECIMAL(22, 6), comment='最近两年的贝塔')
    beta_3y = Column(DECIMAL(22, 6), comment='最近三年的贝塔')
    beta_4y = Column(DECIMAL(22, 6), comment='最近四年的贝塔')
    beta_5y = Column(DECIMAL(22, 6), comment='最近五年的贝塔')
    beta_10y = Column(DECIMAL(22, 6), comment='最近十年的贝塔')
    beta_incep = Column(DECIMAL(22, 6), comment='成立以来的贝塔')
    beta_ytd = Column(DECIMAL(22, 6), comment='今年以来的贝塔')
    r2_1y = Column(DECIMAL(22, 6), comment='最近一年的拟合优度')
    r2_2y = Column(DECIMAL(22, 6), comment='最近两年的拟合优度')
    r2_3y = Column(DECIMAL(22, 6), comment='最近三年的拟合优度')
    r2_4y = Column(DECIMAL(22, 6), comment='最近四年的拟合优度')
    r2_5y = Column(DECIMAL(22, 6), comment='最近五年的拟合优度')
    r2_10y = Column(DECIMAL(22, 6), comment='最近十年的拟合优度')
    r2_incep = Column(DECIMAL(22, 6), comment='成立以来的拟合优度')
    r2_ytd = Column(DECIMAL(22, 6), comment='今年以来的拟合优度')
    skewness_1y = Column(DECIMAL(22, 6), comment='最近一年的偏度')
    skewness_2y = Column(DECIMAL(22, 6), comment='最近两年的偏度')
    skewness_3y = Column(DECIMAL(22, 6), comment='最近三年的偏度')
    skewness_4y = Column(DECIMAL(22, 6), comment='最近四年的偏度')
    skewness_5y = Column(DECIMAL(22, 6), comment='最近五年的偏度')
    skewness_10y = Column(DECIMAL(22, 6), comment='最近十年的偏度')
    skewness_incep = Column(DECIMAL(22, 6), comment='成立以来的偏度')
    skewness_ytd = Column(DECIMAL(22, 6), comment='今年以来的偏度')
    kurtosis_1y = Column(DECIMAL(22, 6), comment='最近一年的峰度')
    kurtosis_2y = Column(DECIMAL(22, 6), comment='最近两年的峰度')
    kurtosis_3y = Column(DECIMAL(22, 6), comment='最近三年的峰度')
    kurtosis_4y = Column(DECIMAL(22, 6), comment='最近四年的峰度')
    kurtosis_5y = Column(DECIMAL(22, 6), comment='最近五年的峰度')
    kurtosis_10y = Column(DECIMAL(22, 6), comment='最近十年的峰度')
    kurtosis_incep = Column(DECIMAL(22, 6), comment='成立以来的峰度')
    kurtosis_ytd = Column(DECIMAL(22, 6), comment='今年以来的峰度')
    worstmonth_1y = Column(DECIMAL(22, 6), comment='最近一年的单月最大下跌')
    worstmonth_2y = Column(DECIMAL(22, 6), comment='最近两年的单月最大下跌')
    worstmonth_3y = Column(DECIMAL(22, 6), comment='最近三年的单月最大下跌')
    worstmonth_4y = Column(DECIMAL(22, 6), comment='最近四年的单月最大下跌')
    worstmonth_5y = Column(DECIMAL(22, 6), comment='最近五年的单月最大下跌')
    worstmonth_10y = Column(DECIMAL(22, 6), comment='最近十年的单月最大下跌')
    worstmonth_incep = Column(DECIMAL(22, 6), comment='成立以来的单月最大下跌')
    worstmonth_ytd = Column(DECIMAL(22, 6), comment='今年以来的单月最大下跌')
    downmonth_percent_1y = Column(DECIMAL(22, 6), comment='最近一年的下跌月份比')
    downmonth_percent_2y = Column(DECIMAL(22, 6), comment='最近两年的下跌月份比')
    downmonth_percent_3y = Column(DECIMAL(22, 6), comment='最近三年的下跌月份比')
    downmonth_percent_4y = Column(DECIMAL(22, 6), comment='最近四年的下跌月份比')
    downmonth_percent_5y = Column(DECIMAL(22, 6), comment='最近五年的下跌月份比')
    downmonth_percent_10y = Column(DECIMAL(22, 6), comment='最近十年的下跌月份比')
    downmonth_percent_incep = Column(DECIMAL(22, 6), comment='成立以来的下跌月份比')
    downmonth_percent_ytd = Column(DECIMAL(22, 6), comment='今年以来的下跌月份比')
    battingaverage_1y = Column(DECIMAL(22, 6), comment='最近一年的跑赢指数月份比')
    battingaverage_2y = Column(DECIMAL(22, 6), comment='最近两年的跑赢指数月份比')
    battingaverage_3y = Column(DECIMAL(22, 6), comment='最近三年的跑赢指数月份比')
    battingaverage_4y = Column(DECIMAL(22, 6), comment='最近四年的跑赢指数月份比')
    battingaverage_5y = Column(DECIMAL(22, 6), comment='最近五年的跑赢指数月份比')
    battingaverage_10y = Column(DECIMAL(22, 6), comment='最近五年的跑赢指数月份比')
    battingaverage_incep = Column(DECIMAL(22, 6), comment='成立以来的跑赢指数月份比')
    battingaverage_ytd = Column(DECIMAL(22, 6), comment='今年以来的跑赢指数月份比')
    gainloss_ratio_1y = Column(DECIMAL(22, 6), comment='最近一年的盈利/亏损比')
    gainloss_ratio_2y = Column(DECIMAL(22, 6), comment='最近两年的盈利/亏损比')
    gainloss_ratio_3y = Column(DECIMAL(22, 6), comment='最近三年的盈利/亏损比')
    gainloss_ratio_4y = Column(DECIMAL(22, 6), comment='最近四年的盈利/亏损比')
    gainloss_ratio_5y = Column(DECIMAL(22, 6), comment='最近五年的最长连续下跌月份数')
    gainloss_ratio_10y = Column(DECIMAL(22, 6), comment='最近十年的最长连续下跌月份数')
    gainloss_ratio_incep = Column(DECIMAL(22, 6), comment='成立以来的最长连续下跌月份数')
    gainloss_ratio_ytd = Column(DECIMAL(22, 6), comment='今年以来的最长连续下跌月份数')
    longestdown_months_1y = Column(INTEGER(11), comment='最近一年的最长连续下跌月份数')
    longestdown_months_2y = Column(INTEGER(11), comment='最近两年的最长连续下跌月份数')
    longestdown_months_3y = Column(INTEGER(11), comment='最近三年的最长连续下跌月份数')
    longestdown_months_4y = Column(INTEGER(11), comment='最近四年的最长连续下跌月份数')
    longestdown_months_5y = Column(INTEGER(11), comment='最近五年的最长连续下跌月份数')
    longestdown_months_10y = Column(INTEGER(11), comment='最近十年的最长连续下跌月份数')
    longestdown_months_incep = Column(INTEGER(11), comment='成立以来的最长连续下跌月份数')
    longestdown_months_ytd = Column(INTEGER(11), comment='今年以来的最长连续下跌月份数')
    maxdrawdown_3m = Column(DECIMAL(22, 6), comment='最近一年的最大回撤')
赵杰's avatar
赵杰 committed
960 961 962 963
    maxdrawdown_ytd = Column(DECIMAL(22, 6))
    maxdrawdown_months_ytd = Column(DECIMAL(22, 6))
    maxdrawdown_peakdate_ytd = Column(DECIMAL(22, 6))
    maxdrawdown_valleydate_ytd = Column(DECIMAL(22, 6))
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005
    maxdrawdown_1y = Column(DECIMAL(22, 6), comment='最近一年的最大回撤')
    maxdrawdown_months_1y = Column(INTEGER(11), comment='最近一年的最大回撤区间月份数')
    maxdrawdown_peakdate_1y = Column(String(10), comment='最近一年的最大回撤的峰值值起始日期')
    maxdrawdown_valleydate_1y = Column(String(10), comment='最近一年的最大回撤的谷值截止日期')
    maxdrawdown_recoverydate_1y = Column(String(10), comment='最近一年的最大回撤修复日期')
    maxdrawdown_recoverymonths_1y = Column(INTEGER(11), comment='最近一年的最大回撤修复区间月份数')
    maxdrawdown_2y = Column(DECIMAL(22, 6), comment='最近两年的最大回撤')
    maxdrawdown_months_2y = Column(INTEGER(11), comment='最近两年的最大回撤区间月份数')
    maxdrawdown_peakdate_2y = Column(String(11), comment='最近两年的最大回撤的峰值值起始日期')
    maxdrawdown_valleydate_2y = Column(String(11), comment='最近两年的最大回撤的谷值截止日期')
    maxdrawdown_recoverydate_2y = Column(INTEGER(11), comment='最近两年的最大回撤修复日期')
    maxdrawdown_recoverymonths_2y = Column(INTEGER(11), comment='最近两年的最大回撤修复区间月份数')
    maxdrawdown_3y = Column(DECIMAL(22, 6), comment='最近三年的最大回撤')
    maxdrawdown_months_3y = Column(INTEGER(11), comment='最近四年的最大回撤区间月份数')
    maxdrawdown_peakdate_3y = Column(String(10), comment='最近四年的最大回撤的峰值值起始日期')
    maxdrawdown_valleydate_3y = Column(String(10), comment='最近五年的最大回撤的谷值截止日期')
    maxdrawdown_recoverydate_3y = Column(String(10), comment='最近三年的最大回撤的谷值截止日期')
    maxdrawdown_recoverymonths_3y = Column(INTEGER(11), comment='最近三年的最大回撤修复区间月份数')
    maxdrawdown_4y = Column(DECIMAL(22, 6), comment='最近四年的最大回撤')
    maxdrawdown_months_4y = Column(INTEGER(11), comment='最近四年的最大回撤区间月份数')
    maxdrawdown_peakdate_4y = Column(String(10), comment='最近四年的最大回撤的峰值值起始日期')
    maxdrawdown_valleydate_4y = Column(String(10), comment='最近四年的最大回撤的谷值截止日期')
    maxdrawdown_recoverydate_4y = Column(String(10), comment='最近四年的最大回撤修复日期')
    maxdrawdown_recoverymonths_4y = Column(INTEGER(11), comment='最近四年的最大回撤修复区间月份数')
    maxdrawdown_5y = Column(DECIMAL(22, 6), comment='最近五年的最大回撤')
    maxdrawdown_10y = Column(DECIMAL(22, 6), comment='最近十年的最大回撤')
    maxdrawdown_months_5y = Column(INTEGER(11), comment='最近五年的最大回撤区间月份数')
    maxdrawdown_peakdate_5y = Column(String(10), comment='最近五年的最大回撤的峰值值起始日期')
    maxdrawdown_valleydate_5y = Column(String(10), comment='最近五年的最大回撤的谷值截止日期')
    maxdrawdown_recoverydate_5y = Column(String(10), comment='最近五年的最大回撤修复日期')
    maxdrawdown_recoverymonths_5y = Column(INTEGER(11), comment='最近五年的最大回撤修复区间月份数')
    maxdrawdown_months_10y = Column(INTEGER(11), comment='最近十年的最大回撤区间月份数')
    maxdrawdown_peakdate_10y = Column(String(10), comment='最近十年的最大回撤的峰值值起始日期')
    maxdrawdown_valleydate_10y = Column(String(10), comment='最近十年的最大回撤的谷值截止日期')
    maxdrawdown_recoverydate_10y = Column(String(10), comment='最近十年的最大回撤修复日期')
    maxdrawdown_recoverymonths_10y = Column(INTEGER(11), comment='最近十年的最大回撤修复区间月份数')
    maxdrawdown_incep = Column(DECIMAL(22, 6), comment='成立以来的最大回撤')
    maxdrawdown_months_incep = Column(INTEGER(11), comment='成立以来的最大回撤区间月份数')
    maxdrawdown_peakdate_incep = Column(String(10), comment='成立以来的最大回撤的峰值值起始日期')
    maxdrawdown_valleydate_incep = Column(String(10), comment='成立以来的最大回撤的谷值截止日期')
    maxdrawdown_recoverydate_incep = Column(String(10), comment='成立以来的最大回撤修复日期')
    maxdrawdown_recoverymonths_incep = Column(INTEGER(11), comment='成立以来的最大回撤修复区间月份数')
赵杰's avatar
赵杰 committed
1006 1007 1008 1009 1010
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1011
class FundRiskadjretStat(Base, BaseModel):
赵杰's avatar
赵杰 committed
1012
    __tablename__ = 'fund_riskadjret_stats'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1013
    __table_args__ = {'comment': '基金风险调整收益指标'}
赵杰's avatar
赵杰 committed
1014 1015

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065
    fund_id = Column(String(64), nullable=False, index=True, comment='基金id')
    end_date = Column(Date, nullable=False, comment='截至日期')
    sharperatio_1y = Column(DECIMAL(22, 6), comment='最近一年的夏普比率')
    sharperatio_2y = Column(DECIMAL(22, 6), comment='最近两年的夏普比率')
    sharperatio_3y = Column(DECIMAL(22, 6), comment='最近三年的夏普比率')
    sharperatio_4y = Column(DECIMAL(22, 6), comment='最近四年的夏普比率')
    sharperatio_5y = Column(DECIMAL(22, 6), comment='最近五年的夏普比率')
    sharperatio_incep = Column(DECIMAL(22, 6), comment='成立以来的夏普比率')
    sortinoratio_1y = Column(DECIMAL(22, 6), comment='最近一年的索提诺比率')
    sortinoratio_2y = Column(DECIMAL(22, 6), comment='最近两年的索提诺比率')
    sortinoratio_3y = Column(DECIMAL(22, 6), comment='最近三年的索提诺比率')
    sortinoratio_4y = Column(DECIMAL(22, 6), comment='最近四年的索提诺比率')
    sortinoratio_5y = Column(DECIMAL(22, 6), comment='最近五年的索提诺比率')
    sortinoratio_incep = Column(DECIMAL(22, 6), comment='成立以来的索提诺比率')
    sortinoratio_MAR_1y = Column(DECIMAL(22, 6), comment='最近一年的索提诺比率(MAR)')
    sortinoratio_MAR_2y = Column(DECIMAL(22, 6), comment='最近两年的索提诺比率(MAR)')
    sortinoratio_MAR_3y = Column(DECIMAL(22, 6), comment='最近三年的索提诺比率(MAR)')
    sortinoratio_MAR_4y = Column(DECIMAL(22, 6), comment='最近四年的索提诺比率(MAR)')
    sortinoratio_MAR_5y = Column(DECIMAL(22, 6), comment='最近五年的索提诺比率(MAR)')
    sortinoratio_MAR_incep = Column(DECIMAL(22, 6), comment='成立以来的索提诺比率(MAR)')
    treynorratio_1y = Column(DECIMAL(22, 6), comment='最近一年的特雷诺比率')
    treynorratio_2y = Column(DECIMAL(22, 6), comment='最近两年的特雷诺比率')
    treynorratio_3y = Column(DECIMAL(22, 6), comment='最近三年的特雷诺比率')
    treynorratio_4y = Column(DECIMAL(22, 6), comment='最近四年的特雷诺比率')
    treynorratio_5y = Column(DECIMAL(22, 6), comment='最近五年的特雷诺比率')
    treynorratio_incep = Column(DECIMAL(22, 6), comment='成立以来的特雷诺比率')
    jensen_1y = Column(DECIMAL(22, 6), comment='最近一年的詹森指数')
    jensen_2y = Column(DECIMAL(22, 6), comment='最近两年的詹森指数')
    jensen_3y = Column(DECIMAL(22, 6), comment='最近三年的詹森指数')
    jensen_4y = Column(DECIMAL(22, 6), comment='最近四年的詹森指数')
    jensen_5y = Column(DECIMAL(22, 6), comment='最近五年的詹森指数')
    jensen_incep = Column(DECIMAL(22, 6), comment='成立以来的詹森指数')
    calmarratio_1y = Column(DECIMAL(22, 6), comment='最近一年的卡玛比率')
    calmarratio_2y = Column(DECIMAL(22, 6), comment='最近两年的卡玛比率')
    calmarratio_3y = Column(DECIMAL(22, 6), comment='最近三年的卡玛比率')
    calmarratio_4y = Column(DECIMAL(22, 6), comment='最近四年的卡玛比率')
    calmarratio_5y = Column(DECIMAL(22, 6), comment='最近五年的卡玛比率')
    calmarratio_incep = Column(DECIMAL(22, 6), comment='成立以来的卡玛比率')
    omegaratio_1y = Column(DECIMAL(22, 6), comment='最近一年的欧米茄比率')
    omegaratio_2y = Column(DECIMAL(22, 6), comment='最近两年的欧米茄比率')
    omegaratio_3y = Column(DECIMAL(22, 6), comment='最近三年的欧米茄比率')
    omegaratio_4y = Column(DECIMAL(22, 6), comment='最近四年的欧米茄比率')
    omegaratio_5y = Column(DECIMAL(22, 6), comment='最近五年的欧米茄比率')
    omegaratio_incep = Column(DECIMAL(22, 6), comment='成立以来的欧米茄比率')
    kapparatio_1y = Column(DECIMAL(22, 6), comment='最近一年的卡帕比率')
    kapparatio_2y = Column(DECIMAL(22, 6), comment='最近两年的卡帕比率')
    kapparatio_3y = Column(DECIMAL(22, 6), comment='最近三年的卡帕比率')
    kapparatio_4y = Column(DECIMAL(22, 6), comment='最近四年的卡帕比率')
    kapparatio_5y = Column(DECIMAL(22, 6), comment='最近五年的卡帕比率')
    kapparatio_incep = Column(DECIMAL(22, 6), comment='成立以来的卡帕比率')
赵杰's avatar
赵杰 committed
1066 1067 1068 1069 1070
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1071
class FundStatu(Base, BaseModel):
赵杰's avatar
赵杰 committed
1072
    __tablename__ = 'fund_status'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1073
    __table_args__ = {'comment': '基金状态'}
赵杰's avatar
赵杰 committed
1074

pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1075 1076 1077 1078 1079
    id = Column(String(64), primary_key=True, comment='基金Id')
    fund_status = Column(String(10), comment='基金运行状态:1-募集中、2-开放运行、3-封闭运行、4-提前清算、5-到期清算、6-发行失败、7-更换管理人、-1-其他')
    status_start_date = Column(Date, comment='募集开始时间')
    status_end_date = Column(Date, comment='募集结束时间')
    liquidate_date = Column(Date, comment='清算日期')
赵杰's avatar
赵杰 committed
1080 1081 1082 1083 1084 1085 1086
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(3), nullable=False)


1087
class FundStrategyRanknum(Base, BaseModel):
赵杰's avatar
赵杰 committed
1088
    __tablename__ = 'fund_strategy_ranknum'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1089
    __table_args__ = {'comment': '策略排名基金总数'}
赵杰's avatar
赵杰 committed
1090 1091

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1092 1093 1094
    strategy = Column(INTEGER(11), comment='基金策略')
    end_date = Column(String(10), nullable=False, comment='截至日期')
    rankfunds_1m = Column(INTEGER(11), comment='参与排名基金数目(最近一个月)')
赵杰's avatar
赵杰 committed
1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112
    rankfunds_3m = Column(INTEGER(11))
    rankfunds_6m = Column(INTEGER(11))
    rankfunds_1y = Column(INTEGER(11))
    rankfunds_2y = Column(INTEGER(11))
    rankfunds_3y = Column(INTEGER(11))
    rankfunds_4y = Column(INTEGER(11))
    rankfunds_5y = Column(INTEGER(11))
    rankfunds_ytd = Column(INTEGER(11))
    ratingnum_1y = Column(INTEGER(11))
    ratingnum_2y = Column(INTEGER(11))
    ratingnum_3y = Column(INTEGER(11))
    ratingnum_4y = Column(INTEGER(11))
    ratingnum_5y = Column(INTEGER(11))
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1113
class FundStyleStat(Base, BaseModel):
赵杰's avatar
赵杰 committed
1114
    __tablename__ = 'fund_style_stats'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1115
    __table_args__ = {'comment': '基金风格指标'}
赵杰's avatar
赵杰 committed
1116 1117

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143
    fund_id = Column(String(64), nullable=False, index=True, comment='基金id')
    end_date = Column(String(10), nullable=False, comment='截至日期')
    upsidecapture_ret_1y = Column(DECIMAL(22, 6), comment='最近一年的上行捕获收益率')
    upsidecapture_ret_2y = Column(DECIMAL(22, 6), comment='最近两年的上行捕获收益率')
    upsidecapture_ret_3y = Column(DECIMAL(22, 6), comment='最近三年的上行捕获收益率')
    upsidecapture_ret_4y = Column(DECIMAL(22, 6), comment='最近四年的上行捕获收益率')
    upsidecapture_ret_5y = Column(DECIMAL(22, 6), comment='最近五年的上行捕获收益率')
    upsidecapture_ret_incep = Column(DECIMAL(22, 6), comment='成立以来的上行捕获收益率')
    downsidecapture_ret_1y = Column(DECIMAL(22, 6), comment='最近一年的下行捕获收益率')
    downsidecapture_ret_2y = Column(DECIMAL(22, 6), comment='最近两年的下行捕获收益率')
    downsidecapture_ret_3y = Column(DECIMAL(22, 6), comment='最近三年的下行捕获收益率')
    downsidecapture_ret_4y = Column(DECIMAL(22, 6), comment='最近四年的下行捕获收益率')
    downsidecapture_ret_5y = Column(DECIMAL(22, 6), comment='最近五年的下行捕获收益率')
    downsidecapture_ret_incep = Column(DECIMAL(22, 6), comment='成立以来的下行捕获收益率')
    upsidecapture_ratio_1y = Column(DECIMAL(22, 6), comment='最近一年的上行捕获率')
    upsidecapture_ratio_2y = Column(DECIMAL(22, 6), comment='最近两年的上行捕获率')
    upsidecapture_ratio_3y = Column(DECIMAL(22, 6), comment='最近三年的上行捕获率')
    upsidecapture_ratio_4y = Column(DECIMAL(22, 6), comment='最近四年的上行捕获率')
    upsidecapture_ratio_5y = Column(DECIMAL(22, 6), comment='最近五年的上行捕获率')
    upsidecapture_ratio_incep = Column(DECIMAL(22, 6), comment='成立以来的上行捕获率')
    downsidecapture_ratio_1y = Column(DECIMAL(22, 6), comment='最近一年的下行捕获率')
    downsidecapture_ratio_2y = Column(DECIMAL(22, 6), comment='最近两年的下行捕获率')
    downsidecapture_ratio_3y = Column(DECIMAL(22, 6), comment='最近三年的下行捕获率')
    downsidecapture_ratio_4y = Column(DECIMAL(22, 6), comment='最近四年的下行捕获率')
    downsidecapture_ratio_5y = Column(DECIMAL(22, 6), comment='最近五年的下行捕获率')
    downsidecapture_ratio_incep = Column(DECIMAL(22, 6), comment='成立以来的下行捕获率')
赵杰's avatar
赵杰 committed
1144 1145 1146 1147 1148
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1149
class IndexesProfile(Base, BaseModel):
赵杰's avatar
赵杰 committed
1150
    __tablename__ = 'indexes_profile'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167
    __table_args__ = {'comment': '指数基本信息'}

    id = Column(String(64), primary_key=True, comment='指数Id')
    index_id = Column(String(10), comment='指数ID')
    index_type_id = Column(INTEGER(11), comment='指数类型:1-对冲基金指数、2-信心指数、3-公募基金指数、4-沪深港股票指数、5-全球股票指数、6-金汇期指、7-无风险利率、-1-其他')
    index_code = Column(String(60), comment='指数代码')
    index_name = Column(String(255), comment='指数中文全称')
    index_short_name = Column(String(80), comment='指数中文简称')
    index_area_flag = Column(INTEGER(11), comment='1-中国,2-全球')
    index_family_id = Column(String(64), comment='指数提供机构ID')
    pricing_frequency = Column(INTEGER(11), comment='指数发布周期,1-日度、2-周、3-月度、4-季度、5-半年度、6-年度')
    inception_date = Column(Date, comment='指数基期,指数开始日期')
    index_initial_value = Column(DECIMAL(22, 6), comment='指数基点')
    base_currency = Column(INTEGER(11), comment='计算指数所使用的货币,1-人民币,2-港币,3-美元,4-新加坡元、-1-其他')
    calculation_method = Column(String(80), comment='编制指数所使用的计算方法')
    weighting_scheme = Column(String(80), comment='计算成份基金权重的方法')
    selection_scheme = Column(String(80), comment='成份基金筛选方法')
赵杰's avatar
赵杰 committed
1168 1169 1170 1171 1172 1173 1174
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1175
class PersonnelCompanyMapping(Base, BaseModel):
赵杰's avatar
赵杰 committed
1176
    __tablename__ = 'personnel_company_mapping'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1177
    __table_args__ = {'comment': '人员公司匹配表'}
赵杰's avatar
赵杰 committed
1178 1179 1180

    id = Column(String(62), primary_key=True)
    personnel_id = Column(String(64), nullable=False)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193
    company_id = Column(String(64), nullable=False, comment='任职公司id')
    company_order = Column(INTEGER(11), comment='公司次序')
    personnel_order = Column(INTEGER(11), comment='人物次序')
    address = Column(String(80), comment='联系地址')
    is_keyfigure = Column(INTEGER(11), comment='是否为核心人物标志,1-是,0-否,-1-其他')
    is_include = Column(INTEGER(11), comment='是否纳入团队信息')
    is_visible = Column(INTEGER(11), comment='人物是否在前台可见:1-可见,0-禁止显示')
    is_leave = Column(INTEGER(11), comment='人物是否离职:1-是,0-否')
    is_default = Column(INTEGER(11), comment='默认任职公司:1-是,0-否')
    is_senior = Column(TINYINT(4), comment='是否高管:1-是,0-否')
    is_represent = Column(TINYINT(4), comment='是否法人:1-是,0-否')
    start_date = Column(Date, comment='任职开始日期')
    end_date = Column(Date, comment='任职结束日期')
赵杰's avatar
赵杰 committed
1194 1195 1196 1197 1198 1199 1200
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1201
class PersonnelCompanyPositionMapping(Base, BaseModel):
赵杰's avatar
赵杰 committed
1202
    __tablename__ = 'personnel_company_position_mapping'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1203
    __table_args__ = {'comment': '人员在公司职务信息'}
赵杰's avatar
赵杰 committed
1204 1205

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1206 1207 1208 1209 1210 1211 1212 1213 1214
    personnel_id = Column(String(64), nullable=False, comment='人物id')
    company_id = Column(String(64), nullable=False, comment='公司id')
    personnel_type = Column(INTEGER(11), nullable=False, comment='人员类型:1-基金经理 2-投研 3-联系人 4-市场 5-合规风控 6-公司高管 7-公司法人 -1-其他')
    position = Column(String(40), nullable=False, comment='当前职位')
    department = Column(String(50), comment='任职部门')
    is_default = Column(INTEGER(11), comment='是否默认职位信息:1-是,0-否')
    start_date = Column(Date, comment='任职开始日期')
    end_date = Column(Date, comment='任职结束日期')
    position_order = Column(INTEGER(11), comment='职位次序')
赵杰's avatar
赵杰 committed
1215 1216 1217 1218 1219 1220 1221
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1222
class PersonnelInfo(Base, BaseModel):
赵杰's avatar
赵杰 committed
1223
    __tablename__ = 'personnel_info'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250
    __table_args__ = {'comment': '人物信息表'}

    id = Column(String(64), primary_key=True, comment='人员id')
    personnel_name = Column(String(40), nullable=False, comment='姓名')
    avatar = Column(String(255), comment='人员头像')
    personnel_type = Column(INTEGER(11), server_default=text("'-1'"), comment='人员类别,1-基金经理,2-研究员、3-联系人、-1-其他')
    profession_background = Column(TINYINT(4), server_default=text("'-1'"), comment='职业背景:1-券商,2-公募,3-其他金融机构,4-媒体,5-海外,6-民间,7-期货,8-实业、9-学者、10-银行、11-信托、12-保险、13-私募、-1-其他')
    key_figure = Column(INTEGER(11), server_default=text("'-1'"), comment='是否为核心人物标志,1-是,0-否,-1-其他')
    company_id = Column(String(64), index=True, comment='就职公司id')
    position = Column(String(64), comment='当前职位')
    career_start_year = Column(String(4), comment='从业开始年份')
    investment_experience = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='从业年限,<量纲:年>,-1:从业年限不详')
    sex = Column(INTEGER(11), comment='性别,1-男,2-女,-1-其他')
    graduateschool = Column(String(100), server_default=text("''"), comment='毕业院校')
    education = Column(INTEGER(11), server_default=text("'0'"), comment='最高学历:1-小学、2-中学、3-大专、4-本科,5-硕士,6-博士,7-博士后,-1-其他')
    major = Column(String(40), server_default=text("''"), comment='主修专业')
    profile = Column(Text, comment='人物简介')
    porder = Column(INTEGER(11), server_default=text("'0'"), comment='人物次序')
    ifinclude = Column(INTEGER(11), server_default=text("'0'"), comment='是否纳入团队信息')
    isvisible = Column(INTEGER(3), server_default=text("'1'"), comment='人物是否在前台可见:1-可见,0-禁止显示')
    is_qualify = Column(TINYINT(4), comment='是否有从业资格:1-是,2-否')
    topic = Column(Text, comment='荣誉名称')
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间')
    update_time = Column(TIMESTAMP, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='修改时间;第一次创建时与CreatTime值相同,修改时与修改时间相同')
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='记录的有效性;1-无效;0-有效;')


1251
class QrQualitativeReport(Base, BaseModel):
赵杰's avatar
赵杰 committed
1252
    __tablename__ = 'qr_qualitative_report'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271
    __table_args__ = {'comment': '公司定性报告信息'}

    id = Column(String(64), primary_key=True, comment='定性报告ID,主键')
    company_id = Column(String(64), comment='公司id')
    organization_name = Column(String(80), nullable=False, comment='公司名称')
    report_name = Column(String(180), nullable=False, comment='报告名称')
    report_date = Column(Date, comment='报告日期')
    linkman = Column(String(50), comment='联系人')
    linkman_position = Column(String(30), comment='联系人职位')
    linkman_mobile = Column(String(20), comment='联系人电话')
    linkman_email = Column(String(50), comment='联系人邮箱')
    visiting_personnel = Column(String(50), comment='走访人员')
    visit_date = Column(Date, comment='走访时间')
    visit_way = Column(INTEGER(11), comment='走访方式:1-电话尽调 2-现场走访')
    report_source = Column(TINYINT(4), comment='报告来源:1-机构 2-组合大师')
    source_id = Column(INTEGER(11), comment='来源ID,组合大师用户打分模板ID. 0=模板')
    report_status = Column(TINYINT(4), comment='报告状态:0-草稿 1-发布')
    is_admin = Column(TINYINT(4), comment='是否管理员填写: 0-否, 1-是\t')
    completion_rate = Column(DECIMAL(22, 6), comment='完成比例')
赵杰's avatar
赵杰 committed
1272 1273 1274 1275 1276 1277 1278
    create_by = Column(String(64))
    create_time = Column(DateTime)
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1279
class RzIndex(Base, BaseModel):
赵杰's avatar
赵杰 committed
1280
    __tablename__ = 'rz_index'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1281
    __table_args__ = {'comment': '融智指数'}
赵杰's avatar
赵杰 committed
1282 1283

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1284 1285 1286 1287
    index_id = Column(String(64), nullable=False, index=True, comment='指数ID与index_profile的index_id关联')
    index_code = Column(String(64), nullable=False, index=True, comment='指数代码来源于indexes_profile')
    end_date = Column(Date, nullable=False, comment='指数截止月份')
    index_value = Column(DECIMAL(22, 0), nullable=False, comment='本期指数')
赵杰's avatar
赵杰 committed
1288 1289 1290 1291 1292
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1293
class StockIndustryType(Base, BaseModel):
赵杰's avatar
赵杰 committed
1294
    __tablename__ = 'stock_industry_type'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1295
    __table_args__ = {'comment': '股票行业分类'}
赵杰's avatar
赵杰 committed
1296 1297

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1298 1299 1300 1301
    stock_industry_id = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='股票行业分类(申万行业分类):1-农林牧渔、2-采掘、3-化工、4-黑色金属、5-有色金属、6-建筑建材、7-机械设备、8-电子元器件、9-交运设备、10-信息设备、11-家用电器、12-食品饮料、13-纺织服装、14-轻工制造、15-医药生物、16-公用事业、17-交通运输、18-房地产、19-金融服务、20-商业贸易、21-餐饮旅游、22-信息服务、23-综合、-1-其他')
    stock_industry_type = Column(String(64), nullable=False, comment='股票行业分类')
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间,默认第一次创建的getdate()时间')
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='修改时间;第一次创建时与CreatTime值相同,修改时与修改时间相同')
赵杰's avatar
赵杰 committed
1302 1303 1304
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1305
class StockInfo(Base, BaseModel):
赵杰's avatar
赵杰 committed
1306
    __tablename__ = 'stock_info'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1307
    __table_args__ = {'comment': '股票信息'}
赵杰's avatar
赵杰 committed
1308 1309

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1310 1311 1312
    stock_code = Column(String(64), nullable=False, index=True, comment='股票代码')
    stock_type = Column(String(3), nullable=False, comment='股票类型')
    stock_name = Column(String(64), nullable=False, comment='股票简称')
赵杰's avatar
赵杰 committed
1313 1314 1315 1316 1317
    create_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
    update_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))


1318
class UserComposeFundCount(Base, BaseModel):
赵杰's avatar
赵杰 committed
1319
    __tablename__ = 'user_compose_fund_count'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1320
    __table_args__ = {'comment': '用户组合基金收益'}
赵杰's avatar
赵杰 committed
1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334

    id = Column(String(64), primary_key=True)
    user_id = Column(String(255), nullable=False)
    fund_id = Column(String(255), nullable=False)
    profit_ratio = Column(String(255))
    profit_ratio_total = Column(DECIMAL(10, 0))
    fund_index = Column(DECIMAL(22, 6))
    create_time = Column(DateTime)
    create_by = Column(String(64))
    update_by = Column(String(64))
    update_time = Column(DateTime)
    delete_tag = Column(INTEGER(3), nullable=False)


1335
class UserHoldFundInfo(Base, BaseModel):
赵杰's avatar
赵杰 committed
1336
    __tablename__ = 'user_hold_fund_info'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353
    __table_args__ = {'comment': '用户持仓信息'}

    id = Column(String(64), primary_key=True, comment='唯一主键')
    user_id = Column(String(64), nullable=False, comment='用户ID')
    p_fund_id = Column(String(64), comment='组合基金ID')
    fund_id = Column(String(64), nullable=False, comment='基金ID')
    buy_fee_ratio = Column(DECIMAL(22, 6), comment='申购费率')
    confirm_share = Column(DECIMAL(22, 6), comment='确认份额')
    confirm_share_date = Column(DateTime, comment='确认份额日期')
    confirm_amount = Column(INTEGER(11), comment='确认金额(单位:分)')
    fund_nav_id = Column(String(64), comment='确认单位净值')
    fund_nav = Column(DECIMAL(22, 6), comment='确认单位净值')
    init_weight = Column(DECIMAL(22, 6), comment='初始权重')
    cost_amount = Column(INTEGER(11), comment='成本(单位:分)')
    market_value = Column(INTEGER(11), comment='市值(单位:分)')
    profit_loss = Column(INTEGER(11), comment='盈亏(单位:分)')
    match_ratio = Column(DECIMAL(22, 6), comment='配比')
赵杰's avatar
赵杰 committed
1354 1355 1356 1357 1358 1359 1360
    create_time = Column(DateTime)
    create_by = Column(String(64))
    update_time = Column(DateTime)
    update_by = Column(String(64))
    delete_tag = Column(INTEGER(3), nullable=False)


1361
class UserHoldFundInfoHistory(Base, BaseModel):
赵杰's avatar
赵杰 committed
1362
    __tablename__ = 'user_hold_fund_info_history'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380
    __table_args__ = {'comment': '用户历史持仓变动'}

    id = Column(String(64), primary_key=True, comment='唯一主键')
    user_id = Column(String(64), nullable=False, comment='用户ID')
    p_fund_id = Column(String(64), comment='组合基金ID')
    fund_id = Column(String(64), nullable=False, comment='基金ID')
    buy_fee_ratio = Column(DECIMAL(22, 6), comment='申购费率')
    confirm_share = Column(DECIMAL(22, 6), comment='确认份额')
    confirm_share_date = Column(DateTime, comment='确认份额日期')
    confirm_amount = Column(INTEGER(11), comment='确认金额(单位:分)')
    fund_nav_id = Column(String(64), comment='确认单位净值')
    fund_nav = Column(DECIMAL(22, 6), comment='确认单位净值')
    init_weight = Column(DECIMAL(22, 6), comment='初始权重')
    cost_amount = Column(INTEGER(11), comment='成本(单位:分)')
    market_value = Column(INTEGER(11), comment='市值(单位:分)')
    profit_loss = Column(INTEGER(11), comment='盈亏(单位:分)')
    match_ratio = Column(DECIMAL(22, 6), comment='配比')
    ratio_transfer = Column(DECIMAL(22, 6), comment='较上次调仓')
赵杰's avatar
赵杰 committed
1381 1382 1383 1384 1385 1386 1387
    create_time = Column(DateTime)
    create_by = Column(String(64))
    update_time = Column(DateTime)
    update_by = Column(String(64))
    delete_tag = Column(INTEGER(3), nullable=False)


1388
class UserSingleFundCount(Base, BaseModel):
赵杰's avatar
赵杰 committed
1389
    __tablename__ = 'user_single_fund_count'
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1390
    __table_args__ = {'comment': '用户单只基金收益统计'}
赵杰's avatar
赵杰 committed
1391 1392

    id = Column(String(64), primary_key=True)
pengxiong@wealthgrow.cn's avatar
pengxiong@wealthgrow.cn committed
1393 1394 1395 1396 1397
    user_id = Column(String(64), nullable=False, comment='用户ID')
    fund_id = Column(String(64), nullable=False, comment='基金ID')
    count_date = Column(Date, nullable=False, comment='统计日期')
    profit_radio = Column(DECIMAL(22, 6), comment='收益率')
    retracement_radio = Column(DECIMAL(22, 6), comment='回撤率')
赵杰's avatar
赵杰 committed
1398 1399 1400 1401 1402
    create_time = Column(DateTime)
    create_by = Column(String(64))
    update_time = Column(DateTime)
    update_by = Column(String(64))
    delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))