1 金蝶数据库表描述
金蝶一些常用表数据查询
1.0 金蝶表名
描述 | 表名 |
---|---|
组织表 | T_ORG_ORGANIZATIONS T_ORG_ORGANIZATIONS_L |
系统用户表 | T_SEC_USER |
下拉列表枚举项 | T_META_FORMENUMITEM |
下拉列表枚举值 | T_META_FORMENUMITEM_L |
单据类型 | T_BAS_BILLTYPE T_BAS_BILLTYPE_L |
辅助资料 | select * from T_BAS_ASSISTANTDATAENTRY select * from T_BAS_ASSISTANTDATAENTRY_L where FDATAVALUE='OA' |
文件服务器 | T_BAS_Attachment T_BAS_FILESERVERFILEINFO |
单据转换规则 | T_META_CONVERTRULE T_META_CONVERTRULE_L |
单据附件数 | select * from T_BAS_Attachment where fbilltype = 'PUR_Requisition' |
维度关联字段-辅助属性 | select * from T_BD_FLEXSITEMDETAILV |
关联关系表 | t_bf_instanceentry |
1.1 查询举例
1.1.0 组织表
sql
select * from T_ORG_ORGANIZATIONS
select * from T_ORG_ORGANIZATIONS_L
1.1.1 系统用户表
sql
select * from T_SEC_USER
1.1.2 下拉列表
plsql
select * from T_META_FORMENUMITEM
select * from T_META_FORMENUMITEM_L
/*例:查询费用报销单或差旅费报销单的发票类型*/
select
t1.FINVOICETYPE,t3.FCAPTION
from t_ER_ExpenseReimbEntry t1
inner join T_META_FORMENUMITEM t2
on t2.FID='ebd7ee09-97d5-41fe-8562-e0cf5aaa0de9' and t1.FINVOICETYPE = t2.FVALUE
inner join T_META_FORMENUMITEM_L t3
on t3.Fenumid=t2.FENUMID
1.1.3 单据类型
plsql
select * from T_BAS_BILLTYPE
select * from T_BAS_BILLTYPE_L
/*查询单据类型"费用报销付款单"的单据内码*/
select
t1.FBILLTYPEID, --单据类型内码
t1.FNUMBER, --单据类型编码
t2.FNAME --单据类型名称
from T_BAS_BILLTYPE t1
inner join T_BAS_BILLTYPE_L t2
on t1.FBILLTYPEID = t2.FBILLTYPEID and FNAME like '%费用报销%'
1.1.4 辅助资料
plsql
--辅助资料分组查询
select * from T_BAS_ASSISTANTDATA
select * from T_BAS_ASSISTANTDATA_L
--辅助资料分录项查询
select * from T_BAS_ASSISTANTDATAENTRY
select * from T_BAS_ASSISTANTDATAENTRY_L
/*例:
辅助资料分组:应用系统分类
--南北
--OA
*/
select * from T_BAS_ASSISTANTDATA where FID = '619dfde2a1a5c3' --FID:辅助资料分组内码
select * from T_BAS_ASSISTANTDATA_L where FID = '619dfde2a1a5c3'
select * from T_BAS_ASSISTANTDATAENTRY where FENTRYID = '619dfde2a1a5c3' --FENTRYID:辅助资料分录项内码
select * from T_BAS_ASSISTANTDATAENTRY_L where FDATAVALUE='OA' --FENTRYID:辅助资料分录项内码
select * from T_BAS_ASSISTANTDATAENTRY_L where FENTRYID = '619dfde2a1a5c3' --FDATAVALUE:辅助资料名称
1.1.5 文件服务器
plsql
select * from T_BAS_Attachment
select * from T_BAS_FILESERVERFILEINFO
/*例:查询单据编号为"EBS20211209000010"的附件*/
select t1.fattachmentname,t2.FRELATIVEPATH
from t_bas_attachment t1
inner join T_BAS_FILESERVERFILEINFO t2 on t1.Ffileid = t2.Ffileid
where t1.FFILEID is not null
and FBILLNO = 'EBS20211209000010'
1.1.6维度关联字段-辅助属性
sql
select t5.FNUMBER,t6.FNUMBER,t3.FPRODUCTNO,t7.FAUXPROPID,t9.FDATAVALUE
--update t3 set t3.FPRODUCTNO = '金属桶'
from t_bf_instanceentry t1
inner join T_WorkshopPlanEntry t2 on t1.fsid = t2.FENTRYID
inner join T_SP_PICKMTRLDATA t3 on t1.ftid = t3.FENTRYID
inner join T_SP_PICKMTRL t4 on t4.fid = t3.fid
inner join T_BD_MATERIAL t5 on t5.FMATERIALID = t3.FMATERIALID
inner join T_BD_MATERIAL t6 on t6.FMATERIALID = t3.FPRODUCTID
inner join T_WorkshopPlan t7 on t7.fid = t2.fid
inner join T_BD_FLEXSITEMDETAILV t8 on t8.fid = t7.FAUXPROPID--维度关联-辅助属性表
inner join T_BAS_ASSISTANTDATAENTRY_L t9 on t9.FENTRYID = t8.FF100002--辅助资料属性对应表
where t1.FSTABLENAME = 'T_WorkshopPlanEntry'--车间计划
and t1.FTTABLENAME = 'T_SP_PICKMTRLDATA'--简单生产领料单
and t5.FNUMBER like '04.%'
and t6.FNUMBER like '03.%'
and t3.FPRODUCTNO = ''
and t9.FDATAVALUE like '%闭口桶%'
select t1.FFLEXNUMBER,* from T_BD_FLEXAUXPROPERTY t1
inner join T_BD_FLEXAUXPROPERTY_L t2 on t1.fid = t2.fid
inner join T_BD_FLEXAUXPROPERTYENTITY t3 on t3.fid = t1.fid