You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							219 lines
						
					
					
						
							13 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							219 lines
						
					
					
						
							13 KiB
						
					
					
				
								from sqlalchemy import Column, Float, Integer, String, Text, DateTime, Boolean, ForeignKey, UniqueConstraint, Index, \
							 | 
						|
								    text
							 | 
						|
								from config.database import Base
							 | 
						|
								from datetime import datetime
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetadataExtractInfo(Base):
							 | 
						|
								    """
							 | 
						|
								    元数据采集信息表
							 | 
						|
								    """
							 | 
						|
								    __tablename__ = 't_metadata_extract_info'
							 | 
						|
								
							 | 
						|
								    onum = Column(Integer, primary_key=True, comment='唯一编号')
							 | 
						|
								    extract_ver_num = Column(String(50, collation='utf8_general_ci'), comment='采集版本号')
							 | 
						|
								    ver_desc = Column(String(250, collation='utf8_general_ci'), comment='版本描述')
							 | 
						|
								    ssys_id = Column(Integer, comment='系统代码')
							 | 
						|
								    data_whs_name = Column(String(50, collation='utf8_general_ci'), comment='数据仓库名称')
							 | 
						|
								    mdl_name = Column(String(50, collation='utf8_general_ci'), comment='模式名称')
							 | 
						|
								    tab_no = Column(Integer, comment='表编号')
							 | 
						|
								    tab_type = Column(String(50, collation='utf8_general_ci'), comment='表类型')
							 | 
						|
								    tab_eng_name = Column(String(250, collation='utf8_general_ci'), comment='表英文名称')
							 | 
						|
								    tab_cn_name = Column(String(250, collation='utf8_general_ci'), comment='表中文名称')
							 | 
						|
								    tab_rec_num = Column(Integer, comment='记录数')
							 | 
						|
								    upd_time = Column(DateTime, comment='更新时间')
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetadataSuppInfo(Base):
							 | 
						|
								    """
							 | 
						|
								    元数据补充信息表
							 | 
						|
								    """
							 | 
						|
								    __tablename__ = 't_metadata_supp_info'
							 | 
						|
								
							 | 
						|
								    # onum = Column(Integer, primary_key=True, comment='唯一编号')
							 | 
						|
								    onum = Column(String(36, collation='utf8mb4_unicode_ci'), primary_key=True, comment='唯一编号')
							 | 
						|
								    crrct_ver_num = Column(String(50, collation='utf8_general_ci'), comment='补录版本号')
							 | 
						|
								    ssys_id = Column(Integer, comment='系统代码')
							 | 
						|
								    mdl_name = Column(String(50, collation='utf8_general_ci'), comment='模型名称')
							 | 
						|
								    tab_eng_name = Column(String(250, collation='utf8_general_ci'), comment='表英文名称')
							 | 
						|
								    tab_crrct_name = Column(String(250, collation='utf8_general_ci'), comment='表补录名称')
							 | 
						|
								    tab_desc = Column(String(500, collation='utf8_general_ci'), comment='表描述')
							 | 
						|
								    pic = Column(String(64, collation='utf8_general_ci'), comment='表图片')
							 | 
						|
								    gov_flag = Column(String(1, collation='utf8_general_ci'), default='0', comment='治理标志(0否 1是)')
							 | 
						|
								    rec_stat = Column(String(1, collation='utf8_general_ci'), default='0', comment='记录状态(0有效 1无效)')
							 | 
						|
								    tab_clas = Column(Text, comment='表分类')
							 | 
						|
								    rec_subm_prsn = Column(String(255, collation='utf8_general_ci'), comment='记录提交人')
							 | 
						|
								    upd_time = Column(DateTime, comment='更新时间')
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetadataSuppInfoVett(Base):
							 | 
						|
								    """
							 | 
						|
								    元数据补充信息审批表
							 | 
						|
								    """
							 | 
						|
								    __tablename__ = 't_metadata_supp_info_vett'
							 | 
						|
								
							 | 
						|
								    # onum = Column(Integer, primary_key=True, comment='唯一编号')
							 | 
						|
								    onum = Column(String(36, collation='utf8mb4_unicode_ci'), primary_key=True, comment='唯一编号')
							 | 
						|
								    crrct_ver_num = Column(String(50, collation='utf8_general_ci'), comment='补录版本号')
							 | 
						|
								    ssys_id = Column(Integer, comment='系统代码')
							 | 
						|
								    mdl_name = Column(String(50, collation='utf8_general_ci'), comment='模型名称')
							 | 
						|
								    tab_eng_name = Column(String(250, collation='utf8_general_ci'), comment='表英文名称')
							 | 
						|
								    tab_crrct_name = Column(String(250, collation='utf8_general_ci'), comment='表补录名称')
							 | 
						|
								    tab_desc = Column(String(500, collation='utf8_general_ci'), comment='表描述')
							 | 
						|
								    pic = Column(String(64, collation='utf8_general_ci'), comment='表图片')
							 | 
						|
								    gov_flag = Column(String(1, collation='utf8_general_ci'), default='0', comment='治理标志(0否 1是)')
							 | 
						|
								    rec_stat = Column(String(1, collation='utf8_general_ci'), default='0', comment='记录状态(0有效 1无效)')
							 | 
						|
								    tab_clas = Column(Text, comment='表分类')
							 | 
						|
								    rec_subm_prsn = Column(String(255, collation='utf8_general_ci'), comment='记录提交人')
							 | 
						|
								    apply_time = Column(String(255, collation='utf8_general_ci'), comment='申请时间')
							 | 
						|
								    apply_status = Column(String(255, collation='utf8_general_ci'), comment='申请状态')
							 | 
						|
								    upd_time = Column(String(255, collation='utf8_general_ci'), comment='更新时间')
							 | 
						|
								    business_id = Column(String(255, collation='utf8_general_ci'), comment='审批业务相关ID')
							 | 
						|
								    oldTableData = Column(Text, comment='修改前表格数据')
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetadataClas(Base):
							 | 
						|
								    """
							 | 
						|
								    元数据分类表
							 | 
						|
								    """
							 | 
						|
								    __tablename__ = 't_metadata_clas'
							 | 
						|
								
							 | 
						|
								    clas_onum = Column(Integer, primary_key=True, comment='分类编号')
							 | 
						|
								    # clas_pri_clas = Column(String(50, collation='utf8_general_ci'), comment='一级分类')
							 | 
						|
								    # clas_scd_clas = Column(String(50, collation='utf8_general_ci'), comment='二级分类')
							 | 
						|
								    clas_tmpl = Column(String(200, collation='utf8_general_ci'), comment='标签模板')
							 | 
						|
								    # clas_thre_clas = Column(String(50, collation='utf8_general_ci'), comment='三级分类')
							 | 
						|
								    clas_name = Column(String(255, collation='utf8_general_ci'), comment='分类名称')
							 | 
						|
								    clas_eff_flag = Column(String(1, collation='utf8_general_ci'), default='0', comment='生效标志(0有效 1无效)')
							 | 
						|
								    rec_subm_prsn = Column(String(255, collation='utf8_general_ci'), comment='记录提交人')
							 | 
						|
								    upd_time = Column(DateTime, comment='更新时间')
							 | 
						|
								    belt_batch_content = Column(Integer, default=None, comment='分类')
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetadataFldTabExtractInfo(Base):
							 | 
						|
								    """
							 | 
						|
								    字段采集信息表
							 | 
						|
								    """
							 | 
						|
								    __tablename__ = 't_metadata_fld_tab_extract_info'
							 | 
						|
								
							 | 
						|
								    onum = Column(Integer, primary_key=True, comment='唯一编号')
							 | 
						|
								    extract_ver_num = Column(String(50, collation='utf8_general_ci'), comment='采集版本号')
							 | 
						|
								    ssys_id = Column(Integer, comment='系统代码')
							 | 
						|
								    data_whs_name = Column(String(255, collation='utf8_general_ci'), comment='数据仓库名称')
							 | 
						|
								    mdl_name = Column(String(255, collation='utf8_general_ci'), comment='模块名称')
							 | 
						|
								    tab_no = Column(String(50, collation='utf8_general_ci'), comment='表编号')
							 | 
						|
								    tab_eng_name = Column(String(250, collation='utf8_general_ci'), comment='表英文名称')
							 | 
						|
								    fld_no = Column(Integer, comment='字段编号')
							 | 
						|
								    fld_eng_name = Column(String(255, collation='utf8_general_ci'), comment='字段英文名称')
							 | 
						|
								    fld_cn_name = Column(String(255, collation='utf8_general_ci'), comment='字段中文名称')
							 | 
						|
								    fld_type = Column(String(50, collation='utf8_general_ci'), comment='字段类型')
							 | 
						|
								    pk_flag = Column(Boolean, default=False, comment='是否为主键')  # 待确认字段类型
							 | 
						|
								    require_flag = Column(Boolean, default=False, comment='是否必填')
							 | 
						|
								    idx_flag = Column(Boolean, default=False, comment='是否为索引')
							 | 
						|
								    upd_time = Column(DateTime, comment='更新时间')
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetadataFldSuppInfo(Base):
							 | 
						|
								    """
							 | 
						|
								    字段补充信息表
							 | 
						|
								    """
							 | 
						|
								    __tablename__ = 't_metadata_fld_supp_info'
							 | 
						|
								
							 | 
						|
								    onum = Column(String(50, collation='utf8_general_ci'), primary_key=True, comment='唯一编号')
							 | 
						|
								    crrct_ver_num = Column(String(50, collation='utf8_general_ci'), comment='补充版本号')
							 | 
						|
								    ssys_id = Column(Integer, comment='系统代码')
							 | 
						|
								    mdl_name = Column(String(255, collation='utf8_general_ci'), comment='模块名称')
							 | 
						|
								    tab_eng_name = Column(String(250, collation='utf8_general_ci'), comment='表英文名称')
							 | 
						|
								    fld_eng_name = Column(String(255, collation='utf8_general_ci'), comment='字段英文名称')
							 | 
						|
								    fld_crrct_name = Column(String(255, collation='utf8_general_ci'), comment='补充字段名称')
							 | 
						|
								    crrct_pk_flag = Column(Boolean, default=False, comment='是否为主键')
							 | 
						|
								    fld_desc = Column(String(255, collation='utf8_general_ci'), comment='字段描述')
							 | 
						|
								    pic = Column(String(255, collation='utf8_general_ci'), comment='图片字段')
							 | 
						|
								    fld_clas = Column(Text, comment='字段分类')
							 | 
						|
								    fld_null_rate = Column(String(50, collation='utf8_general_ci'), comment='字段空值率')
							 | 
						|
								    data_dict_id = Column(String(50, collation='utf8_general_ci'), comment='数据字典ID')
							 | 
						|
								    data_sec_lvl = Column(String(50, collation='utf8_general_ci'), comment='字段安全等级')
							 | 
						|
								    rec_stat = Column(String(50, collation='utf8_general_ci'), comment='记录状态')
							 | 
						|
								    upd_time = Column(DateTime, comment='更新时间')
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetadataFldSuppInfoVett(Base):
							 | 
						|
								    """
							 | 
						|
								    字段补充信息表
							 | 
						|
								    """
							 | 
						|
								    __tablename__ = 't_metadata_fld_supp_info_vett'
							 | 
						|
								
							 | 
						|
								    onum = Column(String(50, collation='utf8_general_ci'), primary_key=True, comment='唯一编号')
							 | 
						|
								    crrct_ver_num = Column(String(50, collation='utf8_general_ci'), comment='补充版本号')
							 | 
						|
								    ssys_id = Column(Integer, comment='系统代码')
							 | 
						|
								    mdl_name = Column(String(255, collation='utf8_general_ci'), comment='模块名称')
							 | 
						|
								    tab_eng_name = Column(String(250, collation='utf8_general_ci'), comment='表英文名称')
							 | 
						|
								    fld_eng_name = Column(String(255, collation='utf8_general_ci'), comment='字段英文名称')
							 | 
						|
								    fld_crrct_name = Column(String(255, collation='utf8_general_ci'), comment='补充字段名称')
							 | 
						|
								    crrct_pk_flag = Column(Boolean, default=False, comment='是否为主键')
							 | 
						|
								    fld_desc = Column(String(255, collation='utf8_general_ci'), comment='字段描述')
							 | 
						|
								    pic = Column(String(255, collation='utf8_general_ci'), comment='图片字段')
							 | 
						|
								    fld_clas = Column(Text, comment='字段分类')
							 | 
						|
								    fld_null_rate = Column(String(50, collation='utf8_general_ci'), comment='字段空值率')
							 | 
						|
								    data_dict_id = Column(String(50, collation='utf8_general_ci'), comment='数据字典ID')
							 | 
						|
								    data_sec_lvl = Column(String(50, collation='utf8_general_ci'), comment='字段安全等级')
							 | 
						|
								    rec_stat = Column(String(50, collation='utf8_general_ci'), comment='记录状态')
							 | 
						|
								    upd_time = Column(DateTime, comment='更新时间')
							 | 
						|
								    rec_subm_prsn = Column(String(255, collation='utf8_general_ci'), comment='记录提交人')
							 | 
						|
								    apply_time = Column(String(255, collation='utf8_general_ci'), comment='申请时间')
							 | 
						|
								    apply_status = Column(String(255, collation='utf8_general_ci'), comment='申请状态')
							 | 
						|
								    business_id = Column(String(255, collation='utf8_general_ci'), comment='审批业务相关ID')
							 | 
						|
								    oldColumnData = Column(Text, comment='修改前字段信息')
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetaBatchTabClas(Base):
							 | 
						|
								    """表格标签表"""
							 | 
						|
								    __tablename__ = 't_batch_tab_clas'
							 | 
						|
								
							 | 
						|
								    onum = Column(Integer, primary_key=True, comment='序号(主键自增)')
							 | 
						|
								    ssys_id = Column(Integer, comment='源系统id')
							 | 
						|
								    data_whs_name = Column(String(50, collation='utf8_general_ci'), comment='数据库名称')
							 | 
						|
								    mdl_name = Column(String(50, collation='utf8_general_ci'), comment='模式名称')
							 | 
						|
								    tab_no = Column(Integer, comment='表编号')
							 | 
						|
								    tab_eng_name = Column(String(200, collation='utf8_general_ci'), comment='表英文名称')
							 | 
						|
								    clas_onum = Column(String(200, collation='utf8_general_ci'), comment='标签序号')
							 | 
						|
								    clas_value = Column(String(200, collation='utf8_general_ci'), comment='标签值')
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetaBatchFldClas(Base):
							 | 
						|
								    """字段标签表"""
							 | 
						|
								    __tablename__ = 't_batch_fld_clas'
							 | 
						|
								
							 | 
						|
								    onum = Column(Integer, primary_key=True, comment='序号(主键自增)')
							 | 
						|
								    ssys_id = Column(Integer, comment='源系统代码')
							 | 
						|
								    data_whs_name = Column(String(50, collation='utf8_general_ci'), comment='数据库名称')
							 | 
						|
								    mdl_name = Column(String(50, collation='utf8_general_ci'), comment='模式名称')
							 | 
						|
								    tab_no = Column(Integer, comment='表编号')
							 | 
						|
								    tab_eng_name = Column(String(200, collation='utf8_general_ci'), comment='表英文名称')
							 | 
						|
								    fld_eng_name = Column(String(200, collation='utf8_general_ci'), comment='字段英文名称')
							 | 
						|
								    clas_onum = Column(String(200, collation='utf8_general_ci'), comment='标签序号')
							 | 
						|
								    clas_value = Column(String(200, collation='utf8_general_ci'), comment='标签值')
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								class MetaBloodAnalysis(Base):
							 | 
						|
								    """血緣分析表"""
							 | 
						|
								    __tablename__ = 'meta_blood_analysis'
							 | 
						|
								
							 | 
						|
								    id = Column(String(50, collation='utf8_general_ci'), primary_key=True, comment='id')
							 | 
						|
								    proId = Column(Integer, comment='存储过程ID')
							 | 
						|
								    proName = Column(String(100, collation='utf8_general_ci'), comment='存储过程名称')
							 | 
						|
								    targetSysId = Column(String(100, collation='utf8_general_ci'), comment='目标系统')
							 | 
						|
								    targetMdlName = Column(String(100, collation='utf8_general_ci'), comment='目标模式')
							 | 
						|
								    targetTableName = Column(String(100, collation='utf8_general_ci'), comment='目标表')
							 | 
						|
								    targetTableCnName = Column(String(100, collation='utf8_general_ci'), comment='目标表中文名')
							 | 
						|
								    targetColName = Column(String(100, collation='utf8_general_ci'), comment='目标字段名')
							 | 
						|
								    targetColCnName = Column(String(100, collation='utf8_general_ci'), comment='目标字段中文名')
							 | 
						|
								    targetColType = Column(String(100, collation='utf8_general_ci'), comment='目标字段类型')
							 | 
						|
								    sourceSysId = Column(String(100, collation='utf8_general_ci'), comment='源系统代码')
							 | 
						|
								    sourceMdlName = Column(String(100, collation='utf8_general_ci'), comment='源系统模式')
							 | 
						|
								    sourceTableName = Column(String(100, collation='utf8_general_ci'), comment='源系统表名')
							 | 
						|
								    sourceTableCnName = Column(String(100, collation='utf8_general_ci'), comment='源系统表中文名')
							 | 
						|
								    sourceColName = Column(String(100, collation='utf8_general_ci'), comment='源系统字段名')
							 | 
						|
								    sourceColCnName = Column(String(100, collation='utf8_general_ci'), comment='源系统字段中文名')
							 | 
						|
								    sourceColType = Column(String(100, collation='utf8_general_ci'), comment='源系统字段类型')
							 | 
						|
								
							 | 
						|
								
							 |