PMFlow/MEMORY.md

38 lines
1010 B
Markdown
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.

# Memory
## 飞书工单查询配置
当用户在飞书问"查询今天的工单"、"查询昨天的工单"时,**必须查询外部数据库**:
### 数据库连接
- **Host**: 173.1.1.32:5432
- **Database**: middle_platform
- **User**: readonly
- **Password**: readonly@#2025
- **Schema**: plat_task_center
### 执行命令
```bash
docker exec pmflow-db psql "postgresql://readonly:readonly%40%232025@173.1.1.32:5432/middle_platform" -c "SQL语句" -x
```
### 默认查询 SQL
```sql
SELECT
task_code as 工单编号,
task_name as 工单名称,
excutor_name as 执行人,
status as 状态,
start_time as 开始时间
FROM plat_task_center.task_instance a
WHERE a.start_time >= CURRENT_DATE
AND a.start_time < CURRENT_DATE + INTERVAL '1 day'
AND a.ext3 IN ('90101', '901')
ORDER BY a.start_time DESC
LIMIT 50;
```
### ⚠️ 重要提醒
**这是外部数据库 (middle_platform),不是 PMFlow 数据库!**
飞书查询工单时,**不要查询 PMFlow 的 tasks 表**!