749 lines
18 KiB
Python
749 lines
18 KiB
Python
ddl_sql = '''
|
||
{
|
||
"table_name": "t_pr3rl2oj_yj_person_database",
|
||
"table_comment": "人员信息库",
|
||
"database": "YJOA_APPSERVICE_DB",
|
||
"columns": [
|
||
{
|
||
"name": "id",
|
||
"type": "VARCHAR(22)",
|
||
"comment": "id",
|
||
"role": "dimension",
|
||
"tags": ["主键", "ID"],
|
||
"nullable": false,
|
||
"example": "10001"
|
||
},
|
||
{
|
||
"name": "ytenant_id",
|
||
"type": "VARCHAR(64)",
|
||
"comment": "租户ID",
|
||
"role": "dimension",
|
||
"tags": ["租户", "唯一"],
|
||
"nullable": false,
|
||
"example": "tenant_001"
|
||
},
|
||
{
|
||
"name": "name",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "姓名",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "张三"
|
||
},
|
||
{
|
||
"name": "gender",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "性别(1:男,2:女)",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息", "枚举"],
|
||
"values": {
|
||
"1": "男",
|
||
"2": "女"
|
||
},
|
||
"example": "1"
|
||
},
|
||
{
|
||
"name": "id_card",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "身份证号码",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "110101199001011234"
|
||
},
|
||
{
|
||
"name": "phone_number",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "手机号",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "13800138000"
|
||
},
|
||
{
|
||
"name": "email",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "电子邮箱",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "zhangsan@example.com"
|
||
},
|
||
{
|
||
"name": "birthday",
|
||
"type": "VARCHAR(30)",
|
||
"comment": "出生日期",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "1990-01-01"
|
||
},
|
||
{
|
||
"name": "native_place",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "籍贯",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "北京市"
|
||
},
|
||
{
|
||
"name": "nation",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "民族",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "汉族"
|
||
},
|
||
{
|
||
"name": "country",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "国籍",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "中国"
|
||
},
|
||
{
|
||
"name": "residence_address",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "户籍地址",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "北京市朝阳区"
|
||
},
|
||
{
|
||
"name": "highest_education",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "最高学历",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息", "枚举"],
|
||
"values": {
|
||
"1": "初中",
|
||
"2": "高中",
|
||
"3": "中专",
|
||
"4": "技校",
|
||
"5": "职高",
|
||
"6": "大专",
|
||
"7": "本科",
|
||
"8": "硕士",
|
||
"9": "博士"
|
||
},
|
||
"example": "7"
|
||
},
|
||
{
|
||
"name": "highest_degree",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "最高学位",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息", "枚举"],
|
||
"values": {
|
||
"1": "学士学位",
|
||
"2": "硕士学位",
|
||
"3": "博士学位",
|
||
"4": "无"
|
||
},
|
||
"example": "1"
|
||
},
|
||
{
|
||
"name": "graduate_school",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "毕业院校",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "北京大学"
|
||
},
|
||
{
|
||
"name": "political_status",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "政治面貌",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "中共党员"
|
||
},
|
||
{
|
||
"name": "work_date",
|
||
"type": "VARCHAR(30)",
|
||
"comment": "参加工作日期",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "2012-07-01"
|
||
},
|
||
{
|
||
"name": "worker_id",
|
||
"type": "VARCHAR(200)",
|
||
"comment": "工号",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "G001"
|
||
},
|
||
{
|
||
"name": "is_internal",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "是否内部员工(1代表是,0代表否)",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息", "枚举"],
|
||
"values": {
|
||
"1": "是",
|
||
"0": "否"
|
||
},
|
||
"example": "1"
|
||
},
|
||
{
|
||
"name": "person_type",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "人员类型",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息", "枚举"],
|
||
"values": {
|
||
"YG": "正式员工",
|
||
"PQ": "劳务派遣人员",
|
||
"QT": "其他柔性引进人员",
|
||
"WHZ": "合作单位",
|
||
"WLS": "临时访客",
|
||
"WQT": "其他外部人员"
|
||
},
|
||
"example": "YG"
|
||
},
|
||
{
|
||
"name": "person_status",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "人员状态",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息", "枚举"],
|
||
"values": {
|
||
"1": "草稿",
|
||
"2": "审批中",
|
||
"3": "制卡中",
|
||
"4": "已入库",
|
||
"5": "停用"
|
||
},
|
||
"example": "4"
|
||
},
|
||
{
|
||
"name": "internal_unit",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "内部单位",
|
||
"role": "dimension",
|
||
"tags": ["组织信息"],
|
||
"example": "北京总部"
|
||
},
|
||
{
|
||
"name": "internal_dept",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "内部部门",
|
||
"role": "dimension",
|
||
"tags": ["组织信息"],
|
||
"example": "研发部"
|
||
},
|
||
{
|
||
"name": "to_dept",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "所属处室",
|
||
"role": "dimension",
|
||
"tags": ["组织信息"],
|
||
"example": "技术处"
|
||
},
|
||
{
|
||
"name": "external_unit",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "外部单位",
|
||
"role": "dimension",
|
||
"tags": ["组织信息"],
|
||
"example": "外包公司A"
|
||
},
|
||
{
|
||
"name": "external_dept",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "外部部门",
|
||
"role": "dimension",
|
||
"tags": ["组织信息"],
|
||
"example": "福建亿榕信息技术有限公司"
|
||
},
|
||
{
|
||
"name": "post",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "职务",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "项目经理"
|
||
},
|
||
{
|
||
"name": "engage_post",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "现从事岗位",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "开发工程师"
|
||
},
|
||
{
|
||
"name": "work_content",
|
||
"type": "TEXT(max)",
|
||
"comment": "工作内容",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "负责系统架构设计与开发"
|
||
},
|
||
{
|
||
"name": "work_unit",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "工作单位全称",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "福建亿榕信息技术有限公司"
|
||
},
|
||
{
|
||
"name": "entry_date",
|
||
"type": "VARCHAR(30)",
|
||
"comment": "入场日期",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "2023-01-15"
|
||
},
|
||
{
|
||
"name": "expected_departure_date",
|
||
"type": "VARCHAR(30)",
|
||
"comment": "预计离场日期",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "2025-01-15"
|
||
},
|
||
{
|
||
"name": "office_city",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "办公城市",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "北京"
|
||
},
|
||
{
|
||
"name": "office_address",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "办公地点",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "北京市海淀区中关村"
|
||
},
|
||
{
|
||
"name": "is_sign_confidentiality_agreement",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "是否签署保密协议(1:是,0:否)",
|
||
"role": "dimension",
|
||
"tags": ["工作信息", "枚举"],
|
||
"values": {
|
||
"1": "是",
|
||
"0": "否"
|
||
},
|
||
"example": "1"
|
||
},
|
||
{
|
||
"name": "is_subcontractor",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "是否分包商",
|
||
"role": "dimension",
|
||
"tags": ["工作信息", "枚举"],
|
||
"values": {
|
||
"1": "是",
|
||
"0": "否"
|
||
},
|
||
"example": "0"
|
||
},
|
||
{
|
||
"name": "general_contractor_unit",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "总包单位全称",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "中建集团"
|
||
},
|
||
{
|
||
"name": "engage_contract_no",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "从事项目合同编号",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "CON2023001"
|
||
},
|
||
{
|
||
"name": "engage_contract_name",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "从事项目合同名称",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "智慧城市建设项目"
|
||
},
|
||
{
|
||
"name": "pass_type",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "通行证类型",
|
||
"role": "dimension",
|
||
"tags": ["工作信息", "枚举"],
|
||
"values": {
|
||
"1": "集团公司员工",
|
||
"2": "借调人员",
|
||
"3": "借用人员",
|
||
"4": "外部监管人员",
|
||
"5": "外协服务人员",
|
||
"6": "工勤人员",
|
||
"7": "来访人员"
|
||
},
|
||
"example": "1"
|
||
},
|
||
{
|
||
"name": "expire_time",
|
||
"type": "DATETIME(39)",
|
||
"comment": "失效时间",
|
||
"role": "dimension",
|
||
"tags": ["工作信息"],
|
||
"example": "2025-01-01 00:00:00"
|
||
},
|
||
{
|
||
"name": "input_time",
|
||
"type": "DATETIME(39)",
|
||
"comment": "录入时间",
|
||
"role": "dimension",
|
||
"tags": ["系统信息"],
|
||
"example": "2023-01-01 12:00:00"
|
||
},
|
||
{
|
||
"name": "input_user",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "录入人",
|
||
"role": "dimension",
|
||
"tags": ["系统信息"],
|
||
"example": "admin"
|
||
},
|
||
{
|
||
"name": "input_dept",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "录入部门",
|
||
"role": "dimension",
|
||
"tags": ["系统信息"],
|
||
"example": "人事部"
|
||
},
|
||
{
|
||
"name": "create_time",
|
||
"type": "DATETIME(39)",
|
||
"comment": "创建时间",
|
||
"role": "dimension",
|
||
"tags": ["系统信息"],
|
||
"example": "2023-01-01 12:00:00"
|
||
},
|
||
{
|
||
"name": "modify_time",
|
||
"type": "DATETIME(39)",
|
||
"comment": "修改时间",
|
||
"role": "dimension",
|
||
"tags": ["系统信息"],
|
||
"example": "2023-01-02 12:00:00"
|
||
},
|
||
{
|
||
"name": "creator",
|
||
"type": "VARCHAR(180)",
|
||
"comment": "创建人",
|
||
"role": "dimension",
|
||
"tags": ["系统信息"],
|
||
"example": "admin"
|
||
},
|
||
{
|
||
"name": "modifier",
|
||
"type": "VARCHAR(180)",
|
||
"comment": "修改人",
|
||
"role": "dimension",
|
||
"tags": ["系统信息"],
|
||
"example": "editor"
|
||
},
|
||
{
|
||
"name": "pubts",
|
||
"type": "DATETIME(39)",
|
||
"comment": "pubts",
|
||
"role": "dimension",
|
||
"tags": ["系统信息"],
|
||
"example": "2023-01-01 12:00:00"
|
||
},
|
||
{
|
||
"name": "dr",
|
||
"type": "INT",
|
||
"comment": "逻辑删除,1代表已删除",
|
||
"role": "dimension",
|
||
"tags": ["系统信息", "枚举"],
|
||
"values": {
|
||
"0": "未删除",
|
||
"1": "已删除"
|
||
},
|
||
"example": "0"
|
||
},
|
||
{
|
||
"name": "DHDATASTA",
|
||
"type": "INT",
|
||
"comment": "推送状态(0新增,1更新)",
|
||
"role": "dimension",
|
||
"tags": ["系统信息", "枚举"],
|
||
"values": {
|
||
"0": "新增",
|
||
"1": "更新"
|
||
},
|
||
"example": "0"
|
||
},
|
||
{
|
||
"name": "code",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "编码",
|
||
"role": "dimension",
|
||
"tags": ["系统信息"],
|
||
"example": "CODE001"
|
||
},
|
||
{
|
||
"name": "photo",
|
||
"type": "TEXT(max)",
|
||
"comment": "照片(二进制文本)",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息"],
|
||
"example": "[binary data]"
|
||
},
|
||
{
|
||
"name": "id_card_type",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "身份证件类型",
|
||
"role": "dimension",
|
||
"tags": ["人员基础信息", "枚举"],
|
||
"values": {
|
||
"1": "身份证",
|
||
"2": "护照",
|
||
"3": "港澳通行证"
|
||
},
|
||
"example": "1"
|
||
},
|
||
{
|
||
"name": "auditor",
|
||
"type": "VARCHAR(180)",
|
||
"comment": "终审审批人",
|
||
"role": "dimension",
|
||
"tags": ["审批信息"],
|
||
"example": "李四"
|
||
},
|
||
{
|
||
"name": "audit_time",
|
||
"type": "DATETIME(39)",
|
||
"comment": "审批日期",
|
||
"role": "dimension",
|
||
"tags": ["审批信息"],
|
||
"example": "2023-01-03 10:00:00"
|
||
},
|
||
{
|
||
"name": "auditnote",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "当前审批人",
|
||
"role": "dimension",
|
||
"tags": ["审批信息"],
|
||
"example": "王五"
|
||
},
|
||
{
|
||
"name": "verifystate",
|
||
"type": "INT",
|
||
"comment": "单据状态",
|
||
"role": "dimension",
|
||
"tags": ["审批信息"],
|
||
"example": "1"
|
||
},
|
||
{
|
||
"name": "procinst_id",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "流程实例ID",
|
||
"role": "dimension",
|
||
"tags": ["审批信息"],
|
||
"example": "PROC001"
|
||
},
|
||
{
|
||
"name": "bizflow_id",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "业务流id",
|
||
"role": "dimension",
|
||
"tags": ["审批信息"],
|
||
"example": "FLOW001"
|
||
},
|
||
{
|
||
"name": "bizflowname",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "流程名称",
|
||
"role": "dimension",
|
||
"tags": ["审批信息"],
|
||
"example": "入职审批"
|
||
},
|
||
{
|
||
"name": "source_id",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "上游单据主表id",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "SOURCE001"
|
||
},
|
||
{
|
||
"name": "sourcechild_id",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "上游单据子表id",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "CHILD001"
|
||
},
|
||
{
|
||
"name": "sourcebusiobj",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "上游业务对象",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "HR系统"
|
||
},
|
||
{
|
||
"name": "sourcecode",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "上游单据号",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "HR2023001"
|
||
},
|
||
{
|
||
"name": "bizflowinstance_id",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "业务流实例id",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "BIZINST001"
|
||
},
|
||
{
|
||
"name": "bizflow_makebillcode",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "单据转换规则编码",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "RULE001"
|
||
},
|
||
{
|
||
"name": "sourcegrand_id",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "来源表id",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "GRAND001"
|
||
},
|
||
{
|
||
"name": "first_id",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "来源单据主表id",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "FIRST001"
|
||
},
|
||
{
|
||
"name": "firstchild_id",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "来源单据子表id",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "FIRSTCHILD001"
|
||
},
|
||
{
|
||
"name": "firstbusiobj",
|
||
"type": "VARCHAR(108)",
|
||
"comment": "来源业务对象",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "ERP系统"
|
||
},
|
||
{
|
||
"name": "firstcode",
|
||
"type": "VARCHAR(600)",
|
||
"comment": "来源单据号",
|
||
"role": "dimension",
|
||
"tags": ["来源信息"],
|
||
"example": "ERP2023001"
|
||
},
|
||
{
|
||
"name": "auditor1",
|
||
"type": "VARCHAR(36)",
|
||
"comment": "处室负责人",
|
||
"role": "dimension",
|
||
"tags": ["审批信息"],
|
||
"example": "赵六"
|
||
}
|
||
],
|
||
"relationships": []
|
||
|
||
}
|
||
|
||
|
||
'''
|
||
|
||
|
||
train_document='''
|
||
语法为达梦数据库语法;
|
||
查询地址,籍贯,公司,单位,区域时,尽量使用like查询;
|
||
查询人员信息时,由于数据表字段过多。只需要展示人员关键信息字段:工号,姓名,单位,职务以及用户问题中需要查询的字段;
|
||
注意返回字段有枚举字段时,注意字段的转化。
|
||
'''
|
||
|
||
|
||
attendance_ddl='''
|
||
{
|
||
"table_name": "t_yj_person_attendance_rules",
|
||
"table_comment": "考勤规则表",
|
||
"database": "YJOA_APPSERVICE_DB",
|
||
"columns": [
|
||
{
|
||
"name": "id",
|
||
"type": "VARCHAR(50)",
|
||
"comment": "主键ID",
|
||
"role": "dimension",
|
||
"tags": ["主键", "ID"],
|
||
"nullable": false
|
||
},
|
||
{
|
||
"name": "morning_check_time",
|
||
"type": "VARCHAR(50)",
|
||
"comment": "早上考勤打卡时间",
|
||
"role": "dimension",
|
||
"tags": ["时间配置", "考勤"],
|
||
"example": "08:30"
|
||
},
|
||
{
|
||
"name": "afternoon_check_time",
|
||
"type": "VARCHAR(50)",
|
||
"comment": "下午考勤打卡时间",
|
||
"role": "dimension",
|
||
"tags": ["时间配置", "考勤"],
|
||
"example": "18:00"
|
||
},
|
||
{
|
||
"name": "before_lunch_time",
|
||
"type": "VARCHAR(50)",
|
||
"comment": "午休前时间",
|
||
"role": "dimension",
|
||
"tags": ["时间配置", "午休"],
|
||
"example": "12:00"
|
||
},
|
||
{
|
||
"name": "after_lunch_time",
|
||
"type": "VARCHAR(50)",
|
||
"comment": "午休后时间",
|
||
"role": "dimension",
|
||
"tags": ["时间配置", "午休"],
|
||
"example": "13:30"
|
||
},
|
||
{
|
||
"name": "region",
|
||
"type": "VARCHAR(50)",
|
||
"comment": "考勤地点",
|
||
"role": "dimension",
|
||
"tags": ["地点", "考勤", "枚举"],
|
||
"values": {
|
||
"1": "北京",
|
||
"2": "成都",
|
||
"3": "秭归",
|
||
"4": "林芝市区",
|
||
"5": "拉萨",
|
||
"6": "米林",
|
||
"7": "派镇",
|
||
"8": "墨脱"
|
||
},
|
||
"example": "1"
|
||
}
|
||
],
|
||
"relationships": []
|
||
|
||
}
|
||
|
||
''' |