package com.moon.server.mapper.all;
|
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Update;
|
|
import java.util.List;
|
|
@SuppressWarnings("ALL")
|
public interface GeomBaseMapper<T> extends BasicMapper<T> {
|
@Select("select ST_AsText(geom) geom from ${tab} where gid = #{gid} limit 1")
|
public String selectWktById(@Param("tab") String tab, @Param("gid") Integer gid);
|
|
@Select("select ST_SRID(geom) from ${tab} where geom is not null limit 1")
|
public Integer selectSrid(@Param("tab") String tab);
|
|
@Select("select ST_GeometryType(geom) from ${tab} where geom is not null limit 1")
|
public String selectGeometryType(@Param("tab") String tab);
|
|
@Select("<script>" +
|
" select depid from ${tab} where depid is not null and depid not like '${depid}%'" +
|
" <if test='geoFilter != null'>" +
|
" and ${geoFilter}" +
|
" </if>" +
|
" group by depid" +
|
"</script>")
|
public List<Integer> selectDbOverflowDep(@Param("tab") String tab, @Param("depid") String depid, @Param("geoFilter") String geoFilter);
|
|
@Update("update ${tab} set geom = ST_GeomFromText('${wkt}') where gid = #{gid} limit 1")
|
public Integer updateGeom(@Param("tab") String tab, @Param("gid") Integer gid, @Param("wkt") String wkt);
|
}
|