Files
sqlbot_agent/util/train_ddl.py

124 lines
9.7 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ddl_sql = """
create table YJOA_APPSERVICE_DB."t_pr3rl2oj_yj_person_database"
(
"person_status" VARCHAR(108) default 'NULL' comment '人员状态',
"gender" VARCHAR(108) default 'NULL' comment '性别(1:男,2:女)',
"id_card" VARCHAR(600) default 'NULL' comment '身份证号码',
"input_time" DATETIME(39) default NULL comment '录入时间',
"external_unit" VARCHAR(600) default 'NULL' comment '外部单位',
"photo" TEXT(max) default NULL comment '照片(二进制文本)',
"input_user" VARCHAR(108) default 'NULL' comment '录入人',
"is_internal" VARCHAR(108) default 'NULL' comment '是否内部员工(1代表是0代表否)',
"phone_number" VARCHAR(600) default 'NULL' comment '手机号',
"external_dept" VARCHAR(600) default 'NULL' comment '福建亿榕信息技术有限公司',
"pass_type" VARCHAR(108) default 'NULL' comment '通行证类型',
"expire_time" DATETIME(39) default NULL comment '失效时间',
"internal_dept" VARCHAR(108) default 'NULL' comment '内部部门',
"input_dept" VARCHAR(108) default 'NULL' comment '录入部门',
"name" VARCHAR(600) default 'NULL' comment '姓名',
"internal_unit" VARCHAR(108) default 'NULL' comment '内部单位',
"person_type" VARCHAR(108) default 'NULL' comment '人员类型',
"id" VARCHAR(22) not null comment 'id',
"pubts" DATETIME(39) default CURRENT_TIMESTAMP,
"dr" INT default 0 comment '逻辑删除1代表已删除',
"code" VARCHAR(600) default 'NULL' comment '编码',
"ytenant_id" VARCHAR(64) not null
constraint T_PR3RL2OJ_YJ_PERSON_DATABASE_I_I_YTENANT_ID
unique comment '租户ID',
"sourcegrand_id" VARCHAR(108) default 'NULL' comment '来源表id',
"first_id" VARCHAR(108) default 'NULL' comment '来源单据主表id',
"firstchild_id" VARCHAR(108) default 'NULL' comment '来源单据子表id',
"firstbusiobj" VARCHAR(108) default 'NULL' comment '来源业务对象',
"firstcode" VARCHAR(600) default 'NULL' comment '来源单据号',
"verifystate" INT default NULL comment '单据状态',
"auditor" VARCHAR(180) default 'NULL' comment '终审审批人',
"audit_time" DATETIME(39) default NULL comment '审批日期',
"auditnote" VARCHAR(600) default 'NULL' comment '当前审批人',
"procinst_id" VARCHAR(108) default 'NULL' comment '流程实例ID',
"bizflow_id" VARCHAR(108) default 'NULL' comment '业务流id',
"bizflowname" VARCHAR(600) default 'NULL' comment '流程名称',
"source_id" VARCHAR(108) default 'NULL' comment '上游单据主表id',
"sourcechild_id" VARCHAR(108) default 'NULL' comment '上游单据子表id',
"bizflowinstance_id" VARCHAR(108) default 'NULL' comment '业务流实例id',
"sourcebusiobj" VARCHAR(108) default 'NULL' comment '上游业务对象',
"sourcecode" VARCHAR(600) default 'NULL' comment '上游单据号',
"bizflow_makebillcode" VARCHAR(600) default 'NULL' comment '单据转换规则编码',
"create_time" DATETIME(39) default NULL comment '创建时间',
"modify_time" DATETIME(39) default NULL comment '修改时间',
"creator" VARCHAR(180) default 'NULL' comment '创建人',
"modifier" VARCHAR(180) default 'NULL' comment '修改人',
"worker_id" VARCHAR(200) default 'NULL' comment '工号',
"to_dept" VARCHAR(600) default 'NULL' comment '所属处室',
"id_card_type" VARCHAR(108) default 'NULL' comment '身份证件类型',
"native_place" VARCHAR(600) default 'NULL' comment '籍贯',
"nation" VARCHAR(600) default 'NULL' comment '民族',
"country" VARCHAR(600) default 'NULL' comment '国籍',
"residence_address" VARCHAR(600) default 'NULL' comment '户籍地址',
"highest_education" VARCHAR(108) default 'NULL' comment '最高学历',
"highest_degree" VARCHAR(108) default 'NULL' comment '最高学位',
"graduate_school" VARCHAR(600) default 'NULL' comment '毕业院校',
"birthday" VARCHAR(30) default 'NULL' comment '出生日期',
"work_date" VARCHAR(30) default 'NULL' comment '参加工作日期',
"political_status" VARCHAR(600) default 'NULL' comment '政治面貌',
"work_unit" VARCHAR(600) default 'NULL' comment '工作单位全称',
"post" VARCHAR(600) default 'NULL' comment '职务',
"engage_post" VARCHAR(600) default 'NULL' comment '现从事岗位',
"work_content" TEXT(max) default NULL comment '工作内容',
"engage_contract_no" VARCHAR(600) default 'NULL' comment '从事项目合同编号',
"engage_contract_name" VARCHAR(600) default 'NULL' comment '从事项目合同名称',
"is_subcontractor" VARCHAR(108) default 'NULL' comment '是否分包商',
"general_contractor_unit" VARCHAR(600) default 'NULL' comment '总包单位全称',
"entry_date" VARCHAR(30) default 'NULL' comment '入场日期',
"expected_departure_date" VARCHAR(30) default 'NULL' comment '预计离场日期',
"office_city" VARCHAR(600) default 'NULL' comment '办公城市',
"office_address" VARCHAR(600) default 'NULL' comment '办公地点',
"is_sign_confidentiality_agreement" VARCHAR(108) default 'NULL' comment '是否签署保密协议(1:是,0:否)',
"email" VARCHAR(600) default 'NULL' comment '电子邮箱',
DHDATASTA INT default 0 comment '推送状态(0新增1更新)',
"auditor1" VARCHAR(36) comment '处室负责人'
)
"""
train_document='''
语法为达梦数据库语法;
查询地址籍贯公司单位时尽量使用like查询;
查询人员信息时,由于数据表字段过多。只需要展示人员关键信息字段id工号姓名单位以及用户问题中需要查询的字段;
表字段信息以及字段枚举信息:
<table>
YJOA_APPSERVICE_DB."t_pr3rl2oj_yj_person_database"(人员信息表);
<filed>
person_status: 人员状态 (1:草稿,2:审批中,3:制卡中,4:已入库,5:停用);
pass_type: 通行证类型 (
1集团公司员工,
2借调人员,
3借用人员,
4外部监管人员,
5外协服务人员,
6工勤人员,
7来访人员
);
person_type: 人员类型 (
YG正式员工,
PQ劳务派遣人员,
QT其他柔性引进人员,
WHZ合作单位,
WLS临时访客,
WQT其他外部人员
);
id_card_type: 身份证件类型 (1:身份证,2:护照,3:港澳通行证);
highest_education: 最高学历 (
1初中
2高中
3中专
4技校
5职高
6大专
7本科
8硕士
9博士
);
highest_degree: 最高学位 (1学士学位,2硕士学位,3博士学位,4无);
</filed>
</table>
'''