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.
		
		
		
		
		
			
		
			
				
					
					
						
							205 lines
						
					
					
						
							13 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							205 lines
						
					
					
						
							13 KiB
						
					
					
				| from sqlalchemy import Column, Integer, String, DateTime, Text, DateTime, Date, BigInteger | |
| from config.database import Base | |
| from datetime import datetime | |
| from sqlalchemy.dialects.mysql import MEDIUMTEXT | |
| 
 | |
| 
 | |
| # 数据标准模块相关表 | |
| 
 | |
| class DataStdCode(Base): | |
|     """ | |
|     标准代码表 (Standard Code Table) | |
|     """ | |
|     __tablename__ = 't_data_cd_val' | |
| 
 | |
|     onum = Column(String(50), primary_key=True, comment='标准代码Id') | |
|     create_by = Column(String(20), default='', comment='创建者') | |
|     create_time = Column(DateTime, nullable=True, default=None, comment='创建时间') | |
|     upd_prsn = Column(String(20), default='', comment='更新者') | |
|     upd_time = Column(DateTime, nullable=True, default=None, comment='更新时间') | |
|     cd_no = Column(String(50), default=None, comment='标准代码编号') | |
|     cd_val_cn_mean = Column(String(200), default=None, comment='标准代码值') | |
|     cd_type = Column(String(10), default=None, comment='标准代码类型(sys:系统级 company:公司级)') | |
|     cd_val_stat = Column(String(1), default=None, comment='代码状态(0:有效 1:无效)') | |
|     src_sys = Column(String(50), default=None, comment='归属系统') | |
|     class_id = Column(String(10), default=None, comment='代码类型(code:代码 codeItem:代码项)') | |
|     parent_id = Column(String(50), default=None, comment='父id') | |
|     code_map_id = Column(String(50), default=None, comment='标准代码Id') | |
| 
 | |
| 
 | |
| class DataStdCodeAppr(Base): | |
|     """ | |
|     标准代码表 (Standard Code Table) | |
|     """ | |
|     __tablename__ = 't_data_cd_val_appr' | |
| 
 | |
|     onum = Column(String(50), primary_key=True, comment='标准代码Id') | |
|     create_by = Column(String(20), default='', comment='创建者') | |
|     create_time = Column(DateTime, nullable=True, default=None, comment='创建时间') | |
|     upd_prsn = Column(String(20), default='', comment='更新者') | |
|     upd_time = Column(DateTime, nullable=True, default=None, comment='更新时间') | |
|     cd_no = Column(String(50), default=None, comment='标准代码编号') | |
|     cd_val_cn_mean = Column(String(200), default=None, comment='标准代码值') | |
|     cd_type = Column(String(10), default=None, comment='标准代码类型(sys:系统级 company:公司级)') | |
|     cd_val_stat = Column(String(1), default=None, comment='代码状态(0:有效 1:无效)') | |
|     src_sys = Column(String(50), default=None, comment='归属系统') | |
|     class_id = Column(String(10), default=None, comment='代码类型(code:代码 codeItem:代码项)') | |
|     parent_id = Column(String(50), default=None, comment='父id') | |
|     code_map_id = Column(String(50), default=None, comment='标准代码Id') | |
|     changeType = Column(String(10), default=None, comment='变更类型') | |
|     flowId = Column(String(50), default=None, comment='审批Id') | |
|     oldInstId = Column(String(50), default=None, comment='原始正式id') | |
|     compareId = Column(String(50), default=None, comment='原始数据id(用于对比差异)') | |
|     approStatus = Column(String(10), default=None, | |
|                          comment='审批状态(waiting,申请中,pending审核中,succeed,rejected已审核,canceled已取消)') | |
| 
 | |
| 
 | |
| class DataStdDict(Base): | |
|     """ | |
|     标准字典表 (Standard Code Table) | |
|     """ | |
|     __tablename__ = 't_data_dict'  # 表名为 t_datastd_dict | |
| 
 | |
|     onum = Column(String(50), primary_key=True, comment='标准代码Id') | |
|     create_by = Column(String(20), default='', comment='创建者') | |
|     create_time = Column(DateTime, nullable=True, default=None, comment='创建时间') | |
|     upd_prsn = Column(String(20), default='', comment='更新者') | |
|     upd_time = Column(DateTime, nullable=True, default=None, comment='更新时间') | |
|     data_dict_no = Column(String(50), default=None, comment='字典编号') | |
|     data_dict_eng_name = Column(String(50), default=None, comment='字典英文名') | |
|     data_dict_cn_name = Column(String(200), default=None, comment='字典中文名') | |
|     data_dict_vest = Column(String(10), default=None, comment='字典归属(sys:系统级 company:公司级)') | |
|     data_dict_type = Column(String(1), default=None, comment='字典类型(0:基础数据 1:指标数据)') | |
|     src_sys = Column(Integer, default=None, comment='归属系统') | |
|     data_dict_busi_mean = Column(String(200), default=None, comment='字典业务定义') | |
|     data_dict_data_type = Column(String(100), default=None, comment='数据类型') | |
|     data_std_no = Column(String(50), default=None, comment='数据标准编号') | |
|     src_sys_tab_fld_name = Column(MEDIUMTEXT, default=None, comment='来源系统表字段名') | |
|     data_dict_stat = Column(String(1), default=None, comment='字典状态(1:有效 0:无效)') | |
| 
 | |
| 
 | |
| class DataStdDictAppr(Base): | |
|     """ | |
|     标准字典审批表 (Standard Code Table) | |
|     """ | |
|     __tablename__ = 't_data_dict_appr'  # 表名为 t_datastd_dict | |
| 
 | |
|     onum = Column(String(50), primary_key=True, comment='标准代码Id') | |
|     create_by = Column(String(20), default='', comment='创建者') | |
|     create_time = Column(DateTime, nullable=True, default=None, comment='创建时间') | |
|     upd_prsn = Column(String(20), default='', comment='更新者') | |
|     upd_time = Column(DateTime, nullable=True, default=None, comment='更新时间') | |
|     data_dict_no = Column(String(50), default=None, comment='字典编号') | |
|     data_dict_eng_name = Column(String(50), default=None, comment='字典英文名') | |
|     data_dict_cn_name = Column(String(200), default=None, comment='字典中文名') | |
|     data_dict_vest = Column(String(10), default=None, comment='字典归属(sys:系统级 company:公司级)') | |
|     data_dict_type = Column(String(1), default=None, comment='字典类型(0:基础数据 1:指标数据)') | |
|     src_sys = Column(String(50), default=None, comment='归属系统') | |
|     data_dict_busi_mean = Column(String(200), default=None, comment='字典业务定义') | |
|     data_std_no = Column(String(50), default=None, comment='数据标准编号') | |
|     data_dict_stat = Column(String(1), default=None, comment='字典状态(1:有效 0:无效)') | |
|     data_dict_data_type = Column(String(100), default=None, comment='数据类型') | |
|     src_sys_tab_fld_name = Column(MEDIUMTEXT, default=None, comment='来源系统表字段名') | |
|     changeType = Column(String(10), default=None, comment='变更类型') | |
|     flowId = Column(String(50), default=None, comment='审批Id') | |
|     oldInstId = Column(String(50), default=None, comment='原始正式id') | |
|     compareId = Column(String(50), default=None, comment='原始数据id(用于对比差异)') | |
|     approStatus = Column(String(10), default=None, | |
|                          comment='审批状态(waiting,申请中,pending审核中,succeed,rejected已审核,canceled已取消)') | |
| 
 | |
| 
 | |
| class DataAstContent(Base): | |
|     __tablename__ = "t_data_std_content" | |
| 
 | |
|     content_onum = Column(Integer, primary_key=True, autoincrement=True, comment='目录序号') | |
|     content_name = Column(String(255), nullable=False, comment='目录名称') | |
|     content_stat = Column(String(10), nullable=False, comment='目录状态(有效/废弃/停用)') | |
|     content_intr = Column(Text, comment='目录简介') | |
|     content_pic = Column(String(255), comment='目录负责人') | |
|     supr_content_onum = Column(Integer, comment='上级目录序号') | |
|     leaf_node_flag = Column(Integer, default=1, comment='叶子节点标志') | |
|     upd_prsn = Column(String(255), nullable=False, comment='更新人员') | |
|     upd_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间') | |
| 
 | |
| 
 | |
| class DataAstContentRela(Base): | |
|     __tablename__ = "t_data_std_content_rela" | |
| 
 | |
|     rela_onum = Column(Integer, primary_key=True, autoincrement=True, comment='关系序号') | |
|     content_onum = Column(Integer, nullable=False, comment='目录序号') | |
|     ast_onum = Column(Integer, nullable=False, comment='资产序号') | |
|     rela_type = Column(String(50), default='归属关系', comment='关系类型') | |
|     rela_eff_begn_date = Column(Date, nullable=True, comment='关系生效开始日期') | |
|     rela_eff_end_date = Column(Date, nullable=True, comment='关系生效结束日期') | |
|     upd_prsn = Column(String(255), nullable=False, comment='更新人员') | |
|     rela_status = Column(String(18), nullable=True, comment='关系状态') | |
| 
 | |
| 
 | |
| class DataStdMain(Base): | |
|     """ | |
|     数据标准表 | |
|     """ | |
|     __tablename__ = 't_data_std' | |
| 
 | |
|     onum = Column(String(50), primary_key=True, comment='标准代码Id') | |
|     create_by = Column(String(20), default='', comment='创建者') | |
|     create_time = Column(DateTime, nullable=True, default=None, comment='创建时间') | |
|     upd_prsn = Column(String(20), default='', comment='更新者') | |
|     upd_time = Column(DateTime, nullable=True, default=None, comment='更新时间') | |
|     data_std_no = Column(String(50), default=None, comment='标准编号') | |
|     data_std_eng_name = Column(String(50), default=None, comment='标准英文名') | |
|     data_std_cn_name = Column(String(200), default=None, comment='标准中文名') | |
|     data_std_type = Column(String(1), default=None, comment='标准类型(0:基础数据 1:指标数据)') | |
|     data_sec_lvl = Column(String(1), default=None, comment='安全等级') | |
|     src_sys = Column(String(50), default=None, comment='来源系统') | |
|     data_std_vest = Column(String(50), default=None, comment='数据标准归属(公司级、系统级)') | |
|     data_std_busi_defn = Column(String(200), default=None, comment='标准业务定义') | |
|     cd_id = Column(String(50), default=None, comment='代码id') | |
|     std_status = Column(String(1), default=None, comment='标准状态(1:有效 0:无效)') | |
|     data_std_busi_ownership_dept = Column(String(100), default=None, comment='业务认责部门') | |
|     data_std_it_ownership_dept = Column(String(100), default=None, comment='技术认责部门') | |
|     data_std_busi_ownership_prsn = Column(String(100), default=None, comment='业务认责人员') | |
|     data_std_it_ownership_prsn = Column(String(100), default=None, comment='技术认责人员') | |
|     belt_data_std_content = Column(Integer, default=None, comment='分类') | |
|     data_std_src = Column(String(20), default=None, comment='标准来源') | |
|     data_clas = Column(String(20), default=None, comment='数据类别') | |
|     typical_fld = Column(String(500), default=None, comment='典型字段') | |
|     company_level_data_std_no = Column(String(50), default=None, comment='所属公司级数据标准编号') | |
| 
 | |
| 
 | |
| class DataStdMainAppr(Base): | |
|     """ | |
|     数据标准表 | |
|     """ | |
|     __tablename__ = 't_data_std_appr' | |
| 
 | |
|     onum = Column(String(50), primary_key=True, comment='标准代码Id') | |
|     create_by = Column(String(20), default='', comment='创建者') | |
|     create_time = Column(DateTime, nullable=True, default=None, comment='创建时间') | |
|     upd_prsn = Column(String(20), default='', comment='更新者') | |
|     upd_time = Column(DateTime, nullable=True, default=None, comment='更新时间') | |
|     data_std_no = Column(String(50), default=None, comment='标准编号') | |
|     data_std_eng_name = Column(String(50), default=None, comment='标准英文名') | |
|     data_std_cn_name = Column(String(200), default=None, comment='标准中文名') | |
|     data_std_type = Column(String(1), default=None, comment='标准类型(0:基础数据 1:指标数据)') | |
|     data_sec_lvl = Column(String(1), default=None, comment='安全等级') | |
|     src_sys = Column(Integer, default=None, comment='来源系统') | |
|     data_std_vest = Column(String(50), default=None, comment='数据标准归属(公司级、系统级)') | |
|     data_std_busi_defn = Column(String(200), default=None, comment='标准业务定义') | |
|     cd_id = Column(String(50), default=None, comment='代码id') | |
|     std_status = Column(String(1), default=None, comment='标准状态(1:有效 0:无效)') | |
|     data_std_busi_ownership_dept = Column(String(100), default=None, comment='业务认责部门') | |
|     data_std_it_ownership_dept = Column(String(100), default=None, comment='技术认责部门') | |
|     data_std_busi_ownership_prsn = Column(String(100), default=None, comment='业务认责人员') | |
|     data_std_it_ownership_prsn = Column(String(100), default=None, comment='技术认责人员') | |
|     belt_data_std_content = Column(Integer, default=None, comment='分类') | |
|     data_std_src = Column(String(20), default=None, comment='标准来源') | |
|     data_clas = Column(String(20), default=None, comment='数据类别') | |
|     typical_fld = Column(String(500), default=None, comment='典型字段') | |
|     changeType = Column(String(10), default=None, comment='变更类型') | |
|     flowId = Column(String(50), default=None, comment='审批Id') | |
|     oldInstId = Column(String(50), default=None, comment='原始正式id') | |
|     compareId = Column(String(50), default=None, comment='原始数据id(用于对比差异)') | |
|     approStatus = Column(String(10), default=None, | |
|     comment='审批状态(waiting,申请中,pending审核中,succeed,rejected已审核,canceled已取消)') | |
|     company_level_data_std_no = Column(String(50), default=None, comment='所属公司级数据标准编号')
 | |
| 
 |