| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?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.onemap.apply.mapper.yzt.XzqMapper">
- <select id="GetXzq" resultType="com.onemap.apply.domain.yzt.XzqSqlDTO">
- select t.id as "value",
- t.name as "label",
- t.pid as "parent",
- case when (select count(*) from xzqh p where p.pid = t.id) > 0 then '1'
- else '0' end as "isparent"
- from xzqh t where 1 = 1
- <if test="city == null or city == false">
- and t.pid is not null
- </if>
- <if test="xzqCode != null and xzqCode != ''">
- and t.id like #{xzqCode}||'%'
- </if>
- </select>
- <select id="GetXzqList" parameterType="java.lang.Boolean" resultType="com.onemap.apply.domain.yzt.XzqSqlDTO">
- select t.id as "value",
- t.name as "label",
- t.pid as "parent",
- case when (select count(1) from xzqh p where p.pid = t.id) > 0 then '1'
- else '0' end as "isparent"
- from xzqh t where 1 = 1
- order by t.pid
- <!-- <if test="city == null or city == false">-->
- <!-- and t.pid is not null and length(t.id) <= (select case (select length(t.id) from xzqh t where-->
- <!-- t.pid is null)-->
- <!-- when 2 then 4-->
- <!-- when 4 then 6-->
- <!-- when 6 then 9-->
- <!-- when 9 then 12-->
- <!-- end)-->
- <!-- </if>-->
- <!-- <if test="city != null or city == true">-->
- <!-- and length(t.id) <= (select case (select length(t.id) from xzqh t where t.pid-->
- <!-- is null)-->
- <!-- when 2 then 4-->
- <!-- when 4 then 6-->
- <!-- when 6 then 9-->
- <!-- when 9 then 12-->
- <!-- end )-->
- <!-- </if>-->
- </select>
- <select id="GetGeom" resultType="java.lang.String" parameterType="java.lang.String">
- select public.st_asewkt(t.geom) from xzqh t where t.id = #{id}
- </select>
- </mapper>
|