public class FilterParameter
extends java.lang.Object
implements java.io.Serializable
过滤条件参数类。
该类用于设置查询服务(queryServices)或空间分析服务(spatialAnalystServices)中所使用到的过滤参数。
限定符和类型 | 字段和说明 |
---|---|
java.lang.String |
attributeFilter
属性过滤条件。
|
java.lang.String[] |
fields
获取或设置查询结果的字段数组,如果不设置则使用系统返回的所有字段。
|
java.lang.String |
groupBy
SQL 查询中结果分组条件的字段。
|
int[] |
ids
获取或设置查询 id 数组,即属性表中的 SmID 值。
|
JoinItem[] |
joinItems
关联查询项数组。
|
LinkItem[] |
linkItems
与外部表的关联信息。
|
java.lang.String |
name
数据集名称,或者图层名称,根据实际的功能而定。
|
java.lang.String |
orderBy
SQL 查询和空间查询中结果排序的字段。
|
构造器和说明 |
---|
FilterParameter() |
FilterParameter(FilterParameter queryParam) |
FilterParameter(java.lang.String name) |
FilterParameter(java.lang.String name, java.lang.String attributeFilter) |
public java.lang.String name
数据集名称,或者图层名称,根据实际的功能而定。
一般情况下该字段为数据集名称,但在进行与地图相关功能的操作时,需要设置为图层名称(图层名称格式:数据集名称@数据源别名)。 因为一个地图的图层可能是来自于不同数据源的数据集,而不同的数据源中可能存在同名的数据集,使用数据集名称不能唯一的确定数据集, 所以在进行与地图相关功能的操作时,该值需要设置为图层名称。
暂不支持对 CAD 数据集和 CAD 图层进行查询。
public JoinItem[] joinItems
关联查询项数组。进行 SQL 查询时有效。
public LinkItem[] linkItems
与外部表的关联信息。 进行 SQL 查询时有效。
public int[] ids
获取或设置查询 id 数组,即属性表中的 SmID 值。
public java.lang.String attributeFilter
属性过滤条件。
SQL 语句中的 WHERE 子句的格式为:WHERE <条件表达式>,attributeFilter 就是其中的“条件表达式”。
该字段的用法为 attributeFilter = "过滤条件"。
例如,要查询字段 fieldValue 小于100的记录,设置 attributeFilter = "fieldValue < 100"; 要查询字段值为“酒店”的记录,设置 attributeFilter = "name like '%酒店%'",等等。
public java.lang.String orderBy
SQL 查询和空间查询中结果排序的字段。用于排序的字段必须为数值型。
SQL 语句中的 ORDER BY 子句的格式为:ORDER BY <列名>,列名即属性表中每一列的名称,列又可称为属性, 在 SuperMap 中又称为字段,orderBy 设置为字段名。
对单个字段排序时,该字段的用法为 orderBy = "字段名"; 对多个字段排序时,字段之间以英文逗号进行分割,用法为 orderBy = "字段名1, 字段名2"。
例如,在一个国家数据集中,有两个字段,字段名分别为“SmArea”和“pop_1994”,分别表示国家的面积和1994年的各国的人口数量,如果要按照各国人口数量对记录进行排序,可以设置 orderBy = "pop_1994";如果要以面积和人口进行排序, 设置 orderBy = "SmArea, pop_1994"。
进行 SQL 查询及空间查询时有效。
public java.lang.String groupBy
SQL 查询中结果分组条件的字段。
SQL 语句中的 GROUP BY 子句的格式为:GROUP BY <列名>,列名即属性表中每一列的名称,列又可称为属性, 在 SuperMap 中又称为字段,groupBy 设置为字段名。
对单个字段分组时,该字段的用法为 groupBy = "字段名"; 对多个字段分组时,字段之间以英文逗号进行分割,用法为 groupBy = "字段名1, 字段名2"。
例如,有一个全球城市数据集,该数据集有两个字段,字段名分别为“Continent”和“Country”,分别表示某个城市所属的洲和国家, 如果要按照国家对全球的城市进行分组,可以设置 groupBy = "Country"; 如果以洲和国家对城市进行分组,设置 groupBy = "Continent, Country"。
进行 SQL 查询时有效。注意:空间查询不支持 groupBy字段,否则可能导致空间查询的结果不正确。
public java.lang.String[] fields
获取或设置查询结果的字段数组,如果不设置则使用系统返回的所有字段。
public FilterParameter()
public FilterParameter(FilterParameter queryParam)
public FilterParameter(java.lang.String name)
public FilterParameter(java.lang.String name, java.lang.String attributeFilter)
public int hashCode()
获取 QueryParameter
对象的哈希码。
hashCode
在类中 java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
比较指定对象与当前 对象是否相等。
equals
在类中 java.lang.Object
obj
- 与当前 QueryParameter
进行比较的对象。Object.equals(java.lang.Object)