var joinItem, queryParam, queryBySQLParams, queryBySQLService;
joinItem = new SuperMap.REST.JoinItem({
foreignTableName: "MPG_TAXI_ROAD_ALL_HIS",
joinFilter: "MPG_TAXI_ROAD_ALL_HIS.ROAD_ID = ROAD_ID",
joinType: 'LEFTJOIN'
});
queryParam = new SuperMap.REST.FilterParameter({
name:"MPG_TAXI_ONEROAD@ZHUZHOU_SUPERMAP",
fields:["ROAD_ID","DBCNAME","MPG_TAXI_ROAD_ALL_HIS.INDEX_VALUE"],
joinItems: [joinItem],
attributeFilter:attributeFilter : "MPG_TAXI_ROAD_ALL_HIS.INS_TIME_STR='2017-12-27 09:50'"
});
queryBySQLParams = new SuperMap.REST.QueryBySQLParameters({
queryParams : [queryParam]
});
queryBySQLService = new SuperMap.REST.QueryBySQLService('http://58.20.213.70:8090/iserver/services/map-ZHUZHOU_SUPERMAP/rest/maps/MPG_TAXI_ONEROAD
', {
eventListeners : {
"processCompleted" : processCompleted,
"processFailed" : processFaileds
}
});
queryBySQLService.processAsync(queryBySQLParams);
这个是写的查询语句,在数据库中能查出来数据,在页面上好像关联不到数据库中的表,MPG_TAXI_ROAD_ALL_HIS这个是数据库中的表,MPG_TAXI_ONEROAD这是工作空间中的数据集名字,也是图层的名字
如果去掉关联的代码能查出来图层上的数据,加上关联代码,就不行了 好像关联不上数据库中的表。