枚举查询sql
SELECT e.Code -- 枚举编码
,el.Name -- 枚举显示名称
,e.EValue -- 枚举值
FROM UBF_Sys_ExtenumValue e
LEFT JOIN UBF_Sys_ExtEnumValue_Trl el ON e.ID=el.ID
LEFT JOIN UBF_Sys_ExtenumType ee ON ee.ID=e.ExtEnumType
where ee.Code='UFIDA.U9.CBO.SCM.Item.ItemTypeAttributeEnum' -- 枚举全名
通过值集的编码获取另一个枚举的值(名称匹配)
通过值集发料方式编码A02获取同名称的系统发料方式枚举的枚举值
SELECT e.EValue
FROM UBF_Sys_ExtenumValue e
LEFT JOIN UBF_Sys_ExtEnumValue_Trl el ON e.ID=el.ID
LEFT JOIN UBF_Sys_ExtenumType ee ON ee.ID=e.ExtEnumType
where ee.Code='UFIDA.U9.CBO.MFG.Enums.IssueStyleEnum' and el.Name=(
SELECT A1.[Name] as [Name]
FROM UBF_Sys_ExtEnumValue as A
left join [UBF_Sys_ExtEnumValue_Trl] as A1 on (A1.SysMlFlag = 'zh-CN') and (A.[ID] = A1.[ID])
WHERE A.[Code]='A02' and A.[ExtEnumType] = (select ID from UBF_Sys_ExtEnumType where Code='UFIDA.U9.Paterson.BlueFuturePlan.FrontOrderBE.CopyOfEnumItemWay')
);
评论 (0)