但是报错日志打印的sql语句用pl/sql运行可以
10 回复
哦,, 日志打印的sql语句是:
SELECT * FROM RTS_SDO_SPATIAL where SDO_WITHIN_DISTANCE(RTS_SDO_SPATIAL.SDODATA,SDO_GEOMETRY(2001, 4490, MDSYS.SDO_POINT_TYPE(114.374296952994, 22.7277813986333, null), null, null),'distance=1000.0')='TRUE'
String sqlStr = "SELECT * FROM RTS_SDO_SPATIAL where SDO_WITHIN_DISTANCE(RTS_SDO_SPATIAL.SDODATA,SDO_GEOMETRY(2001, 4490, MDSYS.SDO_POINT_TYPE(@lat, @lon, null), null, null),'distance=@radius')='TRUE'";
Sql sql = Sqls.create(sqlStr);
sql.params().set("lat", point.getX()).set("lon", point.getY()).set("radius", radius);
Entity<Rts_Sdo> entity = dao().getEntity(Rts_Sdo.class);
sql.setEntity(entity);
sql.setCallback(Sqls.callback.entities());
Sql execute = dao().execute(sql);
List<Rts_Sdo> rtsSdo = sql.getList(Rts_Sdo.class);
return rtsSdo;
添加回复
请先登陆