feat:修改递归查询部门写法
This commit is contained in:
		| @@ -164,7 +164,7 @@ template: | ||||
|               <description>这些都可能是外部单位的名称</description> | ||||
|             </terminology> | ||||
|             <terminology> | ||||
|               <words><word>数信中心</word><word>建设处</word></words> | ||||
|               <words><word>数信中心</word><word>建设处</word><word>规划发展部</word></words> | ||||
|               <description>这些都可能是单位的名称</description> | ||||
|             </terminology> | ||||
|           </terminologies> | ||||
|   | ||||
| @@ -191,10 +191,11 @@ question_and_answer = [ | ||||
|         "answer": ''' | ||||
|                   select count(*) | ||||
|                   from YJOA_APPSERVICE_DB.t_pr3rl2oj_yj_person_database | ||||
|                   where internal_dept in (select id | ||||
|                                           from IUAP_APDOC_BASEDOC.org_orgs | ||||
|                                           where parentid in | ||||
|                                                 (select id from IUAP_APDOC_BASEDOC.org_orgs where name like '数信中心')) | ||||
|                   where internal_dept in (SELECT "id" | ||||
|                                           FROM "IUAP_APDOC_BASEDOC"."org_orgs" START | ||||
|                   WITH "name" LIKE '%数信中心%' | ||||
|                   CONNECT BY PRIOR "id" = "parentid" | ||||
|                       ) | ||||
|  | ||||
|  | ||||
|                   ''' | ||||
| @@ -216,7 +217,7 @@ question_and_answer = [ | ||||
|                   SELECT o.name AS "处室名称", COUNT(p.id) AS "人数" | ||||
|                   FROM YJOA_APPSERVICE_DB.t_pr3rl2oj_yj_person_database p | ||||
|                            JOIN IUAP_APDOC_BASEDOC.org_orgs o ON p.internal_dept = o.id | ||||
|                   WHERE o.parentid IN (SELECT id FROM IUAP_APDOC_BASEDOC.org_orgs WHERE name LIKE '数信中心') | ||||
|                   WHERE o.parentid IN (SELECT id FROM IUAP_APDOC_BASEDOC.org_orgs WHERE name LIKE '%数信中心%') | ||||
|                     AND p.dr = 0 | ||||
|                   GROUP BY o.name | ||||
|                   ORDER BY "人数" DESC LIMIT 1000 | ||||
| @@ -239,7 +240,7 @@ question_and_answer = [ | ||||
|     { | ||||
|         "question": "10月数信中心有哪些有员工请假", | ||||
|         "answer": ''' | ||||
|                   SELECT DISTINCT p."id"                                                               AS "id", | ||||
|                   SELECT  p."id"                                                               AS "id", | ||||
|                                   p."code"                                                             AS "工号", | ||||
|                                   p."name"                                                             AS "姓名", | ||||
|                                   p."internal_unit"                                                    AS "内部单位", | ||||
| @@ -249,10 +250,10 @@ question_and_answer = [ | ||||
|                            INNER JOIN "YJOA_APPSERVICE_DB"."t_yj_person_status" ps ON p."code" = ps."person_id" | ||||
|                   WHERE ps."status" = '1003' | ||||
|                     AND ps."date_value" LIKE '2025-10%' | ||||
|                     and p.internal_dept in (select id | ||||
|                                             from IUAP_APDOC_BASEDOC.org_orgs | ||||
|                                             where parentid in | ||||
|                                                   (select id from IUAP_APDOC_BASEDOC.org_orgs where name like '数信中心') | ||||
|                     and p.internal_dept in (SELECT "id" | ||||
|                                           FROM "IUAP_APDOC_BASEDOC"."org_orgs" START | ||||
|                   WITH "name" LIKE '%数信中心%' | ||||
|                   CONNECT BY PRIOR "id" = "parentid" | ||||
|                       ) | ||||
|                     AND p."dr" = 0 | ||||
|                     AND ps."dr" = 0 LIMIT 1000 | ||||
|   | ||||
| @@ -475,8 +475,9 @@ train_document=''' | ||||
|                 查询地址,籍贯,公司,单位时,尽量使用like查询; | ||||
|                 查询人员信息时,由于数据表字段过多。只需要展示人员关键信息字段,id,工号,姓名,单位以及用户问题中需要查询的字段; | ||||
|                 表字段信息以及字段枚举信息在values下,注意相关字段枚举值的转换; | ||||
|                 查询单位时,通过orgs表查询,且需要基于parentID查询单位下的子单位; | ||||
|                 查询内部单位时,则可以直接查询人员信息表,通过like模糊查询; | ||||
|                 查询单位时,通过orgs表查询,且需要基于parentID查询递归查询单位下的子单位; | ||||
|                 查询内部单位时,则可以直接查询人员信息表,通过like模糊查询; | ||||
|                 没有明确说明查询外部单位,都默认查询通过orgs查询单位; | ||||
|         ''' | ||||
|  | ||||
| rule_ddl=''' | ||||
| @@ -553,7 +554,7 @@ user_status_ddl=''' | ||||
| { | ||||
|   "db_name":"YJOA_APPSERVICE_DB", | ||||
|   "table_name": "t_yj_person_status", | ||||
|   "table_comment": "人员状态记录表,记录人员每日考勤状态信息包括西藏地区标识", | ||||
|   "table_comment": "人员状态记录表,记录人员每日考勤汇总状态信息包括西藏地区标识", | ||||
|   "columns": [ | ||||
|     { | ||||
|       "name": "id", | ||||
| @@ -637,7 +638,7 @@ user_attendance_ddl = ''' | ||||
| { | ||||
|   "db_name": "YJOA_APPSERVICE_DB", | ||||
|   "table_name": "t_yj_person_attendance", | ||||
|   "table_comment": "人员考勤记录表,存储员工的打卡记录、考勤状态和位置信息", | ||||
|   "table_comment": "人员考勤记录打卡表,存储员工的打卡记录、考勤状态和位置信息", | ||||
|   "columns": [ | ||||
|     { | ||||
|       "name": "id", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 雷雨
					雷雨