Supermap iClient space query join external Table query multi-Table field sample code
Original article. For more information, see the source! Http://blog.csdn.net/songhfu
The following is an example of the code used to query a space table and a joined table field:
/*
* Code indicating successful association test
**/
Var joinItem = new SuperMap. REST. JoinItem ({
ForeignTableName: "V_ENABLEVIEW_LAND ",
JoinFilter: "BBS_PARCEL.CADASTRALNO = V_ENABLEVIEW_LAND.CADASTRALNO ",
JoinType: "INNERJOIN"
});
Var queryParam, queryByGeometryParameters, queryService;
QueryParam = new SuperMap. REST. FilterParameter ({
JoinItems: [joinItem],
Name: "BBS_PARCEL @ grid_sysdb ",
Fields :[
"BBS_PARCEL.CADASTRALNO as CADASTRALNO ",
"BBS_PARCEL.LANDUSER as LANDUSER ",
"BBS_PARCEL.PARCELADDRESS as PARCELADDRESS ",
"BBS_PARCEL.RIGHTSTYPE_CN as RIGHTSTYPE_CN ",
"BBS_PARCEL.LANDPURPOSE_CN as LANDPURPOSE_CN ",
"BBS_PARCEL.PLOTRATIO as PLOTRATIO ",
"BBS_PARCEL.POSTADDRESS as POSTADDRESS ",
"BBS_PARCEL.BOOKAREA as BOOKAREA ",
"BBS_PARCEL.REALAREA as REALAREA ",
"V_ENABLEVIEW_LAND.FJBM as FJBM"],
DisplayFilters: ["V_ENABLEVIEW_LAND.FJBM = '" + _ disCode + "' or V_ENABLEVIEW_LAND.FJBM is null"]
});
QueryByGeometryParameters = new SuperMap. REST. QueryByGeometryParameters ({
QueryParams: [queryParam],
Geometry: feature. geometry,
SpatialQueryMode: SuperMap. REST. SpatialQueryMode. INTERSECT
});