<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.lf.server.mapper.show.PipelineMapper">
|
<select id="selectSegNames" resultType="com.lf.server.entity.show.PipelineEntity">
|
select gid, pipename, segname from bs.m_pipesegment order by pipename, segname;
|
</select>
|
|
<select id="selectPipeAnalysis" resultType="com.lf.server.entity.show.PipelineEntity">
|
select a.name as acrossName, b.segname as segName, b.remarks, b.pipename as pipeName,
|
cast( st_length( st_geographyfromtext( st_astext( st_intersection(ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) ) ) as decimal(12, 2) ) AS acrossLength
|
from ${tab} as a, (select segname, remarks, pipename, geom from bs.m_pipesegment where gid = #{gid} ) as b
|
where ST_Intersects(a.geom, b.geom)
|
</select>
|
|
<select id="selectAnalysisResult" resultType="com.lf.server.entity.show.PipelineEntity">
|
select a.name as acrossName, b.segname as segName, b.remarks, b.pipename as pipeName,
|
cast( st_length( st_geographyfromtext( st_astext( st_intersection(ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) ) ) as decimal(12, 2) ) AS acrossLength,
|
st_astext( st_intersection( ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) as wkt
|
from ${tab} as a, (select segname, remarks, pipename, geom from bs.m_pipesegment where gid = #{gid} ) as b
|
where ST_Intersects(a.geom, b.geom)
|
</select>
|
</mapper>
|