¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.mapper.all; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | /** |
| | | * 空é´åºç¡Mapper |
| | | * @author WWW |
| | | * @param <T> æ³å |
| | | */ |
| | | public interface GeomBaseMapper<T> extends BasicMapper<T> { |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢WKT |
| | | * |
| | | * @param tab 表å |
| | | * @param gid GID |
| | | * @return WKT |
| | | */ |
| | | @Select("select ST_AsText(geom) geom from ${tab} where gid = #{gid}") |
| | | public String selectWktById(@Param("tab") String tab, @Param("gid") Integer gid); |
| | | |
| | | /** |
| | | * æ ¹æ®è¡¨åæ¥è¯¢ç©ºé´åè |
| | | * |
| | | * @param tab 表å |
| | | * @return SRID |
| | | */ |
| | | @Select("select ST_SRID(geom) from ${tab} limit 1") |
| | | public Integer selectSrid(@Param("tab") String tab); |
| | | |
| | | /** |
| | | * æ´æ°ç©ºé´ä½ç½® |
| | | * |
| | | * @param tab 表å |
| | | * @param gid GID |
| | | * @param wkt WKT |
| | | * @return å½±åè¡æ° |
| | | */ |
| | | @Update("update ${tab} set geom = ST_GeomFromText('${wkt}') where gid = #{gid}") |
| | | public Integer updateGeom(@Param("tab") String tab, @Param("gid") Integer gid, @Param("wkt") String wkt); |
| | | } |