Install
openclaw skills install kingdee-sold金蝶EAS Cloud ERP系统数据库SQL查询技能,支持采购、销售、库存、财务等模块的单据查询和数据分析。
openclaw skills install kingdee-sold本技能用于金蝶EAS Cloud ERP系统的PostgreSQL数据库查询,支持各类业务单据的SQL查询、数据分析、表结构探查等操作。
主机: 111.198.79.26
端口: 5432
用户: cosmic
密码: Kd1234567890!
数据库: yyzl202501
| 前缀/后缀 | 说明 | 示例 |
|---|---|---|
t_ | 业务数据表前缀 | t_ap_finapbill |
_l | 分录表后缀 | t_ap_finapbill_l |
_r3 | R3视图后缀 | t_im_purinbill_r3 |
_lk | Link关联表 | t_po_purorder_lk |
_tc | 临时表 | |
_wb | 工作流相关表 | |
t_bos_ | BOS平台表 | t_bos_atomicincr_generator |
t_gl_ | 财务总账模块 | t_gl_voucher |
t_ap_ | 应付模块 | t_ap_paybill |
t_ar_ | 应收模块 | t_ar_receivebill |
t_im_ | 库存模块 | t_im_purinbill |
t_po_ | 采购模块 | t_po_purorder |
t_sal_ | 销售模块 | t_sal_saleorder |
t_bd_ | 基础资料 | t_bd_material |
| 字段名 | 说明 |
|---|---|
fid | 单据主键ID |
fnumber | 单据编号 |
fcreate_time | 创建时间 |
fcreatorid | 创建人ID |
fmodify_time | 修改时间 |
fmodifierid | 修改人ID |
fdocumentstatus | 单据状态 |
fbilltype | 单据类型 |
fdate | 单据日期 |
famount | 金额 |
famt_lc | 本币金额 |
| 状态码 | 说明 |
|---|---|
| 0 | 草稿 |
| 1 | 已提交/审核中 |
| 2 | 已审核 |
| 3 | 已驳回 |
| 4 | 已关闭 |
| 5 | 作废/红冲 |
-- 查询表的列信息
SELECT column_name, data_type, is_nullable
FROM information_schema.columns
WHERE table_name = 't_po_purorder'
ORDER BY ordinal_position;
-- 查询采购订单表头
SELECT fid, fnumber, fdate, famount_lc, fdocumentstatus
FROM t_po_purorder
WHERE fdate >= '2025-01-01'
LIMIT 100;
-- 查询采购订单分录
SELECT fid, fentryid, fmaterialid, fqty, fprice, famount
FROM t_po_purorder_l
WHERE fid = '订单fid';
SELECT fid, fnumber, fdate, fcustid, famount_lc, fdocumentstatus
FROM t_sal_saleorder
WHERE fdate >= '2025-01-01'
ORDER BY fdate DESC
LIMIT 100;
SELECT fid, fnumber, fdate, famount_lc, fpaytype, fdocumentstatus
FROM t_ap_paybill
WHERE fdate >= '2025-01-01'
ORDER BY fdate DESC
LIMIT 100;
SELECT fid, fnumber, fdate, famount_lc, fdocumentstatus
FROM t_ar_receivebill
WHERE fdate >= '2025-01-01'
ORDER BY fdate DESC
LIMIT 100;
SELECT fid, fnumber, fdate, fstockorgid, fdocumentstatus
FROM t_im_purinbill
WHERE fdate >= '2025-01-01'
ORDER BY fdate DESC
LIMIT 100;
-- 查询所有单据编码规则
SELECT fnumber, fprefix, fformat, fcurrentvalue
FROM t_bos_atomicincr_generator
ORDER BY fnumber;
-- 搜索包含指定关键词的表
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_name LIKE '%keyword%'
ORDER BY table_name;
SELECT
h.fnumber,
h.fdate,
h.famount_lc,
l.fentryid,
l.fmaterialid,
l.fqty,
l.fprice,
l.famount
FROM t_po_purorder h
LEFT JOIN t_po_purorder_l l ON h.fid = l.fid
WHERE h.fdate >= '2025-01-01'
LIMIT 100;
SELECT
DATE(fdate) as bill_date,
COUNT(*) as bill_count,
SUM(famount_lc) as total_amount
FROM t_po_purorder
WHERE fdate >= '2025-01-01'
GROUP BY DATE(fdate)
ORDER BY bill_date DESC;
SELECT
CASE fdocumentstatus
WHEN 0 THEN '草稿'
WHEN 1 THEN '已提交'
WHEN 2 THEN '已审核'
WHEN 3 THEN '已驳回'
WHEN 4 THEN '已关闭'
WHEN 5 THEN '作废'
ELSE '未知'
END as status_name,
COUNT(*) as count,
SUM(famount_lc) as total_amount
FROM t_po_purorder
WHERE fdate >= '2025-01-01'
GROUP BY fdocumentstatus
ORDER BY fdocumentstatus;
_l后缀,通过fid字段与主表关联'YYYY-MM-DD't_前缀_l后缀)information_schema.columns查询表的实际列名