924 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			924 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| person_ddl_sql = """
 | ||
| 
 | ||
| {
 | ||
|   "db_name":"YJOA_APPSERVICE_DB",
 | ||
|   "table_name": "t_pr3rl2oj_yj_person_database",
 | ||
|   "table_comment": "人员信息主表,记录人员基本信息、工作信息、审批流程信息等",
 | ||
|   "columns": [
 | ||
|     {
 | ||
|       "name": "person_status",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "人员状态",
 | ||
|       "values":{
 | ||
|         "1":"草稿",
 | ||
|         "2":"审批中",
 | ||
|         "3":"制卡中",
 | ||
|         "4":"已入库",
 | ||
|         "5":"停用"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["状态信息","枚举"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "gender",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "性别",
 | ||
|       "values": {
 | ||
|         "1": "男",
 | ||
|         "2": "女"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["基本信息", "人口属性","枚举"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "id_card",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "身份证号码",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["证件信息", "身份标识"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "input_time",
 | ||
|       "type": "DATETIME(39)",
 | ||
|       "comment": "录入时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "操作记录"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "external_unit",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "外部单位",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["组织信息", "外部单位"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "photo",
 | ||
|       "type": "TEXT(max)",
 | ||
|       "comment": "照片(二进制文本)",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["多媒体信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "input_user",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "录入人",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["操作人信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "is_internal",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "是否内部员工",
 | ||
|       "values": {
 | ||
|         "1": "是",
 | ||
|         "0": "否"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["员工类型", "身份标识","枚举"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "phone_number",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "手机号",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["联系方式", "通讯信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "external_dept",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "外部部门",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["组织信息", "外部部门"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "pass_type",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "通行证类型",
 | ||
|       "value":{
 | ||
|         "1": "集团公司员工",
 | ||
|         "2": "借调人员",
 | ||
|         "3":"借用人员",
 | ||
|         "4":"外部监管人员",
 | ||
|         "5":"外协服务人员",
 | ||
|         "6":"工勤人员",
 | ||
|         "7":"来访人员",
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["证件信息", "通行权限","枚举"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "expire_time",
 | ||
|       "type": "DATETIME(39)",
 | ||
|       "comment": "失效时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "有效期"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "internal_dept",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "内部部门",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["组织信息", "内部架构"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "input_dept",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "录入部门",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["操作部门", "组织信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "name",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "姓名",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["基本信息", "身份标识"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "internal_unit",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "内部单位",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["组织信息", "内部架构"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "person_type",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "人员类型",
 | ||
|       "value":{
 | ||
|         "YG":"正式员工",
 | ||
|         "PQ":"劳务派遣人员",
 | ||
|         "QT":"其他柔性引进人员",
 | ||
|         "WHZ":"合作单位",
 | ||
|         "WLS":"临时访客",
 | ||
|         "WQT":"其他外部人员"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["分类信息", "人员分类","枚举"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "id",
 | ||
|       "type": "VARCHAR(22)",
 | ||
|       "comment": "主键ID",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["主键", "ID标识"]
 | ||
|     },
 | ||
|   
 | ||
|     {
 | ||
|       "name": "dr",
 | ||
|       "type": "INT",
 | ||
|       "comment": "逻辑删除标志",
 | ||
|       "values": {
 | ||
|         "0": "正常",
 | ||
|         "1": "已删除"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["系统状态", "数据状态"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "code",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "编码",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["编码信息", "工号"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "ytenant_id",
 | ||
|       "type": "VARCHAR(64)",
 | ||
|       "comment": "租户ID",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["租户信息", "系统隔离"]
 | ||
|     },
 | ||
|   
 | ||
|     {
 | ||
|       "name": "create_time",
 | ||
|       "type": "DATETIME(39)",
 | ||
|       "comment": "创建时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "系统记录"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "modify_time",
 | ||
|       "type": "DATETIME(39)",
 | ||
|       "comment": "修改时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "系统记录"]
 | ||
|     },
 | ||
|    
 | ||
|   
 | ||
|     {
 | ||
|       "name": "to_dept",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "所属处室",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["组织信息", "部门架构"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "id_card_type",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "身份证件类型",
 | ||
|       "value":{
 | ||
|         "1":"身份证",
 | ||
|         "2":"护照",
 | ||
|         "3":"港澳通行证"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["证件信息", "身份标识"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "native_place",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "籍贯",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["基本信息", "籍贯信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "nation",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "民族",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["基本信息", "民族信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "country",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "国籍",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["基本信息", "国籍信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "residence_address",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "户籍地址",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["地址信息", "户籍信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "highest_education",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "最高学历",
 | ||
|       "value":{
 | ||
|         "1":"初中",
 | ||
|         "2":"高中",
 | ||
|         "3":"中专",
 | ||
|         "4":"技校",
 | ||
|         "5":"职高",
 | ||
|         "6":"大专",
 | ||
|         "7":"本科",
 | ||
|         "8":"硕士",
 | ||
|         "9":"博士 "
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["教育信息", "学历背景","枚举"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "highest_degree",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "最高学位",
 | ||
|       "value":{
 | ||
|         "1":"学士学位",
 | ||
|         "2":"硕士学位",
 | ||
|         "3":"博士学位",
 | ||
|         "4":"无"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["教育信息", "学位背景","枚举"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "graduate_school",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "毕业院校",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["教育信息", "院校背景"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "birthday",
 | ||
|       "type": "VARCHAR(30)",
 | ||
|       "comment": "出生日期",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "个人资料"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "work_date",
 | ||
|       "type": "VARCHAR(30)",
 | ||
|       "comment": "参加工作日期",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "工作经历"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "political_status",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "政治面貌",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["政治信息", "个人属性"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "work_unit",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "工作单位全称",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["工作信息", "单位信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "post",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "职务",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["工作信息", "职务信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "engage_post",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "现从事岗位",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["工作信息", "岗位信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "work_content",
 | ||
|       "type": "TEXT(max)",
 | ||
|       "comment": "工作内容",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["工作信息", "职责描述"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "engage_contract_no",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "从事项目合同编号",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["合同信息", "项目信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "engage_contract_name",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "从事项目合同名称",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["合同信息", "项目信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "is_subcontractor",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "是否分包商",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["供应商类型", "合作模式"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "general_contractor_unit",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "总包单位全称",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["合作单位", "总包信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "entry_date",
 | ||
|       "type": "VARCHAR(30)",
 | ||
|       "comment": "入场日期",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "项目参与"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "expected_departure_date",
 | ||
|       "type": "VARCHAR(30)",
 | ||
|       "comment": "预计离场日期",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "项目参与"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "office_city",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "办公城市",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["地址信息", "办公地点"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "office_address",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "办公地点",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["地址信息", "办公地点"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "is_sign_confidentiality_agreement",
 | ||
|       "type": "VARCHAR(108)",
 | ||
|       "comment": "是否签署保密协议",
 | ||
|       "values": {
 | ||
|         "1": "是",
 | ||
|         "0": "否"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["协议状态", "合规信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "email",
 | ||
|       "type": "VARCHAR(600)",
 | ||
|       "comment": "电子邮箱",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["联系方式", "通讯信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "DHDATASTA",
 | ||
|       "type": "INT",
 | ||
|       "comment": "推送状态",
 | ||
|       "values": {
 | ||
|         "0": "新增",
 | ||
|         "1": "更新"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["数据同步", "系统状态"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "auditor1",
 | ||
|       "type": "VARCHAR(36)",
 | ||
|       "comment": "处室负责人",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["审批信息", "负责人信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "person_count",
 | ||
|       "type": "INT",
 | ||
|       "comment": "人员数量",
 | ||
|       "role": "metric",
 | ||
|       "aggregation": "count",
 | ||
|       "tags": ["统计指标", "数量统计"]
 | ||
|     }
 | ||
|   ],
 | ||
|   "relationships": [
 | ||
|     {
 | ||
|       "from": "input_dept",
 | ||
|       "to_table": "IUAP_APDOC_BASEDOC.org_orgs",
 | ||
|       "to_field": "id",
 | ||
|       "type": "foreign_key",
 | ||
|       "comment": "关联部门表"
 | ||
|     },
 | ||
|     {
 | ||
|       "from": "internal_dept",
 | ||
|       "to_table": "IUAP_APDOC_BASEDOC.org_orgs",
 | ||
|       "to_field": "id",
 | ||
|       "type": "foreign_key",
 | ||
|       "comment": "关联部门表"
 | ||
|     },
 | ||
|     {
 | ||
|       "from": "internal_unit",
 | ||
|       "to_table": "IUAP_APDOC_BASEDOC.org_orgs",
 | ||
|       "to_field": "id",
 | ||
|       "type": "foreign_key",
 | ||
|       "comment": "关联部门表"
 | ||
|     },
 | ||
|   ],
 | ||
|  
 | ||
|   "tags": ["人员管理", "人力资源", "审批流程", "基本信息", "工作信息"],
 | ||
| }
 | ||
| 
 | ||
| """
 | ||
| 
 | ||
| train_document='''
 | ||
|                 语法为达梦数据库语法;
 | ||
|                 查询地址,籍贯,公司,单位时,尽量使用like查询;
 | ||
|                 查询人员信息时,由于数据表字段过多。只需要展示人员关键信息字段,id,工号,姓名,单位以及用户问题中需要查询的字段;
 | ||
|                 表字段信息以及字段枚举信息在values下,注意相关字段枚举值的转换;
 | ||
|                 查询单位信息时,内部单位和外部单位都需要查询,用OR条件查询;
 | ||
|                 
 | ||
|         '''
 | ||
| 
 | ||
| rule_ddl='''
 | ||
| {
 | ||
|   "db_name":"YJOA_APPSERVICE_DB",
 | ||
|   "table_name": "t_yj_person_attendance_rules",
 | ||
|   "table_comment": "人员考勤规则表,定义考勤时间规则,考勤地点设置",
 | ||
|   "columns": [
 | ||
|     {
 | ||
|       "name": "id",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "主键ID",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["主键", "ID标识"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "morning_check_time",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "上午打卡时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间规则", "考勤设置"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "afternoon_check_time",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "下午打卡时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间规则", "考勤设置"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "before_lunch_time",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "午餐前时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间规则", "考勤分段"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "after_lunch_time",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "午餐后时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间规则", "考勤分段"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "region",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "地区",
 | ||
|       "value":{
 | ||
|         "1":"北京",
 | ||
|         "2":"成都",
 | ||
|         "3":"秭归",
 | ||
|         "4":"拉萨",
 | ||
|         "5": "林芝"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": [ "考勤的地区位置","非办公区域,不要混淆","枚举"]
 | ||
|     },
 | ||
|   ],
 | ||
|   "relationships": [
 | ||
|     {
 | ||
|       "from": "region",
 | ||
|       "to_table": "t_yj_person_ac_area",
 | ||
|       "to_field": "region",
 | ||
|       "type": "foreign_key",
 | ||
|       "comment": "关联区域配置信息"
 | ||
|     }
 | ||
|   ],
 | ||
|  
 | ||
|   "tags": ["考勤规则", "时间设置", "区域配置", "考勤管理", "规则定义"]
 | ||
| }
 | ||
| '''
 | ||
| 
 | ||
| user_status_ddl='''
 | ||
| {
 | ||
|   "db_name":"YJOA_APPSERVICE_DB",
 | ||
|   "table_name": "t_yj_person_status",
 | ||
|   "table_comment": "人员状态记录表,记录人员每日考勤状态信息包括西藏地区标识",
 | ||
|   "columns": [
 | ||
|     {
 | ||
|       "name": "id",
 | ||
|       "type": "BIGINT",
 | ||
|       "comment": "主键ID",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["主键", "id标识"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "person_id",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "人员ID",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["人员标识", "关联信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "status",
 | ||
|       "type": "VARCHAR(10)",
 | ||
|       "comment": "人员状态",
 | ||
|       "value":{
 | ||
|         "1001":"在岗",
 | ||
|         "1002":"出差",
 | ||
|         "1003":"休假,请假",
 | ||
|         "1005":"旷工",
 | ||
|         "1006":"迟到,早退",
 | ||
|         "1007":"休息日",
 | ||
|         "4001":"am在岗pm缺勤",
 | ||
|         "4002":"am缺勤pm在岗",
 | ||
|         "6001":"am在岗pm早退",
 | ||
|         "6002":"am迟到pm在岗",
 | ||
|         "6004":"am迟到pm缺勤",
 | ||
|         "4006":"am缺勤pm早退"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["状态信息", "人员状态","枚举","迟到早退都是:1006"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "date_value",
 | ||
|       "type": "VARCHAR(20)",
 | ||
|       "comment": "日期值",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "日期记录"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "dr",
 | ||
|       "type": "INT",
 | ||
|       "comment": "逻辑删除标志",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["系统状态", "数据状态"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "create_time",
 | ||
|       "type": "DATETIME(39)",
 | ||
|       "comment": "创建时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间信息", "系统记录"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "is_in_tibet",
 | ||
|       "type": "INT",
 | ||
|       "comment": "是否在西藏地区",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["地区标识", "地理位置"]
 | ||
|     }
 | ||
|   ],
 | ||
|   "relationships": [
 | ||
|     {
 | ||
|       "from": "person_id",
 | ||
|       "to_table": "t_pr3rl2oj_yj_person_database",
 | ||
|       "to_field": "code",
 | ||
|       "type": "foreign_key",
 | ||
|       "comment": "关联人员基本信息表"
 | ||
|     }
 | ||
|   ],
 | ||
|  
 | ||
|   "tags": ["人员状态", "状态记录", "地区管理", "西藏标识", "每日状态"]
 | ||
| }
 | ||
| '''
 | ||
| 
 | ||
| user_attendance_ddl = '''
 | ||
| {
 | ||
|   "db_name": "YJOA_APPSERVICE_DB",
 | ||
|   "table_name": "t_person_attendance_records",
 | ||
|   "table_comment": "人员考勤记录表,存储员工的打卡记录、考勤状态和位置信息",
 | ||
|   "columns": [
 | ||
|     {
 | ||
|       "name": "id",
 | ||
|       "type": "VARCHAR(200)",
 | ||
|       "comment": "主键ID",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["主键", "ID标识"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "person_name",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "人员姓名",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["人员信息", "姓名"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "person_id",
 | ||
|       "type": "VARCHAR(200)",
 | ||
|       "comment": "人员ID",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["人员标识", "关联字段"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "phone_number",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "手机号码",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["联系方式", "人员信息"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "attendance_time",
 | ||
|       "type": "DATETIME",
 | ||
|       "comment": "考勤时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间戳", "打卡时间", "关键时间"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "attendance_address",
 | ||
|       "type": "VARCHAR(200)",
 | ||
|       "comment": "考勤地址",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["位置信息", "打卡地点"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "status",
 | ||
|       "type": "INT",
 | ||
|       "comment": "状态",
 | ||
|       "value": {
 | ||
|         "0": "在岗",
 | ||
|         "1": "出差",
 | ||
|         "2": "休假"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["状态标识", "人员在岗状态"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "original_id",
 | ||
|       "type": "VARCHAR(200)",
 | ||
|       "comment": "原始ID",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["原数据ID"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "source",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "数据来源",
 | ||
|       "value": {
 | ||
|         "APP": "手机应用",
 | ||
|         "DEVICE": "考勤设备",
 | ||
|         "SYSTEM": "系统导入"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["来源系统", "数据渠道"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "dr",
 | ||
|       "type": "INT",
 | ||
|       "comment": "删除标志",
 | ||
|       "value": {
 | ||
|         "0": "正常",
 | ||
|         "1": "已删除"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["软删除", "数据状态"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "create_time",
 | ||
|       "type": "DATETIME",
 | ||
|       "comment": "创建时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间戳", "记录创建时间"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "enter_or_exit",
 | ||
|       "type": "INT",
 | ||
|       "comment": "进出类型",
 | ||
|       "value": {
 | ||
|         "0": "进",
 | ||
|         "1": "出"
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["进出标识", "打卡方向"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "access_control_point",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "门禁点",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["门禁位置", "打卡设备点"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "by_st",
 | ||
|       "type": "VARCHAR(20)",
 | ||
|       "comment": "上午打卡时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间范围", "开始时间"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "by_et",
 | ||
|       "type": "VARCHAR(20)",
 | ||
|       "comment": "下午打卡时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["时间范围", "结束时间"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "by_st_field",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "午休前打卡时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["中间打卡","时间配置"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "by_et_field",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "午休后打卡时间",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["中间打卡", "时间配置"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "by_go_type",
 | ||
|       "type": "VARCHAR(8)",
 | ||
|       "comment": "打卡类型",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["类型标识", "打卡类型"]
 | ||
|     }
 | ||
|   ],
 | ||
|   "relationships": [
 | ||
|     {
 | ||
|       "from": "person_id",
 | ||
|       "to_table": "t_pr3rl2oj_yj_person_database",
 | ||
|       "to_field": "code",
 | ||
|       "type": "foreign_key",
 | ||
|       "comment": "关联人员基本信息"
 | ||
|     },
 | ||
|     {
 | ||
|       "from": "access_control_point",
 | ||
|       "to_table": "t_yj_person_ac_position",
 | ||
|       "to_field": "ac_point",
 | ||
|       "type": "foreign_key",
 | ||
|       "comment": "关联门禁点配置信息"
 | ||
|     }
 | ||
|   ],
 | ||
|   "tags": ["考勤记录", "打卡数据", "人员考勤", "时间记录", "位置信息", "门禁系统"]
 | ||
| }
 | ||
| '''
 | ||
| 
 | ||
| person_ac_position = '''
 | ||
| {
 | ||
|   "db_name":"YJOA_APPSERVICE_DB",
 | ||
|   "table_name": "t_yj_person_ac_position",
 | ||
|   "table_comment": "门禁控制点位置记录",
 | ||
|   "columns": [
 | ||
|     {
 | ||
|       "name": "ac_point",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "门禁点",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["门禁点", "门禁点标识"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "position",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "位置编号",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["门禁位置"]
 | ||
|     },
 | ||
|   ],
 | ||
|   "relationships": [
 | ||
|     {
 | ||
|       "from": "ac_point",
 | ||
|       "to_table": "t_yj_person_ac_area",
 | ||
|       "to_field": "ac_point",
 | ||
|       "type": "foreign_key",
 | ||
|       "comment": "关联门禁区域关系表"
 | ||
|     },
 | ||
|   ],
 | ||
|  
 | ||
|   "tags": ["门禁控制点","门禁位置"]
 | ||
| }
 | ||
| '''
 | ||
| 
 | ||
| person_ac_area = '''
 | ||
| {
 | ||
|   "db_name":"YJOA_APPSERVICE_DB",
 | ||
|   "table_name": "t_yj_person_ac_area",
 | ||
|   "table_comment": "门禁区域关系表",
 | ||
|   "columns": [
 | ||
|     {
 | ||
|       "name": "ac_point",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "门禁点",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["门禁点", "门禁点标识"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "area",
 | ||
|       "type": "Int",
 | ||
|       "comment": "区域位置",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["门禁所属区域"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "region",
 | ||
|       "type": "Int",
 | ||
|       "comment": "地区位置",
 | ||
|       "value":{
 | ||
|         "1":"北京",
 | ||
|         "2":"成都",
 | ||
|         "3":"秭归",
 | ||
|         "4":"林芝市区",
 | ||
|         "5":"拉萨",
 | ||
|         "6":"米林",
 | ||
|         "7":"派镇",
 | ||
|         "8":"墨脱",
 | ||
|       },
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["门禁所属地区"]
 | ||
|     },
 | ||
|   ],
 | ||
|  
 | ||
|   "tags": ["门禁详情","门禁区域位置","门禁地区信息"]
 | ||
| }
 | ||
| '''
 | ||
| 
 | ||
| 
 | ||
| org_orgs_ddl = '''
 | ||
| {
 | ||
|   "db_name":"IUAP_APDOC_BASEDOC",
 | ||
|   "table_name": "org_orgs",
 | ||
|   "table_comment": "人员状态记录表,记录人员每日考勤状态信息包括西藏地区标识",
 | ||
|   "columns": [
 | ||
|     {
 | ||
|       "name": "id",
 | ||
|       "type": "VARCHAR(36)",
 | ||
|       "comment": "主键ID",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["主键", "id标识"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "code",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "编号",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["部门编号"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "name",
 | ||
|       "type": "VARCHAR(50)",
 | ||
|       "comment": "部门名称",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["部门名称","单位名称"]
 | ||
|     },
 | ||
|     {
 | ||
|       "name": "shortname",
 | ||
|       "type": "VARCHAR(1152)",
 | ||
|       "comment": "部门简称",
 | ||
|       "role": "dimension",
 | ||
|       "tags": ["部门名称","部门简称","部门缩写"]
 | ||
|     },
 | ||
|   ],
 | ||
|  
 | ||
|   "tags": ["部门id","部门信息","部门名称"]
 | ||
| }
 | ||
| ''' | 
