技术答疑.常用SQL
持续更新......
---------------------------------------------------------------------------------------------------------
【登录用户】
SELECT FUSERID AS 用户内码,FNAME AS 用户名称,FUSERACCOUNT AS 用户账号,*
FROM T_SEC_USER
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【数据中心】
--注意:查询数据中心,必须连接管理中心数据库查询
SELECT b.FNAME AS [数据中心(账套名称)],a.FDATACENTERID AS [数据中心内码(DBID)],a.FVISION AS 产品版本号,a.*
FROM T_BAS_DATACENTER a
LEFT JOIN T_BAS_DATACENTER_L b ON a.FDATACENTERID=b.FDATACENTERID AND b.FLOCALEID=2052
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【上机操作日志】
SELECT b.FNAME AS 用户名,c.FNAME AS 子系统,d.FNAME AS 业务对象名称,a.FOPERATENAME AS 操作名称,a.FDESCRIPTION AS 操作描述,a.*
FROM T_BAS_OPERATELOG a
LEFT JOIN T_SEC_USER b ON a.FUSERID=b.FUSERID
LEFT JOIN T_META_SUBSYSTEM_L c ON a.FSUBSYSTEMID=c.FID AND c.FLOCALEID=2052
LEFT JOIN T_META_OBJECTTYPE_L d ON a.FOBJECTTYPEID=d.FID AND d.FLOCALEID=2052
WHERE a.FUSERID=100008
【上机操作日志归档表】
SELECT b.FNAME AS 用户名,c.FNAME AS 子系统,d.FNAME AS 业务对象名称,a.FOPERATENAME AS 操作名称,a.FDESCRIPTION AS 操作描述,a.*
FROM T_BAS_OPERATELOGBK a
LEFT JOIN T_SEC_USER b ON a.FUSERID=b.FUSERID
LEFT JOIN T_META_SUBSYSTEM_L c ON a.FSUBSYSTEMID=c.FID AND c.FLOCALEID=2052
LEFT JOIN T_META_OBJECTTYPE_L d ON a.FOBJECTTYPEID=d.FID AND d.FLOCALEID=2052
WHERE a.FUSERID=100008
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【元数据修改日志】
SELECT TOP 10 c.FNAME AS 业务对象名称,d.FNAME AS 修改人,a.*,b.FKERNELXMLLANG
FROM T_BAS_METADATALOG a
LEFT JOIN T_BAS_METADATALOG_L b ON a.FID=b.FID AND b.FLOCALEID=2052
LEFT JOIN T_META_OBJECTTYPE_L c ON a.FOBJECTID=c.FID AND c.FLOCALEID=2052
LEFT JOIN T_SEC_USER d ON a.FUSERID=d.FUSERID
ORDER BY a.FCREATETIME DESC
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【子系统】
SELECT b.FNAME AS 子系统名称,a.FID AS 子系统内码,a.*
FROM T_META_SUBSYSTEM a
LEFT JOIN T_META_SUBSYSTEM_L b ON a.FID=b.FID AND b.FLOCALEID=2052
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【领域模型】
SELECT b.FNAME AS 领域模型名称,a.FID AS 领域模型内码,a.*
FROM T_MDL_DOMAINMODETYPE a
LEFT JOIN T_MDL_DOMAINMODETYPE_L b ON a.FID=b.FID AND b.FLOCALEID=2052
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【业务对象】
SELECT b.FNAME AS 业务对象名称,a.FID AS [业务对象标识(FormId)],*
FROM T_META_OBJECTTYPE a
LEFT JOIN T_META_OBJECTTYPE_L b ON a.FID=b.FID AND b.FLOCALEID=2052
WHERE a.FID='SAL_OUTSTOCK'
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【单据视图】
SELECT c.FNAME AS 业务对象名称,a.FDEPENDENCYOBJECTID AS [业务对象内码 (FormId)],b.FNAME AS 视图名称,a.FID AS [视图内码(layoutid)],*
FROM T_META_OBJECTTYPEVIEW a
LEFT JOIN T_META_OBJECTTYPEVIEW_L b ON a.FID=b.FID AND b.FLOCALEID=2052
LEFT JOIN T_META_OBJECTTYPE_L c ON a.FDEPENDENCYOBJECTID=c.FID AND c.FLOCALEID=2052
WHERE a.FDEPENDENCYOBJECTID IN ('SAL_OUTSTOCK','DE_CD_OutStock','00f0614c-d928-46b6-8e79-d1ac94ae867a')
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【表单操作】
SELECT b.FNAME AS 操作名称,a.FID AS 操作内码,a.*
FROM T_MDL_FORMOPERATIONTYPE a
LEFT JOIN T_MDL_FORMOPERATIONTYPE_L b ON a.FID=b.FID AND b.FLOCALEID=2052
ORDER BY a.FID
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【表单服务】
SELECT b.FDESC AS 服务名称,a.FACTIONID AS 服务内码,a.*
FROM T_MDL_FORMBUSINESS a
LEFT JOIN T_MDL_FORMBUSINESS_L b ON a.FACTIONID=b.FACTIONID AND b.FLOCALEID=2052
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【操作内置校验器】
SELECT b.FNAME AS 校验器名称,a.* FROM T_MDL_FORMVALIDATIONTYPE a
LEFT JOIN T_MDL_FORMVALIDATIONTYPE_L b ON a.FTYPEID=b.FTYPEID AND b.FLOCALEID=2052
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【过滤方案】
SELECT b.FDESCRIPTION AS 过滤方案名称,a.FSCHEMEID AS 过滤方案内码,c.FNAME AS 业务对象名称,d.FNAME AS 用户名,*
FROM T_BAS_FILTERSCHEME a
LEFT JOIN T_BAS_FILTERSCHEME_L b ON a.FSCHEMEID=b.FSCHEMEID AND b.FLOCALEID=2052
LEFT JOIN T_META_OBJECTTYPE_L c ON a.FFORMID=c.FID AND c.FLOCALEID=2052
LEFT JOIN T_SEC_USER d ON a.FUSERID=d.FUSERID
WHERE a.FFORMID='PUR_PurchaseOrder'
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【过滤符】
SELECT b.FNAME AS 过滤符名称,a.FCONDITIONTYPEID AS 符号集编码,a.* FROM T_MDL_FILTERCONDITION a
LEFT JOIN T_MDL_FILTERCONDITION_L b ON a.FID=b.FID AND b.FLOCALEID=2052
ORDER BY a.FCONDITIONTYPEID
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【语言】
SELECT a.FMSNUMBER AS [语言ID(LCID)],b.FNAME AS 语言名称,a.*
FROM T_BD_LANGUAGE a
LEFT JOIN T_BD_LANGUAGE_L b ON a.FID=b.FID AND b.FLOCALEID=2052
ORDER BY a.FMSNUMBER
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【编码规则】
SELECT b.FNAME AS [编码规则名称],a.FRULEID AS 编码规则内码,c.FNAME AS 业务对象名称,a.*
FROM T_BAS_BILLCODERULE a
LEFT JOIN T_BAS_BILLCODERULE_L b ON a.FRULEID=b.FRULEID AND b.FLOCALEID=2052
LEFT JOIN T_META_OBJECTTYPE_L c ON a.FBILLFORMID=c.FID AND c.FLOCALEID=2052
WHERE a.FBILLFORMID='BD_Supplier'
【编码规则编码模板】
SELECT FRULEID AS 编码规则内码,*
FROM T_BAS_BILLCODERULEENTRY
WHERE FRULEID='cbda6d5a48e0438ea9729e9279a1e59f'
【编码规则流水号】
SELECT FRULEID AS 编码规则内码,FNUMMAX AS 当前编码规则最大流水号,*
FROM T_BAS_BILLCODES
WHERE FRULEID='cbda6d5a48e0438ea9729e9279a1e59f'
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【辅助资料类型】
SELECT a.FID AS 辅助资料类型内码,b.FNAME AS 辅助资料类型名称,a.*
FROM T_BAS_ASSISTANTDATA a
LEFT JOIN T_BAS_ASSISTANTDATA_L b ON a.FID=b.FID AND b.FLOCALEID=2052
WHERE b.FNAME='等级'
【辅助资料】
SELECT a.FID AS 辅助资料类型内码,a.FNUMBER AS 辅助资料编码,b.FDATAVALUE AS 辅助资料名称,a.FENTRYID AS 辅助资料内码,a.*
FROM T_BAS_ASSISTANTDATAENTRY a
LEFT JOIN T_BAS_ASSISTANTDATAENTRY_L b ON a.FENTRYID=b.FENTRYID AND b.FLOCALEID=2052
WHERE a.FID='005056a3024b911211e36619ce35ebd3'
ORDER BY a.FSEQ
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【枚举类型】
SELECT a.FID AS 枚举类型内码,b.FNAME AS 枚举类型名称,*
FROM T_META_FORMENUM a
LEFT JOIN T_META_FORMENUM_L b ON a.FID=b.FID AND b.FLOCALEID=2052
WHERE b.FNAME=N'发货状态'
【枚举项】
SELECT a.FID AS 枚举类型内码,a.FENUMID AS 枚举项内码,b.FCAPTION AS 枚举项名称,a.FVALUE AS 枚举项值,*
FROM T_META_FORMENUMITEM a
LEFT JOIN T_META_FORMENUMITEM_L b ON a.FENUMID=b.FENUMID AND b.FLOCALEID=2052
WHERE a.FID='0113bd8e-03b1-4c47-8fb4-9ed5b9074680'
ORDER BY a.FSEQ
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【执行计划】
SELECT b.FNAME AS 执行计划名称,a.FSCHEDULETYPEID AS 执行计划内码,a.FSCHEDULECLASS AS 执行计划服务插件
,CASE c.FSTATUS WHEN 0 THEN N'准备' WHEN 1 THEN N'停止' WHEN 2 THEN N'运行' WHEN 5 THEN N'异常' ELSE '' END AS 任务状态,*
FROM T_BAS_SCHEDULETYPE a
LEFT JOIN T_BAS_SCHEDULETYPE_L b ON a.FSCHEDULETYPEID=b.FSCHEDULETYPEID AND b.FLOCALEID=2052
LEFT JOIN T_BAS_SCHEDULEINFO c ON a.FSCHEDULETYPEID=c.FSCHEDULETYPEID
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【网控】
/*网控类型*/
SELECT a.FID AS 网控类型内码,b.FNAME AS 网控类型名称
,a.*
FROM T_BAS_NETWORKCTRLTYPE a
LEFT JOIN T_BAS_NETWORKCTRLTYPE_L b ON a.FID=b.FID AND b.FLOCALEID=2052
/*网控对象*/
SELECT a.FID AS 网控对象内码,b.FNAME AS 网控对象名称,t.FNAME AS 网控类型名称
,c.FNAME AS 业务对象名称,e.FNAME AS 操作名称
,a.*
FROM T_BAS_NETWORKCTRLOBJECT a
LEFT JOIN T_BAS_NETWORKCTRLOBJECT_L b ON a.FID=b.FID AND b.FLOCALEID=2052
LEFT JOIN T_BAS_NETWORKCTRLTYPE_L t ON a.FTYPE=t.FID AND t.FLOCALEID=2052
LEFT JOIN T_META_OBJECTTYPE_L c ON a.FMETAOBJECTID=c.FID AND c.FLOCALEID=2052
LEFT JOIN T_MDL_FORMOPERATIONTYPE d ON a.FNUMBER=d.FOPERATION
LEFT JOIN T_MDL_FORMOPERATIONTYPE_L e ON d.FID=e.FID AND e.FLOCALEID=2052
--WHERE a.FID='903eafb2784042b5948fe9a245b5dddf'
/*网控互斥对象*/
SELECT b.FNAME AS 网控对象,c.FNAME AS 互斥对象,
a.*
FROM T_BAS_NETWORKCTRLMUTEX a
LEFT JOIN T_BAS_NETWORKCTRLOBJECT_L b ON a.FNETCTRLID=b.FID AND b.FLOCALEID=2052
LEFT JOIN T_BAS_NETWORKCTRLOBJECT_L c ON a.FMUTEXOBJID=c.FID AND c.FLOCALEID=2052
--WHERE a.FNETCTRLID='903eafb2784042b5948fe9a245b5dddf'
/*网控数据*/
SELECT * FROM T_BAS_NETWORKCTRLRECORDS
---------------------------------------------------------------------------------------------------------
【从元数据中查找插件注册信息】
-- 从元数据中查找插件注册信息
SELECT FKERNELXML.query('//PlugIn') AS PlugIn, * FROM T_META_OBJECTTYPE
WHERE FID='PUR_PurchaseOrder'
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
【金蝶云星空BOS二次开发案例演示】https://vip.kingdee.com/article/94751030918525696
技术答疑.常用SQL
本文2024-09-23 04:18:47发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-164502.html