数据库表

实体表

Entity(部分字段)

字段 说明
EntityId 实体ID
Name 实体名称
ObjectTypeCode 实体编码(这个字段和字符串映射表连接)
LogicalName 逻辑名称(查询一般用这个)

字符串映射表

StringMap(部分字段)

字段 说明
ObjectTypeCode 实体编码
AttributeName 字段名
AttributeValue 字段值
Value 显示值

查询实例

查询new_vehiclebenchmark实体中new_paymenttype字段的值等于1时的显示值

1
2
3
4
5
6
7
8
9
SELECT DISTINCT
attributevalue AS VALUE,VALUE AS name
FROM
Entity e
INNER JOIN StringMap sm ON e.objecttypecode = sm.objecttypecode
AND sm.attributename = 'new_paymenttype'
AND AttributeValue = '1'
WHERE
logicalname = 'new_vehiclebenchmark'

image-20210720163656137

去掉 AttributeValue筛选为查找所有对应值

1
2
3
4
5
6
7
8
SELECT DISTINCT
attributevalue AS VALUE,VALUE AS name
FROM
Entity e
INNER JOIN StringMap sm ON e.objecttypecode = sm.objecttypecode
AND sm.attributename = 'new_paymenttype'
WHERE
logicalname = 'new_vehiclebenchmark'

image-20210720163842334